[JavaWorker] Java code lint check and binding to CI (#2225)

* add java code lint check and fix the java code lint error

* add java doc lint check and fix the java doc lint error

* add java code and doc lint to the CI
This commit is contained in:
Yujie Liu
2018-06-10 07:26:54 +08:00
committed by Philipp Moritz
parent 5789a247f9
commit 3b5e700fd7
158 changed files with 3805 additions and 3325 deletions
+43 -44
View File
@@ -1,54 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.ray.parent</groupId>
<artifactId>ray-superpom</artifactId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.ray.parent</groupId>
<artifactId>ray-superpom</artifactId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.ray</groupId>
<artifactId>ray-api</artifactId>
<name>java api for ray</name>
<description>java api for ray</description>
<url></url>
<groupId>org.ray</groupId>
<artifactId>ray-api</artifactId>
<name>java api for ray</name>
<description>java api for ray</description>
<url></url>
<packaging>jar</packaging>
<packaging>jar</packaging>
<dependencies>
<dependencies>
<dependency>
<groupId>org.ray</groupId>
<artifactId>ray-common</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.ray</groupId>
<artifactId>ray-common</artifactId>
<version>1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
<version>2.47</version>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-plasma</artifactId>
</dependency>
</dependencies>
<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
<version>2.47</version>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-plasma</artifactId>
</dependency>
</dependencies>
</project>
+19 -19
View File
@@ -7,12 +7,14 @@ import org.ray.util.logger.DynamicLog;
import org.ray.util.logger.RayLog;
/**
* Ray API
* Ray API.
*/
public final class Ray extends Rpc {
private static RayApi impl = null;
/**
* initialize the current worker or the single-box cluster
* initialize the current worker or the single-box cluster.
*/
public static void init() {
if (impl == null) {
@@ -21,44 +23,44 @@ public final class Ray extends Rpc {
}
/**
* Put obj into object store
* Put obj into object store.
*/
public static <T> RayObject<T> put(T obj) {
return impl.put(obj);
}
public static <T, TM> RayObject<T> put(T obj, TM metadata) {
public static <T, TMT> RayObject<T> put(T obj, TMT metadata) {
return impl.put(obj, metadata);
}
/**
* Get obj(s) from object store
* Get obj(s) from object store.
*/
static <T> T get(UniqueID objectId) throws TaskExecutionException {
return impl.get(objectId);
}
static <T> T getMeta(UniqueID objectId) throws TaskExecutionException {
return impl.getMeta(objectId);
}
static <T> List<T> get(List<UniqueID> objectIds) throws TaskExecutionException {
return impl.get(objectIds);
}
static <T> T getMeta(UniqueID objectId) throws TaskExecutionException {
return impl.getMeta(objectId);
}
static <T> List<T> getMeta(List<UniqueID> objectIds) throws TaskExecutionException {
return impl.getMeta(objectIds);
}
/**
* wait until timeout or enough RayObject are ready
* wait until timeout or enough RayObject are ready.
*
* @param waitfor wait for who
* @param numReturns how many of ready is enough
* @param waitfor wait for who
* @param numReturns how many of ready is enough
* @param timeoutMilliseconds in millisecond
*/
public static <T> WaitResult<T> wait(RayList<T> waitfor, int numReturns,
int timeoutMilliseconds) {
int timeoutMilliseconds) {
return impl.wait(waitfor, numReturns, timeoutMilliseconds);
}
@@ -77,7 +79,7 @@ public final class Ray extends Rpc {
}
/**
* create actor object
* create actor object.
*/
public static <T> RayActor<T> create(Class<T> cls) {
try {
@@ -95,23 +97,21 @@ public final class Ray extends Rpc {
}
/**
* get underlying runtime
* get underlying runtime.
*/
static RayApi internal() {
return impl;
}
/**
* whether to use remote lambda
* whether to use remote lambda.
*/
public static boolean isRemoteLambda() {
return impl.isRemoteLambda();
}
private static RayApi impl = null;
/**
* for ray's app's log
* for ray's app's log.
*/
public static DynamicLog getRappLogger() {
return RayLog.rapp;
@@ -7,7 +7,7 @@ import java.io.ObjectOutput;
import org.ray.util.Sha1Digestor;
/**
* Ray actor abstraction
* Ray actor abstraction.
*/
public class RayActor<T> extends RayObject<T> implements Externalizable {
@@ -40,7 +40,7 @@ public class RayActor<T> extends RayObject<T> implements Externalizable {
}
/**
* Getter method for property <tt>taskCursor</tt>
* Getter method for property <tt>taskCursor</tt>.
*
* @return property value of taskCursor
*/
@@ -49,7 +49,7 @@ public class RayActor<T> extends RayObject<T> implements Externalizable {
}
/**
* Setter method for property <tt>taskCursor</tt>
* Setter method for property <tt>taskCursor</tt>.
*
* @param taskCursor value to be assigned to property taskCursor
*/
@@ -57,11 +57,6 @@ public class RayActor<T> extends RayObject<T> implements Externalizable {
this.taskCursor = taskCursor;
}
public UniqueID computeNextActorHandleId() {
byte[] bytes = Sha1Digestor.digest(actorHandleId.id, ++forksNum);
return new UniqueID(bytes);
}
public UniqueID getActorHandleId() {
return actorHandleId;
}
@@ -77,6 +72,11 @@ public class RayActor<T> extends RayObject<T> implements Externalizable {
out.writeObject(this.taskCursor);
}
public UniqueID computeNextActorHandleId() {
byte[] bytes = Sha1Digestor.digest(actorHandleId.id, ++forksNum);
return new UniqueID(bytes);
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+33 -30
View File
@@ -7,95 +7,98 @@ import org.ray.api.internal.Callable;
import org.ray.util.exception.TaskExecutionException;
/**
* Ray runtime abstraction
* Ray runtime abstraction.
*/
public interface RayApi {
/**
* Put obj into object store
* Put obj into object store.
*
* @return RayObject
*/
<T> RayObject<T> put(T obj);
<T, TM> RayObject<T> put(T obj, TM metadata);
<T, TMT> RayObject<T> put(T obj, TMT metadata);
/**
* Get real obj from object store
* Get real obj from object store.
*/
<T> T get(UniqueID objectId) throws TaskExecutionException;
<T> T getMeta(UniqueID objectId) throws TaskExecutionException;
/**
* Get real objects from object store
* Get real objects from object store.
*
* @param objectIds list of ids of objects to get
*/
<T> List<T> get(List<UniqueID> objectIds) throws TaskExecutionException;
<T> T getMeta(UniqueID objectId) throws TaskExecutionException;
<T> List<T> getMeta(List<UniqueID> objectIds) throws TaskExecutionException;
/**
* wait until timeout or enough RayObjects are ready
* wait until timeout or enough RayObjects are ready.
*
* @param waitfor wait for who
* @param waitfor wait for who
* @param numReturns how many of ready is enough
* @param timeout in millisecond
* @param timeout in millisecond
*/
<T> WaitResult<T> wait(RayList<T> waitfor, int numReturns, int timeout);
/**
* create remote actor
* create remote actor.
*/
<T> RayActor<T> create(Class<T> cls);
/**
* submit a new task by invoking a remote function
* submit a new task by invoking a remote function.
*
* @param taskId nil
* @param funcRun the target running function with @RayRemote
* @param taskId nil
* @param funcRun the target running function with @RayRemote
* @param returnCount the number of to-be-returned objects from funcRun
* @param args arguments to this funcRun, can be its original form or RayObject<original-type>
* @param args arguments to this funcRun, can be its original form or RayObject
* @return a set of ray objects with their return ids
*/
RayObjects call(UniqueID taskId, Callable funcRun, int returnCount, Object... args);
RayObjects call(UniqueID taskId, Class<?> funcCls, Serializable lambda, int returnCount,
Object... args);
Object... args);
/**
* In some cases, we would like the return value of a remote function to be splitted into multiple
* parts so that they are consumed by multiple further functions separately (potentially on
* different machines). We therefore introduce this API so that developers can annotate the
* outputs with a set of labels (usually with Integer or String)
* outputs with a set of labels (usually with Integer or String).
*
* @param taskId nil
* @param funcRun the target running function with @RayRemote
* @param taskId nil
* @param funcRun the target running function with @RayRemote
* @param returnIds a set of labels to be used by the returned objects
* @param args arguments to this funcRun, can be its original form or RayObject<original-type>
* @param args arguments to this funcRun, can be its original form or
* RayObject<original-type>
* @return a set of ray objects with their labels and return ids
*/
<R, RID> RayMap<RID, R> callWithReturnLabels(UniqueID taskId, Callable funcRun,
Collection<RID> returnIds, Object... args);
<R, RIDT> RayMap<RIDT, R> callWithReturnLabels(UniqueID taskId, Callable funcRun,
Collection<RIDT> returnIds, Object... args);
<R, RID> RayMap<RID, R> callWithReturnLabels(UniqueID taskId, Class<?> funcCls,
Serializable lambda, Collection<RID> returnids, Object... args);
<R, RIDT> RayMap<RIDT, R> callWithReturnLabels(UniqueID taskId, Class<?> funcCls,
Serializable lambda, Collection<RIDT> returnids,
Object... args);
/**
* a special case for the above RID-based labeling as <0...returnCount - 1>
* a special case for the above RID-based labeling as <0...returnCount - 1>.
*
* @param taskId nil
* @param funcRun the target running function with @RayRemote
* @param taskId nil
* @param funcRun the target running function with @RayRemote
* @param returnCount the number of to-be-returned objects from funcRun
* @param args arguments to this funcRun, can be its original form or RayObject<original-type>
* @param args arguments to this funcRun, can be its original form or
* RayObject<original-type>
* @return an array of returned objects with their Unique ids
*/
<R> RayList<R> callWithReturnIndices(UniqueID taskId, Callable funcRun, Integer returnCount,
Object... args);
Object... args);
<R> RayList<R> callWithReturnIndices(UniqueID taskId, Class<?> funcCls, Serializable lambda,
Integer returnCount, Object... args);
Integer returnCount, Object... args);
boolean isRemoteLambda();
}
+83 -83
View File
@@ -38,15 +38,16 @@ public class RayList<E> extends ArrayList<E> {
return ids.contains(o);
}
@RayDisabled
@Deprecated
@Override
public Iterator<E> iterator() {
throw new UnsupportedOperationException();
public int indexOf(Object o) {
//throw new UnsupportedOperationException();
return ids.indexOf(o);
}
public Iterator<RayObject<E>> Iterator() {
return ids.iterator();
@Override
public int lastIndexOf(Object o) {
//throw new UnsupportedOperationException();
return ids.lastIndexOf(o);
}
@Override
@@ -61,6 +62,30 @@ public class RayList<E> extends ArrayList<E> {
return ids.toArray(a);
}
@Override
public E get(int index) {
return ids.get(index).get();
}
public List<E> get() {
List<UniqueID> objectIds = new ArrayList<>();
for (RayObject<E> id : ids) {
objectIds.add(id.getId());
}
return Ray.get(objectIds);
}
@RayDisabled
@Deprecated
@Override
public E set(int index, E element) {
throw new UnsupportedOperationException();
}
public RayObject<E> set(int index, RayObject<E> element) {
return ids.set(index, element);
}
@RayDisabled
@Deprecated
@Override
@@ -68,10 +93,28 @@ public class RayList<E> extends ArrayList<E> {
throw new UnsupportedOperationException();
}
@RayDisabled
@Deprecated
@Override
public void add(int index, E element) {
throw new UnsupportedOperationException();
}
public boolean add(RayObject<E> e) {
return ids.add(e);
}
public void add(int index, RayObject<E> element) {
ids.add(index, element);
}
@RayDisabled
@Deprecated
@Override
public E remove(int index) {
throw new UnsupportedOperationException();
}
@Override
public boolean remove(Object o) {
//throw new UnsupportedOperationException();
@@ -79,9 +122,9 @@ public class RayList<E> extends ArrayList<E> {
}
@Override
public boolean containsAll(Collection<?> c) {
public void clear() {
//throw new UnsupportedOperationException();
return ids.containsAll(c);
ids.clear();
}
@RayDisabled
@@ -110,86 +153,13 @@ public class RayList<E> extends ArrayList<E> {
return ids.retainAll(c);
}
@Override
public void clear() {
//throw new UnsupportedOperationException();
ids.clear();
}
public List<E> get() {
List<UniqueID> objectIds = new ArrayList<>();
for (RayObject<E> id : ids) {
objectIds.add(id.getId());
}
return Ray.get(objectIds);
}
public <T> List<T> getMeta() {
List<UniqueID> objectIds = new ArrayList<>();
for (RayObject<E> id : ids) {
objectIds.add(id.getId());
}
return Ray.getMeta(objectIds);
}
@Override
public E get(int index) {
return ids.get(index).get();
}
public <TM> TM getMeta(int index) {
return ids.get(index).getMeta();
}
public RayObject<E> Get(int index) {
return ids.get(index);
}
@RayDisabled
@Deprecated
@Override
public E set(int index, E element) {
public ListIterator<E> listIterator(int index) {
throw new UnsupportedOperationException();
}
public RayObject<E> set(int index, RayObject<E> element) {
return ids.set(index, element);
}
@RayDisabled
@Deprecated
@Override
public void add(int index, E element) {
throw new UnsupportedOperationException();
}
public void add(int index, RayObject<E> element) {
ids.add(index, element);
}
@RayDisabled
@Deprecated
@Override
public E remove(int index) {
throw new UnsupportedOperationException();
}
public RayObject<E> Remove(int index) {
return ids.remove(index);
}
@Override
public int indexOf(Object o) {
//throw new UnsupportedOperationException();
return ids.indexOf(o);
}
@Override
public int lastIndexOf(Object o) {
//throw new UnsupportedOperationException();
return ids.lastIndexOf(o);
}
@RayDisabled
@Deprecated
@Override
@@ -200,7 +170,7 @@ public class RayList<E> extends ArrayList<E> {
@RayDisabled
@Deprecated
@Override
public ListIterator<E> listIterator(int index) {
public Iterator<E> iterator() {
throw new UnsupportedOperationException();
}
@@ -210,4 +180,34 @@ public class RayList<E> extends ArrayList<E> {
public List<E> subList(int fromIndex, int toIndex) {
throw new UnsupportedOperationException();
}
public Iterator<RayObject<E>> Iterator() {
return ids.iterator();
}
@Override
public boolean containsAll(Collection<?> c) {
//throw new UnsupportedOperationException();
return ids.containsAll(c);
}
public <T> List<T> getMeta() {
List<UniqueID> objectIds = new ArrayList<>();
for (RayObject<E> id : ids) {
objectIds.add(id.getId());
}
return Ray.getMeta(objectIds);
}
public <TMT> TMT getMeta(int index) {
return ids.get(index).getMeta();
}
public RayObject<E> Get(int index) {
return ids.get(index);
}
public RayObject<E> Remove(int index) {
return ids.remove(index);
}
}
+38 -38
View File
@@ -32,15 +32,8 @@ public class RayMap<K, V> extends HashMap<K, V> {
}
@Override
public boolean containsKey(Object key) {
//throw new UnsupportedOperationException();
return ids.containsKey(key);
}
@Override
public boolean containsValue(Object value) {
//throw new UnsupportedOperationException();
return ids.containsValue(value);
public V get(Object key) {
return ids.get(key).get();
}
// TODO: try to use multiple get
@@ -52,26 +45,10 @@ public class RayMap<K, V> extends HashMap<K, V> {
return objs;
}
public <TM> Map<K, TM> getMeta() {
Map<K, TM> metas = new HashMap<>();
for (Map.Entry<K, RayObject<V>> id : ids.entrySet()) {
TM meta = id.getValue().getMeta();
metas.put(id.getKey(), meta);
}
return metas;
}
@Override
public V get(Object key) {
return ids.get(key).get();
}
public <TM> TM getMeta(K key) {
return ids.get(key).getMeta();
}
public RayObject<V> Get(K key) {
return ids.get(key);
public boolean containsKey(Object key) {
//throw new UnsupportedOperationException();
return ids.containsKey(key);
}
@RayDisabled
@@ -88,18 +65,14 @@ public class RayMap<K, V> extends HashMap<K, V> {
@RayDisabled
@Deprecated
@Override
public V remove(Object key) {
public void putAll(Map<? extends K, ? extends V> m) {
throw new UnsupportedOperationException();
}
public RayObject<V> Remove(K key) {
return ids.remove(key);
}
@RayDisabled
@Deprecated
@Override
public void putAll(Map<? extends K, ? extends V> m) {
public V remove(Object key) {
throw new UnsupportedOperationException();
}
@@ -109,6 +82,12 @@ public class RayMap<K, V> extends HashMap<K, V> {
ids.clear();
}
@Override
public boolean containsValue(Object value) {
//throw new UnsupportedOperationException();
return ids.containsValue(value);
}
@Override
public Set<K> keySet() {
return ids.keySet();
@@ -121,10 +100,6 @@ public class RayMap<K, V> extends HashMap<K, V> {
throw new UnsupportedOperationException();
}
public Collection<RayObject<V>> Values() {
return ids.values();
}
@RayDisabled
@Deprecated
@Override
@@ -132,6 +107,31 @@ public class RayMap<K, V> extends HashMap<K, V> {
throw new UnsupportedOperationException();
}
public <TMT> Map<K, TMT> getMeta() {
Map<K, TMT> metas = new HashMap<>();
for (Map.Entry<K, RayObject<V>> id : ids.entrySet()) {
TMT meta = id.getValue().getMeta();
metas.put(id.getKey(), meta);
}
return metas;
}
public <TMT> TMT getMeta(K key) {
return ids.get(key).getMeta();
}
public RayObject<V> Get(K key) {
return ids.get(key);
}
public RayObject<V> Remove(K key) {
return ids.remove(key);
}
public Collection<RayObject<V>> Values() {
return ids.values();
}
public Set<java.util.Map.Entry<K, RayObject<V>>> EntrySet() {
return ids.entrySet();
}
@@ -24,7 +24,7 @@ public class RayObject<T> implements Serializable {
return Ray.get(id);
}
public <TM> TM getMeta() throws TaskExecutionException {
public <TMT> TMT getMeta() throws TaskExecutionException {
return Ray.getMeta(id);
}
@@ -3,7 +3,7 @@ package org.ray.api;
import org.apache.commons.lang3.ArrayUtils;
/**
* Real object or ray future proxy for multiple returns
* Real object or ray future proxy for multiple returns.
*/
public class RayObjects {
@@ -6,15 +6,15 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* a ray remote function or class (as an actor)
* a ray remote function or class (as an actor).
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface RayRemote {
/**
* whether to use external I/O pool to execute the function
* whether to use external I/O pool to execute the function.
*/
boolean externalIO() default false;
boolean externalIo() default false;
}
@@ -1,8 +1,7 @@
package org.ray.api;
/**
* a RPC service that represent the data processing services implemented in Ray
*
* a RPC service that represent the data processing services implemented in Ray.
* it is programmed in other services but will be shipped and executed on ray machines at runtime
*/
public @interface RayService {
@@ -1,6 +1,5 @@
package org.ray.api;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
@@ -12,10 +11,9 @@ import java.util.Random;
*/
public class UniqueID implements Serializable {
private static final long serialVersionUID = 8588849129675565761L;
public static final int LENGTH = 20;
public static final UniqueID nil = genNil();
private static final long serialVersionUID = 8588849129675565761L;
byte[] id;
public UniqueID(byte[] id) {
@@ -42,23 +40,26 @@ public class UniqueID implements Serializable {
}
}
@Override
public String toString() {
String s = "";
String hex = "0123456789abcdef";
for (int i = 0; i < LENGTH; i++) {
int val = id[i] & 0xff;
s += hex.charAt(val >> 4);
s += hex.charAt(val & 0xf);
public static UniqueID genNil() {
byte[] b = new byte[LENGTH];
for (int i = 0; i < b.length; i++) {
b[i] = (byte) 0xFF;
}
return s;
return new UniqueID(b);
}
public static UniqueID randomId() {
byte[] b = new byte[LENGTH];
new Random().nextBytes(b);
return new UniqueID(b);
}
public byte[] getBytes() {
return id;
}
public ByteBuffer ToByteBuffer() {
public ByteBuffer toByteBuffer() {
return ByteBuffer.wrap(id);
}
@@ -91,6 +92,18 @@ public class UniqueID implements Serializable {
return Arrays.equals(id, r.id);
}
@Override
public String toString() {
String s = "";
String hex = "0123456789abcdef";
for (int i = 0; i < LENGTH; i++) {
int val = id[i] & 0xff;
s += hex.charAt(val >> 4);
s += hex.charAt(val & 0xf);
}
return s;
}
public boolean isNil() {
for (byte b : id) {
if (b != (byte) 0xFF) {
@@ -99,21 +112,4 @@ public class UniqueID implements Serializable {
}
return true;
}
public static final UniqueID nil = genNil();
public static UniqueID genNil() {
byte[] b = new byte[LENGTH];
for (int i = 0; i < b.length; i++) {
b[i] = (byte) 0xFF;
}
return new UniqueID(b);
}
public static UniqueID randomID() {
byte[] b = new byte[LENGTH];
new Random().nextBytes(b);
return new UniqueID(b);
}
}
@@ -6,8 +6,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_0_1<R0> extends RayFunc {
R0 apply() throws Throwable;
static <R0> R0 execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_0_1.class.getName()));
@@ -16,4 +14,6 @@ public interface RayFunc_0_1<R0> extends RayFunc {
return f.apply();
}
R0 apply() throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns2;
@FunctionalInterface
public interface RayFunc_0_2<R0, R1> extends RayFunc {
MultipleReturns2<R0, R1> apply() throws Throwable;
static <R0, R1> MultipleReturns2<R0, R1> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_0_2.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_0_2<R0, R1> extends RayFunc {
return f.apply();
}
MultipleReturns2<R0, R1> apply() throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns3;
@FunctionalInterface
public interface RayFunc_0_3<R0, R1, R2> extends RayFunc {
MultipleReturns3<R0, R1, R2> apply() throws Throwable;
static <R0, R1, R2> MultipleReturns3<R0, R1, R2> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_0_3.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_0_3<R0, R1, R2> extends RayFunc {
return f.apply();
}
MultipleReturns3<R0, R1, R2> apply() throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns4;
@FunctionalInterface
public interface RayFunc_0_4<R0, R1, R2, R3> extends RayFunc {
MultipleReturns4<R0, R1, R2, R3> apply() throws Throwable;
static <R0, R1, R2, R3> MultipleReturns4<R0, R1, R2, R3> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_0_4.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_0_4<R0, R1, R2, R3> extends RayFunc {
return f.apply();
}
MultipleReturns4<R0, R1, R2, R3> apply() throws Throwable;
}
@@ -6,16 +6,16 @@ import org.apache.commons.lang3.SerializationUtils;
import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_0_n<R, RID> extends RayFunc {
public interface RayFunc_0_n<R, RIDT> extends RayFunc {
Map<RID, R> apply(Collection<RID> returnids) throws Throwable;
static <R, RID> Map<RID, R> execute(Object[] args) throws Throwable {
static <R, RIDT> Map<RIDT, R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_0_n.class.getName()));
byte[] funcBytes = (byte[]) args[args.length - 1];
RayFunc_0_n<R, RID> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RID>) args[0]);
RayFunc_0_n<R, RIDT> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RIDT>) args[0]);
}
Map<RIDT, R> apply(Collection<RIDT> returnids) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_0_n_list<R> extends RayFunc {
List<R> apply() throws Throwable;
static <R> List<R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_0_n_list.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_0_n_list<R> extends RayFunc {
return f.apply();
}
List<R> apply() throws Throwable;
}
@@ -6,8 +6,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_1_1<T0, R0> extends RayFunc {
R0 apply(T0 t0) throws Throwable;
static <T0, R0> R0 execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_1_1.class.getName()));
@@ -16,4 +14,6 @@ public interface RayFunc_1_1<T0, R0> extends RayFunc {
return f.apply((T0) args[0]);
}
R0 apply(T0 t0) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns2;
@FunctionalInterface
public interface RayFunc_1_2<T0, R0, R1> extends RayFunc {
MultipleReturns2<R0, R1> apply(T0 t0) throws Throwable;
static <T0, R0, R1> MultipleReturns2<R0, R1> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_1_2.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_1_2<T0, R0, R1> extends RayFunc {
return f.apply((T0) args[0]);
}
MultipleReturns2<R0, R1> apply(T0 t0) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns3;
@FunctionalInterface
public interface RayFunc_1_3<T0, R0, R1, R2> extends RayFunc {
MultipleReturns3<R0, R1, R2> apply(T0 t0) throws Throwable;
static <T0, R0, R1, R2> MultipleReturns3<R0, R1, R2> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_1_3.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_1_3<T0, R0, R1, R2> extends RayFunc {
return f.apply((T0) args[0]);
}
MultipleReturns3<R0, R1, R2> apply(T0 t0) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns4;
@FunctionalInterface
public interface RayFunc_1_4<T0, R0, R1, R2, R3> extends RayFunc {
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0) throws Throwable;
static <T0, R0, R1, R2, R3> MultipleReturns4<R0, R1, R2, R3> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_1_4<T0, R0, R1, R2, R3> extends RayFunc {
return f.apply((T0) args[0]);
}
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0) throws Throwable;
}
@@ -6,16 +6,16 @@ import org.apache.commons.lang3.SerializationUtils;
import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_1_n<T0, R, RID> extends RayFunc {
public interface RayFunc_1_n<T0, R, RIDT> extends RayFunc {
Map<RID, R> apply(Collection<RID> returnids, T0 t0) throws Throwable;
static <T0, R, RID> Map<RID, R> execute(Object[] args) throws Throwable {
static <T0, R, RIDT> Map<RIDT, R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_1_n.class.getName()));
byte[] funcBytes = (byte[]) args[args.length - 1];
RayFunc_1_n<T0, R, RID> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RID>) args[0], (T0) args[1]);
RayFunc_1_n<T0, R, RIDT> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RIDT>) args[0], (T0) args[1]);
}
Map<RIDT, R> apply(Collection<RIDT> returnids, T0 t0) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_1_n_list<T0, R> extends RayFunc {
List<R> apply(T0 t0) throws Throwable;
static <T0, R> List<R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_1_n_list.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_1_n_list<T0, R> extends RayFunc {
return f.apply((T0) args[0]);
}
List<R> apply(T0 t0) throws Throwable;
}
@@ -6,8 +6,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_2_1<T0, T1, R0> extends RayFunc {
R0 apply(T0 t0, T1 t1) throws Throwable;
static <T0, T1, R0> R0 execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_2_1.class.getName()));
@@ -16,4 +14,6 @@ public interface RayFunc_2_1<T0, T1, R0> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1]);
}
R0 apply(T0 t0, T1 t1) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns2;
@FunctionalInterface
public interface RayFunc_2_2<T0, T1, R0, R1> extends RayFunc {
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1) throws Throwable;
static <T0, T1, R0, R1> MultipleReturns2<R0, R1> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_2_2.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_2_2<T0, T1, R0, R1> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1]);
}
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns3;
@FunctionalInterface
public interface RayFunc_2_3<T0, T1, R0, R1, R2> extends RayFunc {
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1) throws Throwable;
static <T0, T1, R0, R1, R2> MultipleReturns3<R0, R1, R2> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_2_3.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_2_3<T0, T1, R0, R1, R2> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1]);
}
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns4;
@FunctionalInterface
public interface RayFunc_2_4<T0, T1, R0, R1, R2, R3> extends RayFunc {
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1) throws Throwable;
static <T0, T1, R0, R1, R2, R3> MultipleReturns4<R0, R1, R2, R3> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_2_4<T0, T1, R0, R1, R2, R3> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1]);
}
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1) throws Throwable;
}
@@ -6,16 +6,16 @@ import org.apache.commons.lang3.SerializationUtils;
import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_2_n<T0, T1, R, RID> extends RayFunc {
public interface RayFunc_2_n<T0, T1, R, RIDT> extends RayFunc {
Map<RID, R> apply(Collection<RID> returnids, T0 t0, T1 t1) throws Throwable;
static <T0, T1, R, RID> Map<RID, R> execute(Object[] args) throws Throwable {
static <T0, T1, R, RIDT> Map<RIDT, R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_2_n.class.getName()));
byte[] funcBytes = (byte[]) args[args.length - 1];
RayFunc_2_n<T0, T1, R, RID> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RID>) args[0], (T0) args[1], (T1) args[2]);
RayFunc_2_n<T0, T1, R, RIDT> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RIDT>) args[0], (T0) args[1], (T1) args[2]);
}
Map<RIDT, R> apply(Collection<RIDT> returnids, T0 t0, T1 t1) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_2_n_list<T0, T1, R> extends RayFunc {
List<R> apply(T0 t0, T1 t1) throws Throwable;
static <T0, T1, R> List<R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_2_n_list.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_2_n_list<T0, T1, R> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1]);
}
List<R> apply(T0 t0, T1 t1) throws Throwable;
}
@@ -6,8 +6,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_3_1<T0, T1, T2, R0> extends RayFunc {
R0 apply(T0 t0, T1 t1, T2 t2) throws Throwable;
static <T0, T1, T2, R0> R0 execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_3_1.class.getName()));
@@ -16,4 +14,6 @@ public interface RayFunc_3_1<T0, T1, T2, R0> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2]);
}
R0 apply(T0 t0, T1 t1, T2 t2) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns2;
@FunctionalInterface
public interface RayFunc_3_2<T0, T1, T2, R0, R1> extends RayFunc {
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
static <T0, T1, T2, R0, R1> MultipleReturns2<R0, R1> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_3_2.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_3_2<T0, T1, T2, R0, R1> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2]);
}
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns3;
@FunctionalInterface
public interface RayFunc_3_3<T0, T1, T2, R0, R1, R2> extends RayFunc {
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
static <T0, T1, T2, R0, R1, R2> MultipleReturns3<R0, R1, R2> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_3_3<T0, T1, T2, R0, R1, R2> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2]);
}
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns4;
@FunctionalInterface
public interface RayFunc_3_4<T0, T1, T2, R0, R1, R2, R3> extends RayFunc {
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
static <T0, T1, T2, R0, R1, R2, R3> MultipleReturns4<R0, R1, R2, R3> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_3_4<T0, T1, T2, R0, R1, R2, R3> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2]);
}
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
}
@@ -6,16 +6,16 @@ import org.apache.commons.lang3.SerializationUtils;
import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_3_n<T0, T1, T2, R, RID> extends RayFunc {
public interface RayFunc_3_n<T0, T1, T2, R, RIDT> extends RayFunc {
Map<RID, R> apply(Collection<RID> returnids, T0 t0, T1 t1, T2 t2) throws Throwable;
static <T0, T1, T2, R, RID> Map<RID, R> execute(Object[] args) throws Throwable {
static <T0, T1, T2, R, RIDT> Map<RIDT, R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_3_n.class.getName()));
byte[] funcBytes = (byte[]) args[args.length - 1];
RayFunc_3_n<T0, T1, T2, R, RID> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RID>) args[0], (T0) args[1], (T1) args[2], (T2) args[3]);
RayFunc_3_n<T0, T1, T2, R, RIDT> f = SerializationUtils.deserialize(funcBytes);
return f.apply((Collection<RIDT>) args[0], (T0) args[1], (T1) args[2], (T2) args[3]);
}
Map<RIDT, R> apply(Collection<RIDT> returnids, T0 t0, T1 t1, T2 t2) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_3_n_list<T0, T1, T2, R> extends RayFunc {
List<R> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
static <T0, T1, T2, R> List<R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_3_n_list.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_3_n_list<T0, T1, T2, R> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2]);
}
List<R> apply(T0 t0, T1 t1, T2 t2) throws Throwable;
}
@@ -6,8 +6,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_4_1<T0, T1, T2, T3, R0> extends RayFunc {
R0 apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
static <T0, T1, T2, T3, R0> R0 execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_4_1.class.getName()));
@@ -16,4 +14,6 @@ public interface RayFunc_4_1<T0, T1, T2, T3, R0> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3]);
}
R0 apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns2;
@FunctionalInterface
public interface RayFunc_4_2<T0, T1, T2, T3, R0, R1> extends RayFunc {
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
static <T0, T1, T2, T3, R0, R1> MultipleReturns2<R0, R1> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_4_2.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_4_2<T0, T1, T2, T3, R0, R1> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3]);
}
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns3;
@FunctionalInterface
public interface RayFunc_4_3<T0, T1, T2, T3, R0, R1, R2> extends RayFunc {
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
static <T0, T1, T2, T3, R0, R1, R2> MultipleReturns3<R0, R1, R2> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_4_3<T0, T1, T2, T3, R0, R1, R2> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3]);
}
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns4;
@FunctionalInterface
public interface RayFunc_4_4<T0, T1, T2, T3, R0, R1, R2, R3> extends RayFunc {
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
static <T0, T1, T2, T3, R0, R1, R2, R3> MultipleReturns4<R0, R1, R2, R3> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_4_4<T0, T1, T2, T3, R0, R1, R2, R3> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3]);
}
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
}
@@ -6,17 +6,17 @@ import org.apache.commons.lang3.SerializationUtils;
import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_4_n<T0, T1, T2, T3, R, RID> extends RayFunc {
public interface RayFunc_4_n<T0, T1, T2, T3, R, RIDT> extends RayFunc {
Map<RID, R> apply(Collection<RID> returnids, T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
static <T0, T1, T2, T3, R, RID> Map<RID, R> execute(Object[] args) throws Throwable {
static <T0, T1, T2, T3, R, RIDT> Map<RIDT, R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_4_n.class.getName()));
byte[] funcBytes = (byte[]) args[args.length - 1];
RayFunc_4_n<T0, T1, T2, T3, R, RID> f = SerializationUtils.deserialize(funcBytes);
RayFunc_4_n<T0, T1, T2, T3, R, RIDT> f = SerializationUtils.deserialize(funcBytes);
return f
.apply((Collection<RID>) args[0], (T0) args[1], (T1) args[2], (T2) args[3], (T3) args[4]);
.apply((Collection<RIDT>) args[0], (T0) args[1], (T1) args[2], (T2) args[3], (T3) args[4]);
}
Map<RIDT, R> apply(Collection<RIDT> returnids, T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_4_n_list<T0, T1, T2, T3, R> extends RayFunc {
List<R> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
static <T0, T1, T2, T3, R> List<R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_4_n_list.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_4_n_list<T0, T1, T2, T3, R> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3]);
}
List<R> apply(T0 t0, T1 t1, T2 t2, T3 t3) throws Throwable;
}
@@ -6,8 +6,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_5_1<T0, T1, T2, T3, T4, R0> extends RayFunc {
R0 apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
static <T0, T1, T2, T3, T4, R0> R0 execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_5_1.class.getName()));
@@ -16,4 +14,6 @@ public interface RayFunc_5_1<T0, T1, T2, T3, T4, R0> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4]);
}
R0 apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns2;
@FunctionalInterface
public interface RayFunc_5_2<T0, T1, T2, T3, T4, R0, R1> extends RayFunc {
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
static <T0, T1, T2, T3, T4, R0, R1> MultipleReturns2<R0, R1> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_5_2<T0, T1, T2, T3, T4, R0, R1> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4]);
}
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns3;
@FunctionalInterface
public interface RayFunc_5_3<T0, T1, T2, T3, T4, R0, R1, R2> extends RayFunc {
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
static <T0, T1, T2, T3, T4, R0, R1, R2> MultipleReturns3<R0, R1, R2> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_5_3<T0, T1, T2, T3, T4, R0, R1, R2> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4]);
}
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns4;
@FunctionalInterface
public interface RayFunc_5_4<T0, T1, T2, T3, T4, R0, R1, R2, R3> extends RayFunc {
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
static <T0, T1, T2, T3, T4, R0, R1, R2, R3> MultipleReturns4<R0, R1, R2, R3> execute(
Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
@@ -18,4 +16,6 @@ public interface RayFunc_5_4<T0, T1, T2, T3, T4, R0, R1, R2, R3> extends RayFunc
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4]);
}
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
}
@@ -6,18 +6,19 @@ import org.apache.commons.lang3.SerializationUtils;
import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_5_n<T0, T1, T2, T3, T4, R, RID> extends RayFunc {
public interface RayFunc_5_n<T0, T1, T2, T3, T4, R, RIDT> extends RayFunc {
Map<RID, R> apply(Collection<RID> returnids, T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
static <T0, T1, T2, T3, T4, R, RID> Map<RID, R> execute(Object[] args) throws Throwable {
static <T0, T1, T2, T3, T4, R, RIDT> Map<RIDT, R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_5_n.class.getName()));
byte[] funcBytes = (byte[]) args[args.length - 1];
RayFunc_5_n<T0, T1, T2, T3, T4, R, RID> f = SerializationUtils.deserialize(funcBytes);
RayFunc_5_n<T0, T1, T2, T3, T4, R, RIDT> f = SerializationUtils.deserialize(funcBytes);
return f
.apply((Collection<RID>) args[0], (T0) args[1], (T1) args[2], (T2) args[3], (T3) args[4],
.apply((Collection<RIDT>) args[0], (T0) args[1], (T1) args[2], (T2) args[3], (T3) args[4],
(T4) args[5]);
}
Map<RIDT, R> apply(Collection<RIDT> returnids, T0 t0, T1 t1, T2 t2, T3 t3, T4 t4)
throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_5_n_list<T0, T1, T2, T3, T4, R> extends RayFunc {
List<R> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
static <T0, T1, T2, T3, T4, R> List<R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_5_n_list.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_5_n_list<T0, T1, T2, T3, T4, R> extends RayFunc {
return f.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4]);
}
List<R> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) throws Throwable;
}
@@ -6,8 +6,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_6_1<T0, T1, T2, T3, T4, T5, R0> extends RayFunc {
R0 apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
static <T0, T1, T2, T3, T4, T5, R0> R0 execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_6_1.class.getName()));
@@ -17,4 +15,6 @@ public interface RayFunc_6_1<T0, T1, T2, T3, T4, T5, R0> extends RayFunc {
.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4], (T5) args[5]);
}
R0 apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns2;
@FunctionalInterface
public interface RayFunc_6_2<T0, T1, T2, T3, T4, T5, R0, R1> extends RayFunc {
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
static <T0, T1, T2, T3, T4, T5, R0, R1> MultipleReturns2<R0, R1> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -19,4 +17,6 @@ public interface RayFunc_6_2<T0, T1, T2, T3, T4, T5, R0, R1> extends RayFunc {
.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4], (T5) args[5]);
}
MultipleReturns2<R0, R1> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns3;
@FunctionalInterface
public interface RayFunc_6_3<T0, T1, T2, T3, T4, T5, R0, R1, R2> extends RayFunc {
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
static <T0, T1, T2, T3, T4, T5, R0, R1, R2> MultipleReturns3<R0, R1, R2> execute(Object[] args)
throws Throwable {
String name = (String) args[args.length - 2];
@@ -19,4 +17,6 @@ public interface RayFunc_6_3<T0, T1, T2, T3, T4, T5, R0, R1, R2> extends RayFunc
.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4], (T5) args[5]);
}
MultipleReturns3<R0, R1, R2> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.returns.MultipleReturns4;
@FunctionalInterface
public interface RayFunc_6_4<T0, T1, T2, T3, T4, T5, R0, R1, R2, R3> extends RayFunc {
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
static <T0, T1, T2, T3, T4, T5, R0, R1, R2, R3> MultipleReturns4<R0, R1, R2, R3> execute(
Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
@@ -20,4 +18,6 @@ public interface RayFunc_6_4<T0, T1, T2, T3, T4, T5, R0, R1, R2, R3> extends Ray
.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4], (T5) args[5]);
}
MultipleReturns4<R0, R1, R2, R3> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
}
@@ -6,19 +6,19 @@ import org.apache.commons.lang3.SerializationUtils;
import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_6_n<T0, T1, T2, T3, T4, T5, R, RID> extends RayFunc {
public interface RayFunc_6_n<T0, T1, T2, T3, T4, T5, R, RIDT> extends RayFunc {
Map<RID, R> apply(Collection<RID> returnids, T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
throws Throwable;
static <T0, T1, T2, T3, T4, T5, R, RID> Map<RID, R> execute(Object[] args) throws Throwable {
static <T0, T1, T2, T3, T4, T5, R, RIDT> Map<RIDT, R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_6_n.class.getName()));
byte[] funcBytes = (byte[]) args[args.length - 1];
RayFunc_6_n<T0, T1, T2, T3, T4, T5, R, RID> f = SerializationUtils.deserialize(funcBytes);
RayFunc_6_n<T0, T1, T2, T3, T4, T5, R, RIDT> f = SerializationUtils.deserialize(funcBytes);
return f
.apply((Collection<RID>) args[0], (T0) args[1], (T1) args[2], (T2) args[3], (T3) args[4],
.apply((Collection<RIDT>) args[0], (T0) args[1], (T1) args[2], (T2) args[3], (T3) args[4],
(T4) args[5], (T5) args[6]);
}
Map<RIDT, R> apply(Collection<RIDT> returnids, T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
throws Throwable;
}
@@ -7,8 +7,6 @@ import org.ray.api.internal.RayFunc;
@FunctionalInterface
public interface RayFunc_6_n_list<T0, T1, T2, T3, T4, T5, R> extends RayFunc {
List<R> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
static <T0, T1, T2, T3, T4, T5, R> List<R> execute(Object[] args) throws Throwable {
String name = (String) args[args.length - 2];
assert (name.equals(RayFunc_6_n_list.class.getName()));
@@ -18,4 +16,6 @@ public interface RayFunc_6_n_list<T0, T1, T2, T3, T4, T5, R> extends RayFunc {
.apply((T0) args[0], (T1) args[1], (T2) args[2], (T3) args[3], (T4) args[4], (T5) args[5]);
}
List<R> apply(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Throwable;
}
@@ -1,7 +1,7 @@
package org.ray.api.internal;
/**
* hold the remote call
* hold the remote call.
*/
public interface Callable {
@@ -3,7 +3,7 @@ package org.ray.api.internal;
import java.io.Serializable;
/**
* Base of the ray remote function
* Base of the ray remote function.
*/
public interface RayFunc extends Serializable {
@@ -1,13 +1,13 @@
package org.ray.api.returns;
/**
* Multiple return objects for user's method
* Multiple return objects for user's method.
*/
public class MultipleReturns {
protected final Object[] values;
public MultipleReturns(Object values[]) {
public MultipleReturns(Object[] values) {
this.values = values;
}
@@ -4,7 +4,7 @@ package org.ray.api.returns;
public class MultipleReturns2<R0, R1> extends MultipleReturns {
public MultipleReturns2(R0 r0, R1 r1) {
super(new Object[]{r0, r1});
super(new Object[] {r0, r1});
}
public R0 get0() {
@@ -4,7 +4,7 @@ package org.ray.api.returns;
public class MultipleReturns3<R0, R1, R2> extends MultipleReturns {
public MultipleReturns3(R0 r0, R1 r1, R2 r2) {
super(new Object[]{r0, r1, r2});
super(new Object[] {r0, r1, r2});
}
public R0 get0() {
@@ -4,7 +4,7 @@ package org.ray.api.returns;
public class MultipleReturns4<R0, R1, R2, R3> extends MultipleReturns {
public MultipleReturns4(R0 r0, R1 r1, R2 r2, R3 r3) {
super(new Object[]{r0, r1, r2, r3});
super(new Object[] {r0, r1, r2, r3});
}
public R0 get0() {
@@ -11,7 +11,7 @@ public class RayObjects2<R0, R1> extends RayObjects {
super(ids);
}
public RayObjects2(RayObject objs[]) {
public RayObjects2(RayObject[] objs) {
super(objs);
}
@@ -11,7 +11,7 @@ public class RayObjects3<R0, R1, R2> extends RayObjects {
super(ids);
}
public RayObjects3(RayObject objs[]) {
public RayObjects3(RayObject[] objs) {
super(objs);
}
@@ -11,7 +11,7 @@ public class RayObjects4<R0, R1, R2, R3> extends RayObjects {
super(ids);
}
public RayObjects4(RayObject objs[]) {
public RayObjects4(RayObject[] objs) {
super(objs);
}