[Java] Dynamic resource API in Java (#4824)

This commit is contained in:
Qing Wang
2019-05-21 17:13:48 +08:00
committed by Si-Yuan
parent 02583a8598
commit 081708bdef
9 changed files with 117 additions and 0 deletions
@@ -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.
*