mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 20:22:39 +08:00
Java doc: "Starting Ray" page (#10062)
This commit is contained in:
@@ -37,7 +37,7 @@ public final class Ray extends RayCall {
|
||||
*
|
||||
* @param factory A factory that produces the runtime instance.
|
||||
*/
|
||||
public static synchronized void init(RayRuntimeFactory factory) {
|
||||
private static synchronized void init(RayRuntimeFactory factory) {
|
||||
if (runtime == null) {
|
||||
runtime = factory.createRayRuntime();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(Ray::shutdown));
|
||||
@@ -54,6 +54,14 @@ public final class Ray extends RayCall {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if {@link #init} has been called yet.
|
||||
* @return True if {@link #init} has already been called and false otherwise.
|
||||
*/
|
||||
public static boolean isInitialized() {
|
||||
return runtime != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store an object in the object store.
|
||||
*
|
||||
|
||||
@@ -130,7 +130,11 @@ public class RayConfig {
|
||||
workerMode = localWorkerMode;
|
||||
boolean isDriver = workerMode == WorkerType.DRIVER;
|
||||
// Run mode.
|
||||
runMode = config.getEnum(RunMode.class, "ray.run-mode");
|
||||
if (config.hasPath("ray.local-mode")) {
|
||||
runMode = config.getBoolean("ray.local-mode") ? RunMode.SINGLE_PROCESS : RunMode.CLUSTER;
|
||||
} else {
|
||||
runMode = config.getEnum(RunMode.class, "ray.run-mode");
|
||||
}
|
||||
// Node ip.
|
||||
if (config.hasPath("ray.node-ip")) {
|
||||
nodeIp = config.getString("ray.node-ip");
|
||||
|
||||
Reference in New Issue
Block a user