mirror of
https://github.com/wassname/ray.git
synced 2026-07-02 04:08:08 +08:00
[Java] Simplify Ray.init() by invoking ray start internally (#10762)
This commit is contained in:
+2
-5
@@ -1,6 +1,7 @@
|
||||
package io.ray.streaming.runtime.transfer;
|
||||
|
||||
import io.ray.runtime.RayNativeRuntime;
|
||||
import io.ray.runtime.util.BinaryFileUtil;
|
||||
import io.ray.runtime.util.JniUtils;
|
||||
|
||||
/**
|
||||
@@ -10,11 +11,7 @@ import io.ray.runtime.util.JniUtils;
|
||||
public class TransferHandler {
|
||||
|
||||
static {
|
||||
try {
|
||||
Class.forName(RayNativeRuntime.class.getName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
JniUtils.loadLibrary(BinaryFileUtil.CORE_WORKER_JAVA_LIBRARY, true);
|
||||
JniUtils.loadLibrary("streaming_java");
|
||||
}
|
||||
|
||||
|
||||
+2
-7
@@ -1,6 +1,7 @@
|
||||
package io.ray.streaming.runtime.util;
|
||||
|
||||
import io.ray.runtime.RayNativeRuntime;
|
||||
import io.ray.runtime.util.BinaryFileUtil;
|
||||
import io.ray.runtime.util.JniUtils;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.net.InetAddress;
|
||||
@@ -29,13 +30,7 @@ public class EnvUtil {
|
||||
}
|
||||
|
||||
public static void loadNativeLibraries() {
|
||||
// Explicitly load `RayNativeRuntime`, to make sure `core_worker_library_java`
|
||||
// is loaded before `streaming_java`.
|
||||
try {
|
||||
Class.forName(RayNativeRuntime.class.getName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
JniUtils.loadLibrary(BinaryFileUtil.CORE_WORKER_JAVA_LIBRARY, true);
|
||||
JniUtils.loadLibrary("streaming_java");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user