mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 21:38:18 +08:00
[Java] Support wasCurrentActorRestarted in actor task. (#13120)
* Remove check. * Add test * fix lint * lint * Fix spotless lint * Address comments. * Fix lint Co-authored-by: Qing Wang <jovany.wq@antgroup.com>
This commit is contained in:
@@ -7,7 +7,6 @@ import io.ray.api.runtimecontext.NodeInfo;
|
||||
import io.ray.api.runtimecontext.RuntimeContext;
|
||||
import io.ray.runtime.RayRuntimeInternal;
|
||||
import io.ray.runtime.config.RunMode;
|
||||
import io.ray.runtime.generated.Common.TaskType;
|
||||
import java.util.List;
|
||||
|
||||
public class RuntimeContextImpl implements RuntimeContext {
|
||||
@@ -33,14 +32,9 @@ public class RuntimeContextImpl implements RuntimeContext {
|
||||
|
||||
@Override
|
||||
public boolean wasCurrentActorRestarted() {
|
||||
TaskType currentTaskType = runtime.getWorkerContext().getCurrentTaskType();
|
||||
Preconditions.checkState(
|
||||
currentTaskType == TaskType.ACTOR_CREATION_TASK,
|
||||
"This method can only be called from an actor creation task.");
|
||||
if (isSingleProcess()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return runtime.getGcsClient().wasCurrentActorRestarted(getCurrentActorId());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user