* Prepares the provided query on all hosts, except the host provided. * @param {Iterator} iterator * @param {String} query * @param {String} keyspace * @private
(iterator, query, keyspace)
| 281 | * @private |
| 282 | */ |
| 283 | _prepareOnAllHosts(iterator, query, keyspace) { |
| 284 | const queries = [ query ]; |
| 285 | let h; |
| 286 | const hosts = []; |
| 287 | |
| 288 | while ((h = PrepareHandler.getNextHost(iterator, this._client.profileManager)) !== null) { |
| 289 | hosts.push(h); |
| 290 | } |
| 291 | |
| 292 | return Promise.all(hosts.map(h => |
| 293 | PrepareHandler |
| 294 | ._borrowAndPrepare(h, keyspace, queries) |
| 295 | .catch(err => this.log('verbose', `Unexpected error while preparing query (${query}) on ${h.address}`, err)))); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | module.exports = PrepareHandler; |
no test coverage detected