MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / readFlagsInfo

Method readFlagsInfo

lib/readers.js:303–320  ·  view source on GitHub ↗

* Reads the body bytes corresponding to the flags * @returns {{traceId: Uuid, warnings: Array, customPayload}} * @throws {RangeError}

()

Source from the content-addressed store, hash-verified

301 * @throws {RangeError}
302 */
303 readFlagsInfo() {
304 if (this.header.flags === 0) {
305 return utils.emptyObject;
306 }
307 const result = {};
308 if (this.header.flags & types.frameFlags.tracing) {
309 this.checkOffset(16);
310 result.traceId = new types.Uuid(utils.copyBuffer(this.read(16)));
311 }
312 if (this.header.flags & types.frameFlags.warning) {
313 result.warnings = this.readStringList();
314 }
315 if (this.header.flags & types.frameFlags.customPayload) {
316 // Custom payload is a Map<string, Buffer>
317 result.customPayload = this.readMap(this.readShort(), this.readString, this.readBytes);
318 }
319 return result;
320 }
321
322 /**
323 * Reads the metadata from a row or a prepared result response

Callers 1

streams.jsFile · 0.80

Calls 5

checkOffsetMethod · 0.95
readMethod · 0.95
readStringListMethod · 0.95
readMapMethod · 0.95
readShortMethod · 0.95

Tested by

no test coverage detected