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()); }
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(); }
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()); }
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); } } }
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()); }
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); } } }
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); } } }
protected override void WriteBody(FrameWriter wb) { wb.WriteLongString(_cqlQuery); _queryOptions.Write(wb, false); }
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(); }
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); } } }
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); } } }