コード例 #1
0
        public void SetBatchExists(Policy policy, Key[] keys, BatchNode.BatchNamespace batch)
        {
            // Estimate buffer size
            Begin();
            int byteSize = batch.offsetsSize * SyncCommand.DIGEST_SIZE;

            dataOffset += ByteUtil.EstimateSizeUtf8(batch.ns) + FIELD_HEADER_SIZE + byteSize + FIELD_HEADER_SIZE;

            SizeBuffer();

            WriteHeader(policy, Command.INFO1_READ | Command.INFO1_NOBINDATA, 0, 2, 0);
            WriteField(batch.ns, FieldType.NAMESPACE);
            WriteFieldHeader(byteSize, FieldType.DIGEST_RIPE_ARRAY);

            int[] offsets = batch.offsets;
            int   max     = batch.offsetsSize;

            for (int i = 0; i < max; i++)
            {
                Key    key    = keys[offsets[i]];
                byte[] digest = key.digest;
                Array.Copy(digest, 0, dataBuffer, dataOffset, digest.Length);
                dataOffset += digest.Length;
            }
            End();
        }
コード例 #2
0
 public AsyncBatchGetSequenceDirect(AsyncBatchGetSequenceDirect other) : base(other)
 {
     this.batch    = other.batch;
     this.keys     = other.keys;
     this.binNames = other.binNames;
     this.listener = other.listener;
     this.readAttr = other.readAttr;
 }
コード例 #3
0
 public AsyncBatchGetArrayDirect(AsyncBatchGetArrayDirect other) : base(other)
 {
     this.batch    = other.batch;
     this.keys     = other.keys;
     this.binNames = other.binNames;
     this.records  = other.records;
     this.readAttr = other.readAttr;
 }
コード例 #4
0
 public BatchExistsArrayDirect
 (
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     bool[] existsArray
 ) : base(false)
 {
     this.batch       = batch;
     this.policy      = policy;
     this.keys        = keys;
     this.existsArray = existsArray;
 }
コード例 #5
0
 public BatchCommandExists
 (
     Node node,
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     bool[] existsArray
 ) : base(node)
 {
     this.batch       = batch;
     this.policy      = policy;
     this.keys        = keys;
     this.existsArray = existsArray;
 }
コード例 #6
0
 public AsyncBatchExistsSequenceDirect
 (
     AsyncMultiExecutor parent,
     AsyncCluster cluster,
     AsyncNode node,
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     ExistsSequenceListener listener
 ) : base(parent, cluster, policy, node, false)
 {
     this.batch    = batch;
     this.keys     = keys;
     this.listener = listener;
 }
コード例 #7
0
 public AsyncBatchExistsArrayDirect
 (
     AsyncMultiExecutor parent,
     AsyncCluster cluster,
     AsyncNode node,
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     bool[] existsArray
 ) : base(parent, cluster, policy, node, false)
 {
     this.batch       = batch;
     this.keys        = keys;
     this.existsArray = existsArray;
 }
コード例 #8
0
 public BatchGetArrayDirect
 (
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     string[] binNames,
     Record[] records,
     int readAttr
 ) : base(false)
 {
     this.batch    = batch;
     this.policy   = policy;
     this.keys     = keys;
     this.binNames = binNames;
     this.records  = records;
     this.readAttr = readAttr;
 }
コード例 #9
0
 public BatchCommandGet
 (
     Node node,
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     HashSet <string> binNames,
     Record[] records,
     int readAttr
 ) : base(node)
 {
     this.batch    = batch;
     this.policy   = policy;
     this.keys     = keys;
     this.binNames = binNames;
     this.records  = records;
     this.readAttr = readAttr;
 }
