* @param {String} name * @private
(name)
| 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. |
no test coverage detected