mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 22:17:21 +08:00
[Streaming] operator chain (#8910)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import enum
|
||||
import logging
|
||||
|
||||
import ray
|
||||
import ray.streaming.generated.remote_call_pb2 as remote_call_pb
|
||||
@@ -6,6 +7,8 @@ import ray.streaming.operator as operator
|
||||
import ray.streaming.partition as partition
|
||||
from ray.streaming.generated.streaming_pb2 import Language
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class NodeType(enum.Enum):
|
||||
"""
|
||||
@@ -43,7 +46,13 @@ class ExecutionVertex:
|
||||
self.parallelism = vertex_pb.parallelism
|
||||
if vertex_pb.language == Language.PYTHON:
|
||||
operator_bytes = vertex_pb.operator # python operator descriptor
|
||||
self.stream_operator = operator.load_operator(operator_bytes)
|
||||
if vertex_pb.chained:
|
||||
logger.info("Load chained operator")
|
||||
self.stream_operator = operator.load_chained_operator(
|
||||
operator_bytes)
|
||||
else:
|
||||
logger.info("Load operator")
|
||||
self.stream_operator = operator.load_operator(operator_bytes)
|
||||
self.worker_actor = ray.actor.ActorHandle. \
|
||||
_deserialization_helper(vertex_pb.worker_actor)
|
||||
self.container_id = vertex_pb.container_id
|
||||
|
||||
Reference in New Issue
Block a user