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

Method from

lib/metadata/client-state.js:97–113  ·  view source on GitHub ↗

* Creates a new instance from the provided client. * @param {Client} client * @internal * @ignore

(client)

Source from the content-addressed store, hash-verified

95 * @ignore
96 */
97 static from(client) {
98 const openConnections = {};
99 const inFlightQueries = {};
100 const hostArray = [];
101
102 client.hosts.forEach(host => {
103 if (host.pool.connections.length === 0) {
104 return;
105 }
106
107 hostArray.push(host);
108 openConnections[host.address] = host.pool.connections.length;
109 inFlightQueries[host.address] = host.getInFlight();
110 });
111
112 return new ClientState(hostArray, openConnections, inFlightQueries);
113 }
114}
115
116module.exports = ClientState;

Callers 15

_initializeConnectionMethod · 0.80
setPeersInfoMethod · 0.80
client.jsFile · 0.80
clearAndInvokePendingMethod · 0.80
uvintPackFunction · 0.80
_getDataCentersMethod · 0.80
keysMethod · 0.80
valuesMethod · 0.80
constructorMethod · 0.80
load-balancing.jsFile · 0.80
setLocalDcFunction · 0.80

Calls 3

forEachMethod · 0.65
pushMethod · 0.45
getInFlightMethod · 0.45

Tested by

no test coverage detected