def __init__(self, eggroll_session, work_mode: WorkMode, persistent_engine=StoreType.LMDB): self._session_id = eggroll_session.get_session_id() self._eggroll_session = eggroll_session self._persistent_engine = persistent_engine self._sc = self._build_spark_context() eggroll_util.broadcast_eggroll_session(self._sc, work_mode, eggroll_session) self._eggroll = eggroll_util.build_eggroll_runtime(work_mode, eggroll_session) FateSession.set_instance(self)
def __init__(self, eggroll_session, work_mode, persistent_engine=ErStoreType.ROLLPAIR_LMDB): #self._eggroll = eggroll_util.build_eggroll_runtime(work_mode=work_mode, eggroll_session=eggroll_session) from eggroll.roll_pair.roll_pair import runtime_init self._eggroll = runtime_init(session=eggroll_session) self._session_id = eggroll_session.get_session_id() self._persistent_engine = persistent_engine self._session = eggroll_session TableManger.set_instance(self)
def __init__(self, eggroll_session, work_mode, persistent_engine=StoreType.LMDB): self._eggroll = eggroll_util.build_eggroll_runtime( work_mode=work_mode, eggroll_session=eggroll_session) self._session_id = eggroll_session.get_session_id() self._persistent_engine = persistent_engine TableManger.set_instance(self)
def __init__(self, eggroll_session, work_mode: WorkMode): self._session_id = eggroll_session.get_session_id() self._eggroll_session = eggroll_session self._eggroll = eggroll_util.build_eggroll_runtime(work_mode, eggroll_session) self._sc = self._build_spark_context() eggroll_util.broadcast_eggroll_session(self._sc, work_mode, eggroll_session) FateSession.set_instance(self)
def init_roll_site_context(runtime_conf, session_id): from eggroll.roll_site.roll_site import RollSiteContext from eggroll.roll_pair.roll_pair import RollPairContext LOGGER.info("init_roll_site_context runtime_conf: {}".format(runtime_conf)) session_instance = FateSession.get_instance()._eggroll.get_session() rp_context = RollPairContext(session_instance) role = runtime_conf.get("local").get("role") party_id = str(runtime_conf.get("local").get("party_id")) _path = file_utils.get_project_base_directory( ) + "/arch/conf/server_conf.json" server_conf = file_utils.load_json_conf(_path) host = server_conf.get('servers').get('proxy').get("host") port = server_conf.get('servers').get('proxy').get("port") options = { 'self_role': role, 'self_party_id': party_id, 'proxy_endpoint': ErEndpoint(host, int(port)) } rs_context = RollSiteContext(session_id, rp_ctx=rp_context, options=options) LOGGER.info("init_roll_site_context done: {}".format(rs_context.__dict__)) return rp_context, rs_context
def __init__(self, eggroll_session, work_mode): self._eggroll = eggroll_util.build_eggroll_runtime( work_mode=work_mode, eggroll_session=eggroll_session) self._session_id = eggroll_session.get_session_id() TableManger.set_instance(self)
def save_metas(self, kv): from arch.api.table.session import FateSession return FateSession.save_data_table_meta( kv=kv, data_table_name="%s.meta" % self.get_name(), data_table_namespace=self.get_namespace())
def get_metas(self): from arch.api.table.session import FateSession return FateSession.get_data_table_metas( data_table_name=self.get_name(), data_table_namespace=self.get_namespace())