Example #1
0
        public static ClientMessage EncodeResponse(ICollection <KeyValuePair <int, int> > iterationPointers, ICollection <IData> keys)
        {
            var clientMessage = new ClientMessage();
            var initialFrame  = new Frame(new byte[ResponseInitialFrameSize], (FrameFlags)ClientMessageFlags.Unfragmented);

            initialFrame.Bytes.WriteIntL(Messaging.FrameFields.Offset.MessageType, ResponseMessageType);
            clientMessage.Append(initialFrame);
            EntryListIntegerIntegerCodec.Encode(clientMessage, iterationPointers);
            ListMultiFrameCodec.Encode(clientMessage, keys, DataCodec.Encode);
            return(clientMessage);
        }
        public static ClientMessage EncodeRequest(string name, ICollection <KeyValuePair <int, int> > iterationPointers, int batch)
        {
            var clientMessage = CreateForEncode();

            clientMessage.IsRetryable   = true;
            clientMessage.OperationName = "Map.FetchKeys";
            var initialFrame = new Frame(new byte[RequestInitialFrameSize], UnfragmentedMessage);

            EncodeInt(initialFrame.Content, TypeFieldOffset, RequestMessageType);
            EncodeInt(initialFrame.Content, PartitionIdFieldOffset, -1);
            EncodeInt(initialFrame.Content, RequestBatchFieldOffset, batch);
            clientMessage.Add(initialFrame);
            StringCodec.Encode(clientMessage, name);
            EntryListIntegerIntegerCodec.Encode(clientMessage, iterationPointers);
            return(clientMessage);
        }
Example #3
0
        public static ClientMessage EncodeRequest(string name, ICollection <KeyValuePair <int, int> > iterationPointers, int batch)
        {
            var clientMessage = new ClientMessage
            {
                IsRetryable   = true,
                OperationName = "Map.FetchKeys"
            };
            var initialFrame = new Frame(new byte[RequestInitialFrameSize], (FrameFlags)ClientMessageFlags.Unfragmented);

            initialFrame.Bytes.WriteIntL(Messaging.FrameFields.Offset.MessageType, RequestMessageType);
            initialFrame.Bytes.WriteIntL(Messaging.FrameFields.Offset.PartitionId, -1);
            initialFrame.Bytes.WriteIntL(RequestBatchFieldOffset, batch);
            clientMessage.Append(initialFrame);
            StringCodec.Encode(clientMessage, name);
            EntryListIntegerIntegerCodec.Encode(clientMessage, iterationPointers);
            return(clientMessage);
        }