mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 17:58:35 +08:00
[Java] Dynamic resource API in Java (#4824)
This commit is contained in:
@@ -123,6 +123,21 @@ public final class Ray extends RayCall {
|
||||
return runtime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the resource for the specified client.
|
||||
* Set the resource for the specific node.
|
||||
*/
|
||||
public static void setResource(UniqueId nodeId, String resourceName, double capacity) {
|
||||
runtime.setResource(resourceName, capacity, nodeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the resource for local node.
|
||||
*/
|
||||
public static void setResource(String resourceName, double capacity) {
|
||||
runtime.setResource(resourceName, capacity, UniqueId.NIL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the runtime context.
|
||||
*/
|
||||
|
||||
@@ -65,6 +65,15 @@ public interface RayRuntime {
|
||||
*/
|
||||
void free(List<UniqueId> objectIds, boolean localOnly, boolean deleteCreatingTasks);
|
||||
|
||||
/**
|
||||
* Set the resource for the specific node.
|
||||
*
|
||||
* @param resourceName The name of resource.
|
||||
* @param capacity The capacity of the resource.
|
||||
* @param nodeId The node that we want to set its resource.
|
||||
*/
|
||||
void setResource(String resourceName, double capacity, UniqueId nodeId);
|
||||
|
||||
/**
|
||||
* Invoke a remote function.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user