(encoder, streamId)
| 136 | } |
| 137 | |
| 138 | write(encoder, streamId) { |
| 139 | //v1: <queryId> |
| 140 | // <n><value_1>....<value_n><consistency> |
| 141 | //v2: <queryId> |
| 142 | // <consistency><flags>[<n><value_1>...<value_n>][<result_page_size>][<paging_state>][<serial_consistency>] |
| 143 | //v3: <queryId> |
| 144 | // <consistency><flags>[<n>[name_1]<value_1>...[name_n]<value_n>][<result_page_size>][<paging_state>][<serial_consistency>][<timestamp>] |
| 145 | const frameWriter = new FrameWriter(types.opcodes.execute); |
| 146 | let headerFlags = this.options.isQueryTracing() ? types.frameFlags.tracing : 0; |
| 147 | if (this.options.getCustomPayload()) { |
| 148 | //The body may contain the custom payload |
| 149 | headerFlags |= types.frameFlags.customPayload; |
| 150 | frameWriter.writeCustomPayload(this.options.getCustomPayload()); |
| 151 | } |
| 152 | frameWriter.writeShortBytes(this.queryId); |
| 153 | if(types.protocolVersion.supportsResultMetadataId(encoder.protocolVersion)) { |
| 154 | frameWriter.writeShortBytes(this.meta.resultId); |
| 155 | } |
| 156 | this.writeQueryParameters(frameWriter, encoder); |
| 157 | |
| 158 | // Record the length of the body of the request before writing it |
| 159 | this.length = frameWriter.bodyLength; |
| 160 | |
| 161 | return frameWriter.write(encoder.protocolVersion, streamId, headerFlags); |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Writes v1 and v2 execute query parameters |
nothing calls this directly
no test coverage detected