public AsyncBatchGetArrayCommand(AsyncBatchGetArrayCommand other) : base(other)
 {
     this.keys     = other.keys;
     this.binNames = other.binNames;
     this.records  = other.records;
     this.readAttr = other.readAttr;
 }
        public AsyncBatchGetArrayExecutor
        (
            AsyncCluster cluster,
            BatchPolicy policy,
            RecordArrayListener listener,
            Key[] keys,
            string[] binNames,
            int readAttr
        )
        {
            this.keys     = keys;
            this.records  = new Record[keys.Length];
            this.listener = listener;

            // Create commands.
            List <BatchNode> batchNodes = BatchNode.GenerateList(cluster, policy, keys);

            AsyncBatchCommand[] commands = new AsyncBatchCommand[batchNodes.Count];
            int count = 0;

            foreach (BatchNode batchNode in batchNodes)
            {
                commands[count++] = new AsyncBatchGetArrayCommand(this, cluster, batchNode, policy, keys, binNames, records, readAttr);
            }
            // Dispatch commands to nodes.
            Execute(commands);
        }
        public AsyncBatchGetArrayExecutor
        (
            AsyncCluster cluster,
            BatchPolicy policy,
            RecordArrayListener listener,
            Key[] keys,
            string[] binNames,
            int readAttr
        ) : base(cluster, policy, keys)
        {
            this.recordArray = new Record[keys.Length];
            this.listener    = listener;

            // Create commands.
            AsyncMultiCommand[] tasks = new AsyncMultiCommand[base.taskSize];
            int count = 0;

            foreach (BatchNode batchNode in batchNodes)
            {
                if (batchNode.node.UseNewBatch(policy))
                {
                    // New batch
                    tasks[count++] = new AsyncBatchGetArrayCommand(this, cluster, batchNode, policy, keys, binNames, recordArray, readAttr);
                }
                else
                {
                    // Old batch only allows one namespace per call.
                    foreach (BatchNode.BatchNamespace batchNamespace in batchNode.batchNamespaces)
                    {
                        tasks[count++] = new AsyncBatchGetArrayDirect(this, cluster, (AsyncNode)batchNode.node, batchNamespace, policy, keys, binNames, recordArray, readAttr);
                    }
                }
            }
            // Dispatch commands to nodes.
            Execute(tasks, policy.maxConcurrentThreads);
        }
        public AsyncBatchGetArrayExecutor
        (
            AsyncCluster cluster,
            BatchPolicy policy,
            RecordArrayListener listener,
            Key[] keys,
            string[] binNames,
            int readAttr
        ) : base(cluster, policy, keys, true)
        {
            this.recordArray = new Record[keys.Length];
            this.listener    = listener;

            // Create commands.
            AsyncMultiCommand[] tasks = new AsyncMultiCommand[base.taskSize];
            int count = 0;

            foreach (BatchNode batchNode in batchNodes)
            {
                tasks[count++] = new AsyncBatchGetArrayCommand(this, cluster, batchNode, policy, keys, binNames, recordArray, readAttr);
            }
            // Dispatch commands to nodes.
            Execute(tasks, 0);
        }
        public AsyncBatchGetArrayExecutor(
			AsyncCluster cluster,
			BatchPolicy policy,
			RecordArrayListener listener,
			Key[] keys,
			string[] binNames,
			int readAttr
		)
            : base(cluster, policy, keys)
        {
            this.recordArray = new Record[keys.Length];
            this.listener = listener;

            // Create commands.
            AsyncMultiCommand[] tasks = new AsyncMultiCommand[base.taskSize];
            int count = 0;

            foreach (BatchNode batchNode in batchNodes)
            {
                if (batchNode.node.UseNewBatch(policy))
                {
                    // New batch
                    tasks[count++] = new AsyncBatchGetArrayCommand(this, cluster, batchNode, policy, keys, binNames, recordArray, readAttr);
                }
                else
                {
                    // Old batch only allows one namespace per call.
                    foreach (BatchNode.BatchNamespace batchNamespace in batchNode.batchNamespaces)
                    {
                        tasks[count++] = new AsyncBatchGetArrayDirect(this, cluster, (AsyncNode)batchNode.node, batchNamespace, policy, keys, binNames, recordArray, readAttr);
                    }
                }
            }
            // Dispatch commands to nodes.
            Execute(tasks, policy.maxConcurrentThreads);
        }