public RequestFrame GetFrame()
 {
     var wb = new BEBinaryWriter();
     wb.WriteFrameHeader(RequestFrame.ProtocolRequestVersionByte, 0x00, (byte)_streamId, OpCode);
     wb.WriteStringList(_eventTypes);
     return wb.GetFrame();
 }
Beispiel #2
0
        public RequestFrame GetFrame(short streamId)
        {
            //protocol v2: <type><n><query_1>...<query_n><consistency>
            //protocol v3: <type><n><query_1>...<query_n><consistency><flags>[<serial_consistency>][<timestamp>]
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader((byte)ProtocolVersion, _headerFlags, streamId, OpCode);
            wb.WriteByte((byte)_type);
            wb.WriteInt16((short)_requests.Count);
            foreach (var br in _requests)
            {
                br.WriteToBatch((byte)ProtocolVersion, wb);
            }
            wb.WriteInt16((short)Consistency);
            if (ProtocolVersion >= 3)
            {
                wb.WriteByte((byte)_batchFlags);
            }
            if (_serialConsistency != null)
            {
                wb.WriteInt16((short)_serialConsistency.Value);
            }
            if (_timestamp != null)
            {
                //Expressed in microseconds
                wb.WriteLong(TypeCodec.ToUnixTime(_timestamp.Value).Ticks / 10);
            }
            return(wb.GetFrame());
        }
 public RequestFrame GetFrame(short streamId)
 {
     var wb = new BEBinaryWriter();
     wb.WriteFrameHeader((byte)ProtocolVersion, 0x00, streamId, OpCode);
     wb.WriteStringList(_eventTypes);
     return wb.GetFrame();
 }
Beispiel #4
0
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader((byte)ProtocolVersion, 0x00, streamId, OpCode);
            wb.WriteStringList(_eventTypes);
            return(wb.GetFrame());
        }
        public RequestFrame GetFrame()
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader(0x01, 0x00, (byte)_streamId, OpCode);
            wb.WriteBytes(_token);
            return(wb.GetFrame());
        }
Beispiel #6
0
        public RequestFrame GetFrame()
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader(0x01, 0x00, (byte)_streamId, OpCode);
            wb.WriteStringList(_eventTypes);
            return(wb.GetFrame());
        }
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader((byte)ProtocolVersion, _flags, streamId, OpCode);
            wb.WriteShortBytes(_id);
            _queryOptions.Write(wb, (byte)ProtocolVersion, true);

            return(wb.GetFrame());
        }
Beispiel #8
0
        public RequestFrame GetFrame(byte protocolVersionByte)
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader(protocolVersionByte, _flags, (byte)_streamId, OpCode);
            wb.WriteShortBytes(_id);
            _queryProtocolOptions.Write(wb, _consistency, protocolVersionByte);

            return(wb.GetFrame());
        }
Beispiel #9
0
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader((byte)ProtocolVersion, _headerFlags, streamId, OpCode);
            wb.WriteLongString(_cqlQuery);

            _queryOptions.Write(wb, (byte)ProtocolVersion, false);

            return(wb.GetFrame());
        }
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader((byte)ProtocolVersion, (byte)_headerFlags, streamId, OpCode);
            if (Payload != null)
            {
                wb.WriteBytesMap(Payload);
            }
            wb.WriteLongString(Query);
            return(wb.GetFrame());
        }
 public RequestFrame GetFrame()
 {
     var wb = new BEBinaryWriter();
     wb.WriteFrameHeader(RequestFrame.ProtocolRequestVersionByte, 0x00, (byte)_streamId, OpCode);
     wb.WriteUInt16((ushort)_credentials.Count);
     foreach (var kv in _credentials)
     {
         wb.WriteString(kv.Key);
         wb.WriteString(kv.Value);
     }
     return wb.GetFrame();
 }
 public RequestFrame GetFrame()
 {
     var wb = new BEBinaryWriter();
     wb.WriteFrameHeader(0x01, 0x00, (byte)_streamId, OpCode);
     wb.WriteUInt16((ushort)_options.Count);
     foreach(var kv in _options)
     {
         wb.WriteString(kv.Key);
         wb.WriteString(kv.Value);
     }
     return wb.GetFrame();
 }
        public RequestFrame GetFrame()
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader(0x01, 0x00, (byte)_streamId, OpCode);
            wb.WriteUInt16((ushort)_credentials.Count);
            foreach (var kv in _credentials)
            {
                wb.WriteString(kv.Key);
                wb.WriteString(kv.Value);
            }
            return(wb.GetFrame());
        }
Beispiel #14
0
        public RequestFrame GetFrame(byte protocolVersionByte)
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader(protocolVersionByte, 0x00, (byte)_streamId, OpCode);
            wb.WriteUInt16((ushort)_options.Count);
            foreach (KeyValuePair <string, string> kv in _options)
            {
                wb.WriteString(kv.Key);
                wb.WriteString(kv.Value);
            }
            return(wb.GetFrame());
        }
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader((byte)ProtocolVersion, 0x00, streamId, OpCode);
            wb.WriteUInt16((ushort)_options.Count);
            foreach (var kv in _options)
            {
                wb.WriteString(kv.Key);
                wb.WriteString(kv.Value);
            }
            return(wb.GetFrame());
        }
        public RequestFrame GetFrame(short streamId)
        {
            if (ProtocolVersion > 1)
            {
                throw new NotSupportedException("Credentials request is only supported in C* = 1.2.x");
            }

            var wb = new BEBinaryWriter();
            wb.WriteFrameHeader((byte)ProtocolVersion, 0x00, streamId, OpCode);
            wb.WriteUInt16((ushort) _credentials.Count);
            foreach (var kv in _credentials)
            {
                wb.WriteString(kv.Key);
                wb.WriteString(kv.Value);
            }
            return wb.GetFrame();
        }
