Rename max_reconstructions to max_restarts and use -1 for infinite (#8274)

Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
This commit is contained in:
Max Fitton
2020-05-14 08:30:29 -07:00
committed by GitHub
parent 5f4c196fed
commit 00325eb2b2
71 changed files with 403 additions and 393 deletions
@@ -62,7 +62,7 @@ public class RayDevRuntime extends AbstractRayRuntime {
}
@Override
public void killActor(BaseActor actor, boolean noReconstruction) {
public void killActor(BaseActor actor, boolean noRestart) {
throw new UnsupportedOperationException();
}
@@ -126,8 +126,8 @@ public final class RayNativeRuntime extends AbstractRayRuntime {
}
@Override
public void killActor(BaseActor actor, boolean noReconstruction) {
nativeKillActor(actor.getId().getBytes(), noReconstruction);
public void killActor(BaseActor actor, boolean noRestart) {
nativeKillActor(actor.getId().getBytes(), noRestart);
}
@Override
@@ -160,7 +160,7 @@ public final class RayNativeRuntime extends AbstractRayRuntime {
private static native void nativeSetResource(String resourceName, double capacity, byte[] nodeId);
private static native void nativeKillActor(byte[] actorId, boolean noReconstruction);
private static native void nativeKillActor(byte[] actorId, boolean noRestart);
private static native void nativeSetCoreWorker(byte[] workerId);
@@ -32,7 +32,7 @@ public class RuntimeContextImpl implements RuntimeContext {
}
@Override
public boolean wasCurrentActorReconstructed() {
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.");
@@ -40,7 +40,7 @@ public class RuntimeContextImpl implements RuntimeContext {
return false;
}
return runtime.getGcsClient().wasCurrentActorReconstructed(getCurrentActorId());
return runtime.getGcsClient().wasCurrentActorRestarted(getCurrentActorId());
}
@Override
@@ -125,7 +125,7 @@ public class GcsClient {
return primary.exists(key);
}
public boolean wasCurrentActorReconstructed(ActorId actorId) {
public boolean wasCurrentActorRestarted(ActorId actorId) {
byte[] key = ArrayUtils.addAll(TablePrefix.ACTOR.toString().getBytes(), actorId.getBytes());
if (!RayConfig.getInstance().gcsServiceEnabled) {
return primary.exists(key);
@@ -142,10 +142,7 @@ public class GcsClient {
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException("Received invalid protobuf data from GCS.");
}
long maxReconstructions = actorTableData.getMaxReconstructions();
long remainingReconstructions = actorTableData.getRemainingReconstructions();
return maxReconstructions - remainingReconstructions != 0;
return actorTableData.getNumRestarts() != 0;
}
/**