[Java] Refine python function (#8943)

This commit is contained in:
chaokunyang
2020-06-16 16:22:49 +08:00
committed by GitHub
parent 14405b90d5
commit cb6f337372
13 changed files with 164 additions and 103 deletions
@@ -52,8 +52,8 @@ public class WorkerLifecycleController {
.setMaxRestarts(-1)
.remote();
} else {
actor = Ray.actor(new PyActorClass(
"ray.streaming.runtime.worker", "JobWorker"))
actor = Ray.actor(
PyActorClass.of("ray.streaming.runtime.worker", "JobWorker"))
.setResources(executionVertex.getResource())
.setMaxRestarts(-1)
.remote();
@@ -32,7 +32,7 @@ public class RemoteCallWorker {
// python
if (actor instanceof PyActorHandle) {
result = ((PyActorHandle) actor).task(new PyActorMethod("init", Object.class),
result = ((PyActorHandle) actor).task(PyActorMethod.of("init", Boolean.class),
context.getPythonWorkerContextBytes()).remote();
} else {
// java
@@ -56,7 +56,7 @@ public class RemoteCallWorker {
// python
if (actor instanceof PyActorHandle) {
result = ((PyActorHandle) actor)
.task(new PyActorMethod("start", Object.class)).remote();
.task(PyActorMethod.of("start", Boolean.class)).remote();
} else {
// java
result = ((ActorHandle<JobWorker>) actor).task(JobWorker::start).remote();