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

Method _onNewConnectionOpen

lib/host.js:403–420  ·  view source on GitHub ↗

* Executed after an scheduled new connection attempt finished * @private

(err)

Source from the content-addressed store, hash-verified

401 * @private
402 */
403 async _onNewConnectionOpen(err) {
404 if (err) {
405 this._checkPoolState();
406 return;
407 }
408 if (!this.isUp() && this.options.rePrepareOnUp) {
409 this.log('info', `Re-preparing all queries on host ${this.address} before setting it as UP`);
410 const allPrepared = this._metadata.getAllPrepared();
411 try {
412 await PrepareHandler.prepareAllQueries(this, allPrepared);
413 }
414 catch (err) {
415 this.log('warning', `Failed re-preparing on host ${this.address}: ${err}`, err);
416 }
417 }
418 this.setUp();
419 this.pool.increaseSize();
420 }
421
422 /**
423 * Returns an array containing the Cassandra Version as an Array of Numbers having the major version in the first

Callers 1

constructorMethod · 0.95

Calls 6

_checkPoolStateMethod · 0.95
isUpMethod · 0.95
setUpMethod · 0.95
getAllPreparedMethod · 0.80
prepareAllQueriesMethod · 0.80
increaseSizeMethod · 0.80

Tested by

no test coverage detected