(encoder, streamId)
| 257 | } |
| 258 | |
| 259 | write(encoder, streamId) { |
| 260 | //v1: <query><consistency> |
| 261 | //v2: <query> |
| 262 | // <consistency><flags>[<n><value_1>...<value_n>][<result_page_size>][<paging_state>][<serial_consistency>] |
| 263 | //v3: <query> |
| 264 | // <consistency><flags>[<n>[name_1]<value_1>...[name_n]<value_n>][<result_page_size>][<paging_state>][<serial_consistency>][<timestamp>] |
| 265 | const frameWriter = new FrameWriter(types.opcodes.query); |
| 266 | let headerFlags = this.options.isQueryTracing() ? types.frameFlags.tracing : 0; |
| 267 | if (this.options.getCustomPayload()) { |
| 268 | //The body may contain the custom payload |
| 269 | headerFlags |= types.frameFlags.customPayload; |
| 270 | frameWriter.writeCustomPayload(this.options.getCustomPayload()); |
| 271 | } |
| 272 | |
| 273 | frameWriter.writeLString(this.query); |
| 274 | |
| 275 | if (!types.protocolVersion.supportsPaging(encoder.protocolVersion)) { |
| 276 | frameWriter.writeShort(this.consistency); |
| 277 | } else { |
| 278 | //Use the same fields as the execute writer |
| 279 | this.writeQueryParameters(frameWriter, encoder, true); |
| 280 | } |
| 281 | |
| 282 | // Record the length of the body of the request before writing it |
| 283 | this.length = frameWriter.bodyLength; |
| 284 | |
| 285 | return frameWriter.write(encoder.protocolVersion, streamId, headerFlags); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | class PrepareRequest extends Request { |
nothing calls this directly
no test coverage detected