mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
[java] refine and simplify java worker code structure (#2838)
This commit is contained in:
parent
588c573d41
commit
8414e413a2
97 changed files with 749 additions and 1344 deletions
|
@ -1,42 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<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>
|
||||
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>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.arrow</groupId>
|
||||
<artifactId>arrow-plasma</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<name>ray api</name>
|
||||
<description>java api for ray</description>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,13 @@
|
|||
|
||||
package org.ray.api;
|
||||
|
||||
import org.ray.api.function.*;
|
||||
import org.ray.api.function.RayFunc0;
|
||||
import org.ray.api.function.RayFunc1;
|
||||
import org.ray.api.function.RayFunc2;
|
||||
import org.ray.api.function.RayFunc3;
|
||||
import org.ray.api.function.RayFunc4;
|
||||
import org.ray.api.function.RayFunc5;
|
||||
import org.ray.api.function.RayFunc6;
|
||||
|
||||
/**
|
||||
* This class provides type-safe interfaces for `Ray.call` and `Ray.createActor`.
|
||||
|
|
|
@ -10,7 +10,7 @@ public class DefaultRayRuntimeFactory implements RayRuntimeFactory {
|
|||
@Override
|
||||
public RayRuntime createRayRuntime() {
|
||||
try {
|
||||
Method m = Class.forName("org.ray.core.AbstractRayRuntime").getDeclaredMethod("init");
|
||||
Method m = Class.forName("org.ray.runtime.AbstractRayRuntime").getDeclaredMethod("init");
|
||||
m.setAccessible(true);
|
||||
RayRuntime runtime = (RayRuntime) m.invoke(null);
|
||||
m.setAccessible(false);
|
||||
|
|
|
@ -12,9 +12,8 @@
|
|||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-cli</artifactId>
|
||||
|
||||
<name>java cli for ray</name>
|
||||
<name>java cli</name>
|
||||
<description>java cli for ray</description>
|
||||
<url></url>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
@ -26,25 +25,21 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-native</artifactId>
|
||||
<artifactId>ray-runtime</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.davidmoten</groupId>
|
||||
<artifactId>flatbuffers-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.beust/jcommander -->
|
||||
<dependency>
|
||||
<groupId>com.beust</groupId>
|
||||
<artifactId>jcommander</artifactId>
|
||||
|
@ -71,8 +66,8 @@
|
|||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
|
@ -92,7 +87,5 @@
|
|||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -7,20 +7,20 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import net.lingala.zip4j.core.ZipFile;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.model.RayParameters;
|
||||
import org.ray.core.model.RunMode;
|
||||
import org.ray.runner.RunManager;
|
||||
import org.ray.runner.worker.DefaultDriver;
|
||||
import org.ray.spi.KeyValueStoreLink;
|
||||
import org.ray.spi.PathConfig;
|
||||
import org.ray.spi.RemoteFunctionManager;
|
||||
import org.ray.spi.StateStoreProxy;
|
||||
import org.ray.spi.impl.NativeRemoteFunctionManager;
|
||||
import org.ray.spi.impl.RedisClient;
|
||||
import org.ray.spi.impl.StateStoreProxyImpl;
|
||||
import org.ray.util.FileUtil;
|
||||
import org.ray.util.config.ConfigReader;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.config.PathConfig;
|
||||
import org.ray.runtime.config.RayParameters;
|
||||
import org.ray.runtime.config.RunMode;
|
||||
import org.ray.runtime.functionmanager.NativeRemoteFunctionManager;
|
||||
import org.ray.runtime.functionmanager.RemoteFunctionManager;
|
||||
import org.ray.runtime.gcs.KeyValueStoreLink;
|
||||
import org.ray.runtime.gcs.RedisClient;
|
||||
import org.ray.runtime.gcs.StateStoreProxy;
|
||||
import org.ray.runtime.gcs.StateStoreProxyImpl;
|
||||
import org.ray.runtime.runner.RunManager;
|
||||
import org.ray.runtime.runner.worker.DefaultDriver;
|
||||
import org.ray.runtime.util.FileUtil;
|
||||
import org.ray.runtime.util.config.ConfigReader;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
package org.ray.util;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Common utilities.
|
||||
*/
|
||||
public class CommonUtil {
|
||||
|
||||
private static final Random seed = new Random();
|
||||
|
||||
/**
|
||||
* Get random number between 0 and (max-1).
|
||||
*/
|
||||
public static int getRandom(int max) {
|
||||
return Math.abs(seed.nextInt() % max);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package org.ray.util;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.MessageDigest;
|
||||
import org.ray.util.logger.RayLog;
|
||||
|
||||
public class MD5Digestor {
|
||||
|
||||
private static final ThreadLocal<MessageDigest> md = ThreadLocal.withInitial(() -> {
|
||||
try {
|
||||
return MessageDigest.getInstance("MD5");
|
||||
} catch (Exception e) {
|
||||
RayLog.core.error("cannot get MD5 MessageDigest", e);
|
||||
throw new RuntimeException("cannot get MD5 digest", e);
|
||||
}
|
||||
});
|
||||
|
||||
private static final ThreadLocal<ByteBuffer> longBuffer = ThreadLocal
|
||||
.withInitial(() -> ByteBuffer.allocate(Long.SIZE / Byte.SIZE));
|
||||
|
||||
public static byte[] digest(byte[] src, long addIndex) {
|
||||
MessageDigest dg = md.get();
|
||||
longBuffer.get().clear();
|
||||
dg.reset();
|
||||
|
||||
dg.update(src);
|
||||
dg.update(longBuffer.get().putLong(addIndex).array());
|
||||
return dg.digest();
|
||||
}
|
||||
}
|
515
java/pom.xml
515
java/pom.xml
|
@ -1,306 +1,231 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<groupId>org.ray.parent</groupId>
|
||||
<artifactId>ray-superpom</artifactId>
|
||||
<version>1.0</version>
|
||||
<modules>
|
||||
<module>api</module>
|
||||
<module>runtime</module>
|
||||
<module>cli</module>
|
||||
<module>test</module>
|
||||
<module>tutorial</module>
|
||||
</modules>
|
||||
|
||||
<groupId>org.ray.parent</groupId>
|
||||
<artifactId>ray-superpom</artifactId>
|
||||
<version>1.0</version>
|
||||
<modules>
|
||||
<module>api</module>
|
||||
<module>common</module>
|
||||
<module>runtime-common</module>
|
||||
<module>runtime-native</module>
|
||||
<module>runtime-dev</module>
|
||||
<module>cli</module>
|
||||
<module>test</module>
|
||||
<module>tutorial</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<projetct.version>1.0</projetct.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
</properties>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<projetct.version>1.0</projetct.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.arrow</groupId>
|
||||
<artifactId>arrow-plasma</artifactId>
|
||||
<version>0.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
<version>2.47</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ini4j</groupId>
|
||||
<artifactId>ini4j</artifactId>
|
||||
<version>0.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.davidmoten</groupId>
|
||||
<artifactId>flatbuffers-java</artifactId>
|
||||
<version>1.9.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.beust</groupId>
|
||||
<artifactId>jcommander</artifactId>
|
||||
<version>1.72</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>19.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>1.10.19</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<compilerArgument>-parameters</compilerArgument>
|
||||
<testCompilerArgument>-parameters</testCompilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.10</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.26</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>deploy</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>2.17</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.arrow</groupId>
|
||||
<artifactId>arrow-plasma</artifactId>
|
||||
<version>0.10.0</version>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>6.19</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
<version>2.47</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>quartz</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>1.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ini4j</groupId>
|
||||
<artifactId>ini4j</artifactId>
|
||||
<version>0.5.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>6.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.github.davidmoten/flatbuffers-java -->
|
||||
<dependency>
|
||||
<groupId>com.github.davidmoten</groupId>
|
||||
<artifactId>flatbuffers-java</artifactId>
|
||||
<version>1.9.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.beust/jcommander -->
|
||||
<dependency>
|
||||
<groupId>com.beust</groupId>
|
||||
<artifactId>jcommander</artifactId>
|
||||
<version>1.72</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
|
||||
<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>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>19.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--log-->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.beust/jcommander -->
|
||||
<dependency>
|
||||
<groupId>com.beust</groupId>
|
||||
<artifactId>jcommander</artifactId>
|
||||
<version>1.72</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.30</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.hadoop</groupId>
|
||||
<artifactId>hadoop-common</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.hadoop</groupId>
|
||||
<artifactId>hadoop-client</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.hadoop</groupId>
|
||||
<artifactId>hadoop-hdfs</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.esotericsoftware</groupId>
|
||||
<artifactId>kryo</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>1.10.19</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<compilerArgument>-parameters</compilerArgument>
|
||||
<testCompilerArgument>-parameters</testCompilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.10</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.26</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>deploy</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>2.17</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>6.19</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>validate</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<configLocation>checkstyle.xml</configLocation>
|
||||
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<failsOnError>false</failsOnError>
|
||||
<failOnViolation>true</failOnViolation>
|
||||
<violationSeverity>warning</violationSeverity>
|
||||
<format>xml</format>
|
||||
<format>html</format>
|
||||
<outputFile>${project.build.directory}/test/checkstyle-errors.xml
|
||||
</outputFile>
|
||||
<linkXRef>false</linkXRef>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>validate</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<configLocation>checkstyle.xml</configLocation>
|
||||
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<failsOnError>false</failsOnError>
|
||||
<failOnViolation>true</failOnViolation>
|
||||
<violationSeverity>warning</violationSeverity>
|
||||
<format>xml</format>
|
||||
<format>html</format>
|
||||
<outputFile>${project.build.directory}/checkstyle-errors.xml
|
||||
</outputFile>
|
||||
<linkXRef>false</linkXRef>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -70,20 +70,11 @@ driver_args =
|
|||
[ray.java.start.job]
|
||||
|
||||
[ray.java.path.classes.source]
|
||||
%CONFIG_FILE_DIR%/common/target/classes =
|
||||
%CONFIG_FILE_DIR%/common/target/test-classes =
|
||||
|
||||
%CONFIG_FILE_DIR%/api/target/classes =
|
||||
%CONFIG_FILE_DIR%/api/target/test-classes =
|
||||
|
||||
%CONFIG_FILE_DIR%/runtime-common/target/classes =
|
||||
%CONFIG_FILE_DIR%/runtime-common/target/test-classes =
|
||||
|
||||
%CONFIG_FILE_DIR%/runtime-dev/target/classes =
|
||||
%CONFIG_FILE_DIR%/runtime-dev/target/test-classes =
|
||||
|
||||
%CONFIG_FILE_DIR%/runtime-native/target/classes =
|
||||
%CONFIG_FILE_DIR%/runtime-native/target/test-classes =
|
||||
%CONFIG_FILE_DIR%/runtime/target/classes =
|
||||
%CONFIG_FILE_DIR%/runtime/target/test-classes =
|
||||
|
||||
%CONFIG_FILE_DIR%/tutorial/target/classes =
|
||||
|
||||
|
@ -92,11 +83,8 @@ driver_args =
|
|||
%CONFIG_FILE_DIR%/test/lib/* =
|
||||
|
||||
[ray.java.path.classes.package]
|
||||
%CONFIG_FILE_DIR%/common/target/ray-common-1.0.jar =
|
||||
%CONFIG_FILE_DIR%/api/target/ray-api-1.0.jar =
|
||||
%CONFIG_FILE_DIR%/runtime-common/target/ray-runtime-common-1.0.jar =
|
||||
%CONFIG_FILE_DIR%/runtime-dev/target/ray-runtime-dev-1.0.jar =
|
||||
%CONFIG_FILE_DIR%/runtime-native/target/ray-runtime-native-1.0.jar =
|
||||
%CONFIG_FILE_DIR%/runtime/target/ray-runtime-1.0.jar =
|
||||
|
||||
%CONFIG_FILE_DIR%/test/target/ray-test-1.0.jar =
|
||||
%CONFIG_FILE_DIR%/test/target/test-classes =
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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-runtime-common</artifactId>
|
||||
|
||||
<name>runtime common</name>
|
||||
<description>runtime common</description>
|
||||
<url></url>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.github.davidmoten/flatbuffers-java -->
|
||||
<dependency>
|
||||
<groupId>com.github.davidmoten</groupId>
|
||||
<artifactId>flatbuffers-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.arrow</groupId>
|
||||
<artifactId>arrow-plasma</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,50 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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-runtime-dev</artifactId>
|
||||
|
||||
<name>runtime-dev</name>
|
||||
<description>runtime for app development</description>
|
||||
<url></url>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.github.davidmoten/flatbuffers-java -->
|
||||
<dependency>
|
||||
<groupId>com.github.davidmoten</groupId>
|
||||
<artifactId>flatbuffers-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,15 +0,0 @@
|
|||
<assembly>
|
||||
<id>ear</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
|
||||
</fileSets>
|
||||
</assembly>
|
|
@ -1,78 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<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-runtime-native</artifactId>
|
||||
|
||||
<name>native runtime for ray</name>
|
||||
<description>native runtime for ray</description>
|
||||
<url></url>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.arrow</groupId>
|
||||
<artifactId>arrow-plasma</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>ray-runtime-deploy</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -1,88 +0,0 @@
|
|||
package org.ray.spi;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
public interface FileStoreLink {
|
||||
|
||||
boolean mkdirs(String f);
|
||||
|
||||
/**
|
||||
* Check if exists.
|
||||
*
|
||||
* @param f source file
|
||||
*/
|
||||
boolean exists(String f);
|
||||
|
||||
/**
|
||||
* True if the named path is a directory.
|
||||
*
|
||||
* @param f path to check
|
||||
*/
|
||||
boolean isDirectory(String f);
|
||||
|
||||
/**
|
||||
* True if the named path is a regular file.
|
||||
*
|
||||
* @param f path to check
|
||||
*/
|
||||
boolean isFile(String f);
|
||||
|
||||
/**
|
||||
* delete a file.
|
||||
*
|
||||
* @param f the path to delete.
|
||||
* @param recursive if path is a directory and set to true, the directory is deleted else throws
|
||||
* an exception. In case of a file the recursive can be set to either true or
|
||||
* false.
|
||||
* @return true if delete is successful else false.
|
||||
*/
|
||||
boolean delete(String f, boolean recursive);
|
||||
|
||||
/**
|
||||
* The src file is on the local disk. Add it to FS at the given dst name and the source is kept
|
||||
* intact afterwards
|
||||
*
|
||||
* @param src path
|
||||
* @param dst path
|
||||
*/
|
||||
void copyFromLocalFile(String src, String dst);
|
||||
|
||||
/**
|
||||
* The src file is under FS, and the dst is on the local disk. Copy it from FS control to the
|
||||
* local dst name.
|
||||
*
|
||||
* @param src path
|
||||
* @param dst path
|
||||
*/
|
||||
void copyToLocalFile(String src, String dst);
|
||||
|
||||
/**
|
||||
* Create an FSDataOutputStream at the indicated Path. Files are overwritten by default.
|
||||
*
|
||||
* @param f the file to create
|
||||
*/
|
||||
DataOutputStream create(String f, boolean overwrite);
|
||||
|
||||
/**
|
||||
* Opens an FSDataInputStream at the indicated Path.
|
||||
*
|
||||
* @param f the file name to open
|
||||
*/
|
||||
DataInputStream open(String f);
|
||||
|
||||
/**
|
||||
* Append to an existing file (optional operation).
|
||||
*
|
||||
* @param f the existing file to be appended.
|
||||
*/
|
||||
DataOutputStream append(String f);
|
||||
|
||||
/**
|
||||
* get the file length which is located in the file store.
|
||||
*
|
||||
* @param f the existing file path.
|
||||
*/
|
||||
int fileLength(String f);
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package org.ray.spi.impl;
|
||||
|
||||
/**
|
||||
* This exception is raised if the object could not be created because there already is an object
|
||||
* with the same ID in the plasma store.
|
||||
*/
|
||||
public class PlasmaObjectExistsException extends Exception {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 9128880292504270291L;
|
||||
|
||||
public PlasmaObjectExistsException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PlasmaObjectExistsException(String message, Throwable cause, boolean enableSuppression,
|
||||
boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
public PlasmaObjectExistsException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public PlasmaObjectExistsException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public PlasmaObjectExistsException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package org.ray.spi.impl;
|
||||
|
||||
/**
|
||||
* This exception is raised if the object could not be created because the plasma store is unable to
|
||||
* evict enough objects to create room for it.
|
||||
*/
|
||||
public class PlasmaOutOfMemoryException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -2786069077559520659L;
|
||||
|
||||
public PlasmaOutOfMemoryException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PlasmaOutOfMemoryException(String message, Throwable cause, boolean enableSuppression,
|
||||
boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
public PlasmaOutOfMemoryException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public PlasmaOutOfMemoryException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public PlasmaOutOfMemoryException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<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">
|
||||
|
@ -9,12 +8,11 @@
|
|||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-common</artifactId>
|
||||
<name>java common and util for ray</name>
|
||||
<description>java common and util for ray</description>
|
||||
<url></url>
|
||||
<artifactId>ray-runtime</artifactId>
|
||||
|
||||
<name>ray runtime</name>
|
||||
<description>ray runtime implementation</description>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
@ -25,12 +23,40 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>quartz</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.davidmoten</groupId>
|
||||
<artifactId>flatbuffers-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.arrow</groupId>
|
||||
<artifactId>arrow-plasma</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ini4j</groupId>
|
||||
|
@ -40,9 +66,5 @@
|
|||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,8 +1,6 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
@ -17,19 +15,22 @@ import org.ray.api.WaitResult;
|
|||
import org.ray.api.function.RayFunc;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.api.runtime.RayRuntime;
|
||||
import org.ray.core.model.RayParameters;
|
||||
import org.ray.spi.LocalSchedulerLink;
|
||||
import org.ray.spi.ObjectStoreProxy;
|
||||
import org.ray.spi.ObjectStoreProxy.GetStatus;
|
||||
import org.ray.spi.PathConfig;
|
||||
import org.ray.spi.RemoteFunctionManager;
|
||||
import org.ray.spi.model.RayMethod;
|
||||
import org.ray.spi.model.TaskSpec;
|
||||
import org.ray.util.MethodId;
|
||||
import org.ray.util.ResourceUtil;
|
||||
import org.ray.util.config.ConfigReader;
|
||||
import org.ray.util.exception.TaskExecutionException;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.config.PathConfig;
|
||||
import org.ray.runtime.config.RayParameters;
|
||||
import org.ray.runtime.functionmanager.LocalFunctionManager;
|
||||
import org.ray.runtime.functionmanager.RayMethod;
|
||||
import org.ray.runtime.functionmanager.RemoteFunctionManager;
|
||||
import org.ray.runtime.objectstore.ObjectStoreProxy;
|
||||
import org.ray.runtime.objectstore.ObjectStoreProxy.GetStatus;
|
||||
import org.ray.runtime.raylet.RayletClient;
|
||||
import org.ray.runtime.task.ArgumentsBuilder;
|
||||
import org.ray.runtime.task.TaskSpec;
|
||||
import org.ray.runtime.util.MethodId;
|
||||
import org.ray.runtime.util.ResourceUtil;
|
||||
import org.ray.runtime.util.UniqueIdHelper;
|
||||
import org.ray.runtime.util.config.ConfigReader;
|
||||
import org.ray.runtime.util.exception.TaskExecutionException;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* Core functionality to implement Ray APIs.
|
||||
|
@ -41,7 +42,7 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
protected static RayParameters params = null;
|
||||
private static boolean fromRayInit = false;
|
||||
protected Worker worker;
|
||||
protected LocalSchedulerLink localSchedulerClient;
|
||||
protected RayletClient rayletClient;
|
||||
protected ObjectStoreProxy objectStoreProxy;
|
||||
protected LocalFunctionManager functions;
|
||||
protected RemoteFunctionManager remoteFunctionManager;
|
||||
|
@ -118,7 +119,7 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
}
|
||||
|
||||
protected void init(
|
||||
LocalSchedulerLink slink,
|
||||
RayletClient slink,
|
||||
ObjectStoreLink plink,
|
||||
RemoteFunctionManager remoteLoader,
|
||||
PathConfig pathManager
|
||||
|
@ -127,35 +128,18 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
pathConfig = pathManager;
|
||||
|
||||
functions = new LocalFunctionManager(remoteLoader);
|
||||
localSchedulerClient = slink;
|
||||
rayletClient = slink;
|
||||
|
||||
objectStoreProxy = new ObjectStoreProxy(plink);
|
||||
worker = new Worker(this);
|
||||
}
|
||||
|
||||
private static AbstractRayRuntime instantiate(RayParameters params) {
|
||||
String className = params.run_mode.isNativeRuntime()
|
||||
? "org.ray.core.impl.RayNativeRuntime" : "org.ray.core.impl.RayDevRuntime";
|
||||
|
||||
AbstractRayRuntime runtime;
|
||||
try {
|
||||
Class<?> cls = Class.forName(className);
|
||||
if (cls.getConstructors().length > 0) {
|
||||
throw new Error(
|
||||
"The AbstractRayRuntime final class should not have any public constructor.");
|
||||
}
|
||||
Constructor<?> cons = cls.getDeclaredConstructor();
|
||||
cons.setAccessible(true);
|
||||
runtime = (AbstractRayRuntime) cons.newInstance();
|
||||
cons.setAccessible(false);
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
|
||||
| InvocationTargetException | SecurityException | ClassNotFoundException
|
||||
| NoSuchMethodException e) {
|
||||
RayLog.core
|
||||
.error("Load class " + className + " failed for run-mode " + params.run_mode.toString(),
|
||||
e);
|
||||
throw new Error("AbstractRayRuntime not registered for run-mode "
|
||||
+ params.run_mode.toString());
|
||||
if (params.run_mode.isNativeRuntime()) {
|
||||
runtime = new RayNativeRuntime();
|
||||
} else {
|
||||
runtime = new RayDevRuntime();
|
||||
}
|
||||
|
||||
RayLog.core
|
||||
|
@ -219,7 +203,7 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
List<List<UniqueId>> fetchBatches =
|
||||
splitIntoBatches(objectIds, params.worker_fetch_request_size);
|
||||
for (List<UniqueId> batch : fetchBatches) {
|
||||
localSchedulerClient.reconstructObjects(batch, true);
|
||||
rayletClient.reconstructObjects(batch, true);
|
||||
}
|
||||
|
||||
// Get the objects. We initially try to get the objects immediately.
|
||||
|
@ -244,7 +228,7 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
splitIntoBatches(unreadyList, params.worker_fetch_request_size);
|
||||
|
||||
for (List<UniqueId> batch : reconstructBatches) {
|
||||
localSchedulerClient.reconstructObjects(batch, false);
|
||||
rayletClient.reconstructObjects(batch, false);
|
||||
}
|
||||
|
||||
List<Pair<T, GetStatus>> results = objectStoreProxy
|
||||
|
@ -279,14 +263,14 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
// If there were objects that we weren't able to get locally, let the local
|
||||
// scheduler know that we're now unblocked.
|
||||
if (wasBlocked) {
|
||||
localSchedulerClient.notifyUnblocked();
|
||||
rayletClient.notifyUnblocked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void free(List<UniqueId> objectIds, boolean localOnly) {
|
||||
localSchedulerClient.freePlasmaObjects(objectIds, localOnly);
|
||||
rayletClient.freePlasmaObjects(objectIds, localOnly);
|
||||
}
|
||||
|
||||
private List<List<UniqueId>> splitIntoBatches(List<UniqueId> objectIds, int batchSize) {
|
||||
|
@ -307,13 +291,13 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
|
||||
@Override
|
||||
public <T> WaitResult<T> wait(List<RayObject<T>> waitList, int numReturns, int timeoutMs) {
|
||||
return localSchedulerClient.wait(waitList, numReturns, timeoutMs);
|
||||
return rayletClient.wait(waitList, numReturns, timeoutMs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayObject call(RayFunc func, Object[] args) {
|
||||
TaskSpec spec = createTaskSpec(func, RayActorImpl.NIL, args, false);
|
||||
localSchedulerClient.submitTask(spec);
|
||||
rayletClient.submitTask(spec);
|
||||
return new RayObjectImpl(spec.returnIds[0]);
|
||||
}
|
||||
|
||||
|
@ -325,7 +309,7 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
RayActorImpl actorImpl = (RayActorImpl)actor;
|
||||
TaskSpec spec = createTaskSpec(func, actorImpl, args, false);
|
||||
actorImpl.setTaskCursor(spec.returnIds[1]);
|
||||
localSchedulerClient.submitTask(spec);
|
||||
rayletClient.submitTask(spec);
|
||||
return new RayObjectImpl(spec.returnIds[0]);
|
||||
}
|
||||
|
||||
|
@ -336,7 +320,7 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
RayActorImpl<?> actor = new RayActorImpl(spec.returnIds[0]);
|
||||
actor.increaseTaskCounter();
|
||||
actor.setTaskCursor(spec.returnIds[0]);
|
||||
localSchedulerClient.submitTask(spec);
|
||||
rayletClient.submitTask(spec);
|
||||
return (RayActor<T>) actor;
|
||||
}
|
||||
|
||||
|
@ -362,7 +346,7 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
private TaskSpec createTaskSpec(RayFunc func, RayActorImpl actor, Object[] args,
|
||||
boolean isActorCreationTask) {
|
||||
final TaskSpec current = WorkerContext.currentTask();
|
||||
UniqueId taskId = localSchedulerClient.generateTaskId(current.driverId,
|
||||
UniqueId taskId = rayletClient.generateTaskId(current.driverId,
|
||||
current.taskId,
|
||||
WorkerContext.nextCallIndex());
|
||||
int numReturns = actor.getId().isNil() ? 1 : 2;
|
||||
|
@ -411,8 +395,8 @@ public abstract class AbstractRayRuntime implements RayRuntime {
|
|||
return worker;
|
||||
}
|
||||
|
||||
public LocalSchedulerLink getLocalSchedulerClient() {
|
||||
return localSchedulerClient;
|
||||
public RayletClient getRayletClient() {
|
||||
return rayletClient;
|
||||
}
|
||||
|
||||
public LocalFunctionManager getLocalFunctionManager() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime;
|
||||
|
||||
import java.io.Externalizable;
|
||||
import java.io.IOException;
|
||||
|
@ -6,7 +6,7 @@ import java.io.ObjectInput;
|
|||
import java.io.ObjectOutput;
|
||||
import org.ray.api.RayActor;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.util.Sha1Digestor;
|
||||
import org.ray.runtime.util.Sha1Digestor;
|
||||
|
||||
public final class RayActorImpl<T> implements RayActor<T>, Externalizable {
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
package org.ray.core.impl;
|
||||
package org.ray.runtime;
|
||||
|
||||
import org.ray.core.AbstractRayRuntime;
|
||||
import org.ray.core.model.RayParameters;
|
||||
import org.ray.spi.NopRemoteFunctionManager;
|
||||
import org.ray.spi.PathConfig;
|
||||
import org.ray.spi.RemoteFunctionManager;
|
||||
import org.ray.spi.impl.MockLocalScheduler;
|
||||
import org.ray.spi.impl.MockObjectStore;
|
||||
import org.ray.runtime.config.PathConfig;
|
||||
import org.ray.runtime.config.RayParameters;
|
||||
import org.ray.runtime.functionmanager.NopRemoteFunctionManager;
|
||||
import org.ray.runtime.functionmanager.RemoteFunctionManager;
|
||||
import org.ray.runtime.objectstore.MockObjectStore;
|
||||
import org.ray.runtime.raylet.MockRayletClient;
|
||||
|
||||
public class RayDevRuntime extends AbstractRayRuntime {
|
||||
|
||||
|
@ -15,7 +14,7 @@ public class RayDevRuntime extends AbstractRayRuntime {
|
|||
PathConfig pathConfig = new PathConfig(configReader);
|
||||
RemoteFunctionManager rfm = new NopRemoteFunctionManager(params.driver_id);
|
||||
MockObjectStore store = new MockObjectStore();
|
||||
MockLocalScheduler scheduler = new MockLocalScheduler(this, store);
|
||||
MockRayletClient scheduler = new MockRayletClient(this, store);
|
||||
init(scheduler, store, rfm, pathConfig);
|
||||
scheduler.setLocalFunctionManager(this.functions);
|
||||
}
|
|
@ -1,27 +1,25 @@
|
|||
package org.ray.core.impl;
|
||||
package org.ray.runtime;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.arrow.plasma.ObjectStoreLink;
|
||||
import org.apache.arrow.plasma.PlasmaClient;
|
||||
import org.ray.core.AbstractRayRuntime;
|
||||
import org.ray.core.WorkerContext;
|
||||
import org.ray.core.model.RayParameters;
|
||||
import org.ray.core.model.WorkerMode;
|
||||
import org.ray.runner.RunManager;
|
||||
import org.ray.spi.KeyValueStoreLink;
|
||||
import org.ray.spi.LocalSchedulerLink;
|
||||
import org.ray.spi.NopRemoteFunctionManager;
|
||||
import org.ray.spi.PathConfig;
|
||||
import org.ray.spi.RemoteFunctionManager;
|
||||
import org.ray.spi.StateStoreProxy;
|
||||
import org.ray.spi.impl.DefaultLocalSchedulerClient;
|
||||
import org.ray.spi.impl.NativeRemoteFunctionManager;
|
||||
import org.ray.spi.impl.RedisClient;
|
||||
import org.ray.spi.impl.StateStoreProxyImpl;
|
||||
import org.ray.spi.model.AddressInfo;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.config.PathConfig;
|
||||
import org.ray.runtime.config.RayParameters;
|
||||
import org.ray.runtime.config.WorkerMode;
|
||||
import org.ray.runtime.functionmanager.NativeRemoteFunctionManager;
|
||||
import org.ray.runtime.functionmanager.NopRemoteFunctionManager;
|
||||
import org.ray.runtime.functionmanager.RemoteFunctionManager;
|
||||
import org.ray.runtime.gcs.AddressInfo;
|
||||
import org.ray.runtime.gcs.KeyValueStoreLink;
|
||||
import org.ray.runtime.gcs.RedisClient;
|
||||
import org.ray.runtime.gcs.StateStoreProxy;
|
||||
import org.ray.runtime.gcs.StateStoreProxyImpl;
|
||||
import org.ray.runtime.raylet.RayletClient;
|
||||
import org.ray.runtime.raylet.RayletClientImpl;
|
||||
import org.ray.runtime.runner.RunManager;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* native runtime for local box and cluster run.
|
||||
|
@ -38,7 +36,7 @@ public final class RayNativeRuntime extends AbstractRayRuntime {
|
|||
private KeyValueStoreLink kvStore = null;
|
||||
private RunManager manager = null;
|
||||
|
||||
protected RayNativeRuntime() {
|
||||
public RayNativeRuntime() {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -91,14 +89,14 @@ public final class RayNativeRuntime extends AbstractRayRuntime {
|
|||
"how many release requests should be delayed in plasma client");
|
||||
|
||||
ObjectStoreLink plink = new PlasmaClient(params.object_store_name, "", releaseDelay);
|
||||
LocalSchedulerLink slink = new DefaultLocalSchedulerClient(
|
||||
RayletClient rayletClient = new RayletClientImpl(
|
||||
params.raylet_socket_name,
|
||||
WorkerContext.currentWorkerId(),
|
||||
isWorker,
|
||||
WorkerContext.currentTask().taskId
|
||||
);
|
||||
|
||||
init(slink, plink, funcMgr, pathConfig);
|
||||
init(rayletClient, plink, funcMgr, pathConfig);
|
||||
|
||||
// register
|
||||
registerWorker(isWorker, params.node_ip_address, params.object_store_name,
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.ray.api.Ray;
|
|
@ -1,11 +1,12 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.ray.api.exception.RayException;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.spi.model.RayMethod;
|
||||
import org.ray.spi.model.TaskSpec;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.functionmanager.RayMethod;
|
||||
import org.ray.runtime.task.ArgumentsBuilder;
|
||||
import org.ray.runtime.task.TaskSpec;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* The worker, which pulls tasks from {@code org.ray.spi.LocalSchedulerProxy} and executes them
|
||||
|
@ -22,7 +23,7 @@ public class Worker {
|
|||
public void loop() {
|
||||
while (true) {
|
||||
RayLog.core.info(Thread.currentThread().getName() + ":fetching new task...");
|
||||
TaskSpec task = runtime.getLocalSchedulerClient().getTask();
|
||||
TaskSpec task = runtime.getRayletClient().getTask();
|
||||
execute(task);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime;
|
||||
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.model.RayParameters;
|
||||
import org.ray.core.model.WorkerMode;
|
||||
import org.ray.spi.model.TaskSpec;
|
||||
import org.ray.runtime.config.RayParameters;
|
||||
import org.ray.runtime.config.WorkerMode;
|
||||
import org.ray.runtime.task.TaskSpec;
|
||||
|
||||
public class WorkerContext {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package org.ray.spi;
|
||||
package org.ray.runtime.config;
|
||||
|
||||
import org.ray.util.config.AConfig;
|
||||
import org.ray.util.config.ConfigReader;
|
||||
import org.ray.runtime.util.config.AConfig;
|
||||
import org.ray.runtime.util.config.ConfigReader;
|
||||
|
||||
/**
|
||||
* Path related configurations.
|
|
@ -1,9 +1,9 @@
|
|||
package org.ray.core.model;
|
||||
package org.ray.runtime.config;
|
||||
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.util.NetworkUtil;
|
||||
import org.ray.util.config.AConfig;
|
||||
import org.ray.util.config.ConfigReader;
|
||||
import org.ray.runtime.util.NetworkUtil;
|
||||
import org.ray.runtime.util.config.AConfig;
|
||||
import org.ray.runtime.util.config.ConfigReader;
|
||||
|
||||
/**
|
||||
* Runtime parameters of Ray process.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.core.model;
|
||||
package org.ray.runtime.config;
|
||||
|
||||
public enum RunMode {
|
||||
SINGLE_PROCESS(true, false), // dev path, dev runtime
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.core.model;
|
||||
package org.ray.runtime.config;
|
||||
|
||||
public enum WorkerMode {
|
||||
NONE, // not set
|
|
@ -1,15 +1,12 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime.functionmanager;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.spi.RemoteFunctionManager;
|
||||
import org.ray.spi.model.FunctionArg;
|
||||
import org.ray.spi.model.RayActorMethods;
|
||||
import org.ray.spi.model.RayMethod;
|
||||
import org.ray.spi.model.RayTaskMethods;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.task.FunctionArg;
|
||||
import org.ray.runtime.util.Serializer;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* local function manager which pulls remote functions on demand.
|
||||
|
@ -44,7 +41,7 @@ public class LocalFunctionManager {
|
|||
return functionTable;
|
||||
}
|
||||
|
||||
Pair<ClassLoader, RayMethod> getMethod(UniqueId driverId, UniqueId actorId,
|
||||
public Pair<ClassLoader, RayMethod> getMethod(UniqueId driverId, UniqueId actorId,
|
||||
UniqueId methodId, String className) {
|
||||
// assert the driver's resource is load.
|
||||
FunctionTable functionTable = loadDriverFunctions(driverId);
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.functionmanager;
|
||||
|
||||
import java.io.File;
|
||||
import java.security.MessageDigest;
|
||||
|
@ -6,12 +6,12 @@ import java.security.NoSuchAlgorithmException;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import net.lingala.zip4j.core.ZipFile;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.spi.KeyValueStoreLink;
|
||||
import org.ray.spi.RemoteFunctionManager;
|
||||
import org.ray.util.FileUtil;
|
||||
import org.ray.util.Sha1Digestor;
|
||||
import org.ray.util.SystemUtil;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.gcs.KeyValueStoreLink;
|
||||
import org.ray.runtime.util.FileUtil;
|
||||
import org.ray.runtime.util.JarLoader;
|
||||
import org.ray.runtime.util.Sha1Digestor;
|
||||
import org.ray.runtime.util.SystemUtil;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* native implementation of remote function manager.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi;
|
||||
package org.ray.runtime.functionmanager;
|
||||
|
||||
import org.ray.api.id.UniqueId;
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package org.ray.spi.model;
|
||||
package org.ray.runtime.functionmanager;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Executable;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
|
@ -1,11 +1,11 @@
|
|||
package org.ray.spi.model;
|
||||
package org.ray.runtime.functionmanager;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Executable;
|
||||
import java.lang.reflect.Method;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.util.MethodId;
|
||||
import org.ray.runtime.util.MethodId;
|
||||
|
||||
/**
|
||||
* method info.
|
|
@ -1,8 +1,7 @@
|
|||
package org.ray.spi.model;
|
||||
package org.ray.runtime.functionmanager;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Executable;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -10,7 +9,6 @@ import java.util.Collections;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.api.id.UniqueId;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi;
|
||||
package org.ray.runtime.functionmanager;
|
||||
|
||||
import org.ray.api.id.UniqueId;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi.model;
|
||||
package org.ray.runtime.gcs;
|
||||
|
||||
/**
|
||||
* Represents information of different process roles.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi;
|
||||
package org.ray.runtime.gcs;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
|
@ -1,10 +1,9 @@
|
|||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.gcs;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.ray.spi.KeyValueStoreLink;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
import redis.clients.jedis.JedisPoolConfig;
|
|
@ -1,8 +1,7 @@
|
|||
package org.ray.spi;
|
||||
package org.ray.runtime.gcs;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.ray.spi.model.AddressInfo;
|
||||
|
||||
/**
|
||||
* Proxy client for state store, for instance redis.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.gcs;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -9,12 +9,9 @@ import java.util.Objects;
|
|||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.format.gcs.ClientTableData;
|
||||
import org.ray.spi.KeyValueStoreLink;
|
||||
import org.ray.spi.StateStoreProxy;
|
||||
import org.ray.spi.model.AddressInfo;
|
||||
import org.ray.util.NetworkUtil;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.generated.ClientTableData;
|
||||
import org.ray.runtime.util.NetworkUtil;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* A class used to interface with the Ray control state.
|
|
@ -1,10 +1,9 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.generated;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.format.gcs;
|
||||
package org.ray.runtime.generated;
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
import java.nio.*;
|
|
@ -1,10 +1,9 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.generated;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
|
@ -1,10 +1,9 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.generated;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
|
@ -1,6 +1,6 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.generated;
|
||||
|
||||
public final class TaskLanguage {
|
||||
private TaskLanguage() { }
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.objectstore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -7,8 +7,9 @@ import java.util.Map;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.apache.arrow.plasma.ObjectStoreLink;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.WorkerContext;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.WorkerContext;
|
||||
import org.ray.runtime.raylet.MockRayletClient;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* A mock implementation of {@code org.ray.spi.ObjectStoreLink}, which use Map to store data.
|
||||
|
@ -17,7 +18,7 @@ public class MockObjectStore implements ObjectStoreLink {
|
|||
|
||||
private final Map<UniqueId, byte[]> data = new ConcurrentHashMap<>();
|
||||
private final Map<UniqueId, byte[]> metadata = new ConcurrentHashMap<>();
|
||||
private MockLocalScheduler scheduler = null;
|
||||
private MockRayletClient scheduler = null;
|
||||
|
||||
@Override
|
||||
public void put(byte[] objectId, byte[] value, byte[] metadataValue) {
|
||||
|
@ -103,7 +104,7 @@ public class MockObjectStore implements ObjectStoreLink {
|
|||
return data.containsKey(id);
|
||||
}
|
||||
|
||||
public void registerScheduler(MockLocalScheduler s) {
|
||||
public void registerScheduler(MockRayletClient s) {
|
||||
scheduler = s;
|
||||
}
|
||||
}
|
|
@ -1,15 +1,13 @@
|
|||
package org.ray.spi;
|
||||
package org.ray.runtime.objectstore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.arrow.plasma.ObjectStoreLink;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.Serializer;
|
||||
import org.ray.core.WorkerContext;
|
||||
import org.ray.util.exception.TaskExecutionException;
|
||||
import org.ray.runtime.WorkerContext;
|
||||
import org.ray.runtime.util.Serializer;
|
||||
import org.ray.runtime.util.exception.TaskExecutionException;
|
||||
|
||||
/**
|
||||
* Object store proxy, which handles serialization and deserialization, and utilize a {@code
|
|
@ -1,31 +1,28 @@
|
|||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.raylet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.LocalFunctionManager;
|
||||
import org.ray.core.Worker;
|
||||
import org.ray.core.impl.RayDevRuntime;
|
||||
import org.ray.spi.LocalSchedulerLink;
|
||||
import org.ray.spi.model.FunctionArg;
|
||||
import org.ray.spi.model.TaskSpec;
|
||||
import org.ray.runtime.RayDevRuntime;
|
||||
import org.ray.runtime.functionmanager.LocalFunctionManager;
|
||||
import org.ray.runtime.objectstore.MockObjectStore;
|
||||
import org.ray.runtime.task.FunctionArg;
|
||||
import org.ray.runtime.task.TaskSpec;
|
||||
|
||||
/**
|
||||
* A mock implementation of {@code org.ray.spi.LocalSchedulerLink}, which stores waiting tasks in a
|
||||
* Map, and cooperates with a {@code org.ray.spi.impl.MockObjectStore}.
|
||||
* A mock implementation of RayletClient, used in single process mode.
|
||||
*/
|
||||
public class MockLocalScheduler implements LocalSchedulerLink {
|
||||
public class MockRayletClient implements RayletClient {
|
||||
|
||||
private final Map<UniqueId, Map<UniqueId, TaskSpec>> waitTasks = new ConcurrentHashMap<>();
|
||||
private final MockObjectStore store;
|
||||
private LocalFunctionManager functions = null;
|
||||
private final RayDevRuntime runtime;
|
||||
|
||||
public MockLocalScheduler(RayDevRuntime runtime, MockObjectStore store) {
|
||||
public MockRayletClient(RayDevRuntime runtime, MockObjectStore store) {
|
||||
this.runtime = runtime;
|
||||
this.store = store;
|
||||
store.registerScheduler(this);
|
|
@ -1,16 +1,15 @@
|
|||
package org.ray.spi;
|
||||
package org.ray.runtime.raylet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.spi.model.TaskSpec;
|
||||
import org.ray.runtime.task.TaskSpec;
|
||||
|
||||
/**
|
||||
* Provides core functionalities of local scheduler.
|
||||
* Client to the Raylet backend.
|
||||
*/
|
||||
public interface LocalSchedulerLink {
|
||||
public interface RayletClient {
|
||||
|
||||
void submitTask(TaskSpec task);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.raylet;
|
||||
|
||||
import com.google.flatbuffers.FlatBufferBuilder;
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -6,22 +6,20 @@ import java.nio.ByteOrder;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.AbstractRayRuntime;
|
||||
import org.ray.core.UniqueIdHelper;
|
||||
import org.ray.spi.LocalSchedulerLink;
|
||||
import org.ray.spi.model.FunctionArg;
|
||||
import org.ray.spi.model.TaskSpec;
|
||||
import org.ray.util.ResourceUtil;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.AbstractRayRuntime;
|
||||
import org.ray.runtime.generated.Arg;
|
||||
import org.ray.runtime.generated.ResourcePair;
|
||||
import org.ray.runtime.generated.TaskInfo;
|
||||
import org.ray.runtime.generated.TaskLanguage;
|
||||
import org.ray.runtime.task.FunctionArg;
|
||||
import org.ray.runtime.task.TaskSpec;
|
||||
import org.ray.runtime.util.UniqueIdHelper;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* JNI-based local scheduler link provider.
|
||||
*/
|
||||
public class DefaultLocalSchedulerClient implements LocalSchedulerLink {
|
||||
public class RayletClientImpl implements RayletClient {
|
||||
|
||||
private static ThreadLocal<ByteBuffer> _taskBuffer = ThreadLocal.withInitial(() -> {
|
||||
ByteBuffer bb = ByteBuffer
|
||||
|
@ -31,7 +29,7 @@ public class DefaultLocalSchedulerClient implements LocalSchedulerLink {
|
|||
});
|
||||
private long client = 0;
|
||||
|
||||
public DefaultLocalSchedulerClient(String schedulerSockName, UniqueId clientId,
|
||||
public RayletClientImpl(String schedulerSockName, UniqueId clientId,
|
||||
boolean isWorker, UniqueId driverId) {
|
||||
client = nativeInit(schedulerSockName, clientId.getBytes(),
|
||||
isWorker, driverId.getBytes());
|
||||
|
@ -260,12 +258,11 @@ public class DefaultLocalSchedulerClient implements LocalSchedulerLink {
|
|||
/// the C++ header file and update the C++ implementation accordingly:
|
||||
///
|
||||
/// Suppose that $Dir is your ray root directory.
|
||||
/// 1) pushd $Dir/java/runtime-native/target/classes
|
||||
/// 2) javah -classpath .:$Dir/java/runtime-common/target/classes/:$Dir/java/api/target/classes/
|
||||
/// org.ray.spi.impl.DefaultLocalSchedulerClient
|
||||
/// 3) clang-format -i org_ray_spi_impl_DefaultLocalSchedulerClient.h
|
||||
/// 4) cp org_ray_spi_impl_DefaultLocalSchedulerClient.h $Dir/src/local_scheduler/lib/java/
|
||||
/// 5) vim $Dir/src/local_scheduler/lib/java/org_ray_spi_impl_DefaultLocalSchedulerClient.cc
|
||||
/// 1) pushd $Dir/java/runtime/target/classes
|
||||
/// 2) javah -classpath .:$Dir/java/api/target/classes org.ray.runtime.raylet.RayletClientImpl
|
||||
/// 3) clang-format -i org_ray_runtime_raylet_RayletClientImpl.h
|
||||
/// 4) cp org_ray_runtime_raylet_RayletClientImpl.h $Dir/src/local_scheduler/lib/java/
|
||||
/// 5) vim $Dir/src/local_scheduler/lib/java/org_ray_runtime_raylet_RayletClientImpl.cc
|
||||
/// 6) popd
|
||||
|
||||
private static native long nativeInit(String localSchedulerSocket, byte[] workerId,
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.runner;
|
||||
package org.ray.runtime.runner;
|
||||
|
||||
public class ProcessInfo {
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package org.ray.runner;
|
||||
package org.ray.runtime.runner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.ray.spi.model.AddressInfo;
|
||||
import org.ray.runtime.gcs.AddressInfo;
|
||||
|
||||
/**
|
||||
* information of kinds of processes.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.runner;
|
||||
package org.ray.runtime.runner;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.io.File;
|
||||
|
@ -7,21 +7,19 @@ import java.time.LocalDateTime;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.model.RayParameters;
|
||||
import org.ray.core.model.RunMode;
|
||||
import org.ray.runner.RunInfo.ProcessType;
|
||||
import org.ray.spi.PathConfig;
|
||||
import org.ray.spi.model.AddressInfo;
|
||||
import org.ray.util.ResourceUtil;
|
||||
import org.ray.util.StringUtil;
|
||||
import org.ray.util.config.ConfigReader;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.config.PathConfig;
|
||||
import org.ray.runtime.config.RayParameters;
|
||||
import org.ray.runtime.gcs.AddressInfo;
|
||||
import org.ray.runtime.runner.RunInfo.ProcessType;
|
||||
import org.ray.runtime.util.ResourceUtil;
|
||||
import org.ray.runtime.util.StringUtil;
|
||||
import org.ray.runtime.util.config.ConfigReader;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
/**
|
||||
|
@ -484,7 +482,7 @@ public class RunManager {
|
|||
|
||||
return buildJavaProcessCommand(
|
||||
RunInfo.ProcessType.PT_WORKER,
|
||||
"org.ray.runner.worker.DefaultWorker",
|
||||
"org.ray.runtime.runner.worker.DefaultWorker",
|
||||
"",
|
||||
workerConfigs,
|
||||
jvmArgs,
|
|
@ -1,7 +1,7 @@
|
|||
package org.ray.runner.worker;
|
||||
package org.ray.runtime.runner.worker;
|
||||
|
||||
import org.ray.core.AbstractRayRuntime;
|
||||
import org.ray.core.model.WorkerMode;
|
||||
import org.ray.runtime.AbstractRayRuntime;
|
||||
import org.ray.runtime.config.WorkerMode;
|
||||
|
||||
/**
|
||||
* The main function of DefaultDriver.
|
|
@ -1,7 +1,7 @@
|
|||
package org.ray.runner.worker;
|
||||
package org.ray.runtime.runner.worker;
|
||||
|
||||
import org.ray.core.AbstractRayRuntime;
|
||||
import org.ray.core.model.WorkerMode;
|
||||
import org.ray.runtime.AbstractRayRuntime;
|
||||
import org.ray.runtime.config.WorkerMode;
|
||||
|
||||
/**
|
||||
* default worker implementation.
|
|
@ -1,13 +1,10 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime.task;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.RayActor;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.spi.model.FunctionArg;
|
||||
import org.ray.spi.model.TaskSpec;
|
||||
import org.ray.runtime.util.Serializer;
|
||||
|
||||
public class ArgumentsBuilder {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi.model;
|
||||
package org.ray.runtime.task;
|
||||
|
||||
import org.ray.api.id.UniqueId;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package org.ray.spi.model;
|
||||
package org.ray.runtime.task;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.util.ResourceUtil;
|
||||
import org.ray.runtime.util.ResourceUtil;
|
||||
|
||||
/**
|
||||
* Represents necessary information of a task for scheduling and executing.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.spi.impl;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -14,7 +14,7 @@ import org.apache.commons.io.FileUtils;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.io.filefilter.DirectoryFileFilter;
|
||||
import org.apache.commons.io.filefilter.RegexFileFilter;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* load and unload jars from a dir.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.invoke.SerializedLambda;
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.Serializable;
|
||||
|
@ -14,7 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.WeakHashMap;
|
||||
import org.objectweb.asm.Type;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.DatagramSocket;
|
||||
|
@ -7,7 +7,7 @@ import java.net.InetAddress;
|
|||
import java.net.NetworkInterface;
|
||||
import java.net.ServerSocket;
|
||||
import java.util.Enumeration;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
public class NetworkUtil {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import org.nustaq.serialization.FSTConfiguration;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.MessageDigest;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
public class Sha1Digestor {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
|
@ -1,9 +1,9 @@
|
|||
package org.ray.util;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* some utilities for system process.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.core;
|
||||
package org.ray.runtime.util;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util.config;
|
||||
package org.ray.runtime.util.config;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util.config;
|
||||
package org.ray.runtime.util.config;
|
||||
|
||||
/**
|
||||
* A ray configuration item of type {@code T}.
|
|
@ -1,10 +1,9 @@
|
|||
package org.ray.util.config;
|
||||
package org.ray.runtime.util.config;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
@ -13,8 +12,8 @@ import org.ini4j.Config;
|
|||
import org.ini4j.Ini;
|
||||
import org.ini4j.Profile;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.util.ObjectUtil;
|
||||
import org.ray.util.StringUtil;
|
||||
import org.ray.runtime.util.ObjectUtil;
|
||||
import org.ray.runtime.util.StringUtil;
|
||||
|
||||
/**
|
||||
* Loads configurations from a file.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util.config;
|
||||
package org.ray.runtime.util.config;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util.config;
|
||||
package org.ray.runtime.util.config;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util.exception;
|
||||
package org.ray.runtime.util.exception;
|
||||
|
||||
/**
|
||||
* An exception which is thrown when a ray task encounters an error when executing.
|
|
@ -1,4 +1,4 @@
|
|||
package org.ray.util.generator;
|
||||
package org.ray.runtime.util.generator;
|
||||
|
||||
public abstract class BaseGenerator {
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package org.ray.util.generator;
|
||||
package org.ray.runtime.util.generator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.ray.util.FileUtil;
|
||||
import org.ray.runtime.util.FileUtil;
|
||||
|
||||
/**
|
||||
* A util class that generates `RayCall.java`,
|
|
@ -1,7 +1,7 @@
|
|||
package org.ray.util.generator;
|
||||
package org.ray.runtime.util.generator;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.ray.util.FileUtil;
|
||||
import org.ray.runtime.util.FileUtil;
|
||||
|
||||
/**
|
||||
* A util class that generates all the RayFuncX classes under org.ray.api.function package.
|
|
@ -1,6 +1,6 @@
|
|||
package org.ray.util.logger;
|
||||
package org.ray.runtime.util.logger;
|
||||
|
||||
import org.ray.util.SystemUtil;
|
||||
import org.ray.runtime.util.SystemUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -28,25 +28,7 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-native</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-dev</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-common</artifactId>
|
||||
<artifactId>ray-runtime</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
|
0
java/test/run/logs/core.log
Normal file
0
java/test/run/logs/core.log
Normal file
|
@ -11,7 +11,7 @@ import org.ray.api.Ray;
|
|||
import org.ray.api.RayActor;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
public abstract class RayBenchmarkTest<T> implements Serializable {
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ import org.junit.Test;
|
|||
import org.ray.api.function.RayFunc0;
|
||||
import org.ray.api.function.RayFunc1;
|
||||
import org.ray.api.function.RayFunc3;
|
||||
import org.ray.util.MethodId;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.MethodId;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
public class LambdaUtilsTest {
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.lang.reflect.Executable;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.ray.api.function.RayFunc2;
|
||||
import org.ray.util.MethodId;
|
||||
import org.ray.runtime.util.MethodId;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableList;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.ray.api.Ray;
|
||||
|
@ -12,7 +11,6 @@ import org.ray.api.RayObject;
|
|||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.AbstractRayRuntime;
|
||||
|
||||
|
||||
@RunWith(MyRunner.class)
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.ray.api.test;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.spi.model.RayActorMethods;
|
||||
import org.ray.runtime.functionmanager.RayActorMethods;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -3,14 +3,13 @@ package org.ray.api.test;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.WaitResult;
|
||||
import org.ray.util.logger.RayLog;
|
||||
import org.ray.runtime.util.logger.RayLog;
|
||||
|
||||
/**
|
||||
* Integration test for Ray.*
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package org.ray.api.test;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.ray.spi.model.RayMethod;
|
||||
import org.ray.spi.model.RayTaskMethods;
|
||||
import org.ray.runtime.functionmanager.RayMethod;
|
||||
import org.ray.runtime.functionmanager.RayTaskMethods;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.ray.api.test;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.ray.api.Ray;
|
||||
|
@ -11,7 +10,6 @@ import org.ray.api.RayObject;
|
|||
import org.ray.api.WaitResult;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.api.annotation.ResourceItem;
|
||||
import org.ray.core.AbstractRayRuntime;
|
||||
|
||||
/**
|
||||
* Resources Management Test.
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.junit.Assert;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.core.UniqueIdHelper;
|
||||
import org.ray.runtime.util.UniqueIdHelper;
|
||||
|
||||
@RunWith(MyRunner.class)
|
||||
public class UniqueIdTest {
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.junit.Assert;
|
|||
import org.ray.api.Ray;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.util.FileUtil;
|
||||
import org.ray.runtime.util.FileUtil;
|
||||
|
||||
/**
|
||||
* given a directory of document files on each "machine", we would like to count the appearance of
|
||||
|
|
|
@ -1,97 +1,73 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<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>
|
||||
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-tutorial</artifactId>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-tutorial</artifactId>
|
||||
|
||||
<name>java tutorial</name>
|
||||
<description>Tutorial of using Ray with Java</description>
|
||||
<url></url>
|
||||
<name>java tutorial</name>
|
||||
<description>Tutorial of using Ray with Java</description>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-native</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-dev</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<environmentVariables>
|
||||
<RAY_CONFIG>${basedir}/../ray.config.ini</RAY_CONFIG>
|
||||
</environmentVariables>
|
||||
<argLine>-ea
|
||||
-Djava.library.path=${basedir}/../../build/src/plasma:${basedir}/../../build/src/local_scheduler
|
||||
-noverify
|
||||
-DlogOutput=console
|
||||
</argLine>
|
||||
<testSourceDirectory>${basedir}/src/main/java/</testSourceDirectory>
|
||||
<testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/lib</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>false</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<environmentVariables>
|
||||
<RAY_CONFIG>${basedir}/../ray.config.ini</RAY_CONFIG>
|
||||
</environmentVariables>
|
||||
<argLine>-ea
|
||||
-Djava.library.path=${basedir}/../../build/src/plasma:${basedir}/../../build/src/local_scheduler
|
||||
-noverify
|
||||
-DlogOutput=console
|
||||
</argLine>
|
||||
<testSourceDirectory>${basedir}/src/main/java/</testSourceDirectory>
|
||||
<testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/lib</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>false</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <jni.h>
|
||||
|
||||
#include "local_scheduler/lib/java/org_ray_spi_impl_DefaultLocalSchedulerClient.h"
|
||||
#include "local_scheduler/lib/java/org_ray_runtime_raylet_RayletClientImpl.h"
|
||||
#include "local_scheduler_client.h"
|
||||
#include "logging.h"
|
||||
#include "ray/id.h"
|
||||
|
@ -32,18 +32,17 @@ class UniqueIdFromJByteArray {
|
|||
};
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeInit
|
||||
* Signature: (Ljava/lang/String;[BZ[B)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeInit(
|
||||
JNIEnv *env,
|
||||
jclass,
|
||||
jstring sockName,
|
||||
jbyteArray workerId,
|
||||
jboolean isWorker,
|
||||
jbyteArray driverId) {
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeInit(JNIEnv *env,
|
||||
jclass,
|
||||
jstring sockName,
|
||||
jbyteArray workerId,
|
||||
jboolean isWorker,
|
||||
jbyteArray driverId) {
|
||||
UniqueIdFromJByteArray worker_id(env, workerId);
|
||||
UniqueIdFromJByteArray driver_id(env, driverId);
|
||||
const char *nativeString = env->GetStringUTFChars(sockName, JNI_FALSE);
|
||||
|
@ -55,12 +54,12 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeInit(
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeSubmitTask
|
||||
* Signature: (J[BLjava/nio/ByteBuffer;II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeSubmitTask(
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeSubmitTask(
|
||||
JNIEnv *env,
|
||||
jclass,
|
||||
jlong client,
|
||||
|
@ -83,14 +82,14 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeSubmitTask(
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeGetTask
|
||||
* Signature: (J)[B
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeGetTask(JNIEnv *env,
|
||||
jclass,
|
||||
jlong client) {
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeGetTask(JNIEnv *env,
|
||||
jclass,
|
||||
jlong client) {
|
||||
auto conn = reinterpret_cast<LocalSchedulerConnection *>(client);
|
||||
int64_t task_size = 0;
|
||||
|
||||
|
@ -112,26 +111,26 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeGetTask(JNIEnv *env,
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeDestroy
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeDestroy(JNIEnv *,
|
||||
jclass,
|
||||
jlong client) {
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeDestroy(JNIEnv *,
|
||||
jclass,
|
||||
jlong client) {
|
||||
auto conn = reinterpret_cast<LocalSchedulerConnection *>(client);
|
||||
local_scheduler_disconnect_client(conn);
|
||||
LocalSchedulerConnection_free(conn);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeReconstructObjects
|
||||
* Signature: (J[[BZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeReconstructObjects(
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeReconstructObjects(
|
||||
JNIEnv *env,
|
||||
jclass,
|
||||
jlong client,
|
||||
|
@ -151,12 +150,12 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeReconstructObjects(
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeNotifyUnblocked
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeNotifyUnblocked(
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeNotifyUnblocked(
|
||||
JNIEnv *,
|
||||
jclass,
|
||||
jlong client) {
|
||||
|
@ -165,12 +164,12 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeNotifyUnblocked(
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativePutObject
|
||||
* Signature: (J[B[B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativePutObject(
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativePutObject(
|
||||
JNIEnv *env,
|
||||
jclass,
|
||||
jlong client,
|
||||
|
@ -182,12 +181,12 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativePutObject(
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeWaitObject
|
||||
* Signature: (J[[BIIZ)[Z
|
||||
*/
|
||||
JNIEXPORT jbooleanArray JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeWaitObject(
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeWaitObject(
|
||||
JNIEnv *env,
|
||||
jclass,
|
||||
jlong client,
|
||||
|
@ -237,12 +236,12 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeWaitObject(
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeGenerateTaskId
|
||||
* Signature: ([B[BI)[B
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeGenerateTaskId(
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeGenerateTaskId(
|
||||
JNIEnv *env,
|
||||
jclass,
|
||||
jbyteArray driverId,
|
||||
|
@ -267,12 +266,12 @@ Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeGenerateTaskId(
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeFreePlasmaObjects
|
||||
* Signature: ([[BZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeFreePlasmaObjects(
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeFreePlasmaObjects(
|
||||
JNIEnv *env,
|
||||
jclass,
|
||||
jlong client,
|
|
@ -0,0 +1,134 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class org_ray_runtime_raylet_RayletClientImpl */
|
||||
|
||||
#ifndef _Included_org_ray_runtime_raylet_RayletClientImpl
|
||||
#define _Included_org_ray_runtime_raylet_RayletClientImpl
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeInit
|
||||
* Signature: (Ljava/lang/String;[BZ[B)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeInit(JNIEnv *,
|
||||
jclass,
|
||||
jstring,
|
||||
jbyteArray,
|
||||
jboolean,
|
||||
jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeSubmitTask
|
||||
* Signature: (J[BLjava/nio/ByteBuffer;II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeSubmitTask(JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jbyteArray,
|
||||
jobject,
|
||||
jint,
|
||||
jint);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeGetTask
|
||||
* Signature: (J)[B
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeGetTask(JNIEnv *,
|
||||
jclass,
|
||||
jlong);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeDestroy
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeDestroy(JNIEnv *,
|
||||
jclass,
|
||||
jlong);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeReconstructObjects
|
||||
* Signature: (J[[BZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeReconstructObjects(
|
||||
JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jobjectArray,
|
||||
jboolean);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeNotifyUnblocked
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeNotifyUnblocked(JNIEnv *,
|
||||
jclass,
|
||||
jlong);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativePutObject
|
||||
* Signature: (J[B[B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativePutObject(JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jbyteArray,
|
||||
jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeWaitObject
|
||||
* Signature: (J[[BIIZ)[Z
|
||||
*/
|
||||
JNIEXPORT jbooleanArray JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeWaitObject(JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jobjectArray,
|
||||
jint,
|
||||
jint,
|
||||
jboolean);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeGenerateTaskId
|
||||
* Signature: ([B[BI)[B
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeGenerateTaskId(JNIEnv *,
|
||||
jclass,
|
||||
jbyteArray,
|
||||
jbyteArray,
|
||||
jint);
|
||||
|
||||
/*
|
||||
* Class: org_ray_runtime_raylet_RayletClientImpl
|
||||
* Method: nativeFreePlasmaObjects
|
||||
* Signature: (J[[BZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_runtime_raylet_RayletClientImpl_nativeFreePlasmaObjects(
|
||||
JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jobjectArray,
|
||||
jboolean);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,136 +0,0 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class org_ray_spi_impl_DefaultLocalSchedulerClient */
|
||||
|
||||
#ifndef _Included_org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
#define _Included_org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeInit
|
||||
* Signature: (Ljava/lang/String;[BZ[B)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeInit(JNIEnv *,
|
||||
jclass,
|
||||
jstring,
|
||||
jbyteArray,
|
||||
jboolean,
|
||||
jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeSubmitTask
|
||||
* Signature: (J[BLjava/nio/ByteBuffer;II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeSubmitTask(JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jbyteArray,
|
||||
jobject,
|
||||
jint,
|
||||
jint);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeGetTask
|
||||
* Signature: (J)[B
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeGetTask(JNIEnv *,
|
||||
jclass,
|
||||
jlong);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeDestroy
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeDestroy(JNIEnv *,
|
||||
jclass,
|
||||
jlong);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeReconstructObjects
|
||||
* Signature: (J[[BZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeReconstructObjects(
|
||||
JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jobjectArray,
|
||||
jboolean);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeNotifyUnblocked
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeNotifyUnblocked(
|
||||
JNIEnv *,
|
||||
jclass,
|
||||
jlong);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativePutObject
|
||||
* Signature: (J[B[B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativePutObject(JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jbyteArray,
|
||||
jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeWaitObject
|
||||
* Signature: (J[[BIIZ)[Z
|
||||
*/
|
||||
JNIEXPORT jbooleanArray JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeWaitObject(JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jobjectArray,
|
||||
jint,
|
||||
jint,
|
||||
jboolean);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeGenerateTaskId
|
||||
* Signature: ([B[BI)[B
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeGenerateTaskId(
|
||||
JNIEnv *,
|
||||
jclass,
|
||||
jbyteArray,
|
||||
jbyteArray,
|
||||
jint);
|
||||
|
||||
/*
|
||||
* Class: org_ray_spi_impl_DefaultLocalSchedulerClient
|
||||
* Method: nativeFreePlasmaObjects
|
||||
* Signature: (J[[BZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_ray_spi_impl_DefaultLocalSchedulerClient_nativeFreePlasmaObjects(
|
||||
JNIEnv *,
|
||||
jclass,
|
||||
jlong,
|
||||
jobjectArray,
|
||||
jboolean);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
Loading…
Add table
Reference in a new issue