MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / _on_analytics_master_result

Method _on_analytics_master_result

cassandra/cluster.py:2955–2968  ·  view source on GitHub ↗
(self, response, master_future, query_future)

Source from the content-addressed store, hash-verified

2953 master_query_future.add_callbacks(callback=cb, callback_args=args, errback=cb, errback_args=args)
2954
2955 def _on_analytics_master_result(self, response, master_future, query_future):
2956 try:
2957 row = master_future.result()[0]
2958 addr = row[0]['location']
2959 delimiter_index = addr.rfind(':') # assumes <ip>:<port> - not robust, but that's what is being provided
2960 if delimiter_index > 0:
2961 addr = addr[:delimiter_index]
2962 targeted_query = HostTargetingStatement(query_future.query, addr)
2963 query_future.query_plan = query_future._load_balancer.make_query_plan(self.keyspace, targeted_query)
2964 except Exception:
2965 log.debug("Failed querying analytics master (request might not be routed optimally). "
2966 "Make sure the session is connecting to a graph analytics datacenter.", exc_info=True)
2967
2968 self.submit(query_future.send_request)
2969
2970 def _create_response_future(self, query, parameters, trace, custom_payload,
2971 timeout, execution_profile=EXEC_PROFILE_DEFAULT,

Callers

nothing calls this directly

Calls 4

submitMethod · 0.95
resultMethod · 0.80
make_query_planMethod · 0.45

Tested by

no test coverage detected