def _get_manager(cluster_info, host, ppid):
"""Returns this executor's "singleton" instance of the multiprocessing.Manager, reconnecting per python-worker if needed.
Args:
:cluster_info: cluster node reservations
:host: host IP
:ppid: parent (executor JVM) PID
Returns:
TFManager instance for this executor/python-worker
"""
for node in cluster_info:
if node['host'] == host and node['ppid'] == ppid:
addr = node['addr']
authkey = node['authkey']
TFSparkNode.mgr = TFManager.connect(addr,authkey)
break
logging.info("Connected to TFSparkNode.mgr on {0}, ppid={1}, state={2}".format(host, ppid, str(TFSparkNode.mgr.get('state'))))
return TFSparkNode.mgr
评论列表
文章目录