def init_reader(self, input_channel, writer_actor): conf = { Config.TASK_JOB_ID: ray.worker.global_worker.current_job_id, Config.CHANNEL_TYPE: Config.NATIVE_CHANNEL } self.reader = transfer.DataReader([input_channel], [pickle.loads(writer_actor)], conf)
def init_reader(self, input_channel, writer_actor): conf = { Config.TASK_JOB_ID: ray.runtime_context._get_runtime_context().current_driver_id, Config.CHANNEL_TYPE: Config.NATIVE_CHANNEL } self.reader = transfer.DataReader([input_channel], [pickle.loads(writer_actor)], conf)
def init_reader(self, input_channel, writer_actor): conf = {Config.CHANNEL_TYPE: Config.NATIVE_CHANNEL} writer_async_func = PythonFunctionDescriptor( __name__, self.on_writer_message.__name__, self.__class__.__name__) writer_sync_func = PythonFunctionDescriptor( __name__, self.on_writer_message_sync.__name__, self.__class__.__name__) transfer.ChannelCreationParametersBuilder.set_python_writer_function_descriptor( writer_async_func, writer_sync_func) self.reader = transfer.DataReader([input_channel], [pickle.loads(writer_actor)], conf)
def init(self): channels = [c.str_qid for c in self.input_channels] input_actors = [] for c in self.input_channels: actor = self.env.execution_graph.get_actor(c.src_operator_id, c.src_instance_index) input_actors.append(actor) logger.info("DataInput input_actors %s", input_actors) conf = { Config.TASK_JOB_ID: ray.runtime_context._get_runtime_context() .current_driver_id, Config.CHANNEL_TYPE: self.env.config.channel_type } self.reader = transfer.DataReader(channels, input_actors, conf)