コード例 #1
0
        public int WriteFrame(short streamId, MemoryStream stream, ISerializer serializer)
        {
            var wb = new FrameWriter(stream, serializer);

            wb.WriteFrameHeader((byte)_headerFlags, streamId, OpCode);
            var protocolVersion = serializer.ProtocolVersion;

            if (_payload != null)
            {
                wb.WriteBytesMap(_payload);
            }

            wb.WriteLongString(Query);

            if (protocolVersion.SupportsKeyspaceInRequest())
            {
                wb.WriteInt32((int)_prepareFlags);
                if (Keyspace != null)
                {
                    wb.WriteString(Keyspace);
                }
            }

            return(wb.Close());
        }
コード例 #2
0
 public int WriteFrame(short streamId, MemoryStream stream, Serializer serializer)
 {
     var wb = new FrameWriter(stream, serializer);
     wb.WriteFrameHeader((byte)_headerFlags, streamId, OpCode);
     if (Payload != null)
     {
         wb.WriteBytesMap(Payload);
     }
     wb.WriteLongString(Query);
     return wb.Close();
 }
コード例 #3
0
        public int WriteFrame(short streamId, MemoryStream stream, Serializer serializer)
        {
            var wb = new FrameWriter(stream, serializer);

            wb.WriteFrameHeader((byte)_headerFlags, streamId, OpCode);
            if (Payload != null)
            {
                wb.WriteBytesMap(Payload);
            }
            wb.WriteLongString(Query);
            return(wb.Close());
        }
コード例 #4
0
        protected override void WriteBody(FrameWriter wb)
        {
            wb.WriteLongString(Query);

            if (_prepareFlags != null)
            {
                wb.WriteInt32((int)_prepareFlags);
                if (_prepareFlags.Value.HasFlag(PrepareFlags.WithKeyspace))
                {
                    wb.WriteString(Keyspace);
                }
            }
        }
コード例 #5
0
        public int WriteFrame(short streamId, MemoryStream stream, Serializer serializer)
        {
            var wb = new FrameWriter(stream, serializer);

            if (Payload != null)
            {
                _headerFlags |= FrameHeader.HeaderFlag.CustomPayload;
            }
            wb.WriteFrameHeader((byte)_headerFlags, streamId, OpCode);
            if (Payload != null)
            {
                //A custom payload for this request
                wb.WriteBytesMap(Payload);
            }
            wb.WriteLongString(_cqlQuery);
            _queryOptions.Write(wb, false);
            return(wb.Close());
        }
コード例 #6
0
 public void WriteToBatch(FrameWriter wb)
 {
     //not a prepared query
     wb.WriteByte(0);
     wb.WriteLongString(_cqlQuery);
     if (_queryOptions.Values == null || _queryOptions.Values.Length == 0)
     {
         // No values
         wb.WriteUInt16(0);
     }
     else
     {
         wb.WriteUInt16((ushort)_queryOptions.Values.Length);
         foreach (var queryParameter in _queryOptions.Values)
         {
             wb.WriteAsBytes(queryParameter);
         }
     }
 }
コード例 #7
0
 public void WriteToBatch(byte protocolVersion, FrameWriter wb)
 {
     //not a prepared query
     wb.WriteByte(0);
     wb.WriteLongString(_cqlQuery);
     if (_queryOptions.Values == null || _queryOptions.Values.Length == 0)
     {
         //not values
         wb.WriteInt16(0);
     }
     else
     {
         wb.WriteUInt16((ushort)_queryOptions.Values.Length);
         for (var i = 0; i < _queryOptions.Values.Length; i++)
         {
             var bytes = TypeCodec.Encode(protocolVersion, _queryOptions.Values[i]);
             wb.WriteBytes(bytes);
         }
     }
 }
コード例 #8
0
 protected override void WriteBody(FrameWriter wb)
 {
     wb.WriteLongString(_cqlQuery);
     _queryOptions.Write(wb, false);
 }
コード例 #9
0
 public int WriteFrame(short streamId, MemoryStream stream)
 {
     var wb = new FrameWriter(stream);
     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.Close();
 }
コード例 #10
0
 public void WriteToBatch(byte protocolVersion, FrameWriter wb)
 {
     //not a prepared query
     wb.WriteByte(0);
     wb.WriteLongString(_cqlQuery);
     if (_queryOptions.Values == null || _queryOptions.Values.Length == 0)
     {
         //not values
         wb.WriteInt16(0);
     }
     else
     {
         wb.WriteUInt16((ushort) _queryOptions.Values.Length);
         for (var i = 0; i < _queryOptions.Values.Length; i++)
         {
             var bytes = TypeCodec.Encode(protocolVersion, _queryOptions.Values[i]);
             wb.WriteBytes(bytes);
         }
     }
 }
コード例 #11
0
ファイル: QueryRequest.cs プロジェクト: alprema/csharp-driver
 public void WriteToBatch(FrameWriter wb)
 {
     //not a prepared query
     wb.WriteByte(0);
     wb.WriteLongString(_cqlQuery);
     if (_queryOptions.Values == null || _queryOptions.Values.Length == 0)
     {
         //not values
         wb.WriteInt16(0);
     }
     else
     {
         wb.WriteUInt16((ushort) _queryOptions.Values.Length);
         foreach (var queryParameter in _queryOptions.Values)
         {
             wb.WriteAsBytes(queryParameter);
         }
     }
 }