Add a flag to disable reconstruction for a killed actor (#7346)

This commit is contained in:
Kai Yang
2020-03-13 19:10:21 +08:00
committed by GitHub
parent 575c89cf47
commit d6e8f47065
17 changed files with 135 additions and 52 deletions
@@ -181,16 +181,6 @@ 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.
*/
@@ -33,4 +33,13 @@ public interface RayActor<A> extends ActorCall<A> {
*/
ActorId getId();
/**
* 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 noReconstruction If set to true, the killed actor will not be reconstructed anymore.
*/
default void kill(boolean noReconstruction) {
Ray.internal().killActor(this, noReconstruction);
}
}
@@ -80,8 +80,9 @@ public interface RayRuntime {
* Kill the actor immediately.
*
* @param actor The actor to be killed.
* @param noReconstruction If set to true, the killed actor will not be reconstructed anymore.
*/
void killActor(RayActor<?> actor);
void killActor(RayActor<?> actor, boolean noReconstruction);
/**
* Invoke a remote function.