MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / make_query_plan

Method make_query_plan

cassandra/policies.py:172–184  ·  view source on GitHub ↗
(self, working_keyspace=None, query=None)

Source from the content-addressed store, hash-verified

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:

Callers 12

test_basicMethod · 0.95
test_single_hostMethod · 0.95
test_status_updatesMethod · 0.95
test_no_live_nodesMethod · 0.95
test_no_live_nodesMethod · 0.95
make_query_planMethod · 0.45
make_query_planMethod · 0.45
make_query_planMethod · 0.45
_reconnect_internalMethod · 0.45
_make_query_planMethod · 0.45

Calls

no outgoing calls

Tested by 6

test_basicMethod · 0.76
test_single_hostMethod · 0.76
test_status_updatesMethod · 0.76
test_no_live_nodesMethod · 0.76
test_no_live_nodesMethod · 0.76