[Java] Add killActor API in Java (#6728)

* Add killActor API in Java

* fix javadoc

* update test case

* Address comments
This commit is contained in:
Kai Yang
2020-01-14 17:12:00 +08:00
committed by Qing Wang
parent 2bcf72e306
commit ddd4c42fe5
9 changed files with 109 additions and 2 deletions
@@ -130,6 +130,7 @@ public final class Ray extends RayCall {
/**
* Set the async context for the current thread.
*
* @param asyncContext The async context to set.
*/
public static void setAsyncContext(Object asyncContext) {
@@ -180,6 +181,16 @@ public final class Ray extends RayCall {
runtime.setResource(resourceName, capacity, UniqueId.NIL);
}
/**
* Kill the actor immediately. This will cause any outstanding tasks submitted to the actor to
* fail and the actor to exit in the same way as if it crashed.
*
* @param actor The actor to be killed.
*/
public static void killActor(RayActor<?> actor) {
runtime.killActor(actor);
}
/**
* Get the runtime context.
*/
@@ -76,6 +76,13 @@ public interface RayRuntime {
*/
void setResource(String resourceName, double capacity, UniqueId nodeId);
/**
* Kill the actor immediately.
*
* @param actor The actor to be killed.
*/
void killActor(RayActor<?> actor);
/**
* Invoke a remote function.
*