Asynchronously sets the keyspace on all pools. When all pools have set all of their connections, `callback` will be called with a dictionary of all errors that occurred, keyed by the `Host` that they occurred against.
(self, keyspace, callback)
| 3397 | self.execute('USE %s' % (protect_name(keyspace),)) |
| 3398 | |
| 3399 | def _set_keyspace_for_all_pools(self, keyspace, callback): |
| 3400 | """ |
| 3401 | Asynchronously sets the keyspace on all pools. When all |
| 3402 | pools have set all of their connections, `callback` will be |
| 3403 | called with a dictionary of all errors that occurred, keyed |
| 3404 | by the `Host` that they occurred against. |
| 3405 | """ |
| 3406 | with self._lock: |
| 3407 | self.keyspace = keyspace |
| 3408 | remaining_callbacks = set(self._pools.values()) |
| 3409 | errors = {} |
| 3410 | |
| 3411 | if not remaining_callbacks: |
| 3412 | callback(errors) |
| 3413 | return |
| 3414 | |
| 3415 | def pool_finished_setting_keyspace(pool, host_errors): |
| 3416 | remaining_callbacks.remove(pool) |
| 3417 | if host_errors: |
| 3418 | errors[pool.host] = host_errors |
| 3419 | |
| 3420 | if not remaining_callbacks: |
| 3421 | callback(host_errors) |
| 3422 | |
| 3423 | for pool in tuple(self._pools.values()): |
| 3424 | pool._set_keyspace_for_all_conns(keyspace, pool_finished_setting_keyspace) |
| 3425 | |
| 3426 | def user_type_registered(self, keyspace, user_type, klass): |
| 3427 | """ |
no test coverage detected