(self, working_keyspace=None, query=None)
| 170 | return HostDistance.LOCAL |
| 171 | |
| 172 | def make_query_plan(self, working_keyspace=None, query=None): |
| 173 | # not thread-safe, but we don't care much about lost increments |
| 174 | # for the purposes of load balancing |
| 175 | pos = self._position |
| 176 | self._position += 1 |
| 177 | |
| 178 | hosts = self._live_hosts |
| 179 | length = len(hosts) |
| 180 | if length: |
| 181 | pos %= length |
| 182 | return islice(cycle(hosts), pos, pos + length) |
| 183 | else: |
| 184 | return [] |
| 185 | |
| 186 | def on_up(self, host): |
| 187 | with self._hosts_lock: |
no outgoing calls