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

Function setMetadataDependent

lib/client-options.js:335–352  ·  view source on GitHub ↗

* Sets the default options that depend on the protocol version and other metadata. * @param {Client} client

(client)

Source from the content-addressed store, hash-verified

333 * @param {Client} client
334 */
335function setMetadataDependent(client) {
336 const version = client.controlConnection.protocolVersion;
337 let coreConnectionsPerHost = coreConnectionsPerHostV3;
338 let maxRequestsPerConnection = maxRequestsPerConnectionV3;
339
340 if (!types.protocolVersion.uses2BytesStreamIds(version)) {
341 coreConnectionsPerHost = coreConnectionsPerHostV2;
342 maxRequestsPerConnection = maxRequestsPerConnectionV2;
343 }
344
345 if (client.options.queryOptions.consistency === undefined) {
346 client.options.queryOptions.consistency =
347 client.metadata.isDbaas() ? types.consistencies.localQuorum : types.consistencies.localOne;
348 }
349
350 client.options.pooling = utils.deepExtend(
351 {}, { coreConnectionsPerHost, maxRequestsPerConnection }, client.options.pooling);
352}
353
354exports.extend = extend;
355exports.defaultOptions = defaultOptions;

Callers

nothing calls this directly

Calls 1

isDbaasMethod · 0.80

Tested by

no test coverage detected