コード例 #10
0
        public void SetBatchReadDirect(Policy policy, Key[] keys, BatchNode.BatchNamespace batch, string[] binNames, int readAttr)
        {
            // Estimate buffer size
            Begin();
            int byteSize = batch.offsetsSize * SyncCommand.DIGEST_SIZE;

            dataOffset += ByteUtil.EstimateSizeUtf8(batch.ns) + FIELD_HEADER_SIZE + byteSize + FIELD_HEADER_SIZE;

            if (binNames != null)
            {
                foreach (string binName in binNames)
                {
                    EstimateOperationSize(binName);
                }
            }

            SizeBuffer();

            int operationCount = (binNames == null)? 0 : binNames.Length;

            WriteHeader(policy, readAttr, 0, 2, operationCount);
            WriteField(batch.ns, FieldType.NAMESPACE);
            WriteFieldHeader(byteSize, FieldType.DIGEST_RIPE_ARRAY);

            int[] offsets = batch.offsets;
            int   max     = batch.offsetsSize;

            for (int i = 0; i < max; i++)
            {
                Key    key    = keys[offsets[i]];
                byte[] digest = key.digest;
                Array.Copy(digest, 0, dataBuffer, dataOffset, digest.Length);
                dataOffset += digest.Length;
            }

            if (binNames != null)
            {
                foreach (string binName in binNames)
                {
                    WriteOperation(binName, Operation.Type.READ);
                }
            }
            End();
        }
コード例 #11
0
 public AsyncBatchGetSequence
 (
     AsyncMultiExecutor parent,
     AsyncCluster cluster,
     AsyncNode node,
     BatchNode.BatchNamespace batchNamespace,
     Policy policy,
     Key[] keys,
     HashSet <string> binNames,
     RecordSequenceListener listener,
     int readAttr
 ) : base(parent, cluster, node, false, binNames)
 {
     this.batchNamespace = batchNamespace;
     this.policy         = policy;
     this.keys           = keys;
     this.listener       = listener;
     this.readAttr       = readAttr;
 }
コード例 #12
0
 public AsyncBatchGetSequenceDirect
 (
     AsyncMultiExecutor parent,
     AsyncCluster cluster,
     AsyncNode node,
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     string[] binNames,
     RecordSequenceListener listener,
     int readAttr
 ) : base(parent, cluster, policy, node, false)
 {
     this.batch    = batch;
     this.keys     = keys;
     this.binNames = binNames;
     this.listener = listener;
     this.readAttr = readAttr;
 }
コード例 #13
0
 public AsyncBatchGetArray
 (
     AsyncMultiExecutor parent,
     AsyncCluster cluster,
     AsyncNode node,
     BatchNode.BatchNamespace batch,
     Policy policy,
     Key[] keys,
     HashSet <string> binNames,
     Record[] records,
     int readAttr
 ) : base(parent, cluster, node, false, binNames)
 {
     this.batch    = batch;
     this.policy   = policy;
     this.keys     = keys;
     this.records  = records;
     this.readAttr = readAttr;
 }
コード例 #14
0
        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;
        }
コード例 #15
0
        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;
        }
コード例 #16
0
        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;
        }
コード例 #17
0
        public BatchExistsArrayDirect(
			Node node,
			BatchNode.BatchNamespace batch,
			Policy policy,
			Key[] keys,
			bool[] existsArray
		)
            : base(node, false)
        {
            this.batch = batch;
            this.policy = policy;
            this.keys = keys;
            this.existsArray = existsArray;
        }
コード例 #18
0
 public AsyncBatchExistsSequenceDirect(AsyncBatchExistsSequenceDirect other) : base(other)
 {
     this.batch    = other.batch;
     this.keys     = other.keys;
     this.listener = other.listener;
 }
コード例 #19
0
        public BatchGetArrayDirect(
			Node node,
			BatchNode.BatchNamespace batch,
			Policy policy,
			Key[] keys,
			string[] binNames,
			Record[] records,
			int readAttr
		)
            : base(node, false)
        {
            this.batch = batch;
            this.policy = policy;
            this.keys = keys;
            this.binNames = binNames;
            this.records = records;
            this.readAttr = readAttr;
        }
コード例 #20
0
 public AsyncBatchExistsArrayDirect(AsyncBatchExistsArrayDirect other) : base(other)
 {
     this.batch       = other.batch;
     this.keys        = other.keys;
     this.existsArray = other.existsArray;
 }