public AsyncMultiCommand(AsyncMultiExecutor parent, AsyncCluster cluster, AsyncNode node, bool stopOnNotFound)
     : base(cluster)
 {
     this.parent = parent;
     this.fixedNode = node;
     this.stopOnNotFound = stopOnNotFound;
 }
        public AsyncBatchGetSequenceDirect(
			AsyncMultiExecutor parent,
			AsyncCluster cluster,
			AsyncNode node,
			BatchNode.BatchNamespace batch,
			Policy policy,
			Key[] keys,
			string[] binNames,
			RecordSequenceListener listener,
			int readAttr
		)
            : base(parent, cluster, node, false)
        {
            this.batch = batch;
            this.policy = policy;
            this.keys = keys;
            this.binNames = binNames;
            this.listener = listener;
            this.readAttr = readAttr;
        }
        public AsyncBatchExistsSequenceDirect(
			AsyncMultiExecutor parent,
			AsyncCluster cluster,
			AsyncNode node,
			BatchNode.BatchNamespace batch,
			Policy policy,
			Key[] keys,
			ExistsSequenceListener listener
		)
            : base(parent, cluster, node, false)
        {
            this.batch = batch;
            this.policy = policy;
            this.keys = keys;
            this.listener = listener;
        }
        public AsyncBatchExistsArrayDirect(
			AsyncMultiExecutor parent,
			AsyncCluster cluster,
			AsyncNode node,
			BatchNode.BatchNamespace batch,
			Policy policy,
			Key[] keys,
			bool[] existsArray
		)
            : base(parent, cluster, node, false)
        {
            this.batch = batch;
            this.policy = policy;
            this.keys = keys;
            this.existsArray = existsArray;
        }
        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);
                }
            }
        }
Esempio n. 6
0
 /// <summary>
 /// Batch constructor.
 /// </summary>
 public AsyncMultiCommand(AsyncMultiExecutor parent, AsyncCluster cluster, Policy policy, AsyncNode node)
     : base(cluster, policy)
 {
     this.parent         = parent;
     this.serverNode     = node;
     this.stopOnNotFound = false;
 }
Esempio n. 7
0
 /// <summary>
 /// Scan/Query constructor.
 /// </summary>
 public AsyncMultiCommand(AsyncMultiExecutor parent, AsyncCluster cluster, Policy policy, AsyncNode node, int socketTimeout, int totalTimeout)
     : base(cluster, policy, socketTimeout, totalTimeout)
 {
     this.parent         = parent;
     this.serverNode     = node;
     this.stopOnNotFound = true;
 }
        public static void Validate(AsyncCluster cluster, AsyncQueryValidate.Listener listener, AsyncNode node, string ns, ulong expectedKey)
        {
            string    command = "cluster-stable:namespace=" + ns;
            AsyncInfo aic     = new AsyncInfo(cluster, null, new Handler(listener, command, expectedKey), node, command);

            aic.Execute();
        }
        public static void ValidateBegin(AsyncCluster cluster, AsyncQueryValidate.BeginListener listener, AsyncNode node, string ns)
        {
            string    command = "cluster-stable:namespace=" + ns;
            AsyncInfo aic     = new AsyncInfo(cluster, null, new BeginHandler(listener, command), node, command);

            aic.Execute();
        }
Esempio n. 10
0
 public AsyncMultiCommand(AsyncMultiExecutor parent, AsyncCluster cluster, Policy policy, AsyncNode node, bool stopOnNotFound)
     : base(cluster, policy, null, node, true)
 {
     this.parent         = parent;
     this.stopOnNotFound = stopOnNotFound;
 }
Esempio n. 11
0
 public AsyncMultiCommand(AsyncMultiCommand other) : base(other)
 {
     this.parent         = other.parent;
     this.serverNode     = other.serverNode;
     this.stopOnNotFound = other.stopOnNotFound;
 }
 public AsyncCommand(AsyncCluster cluster, Policy policy, Partition partition, AsyncNode node, bool isRead)
 {
     this.cluster   = cluster;
     this.policy    = policy;
     this.partition = partition;
     this.node      = node;
     this.isRead    = isRead;
 }