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

Method _refreshKeyspace

lib/metadata/index.js:220–240  ·  view source on GitHub ↗

* @param {String} name * @private

(name)

Source from the content-addressed store, hash-verified

218 * @private
219 */
220 async _refreshKeyspace(name) {
221 if (!this.initialized) {
222 throw this._uninitializedError();
223 }
224 this.log('info', util.format('Retrieving keyspace %s metadata', name));
225 try {
226 const ksInfo = await this._schemaParser.getKeyspace(name);
227 if (!ksInfo) {
228 // the keyspace was dropped
229 delete this.keyspaces[name];
230 return null;
231 }
232 // Tokens are lazily init on the keyspace, once a replica from that keyspace is retrieved.
233 this.keyspaces[ksInfo.name] = ksInfo;
234 return ksInfo;
235 }
236 catch (err) {
237 this.log('error', 'There was an error while trying to retrieve keyspace information', err);
238 throw err;
239 }
240 }
241
242 /**
243 * Gets the metadata information of all the keyspaces and updates the internal state of the driver.

Callers 1

refreshKeyspaceMethod · 0.95

Calls 2

_uninitializedErrorMethod · 0.95
getKeyspaceMethod · 0.65

Tested by

no test coverage detected