[Streaming] Union api (#8612)

This commit is contained in:
chaokunyang
2020-06-08 14:28:11 +08:00
committed by GitHub
parent 3ee2e9f7e5
commit d04953ab3c
24 changed files with 579 additions and 45 deletions
+8 -2
View File
@@ -30,7 +30,7 @@ class GatewayClient:
def create_py_stream_source(self, serialized_func):
assert isinstance(serialized_func, bytes)
call = self._python_gateway_actor.createPythonStreamSource\
call = self._python_gateway_actor.createPythonStreamSource \
.remote(serialized_func)
return deserialize(ray.get(call))
@@ -41,10 +41,16 @@ class GatewayClient:
def create_py_partition(self, serialized_partition):
assert isinstance(serialized_partition, bytes)
call = self._python_gateway_actor.createPyPartition\
call = self._python_gateway_actor.createPyPartition \
.remote(serialized_partition)
return deserialize(ray.get(call))
def union(self, *streams):
serialized_streams = serialize(streams)
call = self._python_gateway_actor.union \
.remote(serialized_streams)
return deserialize(ray.get(call))
def call_function(self, java_class, java_function, *args):
java_params = serialize([java_class, java_function] + list(args))
call = self._python_gateway_actor.callFunction.remote(java_params)