private void ExecuteCommand()
        {
            if (complete != 0)
            {
                AlreadyCompleted(complete);
                return;
            }

            try
            {
                node = GetNode();
                eventArgs.RemoteEndPoint = node.address;

                conn = node.GetAsyncConnection();

                if (conn == null)
                {
                    conn = new AsyncConnection(node.address, cluster);
                    eventArgs.SetBuffer(0, 0);

                    if (!conn.ConnectAsync(eventArgs))
                    {
                        ConnectionCreated();
                    }
                }
                else
                {
                    ConnectionReady();
                }
            }
            catch (AerospikeException.InvalidNode)
            {
                if (!RetryOnInit())
                {
                    throw;
                }
            }
            catch (AerospikeException.Connection)
            {
                if (!RetryOnInit())
                {
                    throw;
                }
            }
            catch (SocketException se)
            {
                if (!RetryOnInit())
                {
                    throw GetAerospikeException(se.SocketErrorCode);
                }
            }
            catch (Exception e)
            {
                if (!FailOnApplicationInit())
                {
                    throw new AerospikeException(e);
                }
            }
        }
Ejemplo n.º 2
0
        private void ExecuteCommand()
        {
            iteration++;

            try
            {
                node = (AsyncNode)GetNode(cluster);
                node.ValidateErrorCount();
                eventArgs.RemoteEndPoint = node.address;

                conn = node.GetAsyncConnection();

                if (conn == null)
                {
                    node.IncrAsyncConnTotal();
                    conn = new AsyncConnection(node.address, node);
                    eventArgs.SetBuffer(segment.buffer, segment.offset, 0);

                    if (!conn.ConnectAsync(eventArgs))
                    {
                        ConnectionCreated();
                    }
                }
                else
                {
                    ConnectionReady();
                }
                ErrorCount = 0;
            }
            catch (AerospikeException.Connection aec)
            {
                ErrorCount++;
                ConnectionFailed(aec);
            }
            catch (AerospikeException.Backoff aeb)
            {
                ErrorCount++;
                Backoff(aeb);
            }
            catch (AerospikeException ae)
            {
                ErrorCount++;
                FailOnApplicationError(ae);
            }
            catch (SocketException se)
            {
                ErrorCount++;
                ConnectionFailed(GetAerospikeException(se.SocketErrorCode));
            }
            catch (Exception e)
            {
                ErrorCount++;
                FailOnApplicationError(new AerospikeException(e));
            }
        }
        private void ExecuteCommand()
        {
            try
            {
                node = (AsyncNode)GetNode();
                eventArgs.RemoteEndPoint = node.address;

                conn = node.GetAsyncConnection();

                if (conn == null)
                {
                    conn = new AsyncConnection(node.address, cluster);
                    eventArgs.SetBuffer(segment.buffer, segment.offset, 0);

                    if (!conn.ConnectAsync(eventArgs))
                    {
                        ConnectionCreated();
                    }
                }
                else
                {
                    ConnectionReady();
                }
            }
            catch (AerospikeException.Connection)
            {
                if (!RetryOnInit())
                {
                    throw;
                }
            }
            catch (SocketException se)
            {
                if (!RetryOnInit())
                {
                    throw GetAerospikeException(se.SocketErrorCode);
                }
            }
            catch (Exception e)
            {
                if (!FailOnApplicationInit())
                {
                    throw new AerospikeException(e);
                }
            }
        }
Ejemplo n.º 4
0
        private void ExecuteCommand()
        {
            iteration++;

            try
            {
                if (partition != null)
                {
                    node = (AsyncNode)GetNode(cluster, policy, partition, isRead);
                }
                eventArgs.RemoteEndPoint = node.address;

                conn = node.GetAsyncConnection();

                if (conn == null)
                {
                    conn = new AsyncConnection(node.address, cluster, node);
                    eventArgs.SetBuffer(segment.buffer, segment.offset, 0);

                    if (!conn.ConnectAsync(eventArgs))
                    {
                        ConnectionCreated();
                    }
                }
                else
                {
                    ConnectionReady();
                }
            }
            catch (AerospikeException.Connection aec)
            {
                ConnectionFailed(aec);
            }
            catch (SocketException se)
            {
                ConnectionFailed(GetAerospikeException(se.SocketErrorCode));
            }
            catch (Exception e)
            {
                FailOnApplicationError(new AerospikeException(e));
            }
        }
Ejemplo n.º 5
0
        private void ExecuteCommand()
        {
            if (complete != 0)
            {
                AlreadyCompleted(complete);
                return;
            }

            try
            {
                node = GetNode();
                eventArgs.RemoteEndPoint = node.address;

                conn = node.GetAsyncConnection();

                if (conn == null)
                {
                    conn = new AsyncConnection(node.address, cluster);
                    eventArgs.SetBuffer(segment.buffer, segment.offset, 0);

                    if (!conn.ConnectAsync(eventArgs))
                    {
                        ConnectionCreated();
                    }
                }
                else
                {
                    ConnectionReady();
                }
            }
            catch (AerospikeException.InvalidNode)
            {
                failedNodes++;
                if (!RetryOnInit())
                {
                    throw;
                }
            }
            catch (AerospikeException.Connection)
            {
                failedConns++;
                if (!RetryOnInit())
                {
                    throw;
                }
            }
            catch (SocketException se)
            {
                if (!RetryOnInit())
                {
                    throw GetAerospikeException(se.SocketErrorCode);
                }
            }
            catch (Exception e)
            {
                if (!FailOnApplicationInit())
                {
                    throw new AerospikeException(e);
                }
            }
        }