mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
Java call Python use structured function descriptors (#7634)
This commit is contained in:
parent
7d08b418fc
commit
a1ae935839
14 changed files with 475 additions and 305 deletions
|
@ -23,632 +23,632 @@ interface ActorCall<A> {
|
|||
|
||||
default <R> RayObject<R> call(RayFunc1<A, R> f) {
|
||||
Object[] args = new Object[]{};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default void call(RayFuncVoid1<A> f) {
|
||||
Object[] args = new Object[]{};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, R> RayObject<R> call(RayFunc2<A, T0, R> f, T0 t0) {
|
||||
Object[] args = new Object[]{t0};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, R> RayObject<R> call(RayFunc2<A, T0, R> f, RayObject<T0> t0) {
|
||||
Object[] args = new Object[]{t0};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0> void call(RayFuncVoid2<A, T0> f, T0 t0) {
|
||||
Object[] args = new Object[]{t0};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0> void call(RayFuncVoid2<A, T0> f, RayObject<T0> t0) {
|
||||
Object[] args = new Object[]{t0};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, T0 t0, T1 t1) {
|
||||
Object[] args = new Object[]{t0, t1};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, T0 t0, RayObject<T1> t1) {
|
||||
Object[] args = new Object[]{t0, t1};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, RayObject<T0> t0, T1 t1) {
|
||||
Object[] args = new Object[]{t0, t1};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, R> RayObject<R> call(RayFunc3<A, T0, T1, R> f, RayObject<T0> t0, RayObject<T1> t1) {
|
||||
Object[] args = new Object[]{t0, t1};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, T0 t0, RayObject<T1> t1) {
|
||||
Object[] args = new Object[]{t0, t1};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, RayObject<T0> t0, T1 t1) {
|
||||
Object[] args = new Object[]{t0, t1};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1> void call(RayFuncVoid3<A, T0, T1> f, RayObject<T0> t0, RayObject<T1> t1) {
|
||||
Object[] args = new Object[]{t0, t1};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2, R> RayObject<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(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, T1 t1, RayObject<T2> t2) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, RayObject<T1> t1, T2 t2) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, T0 t0, RayObject<T1> t1, RayObject<T2> t2) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, T1 t1, T2 t2) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, T1 t1, RayObject<T2> t2) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, RayObject<T1> t1, T2 t2) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
default <T0, T1, T2> void call(RayFuncVoid4<A, T0, T1, T2> f, RayObject<T0> t0, RayObject<T1> t1, RayObject<T2> t2) {
|
||||
Object[] args = new Object[]{t0, t1, t2};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
return Ray.internal().callActor(f, (RayActor) this, args);
|
||||
return Ray.internal().callActor((RayActor) 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(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) 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) {
|
||||
Object[] args = new Object[]{t0, t1, t2, t3, t4};
|
||||
Ray.internal().callActor(f, (RayActor) this, args);
|
||||
Ray.internal().callActor((RayActor) this, f, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,40 +2,42 @@
|
|||
|
||||
package org.ray.api;
|
||||
|
||||
import org.ray.api.function.PyActorMethod;
|
||||
|
||||
/**
|
||||
* This class provides type-safe interfaces for remote actor calls.
|
||||
**/
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
interface PyActorCall {
|
||||
|
||||
default RayObject call(String functionName) {
|
||||
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod) {
|
||||
Object[] args = new Object[]{};
|
||||
return Ray.internal().callPyActor((RayPyActor)this, functionName, args);
|
||||
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
|
||||
}
|
||||
|
||||
default RayObject call(String functionName, Object obj0) {
|
||||
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0) {
|
||||
Object[] args = new Object[]{obj0};
|
||||
return Ray.internal().callPyActor((RayPyActor)this, functionName, args);
|
||||
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
|
||||
}
|
||||
|
||||
default RayObject call(String functionName, Object obj0, Object obj1) {
|
||||
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1) {
|
||||
Object[] args = new Object[]{obj0, obj1};
|
||||
return Ray.internal().callPyActor((RayPyActor)this, functionName, args);
|
||||
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
|
||||
}
|
||||
|
||||
default RayObject call(String functionName, Object obj0, Object obj1, Object obj2) {
|
||||
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2};
|
||||
return Ray.internal().callPyActor((RayPyActor)this, functionName, args);
|
||||
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
|
||||
}
|
||||
|
||||
default RayObject call(String functionName, Object obj0, Object obj1, Object obj2, Object obj3) {
|
||||
default <R> RayObject<R> call(PyActorMethod<R> pyActorMethod, Object obj0, Object obj1, Object obj2, Object obj3) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3};
|
||||
return Ray.internal().callPyActor((RayPyActor)this, functionName, args);
|
||||
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
|
||||
}
|
||||
|
||||
default RayObject call(String functionName, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) {
|
||||
default <R> RayObject<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().callPyActor((RayPyActor)this, functionName, args);
|
||||
return Ray.internal().callActor((RayPyActor)this, pyActorMethod, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
package org.ray.api;
|
||||
|
||||
import org.ray.api.function.PyActorClass;
|
||||
import org.ray.api.function.PyRemoteFunction;
|
||||
import org.ray.api.function.RayFunc0;
|
||||
import org.ray.api.function.RayFunc1;
|
||||
import org.ray.api.function.RayFunc2;
|
||||
|
@ -3843,144 +3845,144 @@ class RayCall {
|
|||
// ===========================
|
||||
// Cross-language methods.
|
||||
// ===========================
|
||||
public static RayObject callPy(String moduleName, String functionName) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction) {
|
||||
Object[] args = new Object[]{};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, null);
|
||||
return Ray.internal().call(pyRemoteFunction, args, null);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, CallOptions options) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, CallOptions options) {
|
||||
Object[] args = new Object[]{};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, options);
|
||||
return Ray.internal().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0) {
|
||||
Object[] args = new Object[]{obj0};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, null);
|
||||
return Ray.internal().call(pyRemoteFunction, args, null);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, CallOptions options) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, CallOptions options) {
|
||||
Object[] args = new Object[]{obj0};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, options);
|
||||
return Ray.internal().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1) {
|
||||
Object[] args = new Object[]{obj0, obj1};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, null);
|
||||
return Ray.internal().call(pyRemoteFunction, args, null);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, CallOptions options) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, CallOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, options);
|
||||
return Ray.internal().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, null);
|
||||
return Ray.internal().call(pyRemoteFunction, args, null);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2, CallOptions options) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2, CallOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, options);
|
||||
return Ray.internal().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2, Object obj3) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2, Object obj3) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, null);
|
||||
return Ray.internal().call(pyRemoteFunction, args, null);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2, Object obj3, CallOptions options) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2, Object obj3, CallOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, options);
|
||||
return Ray.internal().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, null);
|
||||
return Ray.internal().call(pyRemoteFunction, args, null);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, CallOptions options) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, CallOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, options);
|
||||
return Ray.internal().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4, obj5};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, null);
|
||||
return Ray.internal().call(pyRemoteFunction, args, null);
|
||||
}
|
||||
|
||||
public static RayObject callPy(String moduleName, String functionName, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5, CallOptions options) {
|
||||
public static <R> RayObject<R> call(PyRemoteFunction<R> pyRemoteFunction, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5, CallOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4, obj5};
|
||||
return Ray.internal().callPy(moduleName, functionName, args, options);
|
||||
return Ray.internal().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass) {
|
||||
Object[] args = new Object[]{};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, null);
|
||||
return Ray.internal().createActor(pyActorClass, args, null);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, ActorCreationOptions options) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, ActorCreationOptions options) {
|
||||
Object[] args = new Object[]{};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, options);
|
||||
return Ray.internal().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0) {
|
||||
Object[] args = new Object[]{obj0};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, null);
|
||||
return Ray.internal().createActor(pyActorClass, args, null);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, ActorCreationOptions options) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, ActorCreationOptions options) {
|
||||
Object[] args = new Object[]{obj0};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, options);
|
||||
return Ray.internal().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1) {
|
||||
Object[] args = new Object[]{obj0, obj1};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, null);
|
||||
return Ray.internal().createActor(pyActorClass, args, null);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, ActorCreationOptions options) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, ActorCreationOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, options);
|
||||
return Ray.internal().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, null);
|
||||
return Ray.internal().createActor(pyActorClass, args, null);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2, ActorCreationOptions options) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2, ActorCreationOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, options);
|
||||
return Ray.internal().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2, Object obj3) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2, Object obj3) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, null);
|
||||
return Ray.internal().createActor(pyActorClass, args, null);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2, Object obj3, ActorCreationOptions options) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2, Object obj3, ActorCreationOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, options);
|
||||
return Ray.internal().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, null);
|
||||
return Ray.internal().createActor(pyActorClass, args, null);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, ActorCreationOptions options) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, ActorCreationOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, options);
|
||||
return Ray.internal().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4, obj5};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, null);
|
||||
return Ray.internal().createActor(pyActorClass, args, null);
|
||||
}
|
||||
|
||||
public static RayPyActor createPyActor(String moduleName, String className, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5, ActorCreationOptions options) {
|
||||
public static RayPyActor createActor(PyActorClass pyActorClass, Object obj0, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5, ActorCreationOptions options) {
|
||||
Object[] args = new Object[]{obj0, obj1, obj2, obj3, obj4, obj5};
|
||||
return Ray.internal().createPyActor(moduleName, className, args, options);
|
||||
return Ray.internal().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package org.ray.api.function;
|
||||
|
||||
/**
|
||||
* A class that represents a Python actor class.
|
||||
*
|
||||
* <pre>
|
||||
* example_package/
|
||||
* ├──__init__.py
|
||||
* └──example_module.py
|
||||
*
|
||||
* in example_module.py there is an actor class A.
|
||||
*
|
||||
* \@ray.remote
|
||||
* class A(object):
|
||||
* def __init__(self, x):
|
||||
* self.x = x
|
||||
*
|
||||
* we can create this Python actor from Java:
|
||||
*
|
||||
* {@code
|
||||
* RayPyActor actor = Ray.createActor(new PyActorClass("example_package.example_module", "A"),
|
||||
* "the value for x");
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class PyActorClass {
|
||||
// The full module name of this actor class
|
||||
public final String moduleName;
|
||||
// The name of this actor class
|
||||
public final String className;
|
||||
|
||||
public PyActorClass(String moduleName, String className) {
|
||||
this.moduleName = moduleName;
|
||||
this.className = className;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.ray.api.function;
|
||||
|
||||
/**
|
||||
* A class that represents a method of a Python actor.
|
||||
*
|
||||
* Note, information about the actor will be inferred from the actor handle,
|
||||
* so it's not specified in this class.
|
||||
*
|
||||
* <pre>
|
||||
* there is a Python actor class A.
|
||||
*
|
||||
* \@ray.remote
|
||||
* class A(object):
|
||||
* def foo(self):
|
||||
* return "Hello world!"
|
||||
*
|
||||
* suppose we have got the Python actor class A's handle in Java
|
||||
*
|
||||
* {@code
|
||||
* RayPyActor 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));
|
||||
* String x = res.get();
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class PyActorMethod<R> {
|
||||
// The name of this actor method
|
||||
public final String methodName;
|
||||
// Type of the return value of this actor method
|
||||
public final Class<R> returnType;
|
||||
|
||||
public PyActorMethod(String methodName, Class<R> returnType) {
|
||||
this.methodName = methodName;
|
||||
this.returnType = returnType;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package org.ray.api.function;
|
||||
|
||||
/**
|
||||
* A class that represents a Python remote function.
|
||||
*
|
||||
* <pre>
|
||||
* example_package/
|
||||
* ├──__init__.py
|
||||
* └──example_module.py
|
||||
*
|
||||
* in example_module.py there is a function.
|
||||
*
|
||||
* \@ray.remote
|
||||
* def bar(v):
|
||||
* return v
|
||||
*
|
||||
* then we can call the Python function bar:
|
||||
*
|
||||
* {@code
|
||||
* // bar returns input, so we have to set the returnType to int.class if bar accepts an int
|
||||
* RayObject<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(
|
||||
* new PyRemoteFunction<>("example_package.example_module", "bar", String.class),
|
||||
* "Hello world!");
|
||||
* String value = res.get();
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class PyRemoteFunction<R> {
|
||||
// The full module name of this function
|
||||
public final String moduleName;
|
||||
// The name of this function
|
||||
public final String functionName;
|
||||
// Type of the return value of this function
|
||||
public final Class<R> returnType;
|
||||
|
||||
public PyRemoteFunction(String moduleName, String functionName, Class<R> returnType) {
|
||||
this.moduleName = moduleName;
|
||||
this.functionName = functionName;
|
||||
this.returnType = returnType;
|
||||
}
|
||||
}
|
|
@ -7,6 +7,9 @@ import org.ray.api.RayActor;
|
|||
import org.ray.api.RayObject;
|
||||
import org.ray.api.RayPyActor;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.function.PyActorClass;
|
||||
import org.ray.api.function.PyActorMethod;
|
||||
import org.ray.api.function.PyRemoteFunction;
|
||||
import org.ray.api.function.RayFunc;
|
||||
import org.ray.api.id.ObjectId;
|
||||
import org.ray.api.id.UniqueId;
|
||||
|
@ -95,15 +98,35 @@ public interface RayRuntime {
|
|||
*/
|
||||
RayObject call(RayFunc func, Object[] args, CallOptions options);
|
||||
|
||||
/**
|
||||
* Invoke a remote Python function.
|
||||
*
|
||||
* @param pyRemoteFunction The Python function.
|
||||
* @param args Arguments of the function.
|
||||
* @param options The options for this call.
|
||||
* @return The result object.
|
||||
*/
|
||||
RayObject call(PyRemoteFunction pyRemoteFunction, Object[] args, CallOptions options);
|
||||
|
||||
/**
|
||||
* Invoke a remote function on an actor.
|
||||
*
|
||||
* @param func The remote function to run, it must be a method of the given actor.
|
||||
* @param actor A handle to the actor.
|
||||
* @param func The remote function to run, it must be a method of the given actor.
|
||||
* @param args The arguments of the remote function.
|
||||
* @return The result object.
|
||||
*/
|
||||
RayObject callActor(RayFunc func, RayActor<?> actor, Object[] args);
|
||||
RayObject callActor(RayActor<?> actor, RayFunc func, Object[] args);
|
||||
|
||||
/**
|
||||
* Invoke a remote Python function on an actor.
|
||||
*
|
||||
* @param pyActor A handle to the actor.
|
||||
* @param pyActorMethod The actor method.
|
||||
* @param args Arguments of the function.
|
||||
* @return The result object.
|
||||
*/
|
||||
RayObject callActor(RayPyActor pyActor, PyActorMethod pyActorMethod, Object[] args);
|
||||
|
||||
/**
|
||||
* Create an actor on a remote node.
|
||||
|
@ -117,40 +140,18 @@ public interface RayRuntime {
|
|||
<T> RayActor<T> createActor(RayFunc actorFactoryFunc, Object[] args,
|
||||
ActorCreationOptions options);
|
||||
|
||||
RuntimeContext getRuntimeContext();
|
||||
|
||||
/**
|
||||
* Invoke a remote Python function.
|
||||
*
|
||||
* @param moduleName Module name of the Python function.
|
||||
* @param functionName Name of the Python function.
|
||||
* @param args Arguments of the function.
|
||||
* @param options The options for this call.
|
||||
* @return The result object.
|
||||
*/
|
||||
RayObject callPy(String moduleName, String functionName, Object[] args, CallOptions options);
|
||||
|
||||
/**
|
||||
* Invoke a remote Python function on an actor.
|
||||
*
|
||||
* @param pyActor A handle to the actor.
|
||||
* @param functionName Name of the actor method.
|
||||
* @param args Arguments of the function.
|
||||
* @return The result object.
|
||||
*/
|
||||
RayObject callPyActor(RayPyActor pyActor, String functionName, Object[] args);
|
||||
|
||||
/**
|
||||
* Create a Python actor on a remote node.
|
||||
*
|
||||
* @param moduleName Module name of the Python actor class.
|
||||
* @param className Name of the Python actor class.
|
||||
* @param pyActorClass The Python actor class.
|
||||
* @param args Arguments of the actor constructor.
|
||||
* @param options The options for creating actor.
|
||||
* @return A handle to the actor.
|
||||
*/
|
||||
RayPyActor createPyActor(String moduleName, String className, Object[] args,
|
||||
ActorCreationOptions options);
|
||||
RayPyActor createActor(PyActorClass pyActorClass, Object[] args,
|
||||
ActorCreationOptions options);
|
||||
|
||||
RuntimeContext getRuntimeContext();
|
||||
|
||||
Object getAsyncContext();
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@ import org.ray.api.RayObject;
|
|||
import org.ray.api.RayPyActor;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.exception.RayException;
|
||||
import org.ray.api.function.PyActorClass;
|
||||
import org.ray.api.function.PyActorMethod;
|
||||
import org.ray.api.function.PyRemoteFunction;
|
||||
import org.ray.api.function.RayFunc;
|
||||
import org.ray.api.function.RayFuncVoid;
|
||||
import org.ray.api.id.ObjectId;
|
||||
|
@ -98,7 +101,19 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
}
|
||||
|
||||
@Override
|
||||
public RayObject callActor(RayFunc func, RayActor<?> actor, Object[] args) {
|
||||
public RayObject call(PyRemoteFunction pyRemoteFunction, Object[] args,
|
||||
CallOptions options) {
|
||||
checkPyArguments(args);
|
||||
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(
|
||||
pyRemoteFunction.moduleName,
|
||||
"",
|
||||
pyRemoteFunction.functionName);
|
||||
// Python functions always have a return value, even if it's `None`.
|
||||
return callNormalFunction(functionDescriptor, args, /*numReturns=*/1, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callActor(RayActor<?> actor, RayFunc func, Object[] args) {
|
||||
FunctionDescriptor functionDescriptor =
|
||||
functionManager.getFunction(workerContext.getCurrentJobId(), func)
|
||||
.functionDescriptor;
|
||||
|
@ -106,6 +121,15 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
return callActorFunction(actor, functionDescriptor, args, numReturns);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callActor(RayPyActor pyActor, PyActorMethod pyActorMethod, Object... args) {
|
||||
checkPyArguments(args);
|
||||
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(pyActor.getModuleName(),
|
||||
pyActor.getClassName(), pyActorMethod.methodName);
|
||||
// Python functions always have a return value, even if it's `None`.
|
||||
return callActorFunction(pyActor, functionDescriptor, args, /*numReturns=*/1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> RayActor<T> createActor(RayFunc actorFactoryFunc,
|
||||
|
@ -116,6 +140,17 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
return (RayActor<T>) createActorImpl(functionDescriptor, args, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayPyActor createActor(PyActorClass pyActorClass, Object[] args,
|
||||
ActorCreationOptions options) {
|
||||
checkPyArguments(args);
|
||||
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(
|
||||
pyActorClass.moduleName,
|
||||
pyActorClass.className,
|
||||
PYTHON_INIT_METHOD_NAME);
|
||||
return (RayPyActor) createActorImpl(functionDescriptor, args, options);
|
||||
}
|
||||
|
||||
private void checkPyArguments(Object[] args) {
|
||||
for (Object arg : args) {
|
||||
Preconditions.checkArgument(
|
||||
|
@ -125,34 +160,6 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callPy(String moduleName, String functionName, Object[] args,
|
||||
CallOptions options) {
|
||||
checkPyArguments(args);
|
||||
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(moduleName, "",
|
||||
functionName);
|
||||
// Python functions always have a return value, even if it's `None`.
|
||||
return callNormalFunction(functionDescriptor, args, /*numReturns=*/1, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callPyActor(RayPyActor pyActor, String functionName, Object... args) {
|
||||
checkPyArguments(args);
|
||||
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(pyActor.getModuleName(),
|
||||
pyActor.getClassName(), functionName);
|
||||
// Python functions always have a return value, even if it's `None`.
|
||||
return callActorFunction(pyActor, functionDescriptor, args, /*numReturns=*/1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayPyActor createPyActor(String moduleName, String className, Object[] args,
|
||||
ActorCreationOptions options) {
|
||||
checkPyArguments(args);
|
||||
PyFunctionDescriptor functionDescriptor = new PyFunctionDescriptor(moduleName, className,
|
||||
PYTHON_INIT_METHOD_NAME);
|
||||
return (RayPyActor) createActorImpl(functionDescriptor, args, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable wrapRunnable(Runnable runnable) {
|
||||
return runnable;
|
||||
|
|
|
@ -8,6 +8,9 @@ import org.ray.api.RayActor;
|
|||
import org.ray.api.RayObject;
|
||||
import org.ray.api.RayPyActor;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.function.PyActorClass;
|
||||
import org.ray.api.function.PyActorMethod;
|
||||
import org.ray.api.function.PyRemoteFunction;
|
||||
import org.ray.api.function.RayFunc;
|
||||
import org.ray.api.id.ObjectId;
|
||||
import org.ray.api.id.UniqueId;
|
||||
|
@ -150,8 +153,19 @@ public class RayMultiWorkerNativeRuntime implements RayRuntime {
|
|||
}
|
||||
|
||||
@Override
|
||||
public RayObject callActor(RayFunc func, RayActor<?> actor, Object[] args) {
|
||||
return getCurrentRuntime().callActor(func, actor, args);
|
||||
public RayObject call(PyRemoteFunction pyRemoteFunction, Object[] args,
|
||||
CallOptions options) {
|
||||
return getCurrentRuntime().call(pyRemoteFunction, args, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callActor(RayActor<?> actor, RayFunc func, Object[] args) {
|
||||
return getCurrentRuntime().callActor(actor, func, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callActor(RayPyActor pyActor, PyActorMethod pyActorMethod, Object[] args) {
|
||||
return getCurrentRuntime().callActor(pyActor, pyActorMethod, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -160,28 +174,17 @@ public class RayMultiWorkerNativeRuntime implements RayRuntime {
|
|||
return getCurrentRuntime().createActor(actorFactoryFunc, args, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayPyActor createActor(PyActorClass pyActorClass, Object[] args,
|
||||
ActorCreationOptions options) {
|
||||
return getCurrentRuntime().createActor(pyActorClass, args, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuntimeContext getRuntimeContext() {
|
||||
return getCurrentRuntime().getRuntimeContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callPy(String moduleName, String functionName, Object[] args,
|
||||
CallOptions options) {
|
||||
return getCurrentRuntime().callPy(moduleName, functionName, args, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject callPyActor(RayPyActor pyActor, String functionName, Object[] args) {
|
||||
return getCurrentRuntime().callPyActor(pyActor, functionName, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayPyActor createPyActor(String moduleName, String className, Object[] args,
|
||||
ActorCreationOptions options) {
|
||||
return getCurrentRuntime().createPyActor(moduleName, className, args, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAsyncContext() {
|
||||
return getCurrentRuntime();
|
||||
|
|
|
@ -23,6 +23,8 @@ public class RayCallGenerator extends BaseGenerator {
|
|||
newLine("");
|
||||
newLine("package org.ray.api;");
|
||||
newLine("");
|
||||
newLine("import org.ray.api.function.PyActorClass;");
|
||||
newLine("import org.ray.api.function.PyRemoteFunction;");
|
||||
for (int i = 0; i <= MAX_PARAMETERS; i++) {
|
||||
newLine("import org.ray.api.function.RayFunc" + i + ";");
|
||||
}
|
||||
|
@ -112,6 +114,8 @@ public class RayCallGenerator extends BaseGenerator {
|
|||
newLine("");
|
||||
newLine("package org.ray.api;");
|
||||
newLine("");
|
||||
newLine("import org.ray.api.function.PyActorMethod;");
|
||||
newLine("");
|
||||
newLine("/**");
|
||||
newLine(" * This class provides type-safe interfaces for remote actor calls.");
|
||||
newLine(" **/");
|
||||
|
@ -216,11 +220,11 @@ public class RayCallGenerator extends BaseGenerator {
|
|||
newLine(2, String.format("Object[] args = new Object[]{%s};", args));
|
||||
|
||||
// 5) Construct the third line.
|
||||
String callFuncArgs = "f, ";
|
||||
String callFuncArgs = "";
|
||||
if (forActor) {
|
||||
callFuncArgs += "(RayActor) this, ";
|
||||
}
|
||||
callFuncArgs += "args, ";
|
||||
callFuncArgs += "f, args, ";
|
||||
callFuncArgs += forActor ? "" : hasOptionsParam ? "options, " : "null, ";
|
||||
callFuncArgs = callFuncArgs.substring(0, callFuncArgs.length() - 2);
|
||||
newLine(2, String.format("%sRay.internal().%s(%s);",
|
||||
|
@ -231,12 +235,12 @@ public class RayCallGenerator extends BaseGenerator {
|
|||
}
|
||||
|
||||
/**
|
||||
* Build `Ray.callPy`, `Ray.createPyActor` and `actor.call` methods with
|
||||
* Build `Ray.call`, `Ray.createActor` and `actor.call` methods with
|
||||
* the given number of parameters.
|
||||
*
|
||||
* @param numParameters the number of parameters
|
||||
* @param forActor Build `actor.call` when true, otherwise build `Ray.callPy`.
|
||||
* @param forActorCreation Build `Ray.createPyActor` when true, otherwise build `Ray.callPy`.
|
||||
* @param forActor Build `actor.call` when true, otherwise build `Ray.call`.
|
||||
* @param forActorCreation Build `Ray.createActor` when true, otherwise build `Ray.call`.
|
||||
* @param hasOptionsParam Add ActorCreationOptions if forActorCreation is true;
|
||||
* Add CallOptions if forActorCreation is false;
|
||||
* No additional param if hasOptionsParam is false.
|
||||
|
@ -261,14 +265,14 @@ public class RayCallGenerator extends BaseGenerator {
|
|||
String paramPrefix = "";
|
||||
String funcArgs = "";
|
||||
if (forActorCreation) {
|
||||
paramPrefix += "String moduleName, String className";
|
||||
funcArgs += "moduleName, className";
|
||||
paramPrefix += "PyActorClass pyActorClass";
|
||||
funcArgs += "pyActorClass";
|
||||
} else if (forActor) {
|
||||
paramPrefix += "String functionName";
|
||||
funcArgs += "functionName";
|
||||
paramPrefix += "PyActorMethod<R> pyActorMethod";
|
||||
funcArgs += "pyActorMethod";
|
||||
} else {
|
||||
paramPrefix += "String moduleName, String functionName";
|
||||
funcArgs += "moduleName, functionName";
|
||||
paramPrefix += "PyRemoteFunction<R> pyRemoteFunction";
|
||||
funcArgs += "pyRemoteFunction";
|
||||
}
|
||||
if (numParameters > 0) {
|
||||
paramPrefix += ", ";
|
||||
|
@ -292,14 +296,15 @@ public class RayCallGenerator extends BaseGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
String returnType = !forActorCreation ? "RayObject" : "RayPyActor";
|
||||
String funcName = forActorCreation ? "createPyActor" : forActor ? "call" : "callPy";
|
||||
String internalCallFunc = forActorCreation ? "createPyActor" :
|
||||
forActor ? "callPyActor" : "callPy";
|
||||
String genericType = forActorCreation ? "" : " <R>";
|
||||
String returnType = !forActorCreation ? "RayObject<R>" : "RayPyActor";
|
||||
String funcName = forActorCreation ? "createActor" : "call";
|
||||
String internalCallFunc = forActorCreation ? "createActor" :
|
||||
forActor ? "callActor" : "call";
|
||||
funcArgs += ", args";
|
||||
// Method signature.
|
||||
newLine(1, String.format(
|
||||
"%s %s %s(%s%s) {", modifiers,
|
||||
"%s%s %s %s(%s%s) {", modifiers, genericType,
|
||||
returnType, funcName, paramPrefix + paramList, optionsParam
|
||||
));
|
||||
// Method body.
|
||||
|
|
|
@ -11,6 +11,9 @@ import org.ray.api.Ray;
|
|||
import org.ray.api.RayActor;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.RayPyActor;
|
||||
import org.ray.api.function.PyActorClass;
|
||||
import org.ray.api.function.PyActorMethod;
|
||||
import org.ray.api.function.PyRemoteFunction;
|
||||
import org.ray.runtime.actor.NativeRayActor;
|
||||
import org.ray.runtime.actor.NativeRayPyActor;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -48,26 +51,34 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
|
|||
|
||||
@Test
|
||||
public void testCallingPythonFunction() {
|
||||
RayObject res = Ray.callPy(PYTHON_MODULE, "py_func", "hello".getBytes());
|
||||
RayObject<byte[]> res = Ray.call(
|
||||
new PyRemoteFunction<>(PYTHON_MODULE, "py_func", byte[].class),
|
||||
"hello".getBytes());
|
||||
Assert.assertEquals(res.get(), "Response from Python: hello".getBytes());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPythonCallJavaFunction() {
|
||||
RayObject res = Ray.callPy(PYTHON_MODULE, "py_func_call_java_function", "hello".getBytes());
|
||||
RayObject<byte[]> res = Ray.call(
|
||||
new PyRemoteFunction<>(PYTHON_MODULE, "py_func_call_java_function", byte[].class),
|
||||
"hello".getBytes());
|
||||
Assert.assertEquals(res.get(), "[Python]py_func -> [Java]bytesEcho -> hello".getBytes());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCallingPythonActor() {
|
||||
RayPyActor actor = Ray.createPyActor(PYTHON_MODULE, "Counter", "1".getBytes());
|
||||
RayObject res = actor.call("increase", "1".getBytes());
|
||||
RayPyActor actor = Ray.createActor(new PyActorClass(PYTHON_MODULE, "Counter"), "1".getBytes());
|
||||
RayObject<byte[]> res = actor.call(
|
||||
new PyActorMethod<>("increase", byte[].class),
|
||||
"1".getBytes());
|
||||
Assert.assertEquals(res.get(), "2".getBytes());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPythonCallJavaActor() {
|
||||
RayObject res = Ray.callPy(PYTHON_MODULE, "py_func_call_java_actor", "1".getBytes());
|
||||
RayObject<byte[]> res = Ray.call(
|
||||
new PyRemoteFunction<>(PYTHON_MODULE, "py_func_call_java_actor", byte[].class),
|
||||
"1".getBytes());
|
||||
Assert.assertEquals(res.get(), "Counter1".getBytes());
|
||||
|
||||
}
|
||||
|
@ -76,7 +87,8 @@ 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 res = Ray.callPy(PYTHON_MODULE, "py_func_pass_python_actor_handle");
|
||||
RayObject<byte[]> res = Ray.call(
|
||||
new PyRemoteFunction<>(PYTHON_MODULE, "py_func_pass_python_actor_handle", byte[].class));
|
||||
Assert.assertEquals(res.get(), "3".getBytes());
|
||||
}
|
||||
|
||||
|
@ -86,15 +98,22 @@ public class CrossLanguageInvocationTest extends BaseMultiLanguageTest {
|
|||
RayActor<TestActor> javaActor = Ray.createActor(TestActor::new, "1".getBytes());
|
||||
Preconditions.checkState(javaActor instanceof NativeRayActor);
|
||||
byte[] actorHandleBytes = ((NativeRayActor) javaActor).toBytes();
|
||||
RayObject res = Ray.callPy(PYTHON_MODULE,
|
||||
"py_func_call_java_actor_from_handle", actorHandleBytes);
|
||||
RayObject<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.createPyActor(PYTHON_MODULE, "Counter", "1".getBytes());
|
||||
RayPyActor pyActor = Ray.createActor(
|
||||
new PyActorClass(PYTHON_MODULE, "Counter"), "1".getBytes());
|
||||
Preconditions.checkState(pyActor instanceof NativeRayActor);
|
||||
actorHandleBytes = ((NativeRayActor) pyActor).toBytes();
|
||||
res = Ray.callPy(PYTHON_MODULE,
|
||||
"py_func_call_python_actor_from_handle", actorHandleBytes);
|
||||
res = Ray.call(
|
||||
new PyRemoteFunction<>(PYTHON_MODULE,
|
||||
"py_func_call_python_actor_from_handle",
|
||||
byte[].class),
|
||||
actorHandleBytes);
|
||||
Assert.assertEquals(res.get(), "3".getBytes());
|
||||
}
|
||||
|
||||
|
@ -107,10 +126,12 @@ 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 res = actor.call("increase", "1".getBytes());
|
||||
NativeRayPyActor actor = (NativeRayPyActor) NativeRayActor.fromBytes(value);
|
||||
RayObject<byte[]> res = actor.call(
|
||||
new PyActorMethod<>("increase", byte[].class),
|
||||
"1".getBytes());
|
||||
Assert.assertEquals(res.get(), "3".getBytes());
|
||||
return (byte[])res.get();
|
||||
return (byte[]) res.get();
|
||||
}
|
||||
|
||||
public static class TestActor {
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.ray.api.test;
|
|||
import org.ray.api.Ray;
|
||||
import org.ray.api.RayPyActor;
|
||||
import org.ray.api.TestUtils;
|
||||
import org.ray.api.function.PyActorClass;
|
||||
import org.ray.runtime.context.WorkerContext;
|
||||
import org.ray.runtime.object.NativeRayObject;
|
||||
import org.ray.runtime.object.ObjectSerializer;
|
||||
|
@ -13,7 +14,7 @@ public class RaySerializerTest extends BaseMultiLanguageTest {
|
|||
|
||||
@Test
|
||||
public void testSerializePyActor() {
|
||||
RayPyActor pyActor = Ray.createPyActor("test", "RaySerializerTest");
|
||||
RayPyActor pyActor = Ray.createActor(new PyActorClass("test", "RaySerializerTest"));
|
||||
WorkerContext workerContext = TestUtils.getRuntime().getWorkerContext();
|
||||
NativeRayObject nativeRayObject = ObjectSerializer.serialize(pyActor);
|
||||
RayPyActor result = (RayPyActor) ObjectSerializer
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.ray.api.Ray;
|
|||
import org.ray.api.RayActor;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.RayPyActor;
|
||||
import org.ray.api.function.PyActorMethod;
|
||||
import org.ray.streaming.api.Language;
|
||||
import org.ray.streaming.jobgraph.JobGraph;
|
||||
import org.ray.streaming.runtime.core.graph.ExecutionGraph;
|
||||
|
@ -68,7 +69,8 @@ public class JobSchedulerImpl implements JobScheduler {
|
|||
case PYTHON:
|
||||
byte[] workerContextBytes = buildPythonWorkerContext(
|
||||
taskId, executionGraphPb, jobConfig);
|
||||
waits.add(((RayPyActor)worker).call("init", workerContextBytes));
|
||||
waits.add(((RayPyActor)worker).call(new PyActorMethod("init", Object.class),
|
||||
workerContextBytes));
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException(
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import org.ray.api.BaseActor;
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.function.PyActorClass;
|
||||
import org.ray.streaming.jobgraph.JobEdge;
|
||||
import org.ray.streaming.jobgraph.JobGraph;
|
||||
import org.ray.streaming.jobgraph.JobVertex;
|
||||
|
@ -61,8 +62,8 @@ public class TaskAssignerImpl implements TaskAssigner {
|
|||
private BaseActor createWorker(JobVertex jobVertex) {
|
||||
switch (jobVertex.getLanguage()) {
|
||||
case PYTHON:
|
||||
return Ray.createPyActor(
|
||||
"ray.streaming.runtime.worker", "JobWorker");
|
||||
return Ray.createActor(
|
||||
new PyActorClass("ray.streaming.runtime.worker", "JobWorker"));
|
||||
case JAVA:
|
||||
return Ray.createActor(JobWorker::new);
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue