[Java] Rename java ObjectRef/ActorHandle (#8799)

This commit is contained in:
chaokunyang
2020-06-09 11:40:43 +08:00
committed by GitHub
parent c1e6813cea
commit 31a4d07bc4
88 changed files with 1551 additions and 1544 deletions
+246 -246
View File
@@ -21,634 +21,634 @@ import io.ray.api.function.RayFuncVoid6;
@SuppressWarnings({"rawtypes", "unchecked"})
interface ActorCall<A> {
default <R> RayObject<R> call(RayFunc1<A, R> f) {
default <R> ObjectRef<R> call(RayFunc1<A, R> f) {
Object[] args = new Object[]{};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default void call(RayFuncVoid1<A> f) {
Object[] args = new Object[]{};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, R> RayObject<R> call(RayFunc2<A, T0, R> f, T0 t0) {
default <T0, R> ObjectRef<R> call(RayFunc2<A, T0, R> f, T0 t0) {
Object[] args = new Object[]{t0};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, R> RayObject<R> call(RayFunc2<A, T0, R> f, RayObject<T0> t0) {
default <T0, R> ObjectRef<R> call(RayFunc2<A, T0, R> f, ObjectRef<T0> t0) {
Object[] args = new Object[]{t0};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0> void call(RayFuncVoid2<A, T0> f, T0 t0) {
Object[] args = new Object[]{t0};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0> void call(RayFuncVoid2<A, T0> f, RayObject<T0> t0) {
default <T0> void call(RayFuncVoid2<A, T0> f, ObjectRef<T0> t0) {
Object[] args = new Object[]{t0};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, T0 t0, T1 t1) {
default <T0, T1, R> ObjectRef<R> call(RayFunc3<A, T0, T1, R> f, T0 t0, T1 t1) {
Object[] args = new Object[]{t0, t1};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, T0 t0, RayObject<T1> t1) {
default <T0, T1, R> ObjectRef<R> call(RayFunc3<A, T0, T1, R> f, T0 t0, ObjectRef<T1> t1) {
Object[] args = new Object[]{t0, t1};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, RayObject<T0> t0, T1 t1) {
default <T0, T1, R> ObjectRef<R> call(RayFunc3<A, T0, T1, R> f, ObjectRef<T0> t0, T1 t1) {
Object[] args = new Object[]{t0, t1};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, RayObject<T0> t0, RayObject<T1> t1) {
default <T0, T1, R> ObjectRef<R> call(RayFunc3<A, T0, T1, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1) {
Object[] args = new Object[]{t0, t1};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, T0 t0, T1 t1) {
Object[] args = new Object[]{t0, t1};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, T0 t0, RayObject<T1> t1) {
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, T0 t0, ObjectRef<T1> t1) {
Object[] args = new Object[]{t0, t1};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, RayObject<T0> t0, T1 t1) {
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, ObjectRef<T0> t0, T1 t1) {
Object[] args = new Object[]{t0, t1};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, RayObject<T0> t0, RayObject<T1> t1) {
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, ObjectRef<T0> t0, ObjectRef<T1> t1) {
Object[] args = new Object[]{t0, t1};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, T1 t1, T2 t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, T1 t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, T1 t1, RayObject<T2> t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, T1 t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, RayObject<T1> t1, T2 t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, ObjectRef<T1> t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, RayObject<T0> t0, T1 t1, T2 t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, ObjectRef<T0> t0, T1 t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, R> RayObject<R> call(RayFunc4<A, T0, T1, T2, R> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2) {
default <T0, T1, T2, R> ObjectRef<R> call(RayFunc4<A, T0, T1, T2, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, T1 t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, T1 t1, RayObject<T2> t2) {
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, T1 t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, RayObject<T1> t1, T2 t2) {
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, ObjectRef<T1> t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2) {
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, T1 t1, T2 t2) {
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, ObjectRef<T0> t0, T1 t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2) {
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2) {
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2) {
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2) {
Object[] args = new Object[]{t0, t1, t2};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, T2 t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, RayObject<T1> t1, T2 t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, ObjectRef<T1> t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, T1 t1, T2 t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, T1 t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, T1 t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, T1 t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, R> RayObject<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3, R> ObjectRef<R> call(RayFunc5<A, T0, T1, T2, T3, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, T1 t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, T1 t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, T1 t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, T1 t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, T1 t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, RayObject<T1> t1, T2 t2, T3 t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, ObjectRef<T1> t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, T1 t1, T2 t2, T3 t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, T1 t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, T1 t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, T1 t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, T3 t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3) {
default <T0, T1, T2, T3> void call(RayFuncVoid5<A, T0, T1, T2, T3> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3) {
Object[] args = new Object[]{t0, t1, t2, t3};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, T2 t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, T2 t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4, R> RayObject<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4, R> ObjectRef<R> call(RayFunc6<A, T0, T1, T2, T3, T4, R> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
return Ray.internal().callActor((RayActor) this, f, args);
return Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, T2 t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, T0 t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, T2 t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, T1 t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, T2 t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, T3 t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, T3 t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, T4 t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, T4 t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2, RayObject<T3> t3, RayObject<T4> t4) {
default <T0, T1, T2, T3, T4> void call(RayFuncVoid6<A, T0, T1, T2, T3, T4> f, ObjectRef<T0> t0, ObjectRef<T1> t1, ObjectRef<T2> t2, ObjectRef<T3> t3, ObjectRef<T4> t4) {
Object[] args = new Object[]{t0, t1, t2, t3, t4};
Ray.internal().callActor((RayActor) this, f, args);
Ray.internal().callActor((ActorHandle) this, f, args);
}
}
@@ -12,9 +12,9 @@ package io.ray.api;
* }
* }
* // Create an actor, and get a handle.
* RayActor<MyActor> myActor = Ray.createActor(MyActor::new);
* ActorHandle<MyActor> myActor = Ray.createActor(MyActor::new);
* // Call the `echo` method remotely.
* RayObject<Integer> result = myActor.call(MyActor::echo, 1);
* ObjectRef<Integer> result = myActor.call(MyActor::echo, 1);
* // Get the result of the remote `echo` method.
* Assert.assertEqual(result.get(), 1);
* }</pre>
@@ -24,6 +24,6 @@ package io.ray.api;
*
* @param <A> The type of the concrete actor class.
*/
public interface RayActor<A> extends BaseActor, ActorCall<A> {
public interface ActorHandle<A> extends BaseActorHandle, ActorCall<A> {
}
@@ -7,7 +7,7 @@ import io.ray.api.id.ActorId;
*
* A handle can be used to invoke a remote actor method.
*/
public interface BaseActor {
public interface BaseActorHandle {
/**
* @return The id of this actor.
@@ -3,10 +3,10 @@ package io.ray.api;
import io.ray.api.id.ObjectId;
/**
* Represents an object in the object store.
* Represents a reference to an object in the object store.
* @param <T> The object type.
*/
public interface RayObject<T> {
public interface ObjectRef<T> {
/**
* Fetch the object from the object store, this method will block
@@ -10,34 +10,34 @@ import io.ray.api.function.PyActorMethod;
@SuppressWarnings({"rawtypes", "unchecked"})
interface PyActorCall {
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod) {
default <R> ObjectRef<R> call(PyActorMethod<R> pyActorMethod) {
Object[] args = new Object[]{};
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
return Ray.internal().callActor((PyActorHandle)this, pyActorMethod, args);
}
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0) {
default <R> ObjectRef<R> call(PyActorMethod<R> pyActorMethod, Object obj0) {
Object[] args = new Object[]{obj0};
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
return Ray.internal().callActor((PyActorHandle)this, pyActorMethod, args);
}
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1) {
default <R> ObjectRef<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1) {
Object[] args = new Object[]{obj0, obj1};
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
return Ray.internal().callActor((PyActorHandle)this, pyActorMethod, args);
}
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2) {
default <R> ObjectRef<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2) {
Object[] args = new Object[]{obj0, obj1, obj2};
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
return Ray.internal().callActor((PyActorHandle)this, pyActorMethod, args);
}
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2, Object obj3) {
default <R> ObjectRef<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2, Object obj3) {
Object[] args = new Object[]{obj0, obj1, obj2, obj3};
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
return Ray.internal().callActor((PyActorHandle)this, pyActorMethod, args);
}
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) {
default <R> ObjectRef<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) {
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4};
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
return Ray.internal().callActor((PyActorHandle)this, pyActorMethod, args);
}
}
@@ -3,7 +3,7 @@ package io.ray.api;
/**
* Handle of a Python actor.
*/
public interface RayPyActor extends BaseActor, PyActorCall {
public interface PyActorHandle extends BaseActorHandle, PyActorCall {
/**
* @return Module name of the Python actor class.
+13 -13
View File
@@ -56,9 +56,9 @@ public final class Ray extends RayCall {
* Store an object in the object store.
*
* @param obj The Java object to be stored.
* @return A RayObject instance that represents the in-store object.
* @return A ObjectRef instance that represents the in-store object.
*/
public static <T> RayObject<T> put(T obj) {
public static <T> ObjectRef<T> put(T obj) {
return runtime.put(obj);
}
@@ -85,15 +85,15 @@ public final class Ray extends RayCall {
}
/**
* Get a list of objects by RayObjects from the object store.
* Get a list of objects by `ObjectRef`s from the object store.
*
* @param objectList A list of RayObject to get.
* @param objectList A list of object references.
* @return A list of Java objects.
*/
public static <T> List<T> get(List<RayObject<T>> objectList) {
public static <T> List<T> get(List<ObjectRef<T>> objectList) {
List<ObjectId> objectIds = new ArrayList<>();
Class<T> objectType = null;
for (RayObject<T> o : objectList) {
for (ObjectRef<T> o : objectList) {
objectIds.add(o.getId());
objectType = o.getType();
}
@@ -104,13 +104,13 @@ public final class Ray extends RayCall {
* Wait for a list of RayObjects to be locally available,
* until specified number of objects are ready, or specified timeout has passed.
*
* @param waitList A list of RayObject to wait for.
* @param waitList A list of object references to wait for.
* @param numReturns The number of objects that should be returned.
* @param timeoutMs The maximum time in milliseconds to wait before returning.
* @return Two lists, one containing locally available objects, one containing the rest.
*/
public static <T> WaitResult<T> wait(List<RayObject<T>> waitList, int numReturns,
int timeoutMs) {
public static <T> WaitResult<T> wait(List<ObjectRef<T>> waitList, int numReturns,
int timeoutMs) {
return runtime.wait(waitList, numReturns, timeoutMs);
}
@@ -118,11 +118,11 @@ public final class Ray extends RayCall {
* A convenient helper method for Ray.wait. It will wait infinitely until
* specified number of objects are locally available.
*
* @param waitList A list of RayObject to wait for.
* @param waitList A list of object references to wait for.
* @param numReturns The number of objects that should be returned.
* @return Two lists, one containing locally available objects, one containing the rest.
*/
public static <T> WaitResult<T> wait(List<RayObject<T>> waitList, int numReturns) {
public static <T> WaitResult<T> wait(List<ObjectRef<T>> waitList, int numReturns) {
return runtime.wait(waitList, numReturns, Integer.MAX_VALUE);
}
@@ -130,10 +130,10 @@ public final class Ray extends RayCall {
* A convenient helper method for Ray.wait. It will wait infinitely until
* all objects are locally available.
*
* @param waitList A list of RayObject to wait for.
* @param waitList A list of object references to wait for.
* @return Two lists, one containing locally available objects, one containing the rest.
*/
public static <T> WaitResult<T> wait(List<RayObject<T>> waitList) {
public static <T> WaitResult<T> wait(List<ObjectRef<T>> waitList) {
return runtime.wait(waitList, waitList.size(), Integer.MAX_VALUE);
}
File diff suppressed because it is too large Load Diff
@@ -8,10 +8,10 @@ import java.util.List;
*/
public final class WaitResult<T> {
private final List<RayObject<T>> ready;
private final List<RayObject<T>> unready;
private final List<ObjectRef<T>> ready;
private final List<ObjectRef<T>> unready;
public WaitResult(List<RayObject<T>> ready, List<RayObject<T>> unready) {
public WaitResult(List<ObjectRef<T>> ready, List<ObjectRef<T>> unready) {
this.ready = ready;
this.unready = unready;
}
@@ -19,14 +19,14 @@ public final class WaitResult<T> {
/**
* Get the list of ready objects.
*/
public List<RayObject<T>> getReady() {
public List<ObjectRef<T>> getReady() {
return ready;
}
/**
* Get the list of unready objects.
*/
public List<RayObject<T>> getUnready() {
public List<ObjectRef<T>> getUnready() {
return unready;
}
@@ -18,7 +18,7 @@ package io.ray.api.function;
* we can create this Python actor from Java:
*
* {@code
* RayPyActor actor = Ray.createActor(new PyActorClass("example_package.example_module", "A"),
* PyActorHandle actor = Ray.createActor(new PyActorClass("example_package.example_module", "A"),
* "the value for x");
* }
* </pre>
@@ -17,14 +17,14 @@ package io.ray.api.function;
* suppose we have got the Python actor class A's handle in Java
*
* {@code
* RayPyActor actor = ...; // returned from Ray.createActor or passed from Python
* PyActorHandle actor = ...; // returned from Ray.createActor or passed from Python
* }
*
* then we can call the actor method:
*
* {@code
* // A.foo returns a string, so we have to set the returnType to String.class
* RayObject<String> res = actor.call(new PyActorMethod<>("foo", String.class));
* ObjectRef<String> res = actor.call(new PyActorMethod<>("foo", String.class));
* String x = res.get();
* }
* </pre>
@@ -18,13 +18,13 @@ package io.ray.api.function;
*
* {@code
* // bar returns input, so we have to set the returnType to int.class if bar accepts an int
* RayObject<Integer> res = actor.call(
* ObjectRef<Integer> res = actor.call(
* new PyRemoteFunction<>("example_package.example_module", "bar", Integer.class),
* 1);
* Integer value = res.get();
*
* // bar returns input, so we have to set the returnType to String.class if bar accepts a string
* RayObject<String> res = actor.call(
* ObjectRef<String> res = actor.call(
* new PyRemoteFunction<>("example_package.example_module", "bar", String.class),
* "Hello world!");
* String value = res.get();
@@ -1,9 +1,9 @@
package io.ray.api.runtime;
import io.ray.api.BaseActor;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.RayPyActor;
import io.ray.api.ActorHandle;
import io.ray.api.BaseActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.PyActorHandle;
import io.ray.api.WaitResult;
import io.ray.api.function.PyActorClass;
import io.ray.api.function.PyActorMethod;
@@ -31,9 +31,9 @@ public interface RayRuntime {
* Store an object in the object store.
*
* @param obj The Java object to be stored.
* @return A RayObject instance that represents the in-store object.
* @return A ObjectRef instance that represents the in-store object.
*/
<T> RayObject<T> put(T obj);
<T> ObjectRef<T> put(T obj);
/**
* Get an object from the object store.
@@ -57,12 +57,12 @@ public interface RayRuntime {
* Wait for a list of RayObjects to be locally available, until specified number of objects are
* ready, or specified timeout has passed.
*
* @param waitList A list of RayObject to wait for.
* @param waitList A list of ObjectRef to wait for.
* @param numReturns The number of objects that should be returned.
* @param timeoutMs The maximum time in milliseconds to wait before returning.
* @return Two lists, one containing locally available objects, one containing the rest.
*/
<T> WaitResult<T> wait(List<RayObject<T>> waitList, int numReturns, int timeoutMs);
<T> WaitResult<T> wait(List<ObjectRef<T>> waitList, int numReturns, int timeoutMs);
/**
* Free a list of objects from Plasma Store.
@@ -88,7 +88,7 @@ public interface RayRuntime {
* @param actor The actor to be killed.
* @param noRestart If set to true, the killed actor will not be restarted anymore.
*/
void killActor(BaseActor actor, boolean noRestart);
void killActor(BaseActorHandle actor, boolean noRestart);
/**
* Invoke a remote function.
@@ -98,7 +98,7 @@ public interface RayRuntime {
* @param options The options for this call.
* @return The result object.
*/
RayObject call(RayFunc func, Object[] args, CallOptions options);
ObjectRef call(RayFunc func, Object[] args, CallOptions options);
/**
* Invoke a remote Python function.
@@ -108,7 +108,7 @@ public interface RayRuntime {
* @param options The options for this call.
* @return The result object.
*/
RayObject call(PyRemoteFunction pyRemoteFunction, Object[] args, CallOptions options);
ObjectRef call(PyRemoteFunction pyRemoteFunction, Object[] args, CallOptions options);
/**
* Invoke a remote function on an actor.
@@ -118,7 +118,7 @@ public interface RayRuntime {
* @param args The arguments of the remote function.
* @return The result object.
*/
RayObject callActor(RayActor<?> actor, RayFunc func, Object[] args);
ObjectRef callActor(ActorHandle<?> actor, RayFunc func, Object[] args);
/**
* Invoke a remote Python function on an actor.
@@ -128,7 +128,7 @@ public interface RayRuntime {
* @param args Arguments of the function.
* @return The result object.
*/
RayObject callActor(RayPyActor pyActor, PyActorMethod pyActorMethod, Object[] args);
ObjectRef callActor(PyActorHandle pyActor, PyActorMethod pyActorMethod, Object[] args);
/**
* Create an actor on a remote node.
@@ -139,8 +139,8 @@ public interface RayRuntime {
* @param options The options for creating actor.
* @return A handle to the actor.
*/
<T> RayActor<T> createActor(RayFunc actorFactoryFunc, Object[] args,
ActorCreationOptions options);
<T> ActorHandle<T> createActor(RayFunc actorFactoryFunc, Object[] args,
ActorCreationOptions options);
/**
* Create a Python actor on a remote node.
@@ -150,8 +150,8 @@ public interface RayRuntime {
* @param options The options for creating actor.
* @return A handle to the actor.
*/
RayPyActor createActor(PyActorClass pyActorClass, Object[] args,
ActorCreationOptions options);
PyActorHandle createActor(PyActorClass pyActorClass, Object[] args,
ActorCreationOptions options);
RuntimeContext getRuntimeContext();
+1 -1
View File
@@ -36,7 +36,7 @@ EOF
generate_one io.ray.runtime.RayNativeRuntime
generate_one io.ray.runtime.task.NativeTaskSubmitter
generate_one io.ray.runtime.context.NativeWorkerContext
generate_one io.ray.runtime.actor.NativeRayActor
generate_one io.ray.runtime.actor.NativeActorHandle
generate_one io.ray.runtime.object.NativeObjectStore
generate_one io.ray.runtime.task.NativeTaskExecutor
generate_one io.ray.runtime.gcs.GlobalStateAccessor
@@ -3,10 +3,10 @@ package io.ray.runtime;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import io.ray.api.BaseActor;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.RayPyActor;
import io.ray.api.ActorHandle;
import io.ray.api.BaseActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.PyActorHandle;
import io.ray.api.WaitResult;
import io.ray.api.exception.RayException;
import io.ray.api.function.PyActorClass;
@@ -27,8 +27,8 @@ import io.ray.runtime.functionmanager.RayFunction;
import io.ray.runtime.gcs.GcsClient;
import io.ray.runtime.generated.Common;
import io.ray.runtime.generated.Common.Language;
import io.ray.runtime.object.ObjectRefImpl;
import io.ray.runtime.object.ObjectStore;
import io.ray.runtime.object.RayObjectImpl;
import io.ray.runtime.task.ArgumentsBuilder;
import io.ray.runtime.task.FunctionArg;
import io.ray.runtime.task.TaskExecutor;
@@ -72,9 +72,9 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
public abstract void shutdown();
@Override
public <T> RayObject<T> put(T obj) {
public <T> ObjectRef<T> put(T obj) {
ObjectId objectId = objectStore.put(obj);
return new RayObjectImpl<T>(objectId, (Class<T>)(obj == null ? Object.class : obj.getClass()));
return new ObjectRefImpl<T>(objectId, (Class<T>)(obj == null ? Object.class : obj.getClass()));
}
@Override
@@ -94,12 +94,12 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
}
@Override
public <T> WaitResult<T> wait(List<RayObject<T>> waitList, int numReturns, int timeoutMs) {
public <T> WaitResult<T> wait(List<ObjectRef<T>> waitList, int numReturns, int timeoutMs) {
return objectStore.wait(waitList, numReturns, timeoutMs);
}
@Override
public RayObject call(RayFunc func, Object[] args, CallOptions options) {
public ObjectRef call(RayFunc func, Object[] args, CallOptions options) {
RayFunction rayFunction = functionManager.getFunction(workerContext.getCurrentJobId(), func);
FunctionDescriptor functionDescriptor = rayFunction.functionDescriptor;
Optional<Class<?>> returnType = rayFunction.getReturnType();
@@ -107,8 +107,8 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
}
@Override
public RayObject call(PyRemoteFunction pyRemoteFunction, Object[] args,
CallOptions options) {
public ObjectRef call(PyRemoteFunction pyRemoteFunction, Object[] args,
CallOptions options) {
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(
pyRemoteFunction.moduleName,
"",
@@ -119,7 +119,7 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
}
@Override
public RayObject callActor(RayActor<?> actor, RayFunc func, Object[] args) {
public ObjectRef callActor(ActorHandle<?> actor, RayFunc func, Object[] args) {
RayFunction rayFunction = functionManager.getFunction(workerContext.getCurrentJobId(), func);
FunctionDescriptor functionDescriptor = rayFunction.functionDescriptor;
Optional<Class<?>> returnType = rayFunction.getReturnType();
@@ -127,7 +127,7 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
}
@Override
public RayObject callActor(RayPyActor pyActor, PyActorMethod pyActorMethod, Object... args) {
public ObjectRef callActor(PyActorHandle pyActor, PyActorMethod pyActorMethod, Object... args) {
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(pyActor.getModuleName(),
pyActor.getClassName(), pyActorMethod.methodName);
// Python functions always have a return value, even if it's `None`.
@@ -137,22 +137,22 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
@Override
@SuppressWarnings("unchecked")
public <T> RayActor<T> createActor(RayFunc actorFactoryFunc,
Object[] args, ActorCreationOptions options) {
public <T> ActorHandle<T> createActor(RayFunc actorFactoryFunc,
Object[] args, ActorCreationOptions options) {
FunctionDescriptor functionDescriptor =
functionManager.getFunction(workerContext.getCurrentJobId(), actorFactoryFunc)
.functionDescriptor;
return (RayActor<T>) createActorImpl(functionDescriptor, args, options);
return (ActorHandle<T>) createActorImpl(functionDescriptor, args, options);
}
@Override
public RayPyActor createActor(PyActorClass pyActorClass, Object[] args,
ActorCreationOptions options) {
public PyActorHandle createActor(PyActorClass pyActorClass, Object[] args,
ActorCreationOptions options) {
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(
pyActorClass.moduleName,
pyActorClass.className,
PYTHON_INIT_METHOD_NAME);
return (RayPyActor) createActorImpl(functionDescriptor, args, options);
return (PyActorHandle) createActorImpl(functionDescriptor, args, options);
}
@@ -207,7 +207,8 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
};
}
private RayObject callNormalFunction(FunctionDescriptor functionDescriptor,
private ObjectRef callNormalFunction(
FunctionDescriptor functionDescriptor,
Object[] args, Optional<Class<?>> returnType, CallOptions options) {
int numReturns = returnType.isPresent() ? 1 : 0;
List<FunctionArg> functionArgs = ArgumentsBuilder
@@ -218,12 +219,15 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
if (returnIds.isEmpty()) {
return null;
} else {
return new RayObjectImpl(returnIds.get(0), returnType.get());
return new ObjectRefImpl(returnIds.get(0), returnType.get());
}
}
private RayObject callActorFunction(BaseActor rayActor,
FunctionDescriptor functionDescriptor, Object[] args, Optional<Class<?>> returnType) {
private ObjectRef callActorFunction(
BaseActorHandle rayActor,
FunctionDescriptor functionDescriptor,
Object[] args,
Optional<Class<?>> returnType) {
int numReturns = returnType.isPresent() ? 1 : 0;
List<FunctionArg> functionArgs = ArgumentsBuilder
.wrap(args, functionDescriptor.getLanguage());
@@ -233,18 +237,18 @@ public abstract class AbstractRayRuntime implements RayRuntimeInternal {
if (returnIds.isEmpty()) {
return null;
} else {
return new RayObjectImpl(returnIds.get(0), returnType.get());
return new ObjectRefImpl(returnIds.get(0), returnType.get());
}
}
private BaseActor createActorImpl(FunctionDescriptor functionDescriptor,
Object[] args, ActorCreationOptions options) {
private BaseActorHandle createActorImpl(FunctionDescriptor functionDescriptor,
Object[] args, ActorCreationOptions options) {
List<FunctionArg> functionArgs = ArgumentsBuilder
.wrap(args, functionDescriptor.getLanguage());
if (functionDescriptor.getLanguage() != Language.JAVA && options != null) {
Preconditions.checkState(Strings.isNullOrEmpty(options.jvmOptions));
}
BaseActor actor = taskSubmitter.createActor(functionDescriptor, functionArgs, options);
BaseActorHandle actor = taskSubmitter.createActor(functionDescriptor, functionArgs, options);
return actor;
}
@@ -1,7 +1,7 @@
package io.ray.runtime;
import com.google.common.base.Preconditions;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.id.JobId;
import io.ray.api.id.UniqueId;
import io.ray.runtime.config.RayConfig;
@@ -62,7 +62,7 @@ public class RayDevRuntime extends AbstractRayRuntime {
}
@Override
public void killActor(BaseActor actor, boolean noRestart) {
public void killActor(BaseActorHandle actor, boolean noRestart) {
throw new UnsupportedOperationException();
}
@@ -1,7 +1,7 @@
package io.ray.runtime;
import com.google.common.base.Preconditions;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.id.JobId;
import io.ray.api.id.UniqueId;
import io.ray.runtime.config.RayConfig;
@@ -132,7 +132,7 @@ public final class RayNativeRuntime extends AbstractRayRuntime {
}
@Override
public void killActor(BaseActor actor, boolean noRestart) {
public void killActor(BaseActorHandle actor, boolean noRestart) {
nativeKillActor(actor.getId().getBytes(), noRestart);
}
@@ -1,6 +1,6 @@
package io.ray.runtime.actor;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.api.id.ActorId;
import io.ray.api.id.ObjectId;
import java.io.Externalizable;
@@ -12,13 +12,13 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Implementation of actor handle for local mode.
*/
public class LocalModeRayActor implements RayActor, Externalizable {
public class LocalModeActorHandle implements ActorHandle, Externalizable {
private ActorId actorId;
private AtomicReference<ObjectId> previousActorTaskDummyObjectId = new AtomicReference<>();
public LocalModeRayActor(ActorId actorId, ObjectId previousActorTaskDummyObjectId) {
public LocalModeActorHandle(ActorId actorId, ObjectId previousActorTaskDummyObjectId) {
this.actorId = actorId;
this.previousActorTaskDummyObjectId.set(previousActorTaskDummyObjectId);
}
@@ -26,7 +26,7 @@ public class LocalModeRayActor implements RayActor, Externalizable {
/**
* Required by FST
*/
public LocalModeRayActor() {
public LocalModeActorHandle() {
}
@Override
@@ -1,7 +1,7 @@
package io.ray.runtime.actor;
import com.google.common.base.Preconditions;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.id.ActorId;
import io.ray.runtime.generated.Common.Language;
import java.io.Externalizable;
@@ -14,7 +14,7 @@ import java.util.List;
* Abstract and language-independent implementation of actor handle for cluster mode. This is a
* wrapper class for C++ ActorHandle.
*/
public abstract class NativeRayActor implements BaseActor, Externalizable {
public abstract class NativeActorHandle implements BaseActorHandle, Externalizable {
/**
* ID of the actor.
@@ -23,7 +23,7 @@ public abstract class NativeRayActor implements BaseActor, Externalizable {
private Language language;
NativeRayActor(byte[] actorId, Language language) {
NativeActorHandle(byte[] actorId, Language language) {
Preconditions.checkState(!ActorId.fromBytes(actorId).isNil());
this.actorId = actorId;
this.language = language;
@@ -32,15 +32,15 @@ public abstract class NativeRayActor implements BaseActor, Externalizable {
/**
* Required by FST
*/
NativeRayActor() {
NativeActorHandle() {
}
public static NativeRayActor create(byte[] actorId, Language language) {
public static NativeActorHandle create(byte[] actorId, Language language) {
switch (language) {
case JAVA:
return new NativeRayJavaActor(actorId);
return new NativeJavaActorHandle(actorId);
case PYTHON:
return new NativeRayPyActor(actorId);
return new NativePyActorHandle(actorId);
default:
throw new IllegalStateException("Unknown actor handle language: " + language);
}
@@ -81,17 +81,14 @@ public abstract class NativeRayActor implements BaseActor, Externalizable {
*
* @return the bytes of an actor handle
*/
public static NativeRayActor fromBytes(byte[] bytes) {
public static NativeActorHandle fromBytes(byte[] bytes) {
byte[] actorId = nativeDeserialize(bytes);
Language language = Language.forNumber(nativeGetLanguage(actorId));
Preconditions.checkNotNull(language);
return create(actorId, language);
}
@Override
protected void finalize() {
// TODO(zhijunfu): do we need to free the ActorHandle in core worker?
}
// TODO(chaokunyang) do we need to free the ActorHandle in core worker by using phantom reference?
private static native int nativeGetLanguage(byte[] actorId);
@@ -8,20 +8,20 @@ import org.nustaq.serialization.FSTObjectInput;
import org.nustaq.serialization.FSTObjectOutput;
/**
* To deal with serialization about {@link NativeRayActor}.
* To deal with serialization about {@link NativeActorHandle}.
*/
public class NativeRayActorSerializer extends FSTBasicObjectSerializer {
public class NativeActorHandleSerializer extends FSTBasicObjectSerializer {
@Override
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo,
FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
((NativeRayActor) toWrite).writeExternal(out);
((NativeActorHandle) toWrite).writeExternal(out);
}
@Override
public void readObject(FSTObjectInput in, Object toRead, FSTClazzInfo clzInfo,
FSTFieldInfo referencedBy) throws Exception {
super.readObject(in, toRead, clzInfo, referencedBy);
((NativeRayActor) toRead).readExternal(in);
((NativeActorHandle) toRead).readExternal(in);
}
}
@@ -1,7 +1,7 @@
package io.ray.runtime.actor;
import com.google.common.base.Preconditions;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.runtime.generated.Common.Language;
import java.io.IOException;
import java.io.ObjectInput;
@@ -9,16 +9,16 @@ import java.io.ObjectInput;
/**
* Java implementation of actor handle for cluster mode.
*/
public class NativeRayJavaActor extends NativeRayActor implements RayActor {
public class NativeJavaActorHandle extends NativeActorHandle implements ActorHandle {
NativeRayJavaActor(byte[] actorId) {
NativeJavaActorHandle(byte[] actorId) {
super(actorId, Language.JAVA);
}
/**
* Required by FST
*/
public NativeRayJavaActor() {
public NativeJavaActorHandle() {
super();
}
@@ -1,7 +1,7 @@
package io.ray.runtime.actor;
import com.google.common.base.Preconditions;
import io.ray.api.RayPyActor;
import io.ray.api.PyActorHandle;
import io.ray.runtime.generated.Common.Language;
import java.io.IOException;
import java.io.ObjectInput;
@@ -9,16 +9,16 @@ import java.io.ObjectInput;
/**
* Python actor handle implementation for cluster mode.
*/
public class NativeRayPyActor extends NativeRayActor implements RayPyActor {
public class NativePyActorHandle extends NativeActorHandle implements PyActorHandle {
NativeRayPyActor(byte[] actorId) {
NativePyActorHandle(byte[] actorId) {
super(actorId, Language.PYTHON);
}
/**
* Required by FST
*/
public NativeRayPyActor() {
public NativePyActorHandle() {
super();
}
@@ -1,14 +1,14 @@
package io.ray.runtime.object;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.id.ObjectId;
import java.io.Serializable;
/**
* Implementation of {@link RayObject}.
* Implementation of {@link ObjectRef}.
*/
public final class RayObjectImpl<T> implements RayObject<T>, Serializable {
public final class ObjectRefImpl<T> implements ObjectRef<T>, Serializable {
private final ObjectId id;
@@ -27,7 +27,7 @@ public final class RayObjectImpl<T> implements RayObject<T>, Serializable {
*/
private transient boolean objectGotten;
public RayObjectImpl(ObjectId id, Class<T> type) {
public ObjectRefImpl(ObjectId id, Class<T> type) {
this.id = id;
this.type = type;
object = null;
@@ -1,7 +1,7 @@
package io.ray.runtime.object;
import com.google.common.base.Preconditions;
import io.ray.api.RayObject;
import io.ray.api.ObjectRef;
import io.ray.api.WaitResult;
import io.ray.api.exception.RayException;
import io.ray.api.id.ObjectId;
@@ -126,22 +126,22 @@ public abstract class ObjectStore {
* Wait for a list of RayObjects to be locally available, until specified number of objects are
* ready, or specified timeout has passed.
*
* @param waitList A list of RayObject to wait for.
* @param waitList A list of object references to wait for.
* @param numReturns The number of objects that should be returned.
* @param timeoutMs The maximum time in milliseconds to wait before returning.
* @return Two lists, one containing locally available objects, one containing the rest.
*/
public <T> WaitResult<T> wait(List<RayObject<T>> waitList, int numReturns, int timeoutMs) {
public <T> WaitResult<T> wait(List<ObjectRef<T>> waitList, int numReturns, int timeoutMs) {
Preconditions.checkNotNull(waitList);
if (waitList.isEmpty()) {
return new WaitResult<>(Collections.emptyList(), Collections.emptyList());
}
List<ObjectId> ids = waitList.stream().map(RayObject::getId).collect(Collectors.toList());
List<ObjectId> ids = waitList.stream().map(ObjectRef::getId).collect(Collectors.toList());
List<Boolean> ready = wait(ids, numReturns, timeoutMs);
List<RayObject<T>> readyList = new ArrayList<>();
List<RayObject<T>> unreadyList = new ArrayList<>();
List<ObjectRef<T>> readyList = new ArrayList<>();
List<ObjectRef<T>> unreadyList = new ArrayList<>();
for (int i = 0; i < ready.size(); i++) {
if (ready.get(i)) {
@@ -1,7 +1,7 @@
package io.ray.runtime.serializer;
import io.ray.runtime.actor.NativeRayActor;
import io.ray.runtime.actor.NativeRayActorSerializer;
import io.ray.runtime.actor.NativeActorHandle;
import io.ray.runtime.actor.NativeActorHandleSerializer;
import org.nustaq.serialization.FSTConfiguration;
/**
@@ -11,7 +11,7 @@ public class FstSerializer {
private static final ThreadLocal<FSTConfiguration> conf = ThreadLocal.withInitial(() -> {
FSTConfiguration conf = FSTConfiguration.createDefaultConfiguration();
conf.registerSerializer(NativeRayActor.class, new NativeRayActorSerializer(), true);
conf.registerSerializer(NativeActorHandle.class, new NativeActorHandleSerializer(), true);
return conf;
});
@@ -1,7 +1,7 @@
package io.ray.runtime.task;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.id.ObjectId;
import io.ray.runtime.RayRuntimeInternal;
import io.ray.runtime.generated.Common.Language;
@@ -36,8 +36,8 @@ public class ArgumentsBuilder {
for (Object arg : args) {
ObjectId id = null;
NativeRayObject value = null;
if (arg instanceof RayObject) {
id = ((RayObject) arg).getId();
if (arg instanceof ObjectRef) {
id = ((ObjectRef) arg).getId();
} else {
value = ObjectSerializer.serialize(arg);
if (language != Language.JAVA) {
@@ -3,7 +3,7 @@ package io.ray.runtime.task;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.protobuf.ByteString;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.id.ActorId;
import io.ray.api.id.ObjectId;
import io.ray.api.id.TaskId;
@@ -11,7 +11,7 @@ import io.ray.api.id.UniqueId;
import io.ray.api.options.ActorCreationOptions;
import io.ray.api.options.CallOptions;
import io.ray.runtime.RayRuntimeInternal;
import io.ray.runtime.actor.LocalModeRayActor;
import io.ray.runtime.actor.LocalModeActorHandle;
import io.ray.runtime.context.LocalModeWorkerContext;
import io.ray.runtime.functionmanager.FunctionDescriptor;
import io.ray.runtime.functionmanager.JavaFunctionDescriptor;
@@ -149,8 +149,8 @@ public class LocalModeTaskSubmitter implements TaskSubmitter {
}
@Override
public BaseActor createActor(FunctionDescriptor functionDescriptor, List<FunctionArg> args,
ActorCreationOptions options) {
public BaseActorHandle createActor(FunctionDescriptor functionDescriptor, List<FunctionArg> args,
ActorCreationOptions options) {
ActorId actorId = ActorId.fromRandom();
TaskSpec taskSpec = getTaskSpecBuilder(TaskType.ACTOR_CREATION_TASK, functionDescriptor, args)
.setNumReturns(1)
@@ -159,12 +159,12 @@ public class LocalModeTaskSubmitter implements TaskSubmitter {
.build())
.build();
submitTaskSpec(taskSpec);
return new LocalModeRayActor(actorId, getReturnIds(taskSpec).get(0));
return new LocalModeActorHandle(actorId, getReturnIds(taskSpec).get(0));
}
@Override
public List<ObjectId> submitActorTask(
BaseActor actor, FunctionDescriptor functionDescriptor,
BaseActorHandle actor, FunctionDescriptor functionDescriptor,
List<FunctionArg> args, int numReturns, CallOptions options) {
Preconditions.checkState(numReturns <= 1);
TaskSpec.Builder builder = getTaskSpecBuilder(TaskType.ACTOR_TASK, functionDescriptor, args);
@@ -175,7 +175,7 @@ public class LocalModeTaskSubmitter implements TaskSubmitter {
.setActorTaskSpec(
ActorTaskSpec.newBuilder().setActorId(ByteString.copyFrom(actor.getId().getBytes()))
.setPreviousActorTaskDummyObjectId(ByteString.copyFrom(
((LocalModeRayActor) actor)
((LocalModeActorHandle) actor)
.exchangePreviousActorTaskDummyObjectId(returnIds.get(returnIds.size() - 1))
.getBytes()))
.build())
@@ -1,11 +1,11 @@
package io.ray.runtime.task;
import com.google.common.base.Preconditions;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.id.ObjectId;
import io.ray.api.options.ActorCreationOptions;
import io.ray.api.options.CallOptions;
import io.ray.runtime.actor.NativeRayActor;
import io.ray.runtime.actor.NativeActorHandle;
import io.ray.runtime.functionmanager.FunctionDescriptor;
import java.util.List;
import java.util.stream.Collectors;
@@ -23,17 +23,17 @@ public class NativeTaskSubmitter implements TaskSubmitter {
}
@Override
public BaseActor createActor(FunctionDescriptor functionDescriptor, List<FunctionArg> args,
ActorCreationOptions options) {
public BaseActorHandle createActor(FunctionDescriptor functionDescriptor, List<FunctionArg> args,
ActorCreationOptions options) {
byte[] actorId = nativeCreateActor(functionDescriptor, args, options);
return NativeRayActor.create(actorId, functionDescriptor.getLanguage());
return NativeActorHandle.create(actorId, functionDescriptor.getLanguage());
}
@Override
public List<ObjectId> submitActorTask(
BaseActor actor, FunctionDescriptor functionDescriptor,
BaseActorHandle actor, FunctionDescriptor functionDescriptor,
List<FunctionArg> args, int numReturns, CallOptions options) {
Preconditions.checkState(actor instanceof NativeRayActor);
Preconditions.checkState(actor instanceof NativeActorHandle);
List<byte[]> returnIds = nativeSubmitActorTask(actor.getId().getBytes(),
functionDescriptor, args, numReturns, options);
return returnIds.stream().map(ObjectId::new).collect(Collectors.toList());
@@ -1,6 +1,6 @@
package io.ray.runtime.task;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.id.ObjectId;
import io.ray.api.options.ActorCreationOptions;
import io.ray.api.options.CallOptions;
@@ -30,8 +30,8 @@ public interface TaskSubmitter {
* @param options Options for this actor creation task.
* @return Handle to the actor.
*/
BaseActor createActor(FunctionDescriptor functionDescriptor, List<FunctionArg> args,
ActorCreationOptions options);
BaseActorHandle createActor(FunctionDescriptor functionDescriptor, List<FunctionArg> args,
ActorCreationOptions options);
/**
* Submit an actor task.
@@ -42,6 +42,6 @@ public interface TaskSubmitter {
* @param options Options for this task.
* @return Ids of the return objects.
*/
List<ObjectId> submitActorTask(BaseActor actor, FunctionDescriptor functionDescriptor,
List<FunctionArg> args, int numReturns, CallOptions options);
List<ObjectId> submitActorTask(BaseActorHandle actor, FunctionDescriptor functionDescriptor,
List<FunctionArg> args, int numReturns, CallOptions options);
}
@@ -170,9 +170,9 @@ public class RayCallGenerator extends BaseGenerator {
// 2) Construct the `returnType` part.
String returnType;
if (forActorCreation) {
returnType = "RayActor<A>";
returnType = "ActorHandle<A>";
} else {
returnType = hasReturn ? "RayObject<R>" : "void";
returnType = hasReturn ? "ObjectRef<R>" : "void";
}
// 3) Construct the `argsDeclaration` part.
@@ -222,7 +222,7 @@ public class RayCallGenerator extends BaseGenerator {
// 5) Construct the third line.
String callFuncArgs = "";
if (forActor) {
callFuncArgs += "(RayActor) this, ";
callFuncArgs += "(ActorHandle) this, ";
}
callFuncArgs += "f, args, ";
callFuncArgs += forActor ? "" : hasOptionsParam ? "options, " : "null, ";
@@ -297,7 +297,7 @@ public class RayCallGenerator extends BaseGenerator {
}
String genericType = forActorCreation ? "" : " <R>";
String returnType = !forActorCreation ? "RayObject<R>" : "RayPyActor";
String returnType = !forActorCreation ? "ObjectRef<R>" : "PyActorHandle";
String funcName = forActorCreation ? "createActor" : "call";
String internalCallFunc = forActorCreation ? "createActor" :
forActor ? "callActor" : "call";
@@ -310,7 +310,7 @@ public class RayCallGenerator extends BaseGenerator {
// Method body.
newLine(2, String.format("Object[] args = new Object[]{%s};", argList));
if (forActor) {
newLine(2, String.format("return Ray.internal().%s((RayPyActor)this, %s%s);",
newLine(2, String.format("return Ray.internal().%s((PyActorHandle)this, %s%s);",
internalCallFunc, funcArgs, optionsArg));
} else {
newLine(2, String.format("return Ray.internal().%s(%s%s);",
@@ -333,7 +333,7 @@ public class RayCallGenerator extends BaseGenerator {
}
String nextParameter = String.format("T%d t%d, ", pos, pos);
dfs(pos + 1, numParams, cur + nextParameter, res);
nextParameter = String.format("RayObject<T%d> t%d, ", pos, pos);
nextParameter = String.format("ObjectRef<T%d> t%d, ", pos, pos);
dfs(pos + 1, numParams, cur + nextParameter, res);
}
@@ -73,7 +73,7 @@ public class TestUtils {
* idle workers in Raylet's worker pool.
*/
public static void warmUpCluster() {
RayObject<String> obj = Ray.call(TestUtils::hi);
ObjectRef<String> obj = Ray.call(TestUtils::hi);
Assert.assertEquals(obj.get(), "hi");
}
@@ -1,8 +1,8 @@
package io.ray.api.benchmark;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import org.testng.annotations.Test;
public class ActorPressTest extends RayBenchmarkTest {
@@ -10,7 +10,7 @@ public class ActorPressTest extends RayBenchmarkTest {
@Test
public void singleLatencyTest() {
int times = 10;
RayActor<Adder> adder = Ray.createActor(ActorPressTest.Adder::new);
ActorHandle<Adder> adder = Ray.createActor(ActorPressTest.Adder::new);
super.singleLatencyTest(times, adder);
}
@@ -18,7 +18,7 @@ public class ActorPressTest extends RayBenchmarkTest {
public void maxTest() {
int clientNum = 2;
int totalNum = 20;
RayActor<ActorPressTest.Adder> adder = Ray.createActor(ActorPressTest.Adder::new);
ActorHandle<Adder> adder = Ray.createActor(ActorPressTest.Adder::new);
PressureTestParameter pressureTestParameter = new PressureTestParameter();
pressureTestParameter.setClientNum(clientNum);
pressureTestParameter.setTotalNum(totalNum);
@@ -32,7 +32,7 @@ public class ActorPressTest extends RayBenchmarkTest {
int clientNum = 2;
int totalQps = 2;
int duration = 3;
RayActor<ActorPressTest.Adder> adder = Ray.createActor(ActorPressTest.Adder::new);
ActorHandle<Adder> adder = Ray.createActor(ActorPressTest.Adder::new);
PressureTestParameter pressureTestParameter = new PressureTestParameter();
pressureTestParameter.setClientNum(clientNum);
pressureTestParameter.setTotalQps(totalQps);
@@ -43,8 +43,8 @@ public class ActorPressTest extends RayBenchmarkTest {
}
@Override
public RayObject<RemoteResult<Integer>> rayCall(RayActor rayActor) {
return ((RayActor<Adder>) rayActor).call(Adder::add, 10);
public ObjectRef<RemoteResult<Integer>> rayCall(ActorHandle rayActor) {
return ((ActorHandle<Adder>) rayActor).call(Adder::add, 10);
}
@Override
@@ -1,8 +1,8 @@
package io.ray.api.benchmark;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import org.testng.annotations.Test;
public class MaxPressureTest extends RayBenchmarkTest {
@@ -28,7 +28,7 @@ public class MaxPressureTest extends RayBenchmarkTest {
}
@Override
public RayObject<RemoteResult<Integer>> rayCall(RayActor rayActor) {
public ObjectRef<RemoteResult<Integer>> rayCall(ActorHandle rayActor) {
return Ray.call(MaxPressureTest::currentTime);
}
@@ -1,6 +1,6 @@
package io.ray.api.benchmark;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import java.io.Serializable;
public class PressureTestParameter implements Serializable {
@@ -19,7 +19,8 @@ public class PressureTestParameter implements Serializable {
private RayBenchmarkTest rayBenchmarkTest; //reference of current test case instance
private RayActor rayActor; // reference of the Actor, if only test remote funtion it could be null
// reference of the Actor, if only test remote funtion it could be null
private ActorHandle rayActor;
public Integer getClientNum() {
return clientNum;
@@ -69,11 +70,11 @@ public class PressureTestParameter implements Serializable {
this.rayBenchmarkTest = rayBenchmarkTest;
}
public RayActor getRayActor() {
public ActorHandle getRayActor() {
return rayActor;
}
public void setRayActor(RayActor rayActor) {
public void setRayActor(ActorHandle rayActor) {
this.rayActor = rayActor;
}
}
@@ -1,8 +1,8 @@
package io.ray.api.benchmark;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import org.testng.annotations.Test;
public class RateLimiterPressureTest extends RayBenchmarkTest {
@@ -30,7 +30,7 @@ public class RateLimiterPressureTest extends RayBenchmarkTest {
}
@Override
public RayObject<RemoteResult<Integer>> rayCall(RayActor rayActor) {
public ObjectRef<RemoteResult<Integer>> rayCall(ActorHandle rayActor) {
return Ray.call(RateLimiterPressureTest::currentTime);
}
@@ -1,9 +1,9 @@
package io.ray.api.benchmark;
import com.google.common.util.concurrent.RateLimiter;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.function.RayFunc1;
import io.ray.api.test.BaseTest;
import java.io.Serializable;
@@ -52,14 +52,14 @@ public abstract class RayBenchmarkTest<T> extends BaseTest implements Serializab
}
RemoteResultWrapper temp = new RemoteResultWrapper();
temp.setStartTime(System.nanoTime());
temp.setRayObject(rayBenchmarkTest.rayCall(pressureTestParameter.getRayActor()));
temp.setObjectRef(rayBenchmarkTest.rayCall(pressureTestParameter.getRayActor()));
remoteResultWrappers[i++] = temp;
}
int j = 0;
while (j < len) {
RemoteResultWrapper temp = remoteResultWrappers[j++];
RemoteResult remoteResult = (RemoteResult) temp.getRayObject().get();
RemoteResult remoteResult = (RemoteResult) temp.getObjectRef().get();
long endTime = remoteResult.getFinishTime();
long costTime = endTime - temp.getStartTime();
counterList.add(costTime / 1000);
@@ -74,13 +74,13 @@ public abstract class RayBenchmarkTest<T> extends BaseTest implements Serializab
}
}
public void singleLatencyTest(int times, RayActor rayActor) {
public void singleLatencyTest(int times, ActorHandle rayActor) {
List<Long> counterList = new ArrayList<>();
for (int i = 0; i < times; i++) {
long startTime = System.nanoTime();
RayObject<RemoteResult<T>> rayObject = rayCall(rayActor);
RemoteResult<T> remoteResult = rayObject.get();
ObjectRef<RemoteResult<T>> objectRef = rayCall(rayActor);
RemoteResult<T> remoteResult = objectRef.get();
T t = remoteResult.getResult();
long endTime = System.nanoTime();
long costTime = endTime - startTime;
@@ -92,7 +92,7 @@ public abstract class RayBenchmarkTest<T> extends BaseTest implements Serializab
printList(counterList);
}
public abstract RayObject<RemoteResult<T>> rayCall(RayActor rayActor);
public abstract ObjectRef<RemoteResult<T>> rayCall(ActorHandle rayActor);
public abstract boolean checkResult(T t);
@@ -126,7 +126,7 @@ public abstract class RayBenchmarkTest<T> extends BaseTest implements Serializab
List<Long> counterList = new ArrayList<>();
int clientNum = pressureTestParameter.getClientNum();
RayObject<List<Long>>[] rayObjects = new RayObject[clientNum];
ObjectRef<List<Long>>[] objectRefs = new ObjectRef[clientNum];
for (int i = 0; i < clientNum; i++) {
// Java compiler can't automatically infer the type of
@@ -135,10 +135,10 @@ public abstract class RayBenchmarkTest<T> extends BaseTest implements Serializab
// defect of the Java compiler.
// TODO(hchen): Figure out how to avoid manually declaring `RayFunc` type in this case.
RayFunc1<PressureTestParameter, List<Long>> func = RayBenchmarkTest::singleClient;
rayObjects[i] = Ray.call(func, pressureTestParameter);
objectRefs[i] = Ray.call(func, pressureTestParameter);
}
for (int i = 0; i < clientNum; i++) {
List<Long> subCounterList = rayObjects[i].get();
List<Long> subCounterList = objectRefs[i].get();
Assert.assertNotNull(subCounterList);
counterList.addAll(subCounterList);
}
@@ -1,12 +1,12 @@
package io.ray.api.benchmark;
import io.ray.api.RayObject;
import io.ray.api.ObjectRef;
public class RemoteResultWrapper<T> {
private long startTime;
private RayObject<RemoteResult<T>> rayObject;
private ObjectRef<RemoteResult<T>> objectRef;
public long getStartTime() {
return startTime;
@@ -16,11 +16,11 @@ public class RemoteResultWrapper<T> {
this.startTime = startTime;
}
public RayObject<RemoteResult<T>> getRayObject() {
return rayObject;
public ObjectRef<RemoteResult<T>> getObjectRef() {
return objectRef;
}
public void setRayObject(RayObject<RemoteResult<T>> rayObject) {
this.rayObject = rayObject;
public void setObjectRef(ObjectRef<RemoteResult<T>> objectRef) {
this.objectRef = objectRef;
}
}
@@ -1,8 +1,8 @@
package io.ray.api.benchmark;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import org.testng.annotations.Test;
public class SingleLatencyTest extends RayBenchmarkTest {
@@ -22,7 +22,7 @@ public class SingleLatencyTest extends RayBenchmarkTest {
}
@Override
public RayObject<RemoteResult<Integer>> rayCall(RayActor rayActor) {
public ObjectRef<RemoteResult<Integer>> rayCall(ActorHandle rayActor) {
return Ray.call(SingleLatencyTest::doFunc);
}
@@ -1,9 +1,9 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.options.ActorCreationOptions;
import java.util.List;
@@ -35,10 +35,10 @@ public class ActorConcurrentCallTest extends BaseTest {
ActorCreationOptions op = new ActorCreationOptions.Builder()
.setMaxConcurrency(3)
.createActorCreationOptions();
RayActor<ConcurrentActor> actor = Ray.createActor(ConcurrentActor::new, op);
RayObject<String> obj1 = actor.call(ConcurrentActor::countDown);
RayObject<String> obj2 = actor.call(ConcurrentActor::countDown);
RayObject<String> obj3 = actor.call(ConcurrentActor::countDown);
ActorHandle<ConcurrentActor> actor = Ray.createActor(ConcurrentActor::new, op);
ObjectRef<String> obj1 = actor.call(ConcurrentActor::countDown);
ObjectRef<String> obj2 = actor.call(ConcurrentActor::countDown);
ObjectRef<String> obj3 = actor.call(ConcurrentActor::countDown);
List<Integer> expectedResult = ImmutableList.of(1, 2, 3);
Assert.assertEquals(obj1.get(), "ok");
@@ -1,8 +1,8 @@
package io.ray.api.test;
import io.ray.api.ActorHandle;
import io.ray.api.Checkpointable;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.TestUtils;
import io.ray.api.exception.RayActorException;
import io.ray.api.id.ActorId;
@@ -46,7 +46,7 @@ public class ActorRestartTest extends BaseTest {
TestUtils.skipTestUnderSingleProcess();
ActorCreationOptions options =
new ActorCreationOptions.Builder().setMaxRestarts(1).createActorCreationOptions();
RayActor<Counter> actor = Ray.createActor(Counter::new, options);
ActorHandle<Counter> actor = Ray.createActor(Counter::new, options);
// Call increase 3 times.
for (int i = 0; i < 3; i++) {
actor.call(Counter::increase).get();
@@ -125,7 +125,7 @@ public class ActorRestartTest extends BaseTest {
TestUtils.skipTestUnderSingleProcess();
ActorCreationOptions options =
new ActorCreationOptions.Builder().setMaxRestarts(1).createActorCreationOptions();
RayActor<CheckpointableCounter> actor = Ray.createActor(CheckpointableCounter::new, options);
ActorHandle<CheckpointableCounter> actor = Ray.createActor(CheckpointableCounter::new, options);
// Call increase 3 times.
for (int i = 0; i < 3; i++) {
actor.call(CheckpointableCounter::increase).get();
@@ -1,10 +1,10 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.PyActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.RayPyActor;
import io.ray.api.TestUtils;
import io.ray.api.exception.UnreconstructableException;
import io.ray.api.id.ActorId;
@@ -47,10 +47,10 @@ public class ActorTest extends BaseTest {
public void testCreateAndCallActor() {
// Test creating an actor from a constructor
RayActor<Counter> actor = Ray.createActor(Counter::new, 1);
ActorHandle<Counter> actor = Ray.createActor(Counter::new, 1);
Assert.assertNotEquals(actor.getId(), ActorId.NIL);
// A java actor is not a python actor
Assert.assertFalse(actor instanceof RayPyActor);
Assert.assertFalse(actor instanceof PyActorHandle);
// Test calling an actor
Assert.assertEquals(Integer.valueOf(1), actor.call(Counter::getValue).get());
actor.call(Counter::increase, 1);
@@ -64,8 +64,8 @@ public class ActorTest extends BaseTest {
* get. To enable getting it twice, we cache the object in `RayObjectImpl`.
*/
public void testGetObjectTwice() {
RayActor<Counter> actor = Ray.createActor(Counter::new, 1);
RayObject<Integer> result = actor.call(Counter::getValue);
ActorHandle<Counter> actor = Ray.createActor(Counter::new, 1);
ObjectRef<Integer> result = actor.call(Counter::getValue);
Assert.assertEquals(result.get(), Integer.valueOf(1));
Assert.assertEquals(result.get(), Integer.valueOf(1));
// TODO(hchen): The following code will still fail, and can be fixed by using ref counting.
@@ -73,7 +73,7 @@ public class ActorTest extends BaseTest {
}
public void testCallActorWithLargeObject() {
RayActor<Counter> actor = Ray.createActor(Counter::new, 1);
ActorHandle<Counter> actor = Ray.createActor(Counter::new, 1);
TestUtils.LargeObject largeObject = new TestUtils.LargeObject();
Assert.assertEquals(Integer.valueOf(largeObject.data.length + 1),
actor.call(Counter::accessLargeObject, largeObject).get());
@@ -85,29 +85,29 @@ public class ActorTest extends BaseTest {
public void testCreateActorFromFactory() {
// Test creating an actor from a factory method
RayActor<Counter> actor = Ray.createActor(ActorTest::factory, 1);
ActorHandle<Counter> actor = Ray.createActor(ActorTest::factory, 1);
Assert.assertNotEquals(actor.getId(), UniqueId.NIL);
// Test calling an actor
Assert.assertEquals(Integer.valueOf(1), actor.call(Counter::getValue).get());
}
static int testActorAsFirstParameter(RayActor<Counter> actor, int delta) {
RayObject<Integer> res = actor.call(Counter::increaseAndGet, delta);
static int testActorAsFirstParameter(ActorHandle<Counter> actor, int delta) {
ObjectRef<Integer> res = actor.call(Counter::increaseAndGet, delta);
return res.get();
}
static int testActorAsSecondParameter(int delta, RayActor<Counter> actor) {
RayObject<Integer> res = actor.call(Counter::increaseAndGet, delta);
static int testActorAsSecondParameter(int delta, ActorHandle<Counter> actor) {
ObjectRef<Integer> res = actor.call(Counter::increaseAndGet, delta);
return res.get();
}
static int testActorAsFieldOfParameter(List<RayActor<Counter>> actor, int delta) {
RayObject<Integer> res = actor.get(0).call(Counter::increaseAndGet, delta);
static int testActorAsFieldOfParameter(List<ActorHandle<Counter>> actor, int delta) {
ObjectRef<Integer> res = actor.get(0).call(Counter::increaseAndGet, delta);
return res.get();
}
public void testPassActorAsParameter() {
RayActor<Counter> actor = Ray.createActor(Counter::new, 0);
ActorHandle<Counter> actor = Ray.createActor(Counter::new, 0);
Assert.assertEquals(Integer.valueOf(1),
Ray.call(ActorTest::testActorAsFirstParameter, actor, 1).get());
Assert.assertEquals(Integer.valueOf(11),
@@ -123,9 +123,9 @@ public class ActorTest extends BaseTest {
TestUtils.skipTestUnderSingleProcess();
// The UnreconstructableException is created by raylet.
RayActor<Counter> counter = Ray.createActor(Counter::new, 100);
ActorHandle<Counter> counter = Ray.createActor(Counter::new, 100);
// Call an actor method.
RayObject value = counter.call(Counter::getValue);
ObjectRef value = counter.call(Counter::getValue);
Assert.assertEquals(100, value.get());
// Delete the object from the object store.
Ray.internal().free(ImmutableList.of(value.getId()), false, false);
@@ -1,9 +1,9 @@
package io.ray.api.test;
import io.ray.api.BaseActor;
import io.ray.api.ActorHandle;
import io.ray.api.BaseActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.options.ActorCreationOptions;
import io.ray.runtime.AbstractRayRuntime;
@@ -93,18 +93,20 @@ public class ClassLoaderTest extends BaseTest {
// Compile the java file.
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
int result = compiler.run(null, null, null, "-d", jobResourcePath, javaFilePath);
int result = compiler.run(null, null, null, "-d",
jobResourcePath, javaFilePath);
if (result != 0) {
throw new RuntimeException("Couldn't compile ClassLoaderTester.java.");
}
FunctionDescriptor constructor = new JavaFunctionDescriptor("ClassLoaderTester", "<init>",
"()V");
RayActor<?> actor1 = createActor(constructor);
FunctionDescriptor getPid = new JavaFunctionDescriptor("ClassLoaderTester", "getPid", "()I");
FunctionDescriptor constructor = new JavaFunctionDescriptor(
"ClassLoaderTester", "<init>", "()V");
ActorHandle<?> actor1 = createActor(constructor);
FunctionDescriptor getPid = new JavaFunctionDescriptor(
"ClassLoaderTester", "getPid", "()I");
int pid = this.<Integer>callActorFunction(actor1, getPid, new Object[0],
Optional.of(Integer.class)).get();
RayActor<?> actor2;
ActorHandle<?> actor2;
while (true) {
// Create another actor which share the same process of actor 1.
actor2 = createActor(constructor);
@@ -115,40 +117,42 @@ public class ClassLoaderTest extends BaseTest {
}
}
FunctionDescriptor getClassLoaderHashCode = new JavaFunctionDescriptor("ClassLoaderTester",
"getClassLoaderHashCode",
"()I");
RayObject<Integer> hashCode1 = callActorFunction(actor1, getClassLoaderHashCode, new Object[0],
FunctionDescriptor getClassLoaderHashCode = new JavaFunctionDescriptor(
"ClassLoaderTester", "getClassLoaderHashCode", "()I");
ObjectRef<Integer> hashCode1 = callActorFunction(actor1, getClassLoaderHashCode, new Object[0],
Optional.of(Integer.class));
RayObject<Integer> hashCode2 = callActorFunction(actor2, getClassLoaderHashCode, new Object[0],
ObjectRef<Integer> hashCode2 = callActorFunction(actor2, getClassLoaderHashCode, new Object[0],
Optional.of(Integer.class));
Assert.assertEquals(hashCode1.get(), hashCode2.get());
FunctionDescriptor increase = new JavaFunctionDescriptor("ClassLoaderTester", "increase",
"()I");
RayObject<Integer> value1 = callActorFunction(actor1, increase, new Object[0],
FunctionDescriptor increase = new JavaFunctionDescriptor(
"ClassLoaderTester", "increase", "()I");
ObjectRef<Integer> value1 = callActorFunction(actor1, increase, new Object[0],
Optional.of(Integer.class));
RayObject<Integer> value2 = callActorFunction(actor2, increase, new Object[0],
ObjectRef<Integer> value2 = callActorFunction(actor2, increase, new Object[0],
Optional.of(Integer.class));
Assert.assertNotEquals(value1.get(), value2.get());
}
private RayActor<?> createActor(FunctionDescriptor functionDescriptor)
private ActorHandle<?> createActor(FunctionDescriptor functionDescriptor)
throws Exception {
Method createActorMethod = AbstractRayRuntime.class.getDeclaredMethod("createActorImpl",
FunctionDescriptor.class, Object[].class, ActorCreationOptions.class);
createActorMethod.setAccessible(true);
return (RayActor<?>) createActorMethod
return (ActorHandle<?>) createActorMethod
.invoke(TestUtils.getUnderlyingRuntime(), functionDescriptor, new Object[0], null);
}
private <T> RayObject<T> callActorFunction(RayActor<?> rayActor,
FunctionDescriptor functionDescriptor, Object[] args, Optional<Class<?>> returnType)
private <T> ObjectRef<T> callActorFunction(
ActorHandle<?> rayActor,
FunctionDescriptor functionDescriptor,
Object[] args,
Optional<Class<?>> returnType)
throws Exception {
Method callActorFunctionMethod = AbstractRayRuntime.class.getDeclaredMethod("callActorFunction",
BaseActor.class, FunctionDescriptor.class, Object[].class, Optional.class);
BaseActorHandle.class, FunctionDescriptor.class, Object[].class, Optional.class);
callActorFunctionMethod.setAccessible(true);
return (RayObject<T>) callActorFunctionMethod
return (ObjectRef<T>) callActorFunctionMethod
.invoke(TestUtils.getUnderlyingRuntime(), rayActor, functionDescriptor, args, returnType);
}
}
@@ -2,15 +2,15 @@ package io.ray.api.test;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.PyActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.RayPyActor;
import io.ray.api.function.PyActorClass;
import io.ray.api.function.PyActorMethod;
import io.ray.api.function.PyRemoteFunction;
import io.ray.runtime.actor.NativeRayActor;
import io.ray.runtime.actor.NativeRayPyActor;
import io.ray.runtime.actor.NativeActorHandle;
import io.ray.runtime.actor.NativePyActorHandle;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -69,7 +69,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
1.234, // Double
"example binary".getBytes()}; // byte[]
for (Object o : inputs) {
RayObject res = Ray.call(
ObjectRef res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_return_input", o.getClass()),
o);
Assert.assertEquals(res.get(), o);
@@ -77,7 +77,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
// null
{
Object input = null;
RayObject<Object> res = Ray.call(
ObjectRef<Object> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_return_input", Object.class), input);
Object r = res.get();
Assert.assertEquals(r, input);
@@ -85,7 +85,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
// array
{
int[] input = new int[]{1, 2};
RayObject<int[]> res = Ray.call(
ObjectRef<int[]> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_return_input", int[].class), input);
int[] r = res.get();
Assert.assertEquals(r, input);
@@ -94,7 +94,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
{
Object[] input = new Object[]{1, 2.3f, 4.56, "789", "10".getBytes(), null, true,
new int[]{1, 2}};
RayObject<Object[]> res = Ray.call(
ObjectRef<Object[]> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_return_input", Object[].class), input);
Object[] r = res.get();
// If we tell the value type is Object, then all numbers will be Number type.
@@ -119,7 +119,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
{
Assert.expectThrows(Exception.class, () -> {
List<Integer> input = Arrays.asList(1, 2);
RayObject<List<Integer>> res = Ray.call(
ObjectRef<List<Integer>> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_return_input",
(Class<List<Integer>>) input.getClass()), input);
List<Integer> r = res.get();
@@ -130,15 +130,16 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
@Test
public void testPythonCallJavaFunction() {
RayObject<String> res = Ray.call(
ObjectRef<String> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_func_call_java_function", String.class));
Assert.assertEquals(res.get(), "success");
}
@Test
public void testCallingPythonActor() {
RayPyActor actor = Ray.createActor(new PyActorClass(PYTHON_MODULE, "Counter"), "1".getBytes());
RayObject<byte[]> res = actor.call(
PyActorHandle actor = Ray.createActor(
new PyActorClass(PYTHON_MODULE, "Counter"), "1".getBytes());
ObjectRef<byte[]> res = actor.call(
new PyActorMethod<>("increase", byte[].class),
"1".getBytes());
Assert.assertEquals(res.get(), "2".getBytes());
@@ -146,7 +147,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
@Test
public void testPythonCallJavaActor() {
RayObject<byte[]> res = Ray.call(
ObjectRef<byte[]> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_func_call_java_actor", byte[].class),
"1".getBytes());
Assert.assertEquals(res.get(), "Counter1".getBytes());
@@ -157,7 +158,7 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
public void testPassActorHandleFromPythonToJava() {
// Call a python function which creates a python actor
// and pass the actor handle to callPythonActorHandle.
RayObject<byte[]> res = Ray.call(
ObjectRef<byte[]> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE, "py_func_pass_python_actor_handle", byte[].class));
Assert.assertEquals(res.get(), "3".getBytes());
}
@@ -165,20 +166,20 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
@Test
public void testPassActorHandleFromJavaToPython() {
// Create a java actor, and pass actor handle to python.
RayActor<TestActor> javaActor = Ray.createActor(TestActor::new, "1".getBytes());
Preconditions.checkState(javaActor instanceof NativeRayActor);
byte[] actorHandleBytes = ((NativeRayActor) javaActor).toBytes();
RayObject<byte[]> res = Ray.call(
ActorHandle<TestActor> javaActor = Ray.createActor(TestActor::new, "1".getBytes());
Preconditions.checkState(javaActor instanceof NativeActorHandle);
byte[] actorHandleBytes = ((NativeActorHandle) javaActor).toBytes();
ObjectRef<byte[]> res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE,
"py_func_call_java_actor_from_handle",
byte[].class),
actorHandleBytes);
Assert.assertEquals(res.get(), "12".getBytes());
// Create a python actor, and pass actor handle to python.
RayPyActor pyActor = Ray.createActor(
PyActorHandle pyActor = Ray.createActor(
new PyActorClass(PYTHON_MODULE, "Counter"), "1".getBytes());
Preconditions.checkState(pyActor instanceof NativeRayActor);
actorHandleBytes = ((NativeRayActor) pyActor).toBytes();
Preconditions.checkState(pyActor instanceof NativeActorHandle);
actorHandleBytes = ((NativeActorHandle) pyActor).toBytes();
res = Ray.call(
new PyRemoteFunction<>(PYTHON_MODULE,
"py_func_call_python_actor_from_handle",
@@ -218,8 +219,8 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
public static byte[] callPythonActorHandle(byte[] value) {
// This function will be called from test_cross_language_invocation.py
NativeRayPyActor actor = (NativeRayPyActor) NativeRayActor.fromBytes(value);
RayObject<byte[]> res = actor.call(
NativePyActorHandle actor = (NativePyActorHandle) NativeActorHandle.fromBytes(value);
ObjectRef<byte[]> res = actor.call(
new PyActorMethod<>("increase", byte[].class),
"1".getBytes());
Assert.assertEquals(res.get(), "3".getBytes());
@@ -2,8 +2,8 @@ package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.WaitResult;
import io.ray.api.options.CallOptions;
@@ -27,7 +27,7 @@ public class DynamicResourceTest extends BaseTest {
CallOptions op1 =
new CallOptions.Builder().setResources(ImmutableMap.of("A", 10.0)).createCallOptions();
RayObject<String> obj = Ray.call(DynamicResourceTest::sayHi, op1);
ObjectRef<String> obj = Ray.call(DynamicResourceTest::sayHi, op1);
WaitResult<String> result = Ray.wait(ImmutableList.of(obj), 1, 1000);
Assert.assertEquals(result.getReady().size(), 0);
@@ -1,8 +1,8 @@
package io.ray.api.test;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.exception.RayActorException;
import io.ray.api.exception.RayException;
@@ -71,9 +71,9 @@ public class FailureTest extends BaseTest {
}
}
private static void assertTaskFailedWithRayTaskException(RayObject<?> rayObject) {
private static void assertTaskFailedWithRayTaskException(ObjectRef<?> objectRef) {
try {
rayObject.get();
objectRef.get();
Assert.fail("Task didn't fail.");
} catch (RayTaskException e) {
Throwable rootCause = e.getCause();
@@ -94,14 +94,14 @@ public class FailureTest extends BaseTest {
@Test
public void testActorCreationFailure() {
TestUtils.skipTestUnderSingleProcess();
RayActor<BadActor> actor = Ray.createActor(BadActor::new, true);
ActorHandle<BadActor> actor = Ray.createActor(BadActor::new, true);
assertTaskFailedWithRayTaskException(actor.call(BadActor::badMethod));
}
@Test
public void testActorTaskFailure() {
TestUtils.skipTestUnderSingleProcess();
RayActor<BadActor> actor = Ray.createActor(BadActor::new, false);
ActorHandle<BadActor> actor = Ray.createActor(BadActor::new, false);
assertTaskFailedWithRayTaskException(actor.call(BadActor::badMethod));
}
@@ -120,7 +120,7 @@ public class FailureTest extends BaseTest {
@Test
public void testActorProcessDying() {
TestUtils.skipTestUnderSingleProcess();
RayActor<BadActor> actor = Ray.createActor(BadActor::new, false);
ActorHandle<BadActor> actor = Ray.createActor(BadActor::new, false);
try {
actor.call(BadActor::badMethod2).get();
Assert.fail("This line shouldn't be reached.");
@@ -144,8 +144,8 @@ public class FailureTest extends BaseTest {
FailureTest::badFunc2);
TestUtils.warmUpCluster();
for (RayFunc0<Integer> badFunc : badFunctions) {
RayObject<Integer> obj1 = Ray.call(badFunc);
RayObject<Integer> obj2 = Ray.call(FailureTest::slowFunc);
ObjectRef<Integer> obj1 = Ray.call(badFunc);
ObjectRef<Integer> obj2 = Ray.call(FailureTest::slowFunc);
Instant start = Instant.now();
try {
Ray.get(Arrays.asList(obj1, obj2));
@@ -1,7 +1,7 @@
package io.ray.api.test;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -24,8 +24,8 @@ public class HelloWorldTest extends BaseTest {
@Test
public void testHelloWorld() {
RayObject<String> hello = Ray.call(HelloWorldTest::hello);
RayObject<String> world = Ray.call(HelloWorldTest::world);
ObjectRef<String> hello = Ray.call(HelloWorldTest::hello);
ObjectRef<String> world = Ray.call(HelloWorldTest::world);
String helloWorld = Ray.call(HelloWorldTest::merge, hello, world).get();
Assert.assertEquals("hello,world!", helloWorld);
}
@@ -1,9 +1,9 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.exception.RayActorException;
import io.ray.api.options.ActorCreationOptions;
@@ -41,27 +41,27 @@ public class KillActorTest extends BaseTest {
public static class KillerActor {
public void kill(RayActor<?> actor, boolean noRestart) {
public void kill(ActorHandle<?> actor, boolean noRestart) {
actor.kill(noRestart);
}
}
private static void localKill(RayActor<?> actor, boolean noRestart) {
private static void localKill(ActorHandle<?> actor, boolean noRestart) {
actor.kill(noRestart);
}
private static void remoteKill(RayActor<?> actor, boolean noRestart) {
RayActor<KillerActor> killer = Ray.createActor(KillerActor::new);
private static void remoteKill(ActorHandle<?> actor, boolean noRestart) {
ActorHandle<KillerActor> killer = Ray.createActor(KillerActor::new);
killer.call(KillerActor::kill, actor, noRestart);
}
private void testKillActor(BiConsumer<RayActor<?>, Boolean> kill, boolean noRestart) {
private void testKillActor(BiConsumer<ActorHandle<?>, Boolean> kill, boolean noRestart) {
TestUtils.skipTestUnderSingleProcess();
ActorCreationOptions options =
new ActorCreationOptions.Builder().setMaxRestarts(1).createActorCreationOptions();
RayActor<HangActor> actor = Ray.createActor(HangActor::new, options);
RayObject<Boolean> result = actor.call(HangActor::hang);
ActorHandle<HangActor> actor = Ray.createActor(HangActor::new, options);
ObjectRef<Boolean> result = actor.call(HangActor::hang);
// The actor will hang in this task.
Assert.assertEquals(0, Ray.wait(ImmutableList.of(result), 1, 500).getReady().size());
@@ -1,7 +1,7 @@
package io.ray.api.test;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -13,7 +13,7 @@ public class MultiLanguageClusterTest extends BaseMultiLanguageTest {
@Test
public void testMultiLanguageCluster() {
RayObject<String> obj = Ray.call(MultiLanguageClusterTest::echo, "hello");
ObjectRef<String> obj = Ray.call(MultiLanguageClusterTest::echo, "hello");
Assert.assertEquals("hello", obj.get());
}
@@ -1,9 +1,9 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.WaitResult;
import io.ray.api.exception.RayException;
@@ -73,22 +73,22 @@ public class MultiThreadingTest extends BaseTest {
// Test calling normal functions.
runTestCaseInMultipleThreads(() -> {
int arg = random.nextInt();
RayObject<Integer> obj = Ray.call(MultiThreadingTest::echo, arg);
ObjectRef<Integer> obj = Ray.call(MultiThreadingTest::echo, arg);
Assert.assertEquals(arg, (int) obj.get());
}, LOOP_COUNTER);
// Test calling actors.
RayActor<Echo> echoActor = Ray.createActor(Echo::new);
ActorHandle<Echo> echoActor = Ray.createActor(Echo::new);
runTestCaseInMultipleThreads(() -> {
int arg = random.nextInt();
RayObject<Integer> obj = echoActor.call(Echo::echo, arg);
ObjectRef<Integer> obj = echoActor.call(Echo::echo, arg);
Assert.assertEquals(arg, (int) obj.get());
}, LOOP_COUNTER);
// Test creating multi actors
runTestCaseInMultipleThreads(() -> {
int arg = random.nextInt();
RayActor<Echo> echoActor1 = Ray.createActor(Echo::new);
ActorHandle<Echo> echoActor1 = Ray.createActor(Echo::new);
try {
// Sleep a while to test the case that another actor is created before submitting
// tasks to this actor.
@@ -96,20 +96,20 @@ public class MultiThreadingTest extends BaseTest {
} catch (InterruptedException e) {
LOGGER.warn("Got exception while sleeping.", e);
}
RayObject<Integer> obj = echoActor1.call(Echo::echo, arg);
ObjectRef<Integer> obj = echoActor1.call(Echo::echo, arg);
Assert.assertEquals(arg, (int) obj.get());
}, 1);
// Test put and get.
runTestCaseInMultipleThreads(() -> {
int arg = random.nextInt();
RayObject<Integer> obj = Ray.put(arg);
ObjectRef<Integer> obj = Ray.put(arg);
Assert.assertEquals(arg, (int) obj.get());
}, LOOP_COUNTER);
TestUtils.warmUpCluster();
// Test wait for one object in multi threads.
RayObject<Integer> obj = Ray.call(MultiThreadingTest::echo, 100);
ObjectRef<Integer> obj = Ray.call(MultiThreadingTest::echo, 100);
runTestCaseInMultipleThreads(() -> {
WaitResult<Integer> result = Ray.wait(ImmutableList.of(obj), 1, 1000);
Assert.assertEquals(1, result.getReady().size());
@@ -125,23 +125,23 @@ public class MultiThreadingTest extends BaseTest {
public void testInWorker() {
// Single-process mode doesn't have real workers.
TestUtils.skipTestUnderSingleProcess();
RayObject<String> obj = Ray.call(MultiThreadingTest::testMultiThreading);
ObjectRef<String> obj = Ray.call(MultiThreadingTest::testMultiThreading);
Assert.assertEquals("ok", obj.get());
}
public void testGetCurrentActorId() {
TestUtils.skipTestUnderSingleProcess();
RayActor<ActorIdTester> actorIdTester = Ray.createActor(ActorIdTester::new);
ActorHandle<ActorIdTester> actorIdTester = Ray.createActor(ActorIdTester::new);
ActorId actorId = actorIdTester.call(ActorIdTester::getCurrentActorId).get();
Assert.assertEquals(actorId, actorIdTester.getId());
}
/**
* Call this method each time to avoid hitting the cache in {@link RayObject#get()}.
* Call this method each time to avoid hitting the cache in {@link ObjectRef#get()}.
*/
static Runnable[] generateRunnables() {
final RayObject<Integer> fooObject = Ray.put(1);
final RayActor<Echo> fooActor = Ray.createActor(Echo::new);
final ObjectRef<Integer> fooObject = Ray.put(1);
final ActorHandle<Echo> fooActor = Ray.createActor(Echo::new);
return new Runnable[]{
() -> Ray.put(1),
() -> Ray.get(fooObject.getId(), fooObject.getType()),
@@ -219,7 +219,7 @@ public class MultiThreadingTest extends BaseTest {
runnables[0].run();
}
// Return true here to make the Ray.call returns an RayObject.
// Return true here to make the Ray.call returns an ObjectRef.
return true;
}
@@ -303,7 +303,7 @@ public class MultiThreadingTest extends BaseTest {
}
public void testGetAsyncContextAndSetAsyncContextInWorker() {
RayObject<Boolean> obj = Ray.call(MultiThreadingTest::testGetAsyncContextAndSetAsyncContext);
ObjectRef<Boolean> obj = Ray.call(MultiThreadingTest::testGetAsyncContextAndSetAsyncContext);
Assert.assertTrue(obj.get());
}
@@ -1,8 +1,8 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.id.ObjectId;
import java.util.List;
import java.util.stream.Collectors;
@@ -17,19 +17,19 @@ public class ObjectStoreTest extends BaseTest {
@Test
public void testPutAndGet() {
{
RayObject<Integer> obj = Ray.put(1);
ObjectRef<Integer> obj = Ray.put(1);
Assert.assertEquals(1, (int) obj.get());
}
{
String s = null;
RayObject<String> obj = Ray.put(s);
ObjectRef<String> obj = Ray.put(s);
Assert.assertNull(obj.get());
}
{
List<List<String>> l = ImmutableList.of(ImmutableList.of("abc"));
RayObject<List<List<String>>> obj = Ray.put(l);
ObjectRef<List<List<String>>> obj = Ray.put(l);
Assert.assertEquals(obj.get(), l);
}
}
@@ -1,8 +1,8 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.id.TaskId;
import java.util.Arrays;
@@ -17,7 +17,7 @@ public class PlasmaFreeTest extends BaseTest {
@Test
public void testDeleteObjects() {
RayObject<String> helloId = Ray.call(PlasmaFreeTest::hello);
ObjectRef<String> helloId = Ray.call(PlasmaFreeTest::hello);
String helloString = helloId.get();
Assert.assertEquals("hello", helloString);
Ray.internal().free(ImmutableList.of(helloId.getId()), true, false);
@@ -36,7 +36,7 @@ public class PlasmaFreeTest extends BaseTest {
@Test
public void testDeleteCreatingTasks() {
TestUtils.skipTestUnderSingleProcess();
RayObject<String> helloId = Ray.call(PlasmaFreeTest::hello);
ObjectRef<String> helloId = Ray.call(PlasmaFreeTest::hello);
Assert.assertEquals("hello", helloId.get());
Ray.internal().free(ImmutableList.of(helloId.getId()), true, true);
@@ -1,8 +1,8 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.WaitResult;
import java.util.List;
import java.util.stream.Collectors;
@@ -16,15 +16,15 @@ public class RayMethodsTest extends BaseTest {
@Test
public void test() {
RayObject<Integer> i1Id = Ray.put(1);
RayObject<Double> f1Id = Ray.put(3.14);
RayObject<String> s1Id = Ray.put(String.valueOf("Hello "));
RayObject<String> s2Id = Ray.put(String.valueOf("World!"));
RayObject<Object> n1Id = Ray.put(null);
ObjectRef<Integer> i1Id = Ray.put(1);
ObjectRef<Double> f1Id = Ray.put(3.14);
ObjectRef<String> s1Id = Ray.put(String.valueOf("Hello "));
ObjectRef<String> s2Id = Ray.put(String.valueOf("World!"));
ObjectRef<Object> n1Id = Ray.put(null);
WaitResult<String> res = Ray.wait(ImmutableList.of(s1Id, s2Id), 2, 1000);
List<String> ss = res.getReady().stream().map(RayObject::get).collect(Collectors.toList());
List<String> ss = res.getReady().stream().map(ObjectRef::get).collect(Collectors.toList());
int i1 = i1Id.get();
double f1 = f1Id.get();
Object n1 = n1Id.get();
@@ -1,7 +1,7 @@
package io.ray.api.test;
import io.ray.api.PyActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayPyActor;
import io.ray.api.function.PyActorClass;
import io.ray.runtime.object.NativeRayObject;
import io.ray.runtime.object.ObjectSerializer;
@@ -12,9 +12,10 @@ public class RaySerializerTest extends BaseMultiLanguageTest {
@Test
public void testSerializePyActor() {
RayPyActor pyActor = Ray.createActor(new PyActorClass("test", "RaySerializerTest"));
PyActorHandle pyActor = Ray.createActor(
new PyActorClass("test", "RaySerializerTest"));
NativeRayObject nativeRayObject = ObjectSerializer.serialize(pyActor);
RayPyActor result = (RayPyActor) ObjectSerializer
PyActorHandle result = (PyActorHandle) ObjectSerializer
.deserialize(nativeRayObject, null, Object.class);
Assert.assertEquals(result.getId(), pyActor.getId());
Assert.assertEquals(result.getModuleName(), "test");
@@ -1,7 +1,7 @@
package io.ray.api.test;
import io.ray.api.ActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.TestUtils;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
@@ -32,7 +32,7 @@ public class RayletConfigTest extends BaseTest {
@Test
public void testRayletConfigPassThrough() {
RayActor<TestActor> actor = Ray.createActor(TestActor::new);
ActorHandle<TestActor> actor = Ray.createActor(TestActor::new);
String configValue = actor.call(TestActor::getConfigValue).get();
Assert.assertEquals(configValue, RAY_CONFIG_VALUE);
}
@@ -1,7 +1,7 @@
package io.ray.api.test;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@@ -27,7 +27,7 @@ public class RedisPasswordTest extends BaseTest {
@Test
public void testRedisPassword() {
RayObject<String> obj = Ray.call(RedisPasswordTest::echo, "hello");
ObjectRef<String> obj = Ray.call(RedisPasswordTest::echo, "hello");
Assert.assertEquals("hello", obj.get());
}
@@ -2,9 +2,9 @@ package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.WaitResult;
import io.ray.api.options.ActorCreationOptions;
@@ -48,7 +48,7 @@ public class ResourcesManagementTest extends BaseTest {
// This is a case that can satisfy required resources.
// The static resources for test are "CPU:4,RES-A:4".
RayObject<Integer> result1 = Ray.call(ResourcesManagementTest::echo, 100, callOptions1);
ObjectRef<Integer> result1 = Ray.call(ResourcesManagementTest::echo, 100, callOptions1);
Assert.assertEquals(100, (int) result1.get());
CallOptions callOptions2 =
@@ -56,7 +56,7 @@ public class ResourcesManagementTest extends BaseTest {
// This is a case that can't satisfy required resources.
// The static resources for test are "CPU:4,RES-A:4".
final RayObject<Integer> result2 = Ray.call(ResourcesManagementTest::echo, 200, callOptions2);
final ObjectRef<Integer> result2 = Ray.call(ResourcesManagementTest::echo, 200, callOptions2);
WaitResult<Integer> waitResult = Ray.wait(ImmutableList.of(result2), 1, 1000);
Assert.assertEquals(1, waitResult.getReady().size());
@@ -80,8 +80,8 @@ public class ResourcesManagementTest extends BaseTest {
.setResources(ImmutableMap.of("CPU", 2.0)).createActorCreationOptions();
// This is a case that can satisfy required resources.
// The static resources for test are "CPU:4,RES-A:4".
RayActor<Echo> echo1 = Ray.createActor(Echo::new, actorCreationOptions1);
final RayObject<Integer> result1 = echo1.call(Echo::echo, 100);
ActorHandle<Echo> echo1 = Ray.createActor(Echo::new, actorCreationOptions1);
final ObjectRef<Integer> result1 = echo1.call(Echo::echo, 100);
Assert.assertEquals(100, (int) result1.get());
// This is a case that can't satisfy required resources.
@@ -89,9 +89,9 @@ public class ResourcesManagementTest extends BaseTest {
ActorCreationOptions actorCreationOptions2 = new ActorCreationOptions.Builder()
.setResources(ImmutableMap.of("CPU", 8.0)).createActorCreationOptions();
RayActor<ResourcesManagementTest.Echo> echo2 =
ActorHandle<Echo> echo2 =
Ray.createActor(Echo::new, actorCreationOptions2);
final RayObject<Integer> result2 = echo2.call(Echo::echo, 100);
final ObjectRef<Integer> result2 = echo2.call(Echo::echo, 100);
WaitResult<Integer> waitResult = Ray.wait(ImmutableList.of(result2), 1, 1000);
Assert.assertEquals(0, waitResult.getReady().size());
@@ -1,7 +1,7 @@
package io.ray.api.test;
import io.ray.api.ActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.id.ActorId;
import io.ray.api.id.JobId;
import java.nio.ByteBuffer;
@@ -60,7 +60,7 @@ public class RuntimeContextTest extends BaseTest {
@Test
public void testRuntimeContextInActor() {
RayActor<RuntimeContextTester> actor = Ray.createActor(RuntimeContextTester::new);
ActorHandle<RuntimeContextTester> actor = Ray.createActor(RuntimeContextTester::new);
Assert.assertEquals("ok",
actor.call(RuntimeContextTester::testRuntimeContext, actor.getId()).get());
}
@@ -1,8 +1,8 @@
package io.ray.api.test;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.id.ActorId;
import java.util.ArrayList;
@@ -31,18 +31,18 @@ public class SingleProcessModeTest extends BaseTest {
public void testActorTasksInOneThread() {
TestUtils.skipTestUnderClusterMode();
List<RayActor<MyActor>> actors = new ArrayList<>();
List<ActorHandle<MyActor>> actors = new ArrayList<>();
Map<ActorId, Long> actorThreadIds = new HashMap<>();
for (int i = 0; i < NUM_ACTOR_INSTANCE; ++i) {
RayActor<MyActor> actor = Ray.createActor(MyActor::new);
ActorHandle<MyActor> actor = Ray.createActor(MyActor::new);
actors.add(actor);
actorThreadIds.put(actor.getId(), actor.call(MyActor::getThreadId).get());
}
Map<ActorId, List<RayObject<Long>>> allResults = new HashMap<>();
Map<ActorId, List<ObjectRef<Long>>> allResults = new HashMap<>();
for (int i = 0; i < NUM_ACTOR_INSTANCE; ++i) {
final RayActor<MyActor> actor = actors.get(i);
List<RayObject<Long>> thisActorResult = new ArrayList<>();
final ActorHandle<MyActor> actor = actors.get(i);
List<ObjectRef<Long>> thisActorResult = new ArrayList<>();
for (int j = 0; j < TIMES_TO_CALL_PER_ACTOR; ++j) {
thisActorResult.add(actor.call(MyActor::getThreadId));
}
@@ -51,10 +51,10 @@ public class SingleProcessModeTest extends BaseTest {
// check result.
for (int i = 0; i < NUM_ACTOR_INSTANCE; ++i) {
final RayActor<MyActor> actor = actors.get(i);
final List<RayObject<Long>> thisActorResult = allResults.get(actor.getId());
final ActorHandle<MyActor> actor = actors.get(i);
final List<ObjectRef<Long>> thisActorResult = allResults.get(actor.getId());
// assert
for (RayObject<Long> threadId : thisActorResult) {
for (ObjectRef<Long> threadId : thisActorResult) {
Assert.assertEquals(threadId.get(), actorThreadIds.get(actor.getId()));
}
}
@@ -1,9 +1,9 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.id.ObjectId;
import java.util.ArrayList;
@@ -38,7 +38,7 @@ public class StressTest extends BaseTest {
@Test
public void testDependency() {
TestUtils.skipTestUnderSingleProcess();
RayObject<Integer> x = Ray.call(StressTest::echo, 1);
ObjectRef<Integer> x = Ray.call(StressTest::echo, 1);
for (int i = 0; i < 1000; i++) {
x = Ray.call(StressTest::echo, x);
}
@@ -55,9 +55,9 @@ public class StressTest extends BaseTest {
public static class Worker {
private RayActor<Actor> actor;
private ActorHandle<Actor> actor;
public Worker(RayActor<Actor> actor) {
public Worker(ActorHandle<Actor> actor) {
this.actor = actor;
}
@@ -77,10 +77,10 @@ public class StressTest extends BaseTest {
@Test
public void testSubmittingManyTasksToOneActor() throws Exception {
TestUtils.skipTestUnderSingleProcess();
RayActor<Actor> actor = Ray.createActor(Actor::new);
ActorHandle<Actor> actor = Ray.createActor(Actor::new);
List<ObjectId> objectIds = new ArrayList<>();
for (int i = 0; i < 10; i++) {
RayActor<Worker> worker = Ray.createActor(Worker::new, actor);
ActorHandle<Worker> worker = Ray.createActor(Worker::new, actor);
objectIds.add(worker.call(Worker::ping, 100).getId());
}
@@ -93,12 +93,12 @@ public class StressTest extends BaseTest {
public void testPuttingAndGettingManyObjects() {
TestUtils.skipTestUnderSingleProcess();
Integer objectToPut = 1;
List<RayObject<Integer>> objects = new ArrayList<>();
List<ObjectRef<Integer>> objects = new ArrayList<>();
for (int i = 0; i < 100_000; i++) {
objects.add(Ray.put(objectToPut));
}
for (RayObject<Integer> object : objects) {
for (ObjectRef<Integer> object : objects) {
Assert.assertEquals(object.get(), objectToPut);
}
}
@@ -1,8 +1,8 @@
package io.ray.api.test;
import com.google.common.collect.ImmutableList;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.WaitResult;
import java.util.ArrayList;
@@ -29,13 +29,13 @@ public class WaitTest extends BaseTest {
// Call a task in advance to warm up the cluster to avoid being too slow to start workers.
TestUtils.warmUpCluster();
RayObject<String> obj1 = Ray.call(WaitTest::hi);
RayObject<String> obj2 = Ray.call(WaitTest::delayedHi);
ObjectRef<String> obj1 = Ray.call(WaitTest::hi);
ObjectRef<String> obj2 = Ray.call(WaitTest::delayedHi);
List<RayObject<String>> waitList = ImmutableList.of(obj1, obj2);
List<ObjectRef<String>> waitList = ImmutableList.of(obj1, obj2);
WaitResult<String> waitResult = Ray.wait(waitList, 2, 2 * 1000);
List<RayObject<String>> readyList = waitResult.getReady();
List<ObjectRef<String>> readyList = waitResult.getReady();
Assert.assertEquals(1, waitResult.getReady().size());
Assert.assertEquals(1, waitResult.getUnready().size());
@@ -54,7 +54,7 @@ public class WaitTest extends BaseTest {
@Test
public void testWaitInWorker() {
RayObject<Object> res = Ray.call(WaitTest::waitInWorker);
ObjectRef<Object> res = Ray.call(WaitTest::waitInWorker);
res.get();
}
@@ -1,8 +1,8 @@
package io.ray.api.test;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.TestUtils;
import io.ray.api.options.ActorCreationOptions;
import org.testng.Assert;
@@ -24,8 +24,8 @@ public class WorkerJvmOptionsTest extends BaseTest {
// that raylet can correctly handle dynamic options with whitespaces.
.setJvmOptions(" -Dtest.suffix=suffix -Dtest.suffix1=suffix1 ")
.createActorCreationOptions();
RayActor<Echo> actor = Ray.createActor(Echo::new, options);
RayObject<String> obj = actor.call(Echo::getOptions);
ActorHandle<Echo> actor = Ray.createActor(Echo::new, options);
ObjectRef<String> obj = actor.call(Echo::getOptions);
Assert.assertEquals(obj.get(), "suffix");
}
}
@@ -1,7 +1,7 @@
package io.ray.exercise;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import java.io.Serializable;
/**
@@ -29,8 +29,8 @@ public class Exercise01 implements Serializable {
// Use `Ray.init` to initialize the Ray runtime.
Ray.init();
// Use `Ray.call` to call a remote function.
RayObject<String> hello = Ray.call(Exercise01::sayHello);
RayObject<String> world = Ray.call(Exercise01::sayWorld);
ObjectRef<String> hello = Ray.call(Exercise01::sayHello);
ObjectRef<String> world = Ray.call(Exercise01::sayWorld);
System.out.println("First remote call result:" + hello.get());
System.out.println("Second remote call result:" + world.get());
} catch (Throwable t) {
@@ -1,7 +1,7 @@
package io.ray.exercise;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
/**
* Execute remote functions in parallel with some dependencies.
@@ -28,8 +28,8 @@ public class Exercise02 {
}
public static String sayHelloWorld() {
RayObject<String> hello = Ray.call(Exercise02::sayHello);
RayObject<String> world = Ray.call(Exercise02::sayWorld);
ObjectRef<String> hello = Ray.call(Exercise02::sayHello);
ObjectRef<String> world = Ray.call(Exercise02::sayWorld);
// Pass unfinished results as the parameters to another remote function.
return Ray.call(Exercise02::merge, hello, world).get();
}
@@ -1,7 +1,7 @@
package io.ray.exercise;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
/**
* Call a remote function from within another remote function.
@@ -14,7 +14,7 @@ public class Exercise03 {
public static String sayHelloWithWorld() {
String ret = "hello";
System.out.println(ret);
RayObject<String> world = Ray.call(Exercise03::sayWorld);
ObjectRef<String> world = Ray.call(Exercise03::sayWorld);
return ret + "," + world.get();
}
@@ -1,8 +1,8 @@
package io.ray.exercise;
import com.google.common.collect.ImmutableList;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayObject;
import io.ray.api.WaitResult;
import java.util.List;
@@ -38,7 +38,7 @@ public class Exercise04 {
public static void main(String[] args) throws Exception {
try {
Ray.init();
List<RayObject<String>> waitList = ImmutableList.of(
List<ObjectRef<String>> waitList = ImmutableList.of(
Ray.call(Exercise04::f1),
Ray.call(Exercise04::f2),
Ray.call(Exercise04::f3)
@@ -1,8 +1,8 @@
package io.ray.exercise;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
/**
* Show usage of actors.
@@ -13,11 +13,11 @@ public class Exercise05 {
try {
Ray.init();
// `Ray.createActor` creates an actor instance.
RayActor<Adder> adder = Ray.createActor(Adder::new, 0);
ActorHandle<Adder> adder = Ray.createActor(Adder::new, 0);
// Use `Ray.call(actor, parameters)` to call an actor method.
RayObject<Integer> result1 = adder.call(Adder::add, 1);
ObjectRef<Integer> result1 = adder.call(Adder::add, 1);
System.out.println(result1.get());
RayObject<Integer> result2 = adder.call(Adder::add, 10);
ObjectRef<Integer> result2 = adder.call(Adder::add, 10);
System.out.println(result2.get());
} catch (Throwable t) {
t.printStackTrace();
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "ray/core_worker/lib/java/io_ray_runtime_actor_NativeRayActor.h"
#include "ray/core_worker/lib/java/io_ray_runtime_actor_NativeActorHandle.h"
#include <jni.h>
#include "ray/common/id.h"
#include "ray/core_worker/actor_handle.h"
@@ -24,7 +24,7 @@
extern "C" {
#endif
JNIEXPORT jint JNICALL Java_io_ray_runtime_actor_NativeRayActor_nativeGetLanguage(
JNIEXPORT jint JNICALL Java_io_ray_runtime_actor_NativeActorHandle_nativeGetLanguage(
JNIEnv *env, jclass o, jbyteArray actorId) {
auto actor_id = JavaByteArrayToId<ray::ActorID>(env, actorId);
ray::ActorHandle *native_actor_handle = nullptr;
@@ -35,7 +35,7 @@ JNIEXPORT jint JNICALL Java_io_ray_runtime_actor_NativeRayActor_nativeGetLanguag
}
JNIEXPORT jobject JNICALL
Java_io_ray_runtime_actor_NativeRayActor_nativeGetActorCreationTaskFunctionDescriptor(
Java_io_ray_runtime_actor_NativeActorHandle_nativeGetActorCreationTaskFunctionDescriptor(
JNIEnv *env, jclass o, jbyteArray actorId) {
auto actor_id = JavaByteArrayToId<ray::ActorID>(env, actorId);
ray::ActorHandle *native_actor_handle = nullptr;
@@ -46,7 +46,7 @@ Java_io_ray_runtime_actor_NativeRayActor_nativeGetActorCreationTaskFunctionDescr
return NativeRayFunctionDescriptorToJavaStringList(env, function_descriptor);
}
JNIEXPORT jbyteArray JNICALL Java_io_ray_runtime_actor_NativeRayActor_nativeSerialize(
JNIEXPORT jbyteArray JNICALL Java_io_ray_runtime_actor_NativeActorHandle_nativeSerialize(
JNIEnv *env, jclass o, jbyteArray actorId) {
auto actor_id = JavaByteArrayToId<ray::ActorID>(env, actorId);
std::string output;
@@ -59,7 +59,7 @@ JNIEXPORT jbyteArray JNICALL Java_io_ray_runtime_actor_NativeRayActor_nativeSeri
return bytes;
}
JNIEXPORT jbyteArray JNICALL Java_io_ray_runtime_actor_NativeRayActor_nativeDeserialize(
JNIEXPORT jbyteArray JNICALL Java_io_ray_runtime_actor_NativeActorHandle_nativeDeserialize(
JNIEnv *env, jclass o, jbyteArray data) {
auto buffer = JavaByteArrayToNativeBuffer(env, data);
RAY_CHECK(buffer->Size() > 0);
@@ -14,45 +14,44 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class io_ray_runtime_actor_NativeRayActor */
/* Header for class io_ray_runtime_actor_NativeActorHandle */
#ifndef _Included_io_ray_runtime_actor_NativeRayActor
#define _Included_io_ray_runtime_actor_NativeRayActor
#ifndef _Included_io_ray_runtime_actor_NativeActorHandle
#define _Included_io_ray_runtime_actor_NativeActorHandle
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: io_ray_runtime_actor_NativeRayActor
* Class: io_ray_runtime_actor_NativeActorHandle
* Method: nativeGetLanguage
* Signature: ([B)I
*/
JNIEXPORT jint JNICALL
Java_io_ray_runtime_actor_NativeRayActor_nativeGetLanguage(JNIEnv *, jclass, jbyteArray);
JNIEXPORT jint JNICALL Java_io_ray_runtime_actor_NativeActorHandle_nativeGetLanguage
(JNIEnv *, jclass, jbyteArray);
/*
* Class: io_ray_runtime_actor_NativeRayActor
* Class: io_ray_runtime_actor_NativeActorHandle
* Method: nativeGetActorCreationTaskFunctionDescriptor
* Signature: ([B)Ljava/util/List;
*/
JNIEXPORT jobject JNICALL
Java_io_ray_runtime_actor_NativeRayActor_nativeGetActorCreationTaskFunctionDescriptor(
JNIEnv *, jclass, jbyteArray);
JNIEXPORT jobject JNICALL Java_io_ray_runtime_actor_NativeActorHandle_nativeGetActorCreationTaskFunctionDescriptor
(JNIEnv *, jclass, jbyteArray);
/*
* Class: io_ray_runtime_actor_NativeRayActor
* Class: io_ray_runtime_actor_NativeActorHandle
* Method: nativeSerialize
* Signature: ([B)[B
*/
JNIEXPORT jbyteArray JNICALL
Java_io_ray_runtime_actor_NativeRayActor_nativeSerialize(JNIEnv *, jclass, jbyteArray);
JNIEXPORT jbyteArray JNICALL Java_io_ray_runtime_actor_NativeActorHandle_nativeSerialize
(JNIEnv *, jclass, jbyteArray);
/*
* Class: io_ray_runtime_actor_NativeRayActor
* Class: io_ray_runtime_actor_NativeActorHandle
* Method: nativeDeserialize
* Signature: ([B)[B
*/
JNIEXPORT jbyteArray JNICALL
Java_io_ray_runtime_actor_NativeRayActor_nativeDeserialize(JNIEnv *, jclass, jbyteArray);
JNIEXPORT jbyteArray JNICALL Java_io_ray_runtime_actor_NativeActorHandle_nativeDeserialize
(JNIEnv *, jclass, jbyteArray);
#ifdef __cplusplus
}
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.core.collector;
import io.ray.api.BaseActor;
import io.ray.api.RayPyActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.PyActorHandle;
import io.ray.streaming.api.Language;
import io.ray.streaming.api.collector.Collector;
import io.ray.streaming.api.partition.Partition;
@@ -21,7 +21,7 @@ public class OutputCollector implements Collector<Record> {
private final DataWriter writer;
private final ChannelID[] outputQueues;
private final Collection<BaseActor> targetActors;
private final Collection<BaseActorHandle> targetActors;
private final Language[] targetLanguages;
private final Partition partition;
private final Serializer javaSerializer = new JavaSerializer();
@@ -29,13 +29,13 @@ public class OutputCollector implements Collector<Record> {
public OutputCollector(DataWriter writer,
Collection<String> outputQueueIds,
Collection<BaseActor> targetActors,
Collection<BaseActorHandle> targetActors,
Partition partition) {
this.writer = writer;
this.outputQueues = outputQueueIds.stream().map(ChannelID::from).toArray(ChannelID[]::new);
this.targetActors = targetActors;
this.targetLanguages = targetActors.stream()
.map(actor -> actor instanceof RayPyActor ? Language.PYTHON : Language.JAVA)
.map(actor -> actor instanceof PyActorHandle ? Language.PYTHON : Language.JAVA)
.toArray(Language[]::new);
this.partition = partition;
LOGGER.debug("OutputCollector constructed, outputQueueIds:{}, partition:{}.",
@@ -1,6 +1,6 @@
package io.ray.streaming.runtime.core.graph;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
@@ -17,19 +17,19 @@ import java.util.stream.Collectors;
public class ExecutionGraph implements Serializable {
private long buildTime;
private List<ExecutionNode> executionNodeList;
private List<BaseActor> sourceWorkers = new ArrayList<>();
private List<BaseActor> sinkWorkers = new ArrayList<>();
private List<BaseActorHandle> sourceWorkers = new ArrayList<>();
private List<BaseActorHandle> sinkWorkers = new ArrayList<>();
public ExecutionGraph(List<ExecutionNode> executionNodes) {
this.executionNodeList = executionNodes;
for (ExecutionNode executionNode : executionNodeList) {
if (executionNode.getNodeType() == ExecutionNode.NodeType.SOURCE) {
List<BaseActor> actors = executionNode.getExecutionTasks().stream()
List<BaseActorHandle> actors = executionNode.getExecutionTasks().stream()
.map(ExecutionTask::getWorker).collect(Collectors.toList());
sourceWorkers.addAll(actors);
}
if (executionNode.getNodeType() == ExecutionNode.NodeType.SINK) {
List<BaseActor> actors = executionNode.getExecutionTasks().stream()
List<BaseActorHandle> actors = executionNode.getExecutionTasks().stream()
.map(ExecutionTask::getWorker).collect(Collectors.toList());
sinkWorkers.addAll(actors);
}
@@ -37,11 +37,11 @@ public class ExecutionGraph implements Serializable {
buildTime = System.currentTimeMillis();
}
public List<BaseActor> getSourceWorkers() {
public List<BaseActorHandle> getSourceWorkers() {
return sourceWorkers;
}
public List<BaseActor> getSinkWorkers() {
public List<BaseActorHandle> getSinkWorkers() {
return sinkWorkers;
}
@@ -80,10 +80,10 @@ public class ExecutionGraph implements Serializable {
throw new RuntimeException("Task " + taskId + " does not exist!");
}
public Map<Integer, BaseActor> getTaskId2WorkerByNodeId(int nodeId) {
public Map<Integer, BaseActorHandle> getTaskId2WorkerByNodeId(int nodeId) {
for (ExecutionNode executionNode : executionNodeList) {
if (executionNode.getNodeId() == nodeId) {
Map<Integer, BaseActor> taskId2Worker = new HashMap<>();
Map<Integer, BaseActorHandle> taskId2Worker = new HashMap<>();
for (ExecutionTask executionTask : executionNode.getExecutionTasks()) {
taskId2Worker.put(executionTask.getTaskId(), executionTask.getWorker());
}
@@ -1,6 +1,6 @@
package io.ray.streaming.runtime.core.graph;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import java.io.Serializable;
/**
@@ -11,9 +11,9 @@ import java.io.Serializable;
public class ExecutionTask implements Serializable {
private int taskId;
private int taskIndex;
private BaseActor worker;
private BaseActorHandle worker;
public ExecutionTask(int taskId, int taskIndex, BaseActor worker) {
public ExecutionTask(int taskId, int taskIndex, BaseActorHandle worker) {
this.taskId = taskId;
this.taskIndex = taskIndex;
this.worker = worker;
@@ -35,11 +35,11 @@ public class ExecutionTask implements Serializable {
this.taskIndex = taskIndex;
}
public BaseActor getWorker() {
public BaseActorHandle getWorker() {
return worker;
}
public void setWorker(BaseActor worker) {
public void setWorker(BaseActorHandle worker) {
this.worker = worker;
}
}
@@ -1,6 +1,6 @@
package io.ray.streaming.runtime.core.graph.executiongraph;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.streaming.runtime.worker.JobWorker;
import java.io.Serializable;
import java.util.ArrayList;
@@ -143,7 +143,7 @@ public class ExecutionGraph implements Serializable {
*
* @return actor list
*/
public List<RayActor<JobWorker>> getAllActors() {
public List<ActorHandle<JobWorker>> getAllActors() {
return getActorsFromJobVertices(getExecutionJobVertexList());
}
@@ -152,7 +152,7 @@ public class ExecutionGraph implements Serializable {
*
* @return actor list
*/
public List<RayActor<JobWorker>> getSourceActors() {
public List<ActorHandle<JobWorker>> getSourceActors() {
List<ExecutionJobVertex> executionJobVertices = getExecutionJobVertexList().stream()
.filter(ExecutionJobVertex::isSourceVertex)
.collect(Collectors.toList());
@@ -165,7 +165,7 @@ public class ExecutionGraph implements Serializable {
*
* @return actor list
*/
public List<RayActor<JobWorker>> getNonSourceActors() {
public List<ActorHandle<JobWorker>> getNonSourceActors() {
List<ExecutionJobVertex> executionJobVertices = getExecutionJobVertexList().stream()
.filter(executionJobVertex -> executionJobVertex.isTransformationVertex()
|| executionJobVertex.isSinkVertex())
@@ -179,7 +179,7 @@ public class ExecutionGraph implements Serializable {
*
* @return actor list
*/
public List<RayActor<JobWorker>> getSinkActors() {
public List<ActorHandle<JobWorker>> getSinkActors() {
List<ExecutionJobVertex> executionJobVertices = getExecutionJobVertexList().stream()
.filter(ExecutionJobVertex::isSinkVertex)
.collect(Collectors.toList());
@@ -193,7 +193,7 @@ public class ExecutionGraph implements Serializable {
* @param executionJobVertices specified job vertices
* @return actor list
*/
public List<RayActor<JobWorker>> getActorsFromJobVertices(
public List<ActorHandle<JobWorker>> getActorsFromJobVertices(
List<ExecutionJobVertex> executionJobVertices) {
return executionJobVertices.stream()
.map(ExecutionJobVertex::getExecutionVertices)
@@ -2,7 +2,7 @@ package io.ray.streaming.runtime.core.graph.executiongraph;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.streaming.api.Language;
import io.ray.streaming.jobgraph.JobVertex;
import io.ray.streaming.jobgraph.VertexType;
@@ -77,8 +77,8 @@ public class ExecutionJobVertex {
return executionVertices;
}
public Map<Integer, RayActor<JobWorker>> getExecutionVertexWorkers() {
Map<Integer, RayActor<JobWorker>> executionVertexWorkersMap = new HashMap<>();
public Map<Integer, ActorHandle<JobWorker>> getExecutionVertexWorkers() {
Map<Integer, ActorHandle<JobWorker>> executionVertexWorkersMap = new HashMap<>();
Preconditions.checkArgument(
executionVertices != null && !executionVertices.isEmpty(),
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.core.graph.executiongraph;
import com.google.common.base.MoreObjects;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.api.id.ActorId;
import io.ray.streaming.api.Language;
import io.ray.streaming.jobgraph.VertexType;
@@ -49,7 +49,7 @@ public class ExecutionVertex implements Serializable {
private ExecutionVertexState state = ExecutionVertexState.TO_ADD;
private ContainerID containerId;
private RayActor<JobWorker> workerActor;
private ActorHandle<JobWorker> workerActor;
private List<ExecutionEdge> inputEdges = new ArrayList<>();
private List<ExecutionEdge> outputEdges = new ArrayList<>();
@@ -124,7 +124,7 @@ public class ExecutionVertex implements Serializable {
return state == ExecutionVertexState.TO_DEL;
}
public RayActor<JobWorker> getWorkerActor() {
public ActorHandle<JobWorker> getWorkerActor() {
return workerActor;
}
@@ -132,7 +132,7 @@ public class ExecutionVertex implements Serializable {
return workerActor.getId();
}
public void setWorkerActor(RayActor<JobWorker> workerActor) {
public void setWorkerActor(ActorHandle<JobWorker> workerActor) {
this.workerActor = workerActor;
}
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.master;
import com.google.common.base.Preconditions;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.streaming.jobgraph.JobGraph;
import io.ray.streaming.runtime.config.StreamingConfig;
import io.ray.streaming.runtime.config.StreamingMasterConfig;
@@ -30,7 +30,7 @@ public class JobMaster {
private GraphManager graphManager;
private StreamingMasterConfig conf;
private RayActor jobMasterActor;
private ActorHandle jobMasterActor;
public JobMaster(Map<String, String> confMap) {
LOG.info("Creating job master with conf: {}.", confMap);
@@ -76,7 +76,7 @@ public class JobMaster {
* @param jobGraph logical plan
* @return submit result
*/
public boolean submitJob(RayActor<JobMaster> jobMasterActor, JobGraph jobGraph) {
public boolean submitJob(ActorHandle<JobMaster> jobMasterActor, JobGraph jobGraph) {
LOG.info("Begin submitting job using logical plan: {}.", jobGraph);
this.jobMasterActor = jobMasterActor;
@@ -101,7 +101,7 @@ public class JobMaster {
return true;
}
public RayActor getJobMasterActor() {
public ActorHandle getJobMasterActor() {
return jobMasterActor;
}
@@ -1,6 +1,6 @@
package io.ray.streaming.runtime.master.scheduler;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.streaming.runtime.config.StreamingConfig;
import io.ray.streaming.runtime.core.graph.executiongraph.ExecutionGraph;
import io.ray.streaming.runtime.core.graph.executiongraph.ExecutionVertex;
@@ -153,7 +153,7 @@ public class JobSchedulerImpl implements JobScheduler {
*/
protected Map<ExecutionVertex, JobWorkerContext> buildWorkersContext(
ExecutionGraph executionGraph) {
RayActor masterActor = jobMaster.getJobMasterActor();
ActorHandle masterActor = jobMaster.getJobMasterActor();
// build workers' context
Map<ExecutionVertex, JobWorkerContext> needRegistryVertexToContextMap = new HashMap<>();
@@ -166,7 +166,7 @@ public class JobSchedulerImpl implements JobScheduler {
private JobWorkerContext buildJobWorkerContext(
ExecutionVertex executionVertex,
RayActor<JobMaster> masterActor) {
ActorHandle<JobMaster> masterActor) {
// create worker context
JobWorkerContext ctx = new JobWorkerContext(
@@ -1,8 +1,8 @@
package io.ray.streaming.runtime.master.scheduler.controller;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.WaitResult;
import io.ray.api.id.ActorId;
import io.ray.api.options.ActorCreationOptions;
@@ -50,7 +50,7 @@ public class WorkerLifecycleController {
.setMaxRestarts(-1)
.createActorCreationOptions();
RayActor<JobWorker> actor = null;
ActorHandle<JobWorker> actor = null;
// TODO (datayjz): ray create actor
if (null == actor) {
@@ -77,18 +77,18 @@ public class WorkerLifecycleController {
LOG.info("Begin initiating workers: {}.", vertexToContextMap);
long startTime = System.currentTimeMillis();
Map<RayObject<Boolean>, ActorId> rayObjects = new HashMap<>();
Map<ObjectRef<Boolean>, ActorId> rayObjects = new HashMap<>();
vertexToContextMap.entrySet().forEach((entry -> {
ExecutionVertex vertex = entry.getKey();
rayObjects.put(RemoteCallWorker.initWorker(vertex.getWorkerActor(), entry.getValue()),
vertex.getWorkerActorId());
}));
List<RayObject<Boolean>> rayObjectList = new ArrayList<>(rayObjects.keySet());
List<ObjectRef<Boolean>> objectRefList = new ArrayList<>(rayObjects.keySet());
LOG.info("Waiting for workers' initialization.");
WaitResult<Boolean> result = Ray.wait(rayObjectList, rayObjectList.size(), timeout);
if (result.getReady().size() != rayObjectList.size()) {
WaitResult<Boolean> result = Ray.wait(objectRefList, objectRefList.size(), timeout);
if (result.getReady().size() != objectRefList.size()) {
LOG.error("Initializing workers timeout[{} ms].", timeout);
return false;
}
@@ -108,18 +108,18 @@ public class WorkerLifecycleController {
public boolean startWorkers(ExecutionGraph executionGraph, int timeout) {
LOG.info("Begin starting workers.");
long startTime = System.currentTimeMillis();
List<RayObject<Boolean>> rayObjects = new ArrayList<>();
List<ObjectRef<Boolean>> objectRefs = new ArrayList<>();
// start source actors 1st
executionGraph.getSourceActors()
.forEach(actor -> rayObjects.add(RemoteCallWorker.startWorker(actor)));
.forEach(actor -> objectRefs.add(RemoteCallWorker.startWorker(actor)));
// then start non-source actors
executionGraph.getNonSourceActors()
.forEach(actor -> rayObjects.add(RemoteCallWorker.startWorker(actor)));
.forEach(actor -> objectRefs.add(RemoteCallWorker.startWorker(actor)));
WaitResult<Boolean> result = Ray.wait(rayObjects, rayObjects.size(), timeout);
if (result.getReady().size() != rayObjects.size()) {
WaitResult<Boolean> result = Ray.wait(objectRefs, objectRefs.size(), timeout);
if (result.getReady().size() != objectRefs.size()) {
LOG.error("Starting workers timeout[{} ms].", timeout);
return false;
}
@@ -139,7 +139,7 @@ public class WorkerLifecycleController {
}
private boolean destroyWorker(ExecutionVertex executionVertex) {
RayActor rayActor = executionVertex.getWorkerActor();
ActorHandle rayActor = executionVertex.getWorkerActor();
LOG.info("Begin destroying worker[vertex={}, actor={}].",
executionVertex.getVertexName(), rayActor.getId());
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.python;
import com.google.protobuf.ByteString;
import io.ray.runtime.actor.NativeRayActor;
import io.ray.runtime.actor.NativeActorHandle;
import io.ray.streaming.api.function.Function;
import io.ray.streaming.api.partition.Partition;
import io.ray.streaming.operator.Operator;
@@ -43,7 +43,7 @@ public class GraphPbBuilder {
for (ExecutionTask task : node.getExecutionTasks()) {
RemoteCall.ExecutionGraph.ExecutionTask.Builder taskBuilder =
RemoteCall.ExecutionGraph.ExecutionTask.newBuilder();
byte[] serializedActorHandle = ((NativeRayActor) task.getWorker()).toBytes();
byte[] serializedActorHandle = ((NativeActorHandle) task.getWorker()).toBytes();
taskBuilder
.setTaskId(task.getTaskId())
.setTaskIndex(task.getTaskIndex())
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.rpc;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.ActorHandle;
import io.ray.api.ObjectRef;
import io.ray.streaming.runtime.master.JobMaster;
import io.ray.streaming.runtime.worker.JobWorker;
import io.ray.streaming.runtime.worker.context.JobWorkerContext;
@@ -23,9 +23,9 @@ public class RemoteCallWorker {
* @param ctx JobWorker's context
* @return init result
*/
public static RayObject<Boolean> initWorker(RayActor actor, JobWorkerContext ctx) {
public static ObjectRef<Boolean> initWorker(ActorHandle actor, JobWorkerContext ctx) {
LOG.info("Call worker to init, actor: {}, context: {}.", actor.getId(), ctx);
RayObject<Boolean> result = null;
ObjectRef<Boolean> result = null;
// TODO (datayjz): ray call worker to initiate
@@ -39,9 +39,9 @@ public class RemoteCallWorker {
* @param actor target JobWorker actor
* @return start result
*/
public static RayObject<Boolean> startWorker(RayActor actor) {
public static ObjectRef<Boolean> startWorker(ActorHandle actor) {
LOG.info("Call worker to start, actor: {}.", actor.getId());
RayObject<Boolean> result = null;
ObjectRef<Boolean> result = null;
// TODO (datayjz): ray call worker to start
@@ -55,7 +55,7 @@ public class RemoteCallWorker {
* @param actor target JobWorker actor
* @return destroy result
*/
public static Boolean shutdownWithoutReconstruction(RayActor actor) {
public static Boolean shutdownWithoutReconstruction(ActorHandle actor) {
LOG.info("Call worker to shutdown without reconstruction, actor is {}.",
actor.getId());
Boolean result = false;
@@ -1,10 +1,10 @@
package io.ray.streaming.runtime.schedule;
import io.ray.api.BaseActor;
import io.ray.api.ActorHandle;
import io.ray.api.BaseActorHandle;
import io.ray.api.ObjectRef;
import io.ray.api.PyActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayObject;
import io.ray.api.RayPyActor;
import io.ray.api.function.PyActorMethod;
import io.ray.streaming.api.Language;
import io.ray.streaming.jobgraph.JobGraph;
@@ -50,22 +50,22 @@ public class JobSchedulerImpl implements JobScheduler {
if (hasPythonNode) {
executionGraphPb = new GraphPbBuilder().buildExecutionGraphPb(executionGraph);
}
List<RayObject<Object>> waits = new ArrayList<>();
List<ObjectRef<Object>> waits = new ArrayList<>();
for (ExecutionNode executionNode : executionNodes) {
List<ExecutionTask> executionTasks = executionNode.getExecutionTasks();
for (ExecutionTask executionTask : executionTasks) {
int taskId = executionTask.getTaskId();
BaseActor worker = executionTask.getWorker();
BaseActorHandle worker = executionTask.getWorker();
switch (executionNode.getLanguage()) {
case JAVA:
RayActor<JobWorker> jobWorker = (RayActor<JobWorker>) worker;
ActorHandle<JobWorker> jobWorker = (ActorHandle<JobWorker>) worker;
waits.add(jobWorker.call(JobWorker::init,
new WorkerContext(taskId, executionGraph, jobConfig)));
break;
case PYTHON:
byte[] workerContextBytes = buildPythonWorkerContext(
taskId, executionGraphPb, jobConfig);
waits.add(((RayPyActor)worker).call(new PyActorMethod("init", Object.class),
waits.add(((PyActorHandle)worker).call(new PyActorMethod("init", Object.class),
workerContextBytes));
break;
default:
@@ -1,9 +1,9 @@
package io.ray.streaming.runtime.schedule;
import io.ray.api.BaseActor;
import io.ray.api.ActorHandle;
import io.ray.api.BaseActorHandle;
import io.ray.api.PyActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.RayPyActor;
import io.ray.api.function.PyActorClass;
import io.ray.streaming.jobgraph.JobEdge;
import io.ray.streaming.jobgraph.JobGraph;
@@ -64,16 +64,16 @@ public class TaskAssignerImpl implements TaskAssigner {
return new ExecutionGraph(executionNodes);
}
private BaseActor createWorker(JobVertex jobVertex) {
private BaseActorHandle createWorker(JobVertex jobVertex) {
switch (jobVertex.getLanguage()) {
case PYTHON: {
RayPyActor worker = Ray.createActor(
PyActorHandle worker = Ray.createActor(
new PyActorClass("ray.streaming.runtime.worker", "JobWorker"));
LOG.info("Created python worker {}", worker);
return worker;
}
case JAVA: {
RayActor<JobWorker> worker = Ray.createActor(JobWorker::new);
ActorHandle<JobWorker> worker = Ray.createActor(JobWorker::new);
LOG.info("Created java worker {}", worker);
return worker;
}
@@ -1,16 +1,15 @@
package io.ray.streaming.runtime.transfer;
import com.google.common.base.Preconditions;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.id.ActorId;
import io.ray.runtime.actor.LocalModeRayActor;
import io.ray.runtime.actor.NativeRayJavaActor;
import io.ray.runtime.actor.NativeRayPyActor;
import io.ray.runtime.actor.LocalModeActorHandle;
import io.ray.runtime.actor.NativeJavaActorHandle;
import io.ray.runtime.actor.NativePyActorHandle;
import io.ray.runtime.functionmanager.FunctionDescriptor;
import io.ray.runtime.functionmanager.JavaFunctionDescriptor;
import io.ray.runtime.functionmanager.PyFunctionDescriptor;
import io.ray.streaming.runtime.worker.JobWorker;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -107,34 +106,35 @@ public class ChannelCreationParametersBuilder {
javaWriterSyncFuncDesc = syncFunc;
}
public ChannelCreationParametersBuilder buildInputQueueParameters(List<String> queues,
Map<String, BaseActor> actors) {
public ChannelCreationParametersBuilder buildInputQueueParameters(
List<String> queues,
Map<String, BaseActorHandle> actors) {
return buildParameters(queues, actors, javaWriterAsyncFuncDesc, javaWriterSyncFuncDesc,
pyWriterAsyncFunctionDesc, pyWriterSyncFunctionDesc);
}
public ChannelCreationParametersBuilder buildOutputQueueParameters(List<String> queues,
Map<String, BaseActor> actors) {
Map<String, BaseActorHandle> actors) {
return buildParameters(queues, actors, javaReaderAsyncFuncDesc, javaReaderSyncFuncDesc,
pyReaderAsyncFunctionDesc, pyReaderSyncFunctionDesc);
}
private ChannelCreationParametersBuilder buildParameters(List<String> queues,
Map<String, BaseActor> actors,
Map<String, BaseActorHandle> actors,
JavaFunctionDescriptor javaAsyncFunctionDesc, JavaFunctionDescriptor javaSyncFunctionDesc,
PyFunctionDescriptor pyAsyncFunctionDesc, PyFunctionDescriptor pySyncFunctionDesc
) {
parameters = new ArrayList<>(queues.size());
for (String queue : queues) {
Parameter parameter = new Parameter();
BaseActor actor = actors.get(queue);
BaseActorHandle actor = actors.get(queue);
Preconditions.checkArgument(actor != null);
parameter.setActorId(actor.getId());
/// LocalModeRayActor used in single-process mode.
if (actor instanceof NativeRayJavaActor || actor instanceof LocalModeRayActor) {
if (actor instanceof NativeJavaActorHandle || actor instanceof LocalModeActorHandle) {
parameter.setAsyncFunctionDescriptor(javaAsyncFunctionDesc);
parameter.setSyncFunctionDescriptor(javaSyncFunctionDesc);
} else if (actor instanceof NativeRayPyActor) {
} else if (actor instanceof NativePyActorHandle) {
parameter.setAsyncFunctionDescriptor(pyAsyncFunctionDesc);
parameter.setSyncFunctionDescriptor(pySyncFunctionDesc);
} else {
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.transfer;
import com.google.common.base.Preconditions;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.streaming.runtime.util.Platform;
import io.ray.streaming.util.Config;
import java.nio.ByteBuffer;
@@ -24,7 +24,7 @@ public class DataReader {
private Queue<DataMessage> buf = new LinkedList<>();
public DataReader(List<String> inputChannels,
Map<String, BaseActor> fromActors,
Map<String, BaseActorHandle> fromActors,
Map<String, String> conf) {
Preconditions.checkArgument(inputChannels.size() > 0);
Preconditions.checkArgument(inputChannels.size() == fromActors.size());
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.transfer;
import com.google.common.base.Preconditions;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.streaming.runtime.util.Platform;
import io.ray.streaming.util.Config;
import java.nio.ByteBuffer;
@@ -33,7 +33,7 @@ public class DataWriter {
* @param conf configuration
*/
public DataWriter(List<String> outputChannels,
Map<String, BaseActor> toActors,
Map<String, BaseActorHandle> toActors,
Map<String, String> conf) {
Preconditions.checkArgument(!outputChannels.isEmpty());
Preconditions.checkArgument(outputChannels.size() == toActors.size());
@@ -1,7 +1,7 @@
package io.ray.streaming.runtime.worker.context;
import com.google.common.base.MoreObjects;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.api.id.ActorId;
import io.ray.streaming.runtime.core.graph.executiongraph.ExecutionVertex;
import io.ray.streaming.runtime.master.JobMaster;
@@ -20,7 +20,7 @@ public class JobWorkerContext implements Serializable {
/**
* JobMaster actor.
*/
private RayActor<JobMaster> master;
private ActorHandle<JobMaster> master;
/**
* Worker's vertex info.
@@ -29,7 +29,7 @@ public class JobWorkerContext implements Serializable {
public JobWorkerContext(
ActorId workerId,
RayActor<JobMaster> master,
ActorHandle<JobMaster> master,
ExecutionVertex executionVertex) {
this.workerId = workerId;
this.master = master;
@@ -40,7 +40,7 @@ public class JobWorkerContext implements Serializable {
return workerId;
}
public RayActor<JobMaster> getMaster() {
public ActorHandle<JobMaster> getMaster() {
return master;
}
@@ -1,6 +1,6 @@
package io.ray.streaming.runtime.worker.tasks;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.Ray;
import io.ray.streaming.api.collector.Collector;
import io.ray.streaming.api.context.RuntimeContext;
@@ -64,8 +64,8 @@ public abstract class StreamTask implements Runnable {
List<ExecutionEdge> outputEdges = executionNode.getOutputEdges();
List<Collector> collectors = new ArrayList<>();
for (ExecutionEdge edge : outputEdges) {
Map<String, BaseActor> outputActors = new HashMap<>();
Map<Integer, BaseActor> taskId2Worker = executionGraph
Map<String, BaseActorHandle> outputActors = new HashMap<>();
Map<Integer, BaseActorHandle> taskId2Worker = executionGraph
.getTaskId2WorkerByNodeId(edge.getTargetNodeId());
taskId2Worker.forEach((targetTaskId, targetActor) -> {
String queueName = ChannelID.genIdStr(taskId, targetTaskId, executionGraph.getBuildTime());
@@ -87,9 +87,9 @@ public abstract class StreamTask implements Runnable {
// consumer
List<ExecutionEdge> inputEdges = executionNode.getInputsEdges();
Map<String, BaseActor> inputActors = new HashMap<>();
Map<String, BaseActorHandle> inputActors = new HashMap<>();
for (ExecutionEdge edge : inputEdges) {
Map<Integer, BaseActor> taskId2Worker = executionGraph
Map<Integer, BaseActorHandle> taskId2Worker = executionGraph
.getTaskId2WorkerByNodeId(edge.getSrcNodeId());
taskId2Worker.forEach((srcTaskId, srcActor) -> {
String queueName = ChannelID.genIdStr(srcTaskId, taskId, executionGraph.getBuildTime());
@@ -2,7 +2,7 @@ package io.ray.streaming.runtime.streamingqueue;
import com.google.common.collect.ImmutableMap;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.api.options.ActorCreationOptions;
import io.ray.api.options.ActorCreationOptions.Builder;
import io.ray.runtime.config.RayConfig;
@@ -94,9 +94,9 @@ public class StreamingQueueTest extends BaseUnitTest implements Serializable {
ActorCreationOptions.Builder builder = new Builder();
RayActor<WriterWorker> writerActor = Ray.createActor(WriterWorker::new, "writer",
ActorHandle<WriterWorker> writerActor = Ray.createActor(WriterWorker::new, "writer",
builder.createActorCreationOptions());
RayActor<ReaderWorker> readerActor = Ray.createActor(ReaderWorker::new, "reader",
ActorHandle<ReaderWorker> readerActor = Ray.createActor(ReaderWorker::new, "reader",
builder.createActorCreationOptions());
LOGGER.info("call getName on writerActor: {}",
@@ -1,8 +1,8 @@
package io.ray.streaming.runtime.streamingqueue;
import io.ray.api.BaseActor;
import io.ray.api.BaseActorHandle;
import io.ray.api.Ray;
import io.ray.api.RayActor;
import io.ray.api.ActorHandle;
import io.ray.runtime.functionmanager.JavaFunctionDescriptor;
import io.ray.streaming.runtime.transfer.ChannelID;
import io.ray.streaming.runtime.transfer.ChannelCreationParametersBuilder;
@@ -52,10 +52,10 @@ class ReaderWorker extends Worker {
private String name = null;
private List<String> inputQueueList = null;
Map<String, BaseActor> fromActors = new HashMap<>();
Map<String, BaseActorHandle> fromActors = new HashMap<>();
private DataReader dataReader = null;
private long handler = 0;
private RayActor<WriterWorker> peerActor = null;
private ActorHandle<WriterWorker> peerActor = null;
private int msgCount = 0;
private int totalMsg = 0;
@@ -77,7 +77,7 @@ class ReaderWorker extends Worker {
return "testRayCall";
}
public boolean init(List<String> inputQueueList, RayActor<WriterWorker> peer, int msgCount) {
public boolean init(List<String> inputQueueList, ActorHandle<WriterWorker> peer, int msgCount) {
this.inputQueueList = inputQueueList;
this.peerActor = peer;
@@ -171,9 +171,9 @@ class WriterWorker extends Worker {
private String name = null;
private List<String> outputQueueList = null;
Map<String, BaseActor> toActors = new HashMap<>();
Map<String, BaseActorHandle> toActors = new HashMap<>();
DataWriter dataWriter = null;
RayActor<ReaderWorker> peerActor = null;
ActorHandle<ReaderWorker> peerActor = null;
int msgCount = 0;
public WriterWorker(String name) {
@@ -188,13 +188,13 @@ class WriterWorker extends Worker {
return name;
}
public String testCallReader(RayActor<ReaderWorker> readerActor) {
public String testCallReader(ActorHandle<ReaderWorker> readerActor) {
String name = readerActor.call(ReaderWorker::getName).get();
LOGGER.info("testCallReader: {}", name);
return name;
}
public boolean init(List<String> outputQueueList, RayActor<ReaderWorker> peer, int msgCount) {
public boolean init(List<String> outputQueueList, ActorHandle<ReaderWorker> peer, int msgCount) {
this.outputQueueList = outputQueueList;
this.peerActor = peer;