Beispiel #17
0
        public RequestFrame GetFrame(byte protocolVersionByte)
        {
            if (protocolVersionByte != RequestFrame.ProtocolV1RequestVersionByte)
            {
                throw new NotSupportedException("Credentials request is supported in C* <= 1.2.x");
            }

            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader(protocolVersionByte, 0x00, (byte)_streamId, OpCode);
            wb.WriteUInt16((ushort)_credentials.Count);
            foreach (KeyValuePair <string, string> kv in _credentials)
            {
                wb.WriteString(kv.Key);
                wb.WriteString(kv.Value);
            }
            return(wb.GetFrame());
        }
Beispiel #18
0
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();

            if (Payload != null)
            {
                _headerFlags |= FrameHeader.HeaderFlag.CustomPayload;
            }
            wb.WriteFrameHeader((byte)ProtocolVersion, (byte)_headerFlags, streamId, OpCode);
            if (Payload != null)
            {
                //A custom payload for this request
                wb.WriteBytesMap(Payload);
            }
            wb.WriteLongString(_cqlQuery);
            _queryOptions.Write(wb, (byte)ProtocolVersion, false);
            return(wb.GetFrame());
        }
        public RequestFrame GetFrame(short streamId)
        {
            if (ProtocolVersion > 1)
            {
                throw new NotSupportedException("Credentials request is only supported in C* = 1.2.x");
            }

            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader((byte)ProtocolVersion, 0x00, streamId, OpCode);
            wb.WriteUInt16((ushort)_credentials.Count);
            foreach (var kv in _credentials)
            {
                wb.WriteString(kv.Key);
                wb.WriteString(kv.Value);
            }
            return(wb.GetFrame());
        }
Beispiel #20
0
        public RequestFrame GetFrame(byte protocolVersionByte)
        {
            if (protocolVersionByte != RequestFrame.ProtocolV2RequestVersionByte)
            {
                throw new NotSupportedException("Batch request is supported in C* >= 2.0.x");
            }
            var wb = new BEBinaryWriter();

            wb.WriteFrameHeader(protocolVersionByte, _flags, (byte)_streamId, OpCode);
            wb.WriteByte((byte)_type);
            wb.WriteInt16((short)_requests.Count);
            foreach (IQueryRequest br in _requests)
            {
                br.WriteToBatch(wb);
            }
            wb.WriteInt16((short)_consistency);
            return(wb.GetFrame());
        }
 public RequestFrame GetFrame(short streamId)
 {
     var wb = new BEBinaryWriter();
     if (Payload != null)
     {
         _headerFlags |= FrameHeader.HeaderFlag.CustomPayload;
     }
     wb.WriteFrameHeader((byte)ProtocolVersion, (byte)_headerFlags, streamId, OpCode);
     if (Payload != null)
     {
         //A custom payload for this request
         wb.WriteBytesMap(Payload);
     }
     wb.WriteLongString(_cqlQuery);
     _queryOptions.Write(wb, (byte)ProtocolVersion, false);
     return wb.GetFrame();
 }
Beispiel #22
0
 public RequestFrame GetFrame(short streamId)
 {
     //protocol v2: <type><n><query_1>...<query_n><consistency>
     //protocol v3: <type><n><query_1>...<query_n><consistency><flags>[<serial_consistency>][<timestamp>]
     var wb = new BEBinaryWriter();
     wb.WriteFrameHeader((byte)ProtocolVersion, _headerFlags, streamId, OpCode);
     wb.WriteByte((byte) _type);
     wb.WriteInt16((short) _requests.Count);
     foreach (var br in _requests)
     {
         br.WriteToBatch((byte)ProtocolVersion, wb);
     }
     wb.WriteInt16((short) Consistency);
     if (ProtocolVersion >= 3)
     {
         wb.WriteByte((byte)_batchFlags);
     }
     if (_serialConsistency != null)
     {
         wb.WriteInt16((short)_serialConsistency.Value);
     }
     if (_timestamp != null)
     {
         //Expressed in microseconds
         wb.WriteLong(TypeCodec.ToUnixTime(_timestamp.Value).Ticks / 10);
     }
     return wb.GetFrame();
 }
Beispiel #23
0
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();
            wb.WriteFrameHeader((byte)ProtocolVersion, _flags, streamId, OpCode);
            wb.WriteShortBytes(_id);
            _queryOptions.Write(wb, (byte)ProtocolVersion, true);

            return wb.GetFrame();
        }
Beispiel #24
0
        public RequestFrame GetFrame(short streamId)
        {
            var wb = new BEBinaryWriter();
            wb.WriteFrameHeader((byte)ProtocolVersion, _headerFlags, streamId, OpCode);
            wb.WriteLongString(_cqlQuery);

            _queryOptions.Write(wb, (byte)ProtocolVersion, false);

            return wb.GetFrame();
        }