Repository: incubator-reef Updated Branches: refs/heads/master 8efffd910 -> df213c166
[REEF-649] Change DriverRestartState enum to all caps This addressed the issue by * Changing DriverRestartState enum from CamelCase to all caps. JIRA: [REEF-649](https://issues.apache.org/jira/browse/REEF-649) Pull Request: Closes #416 Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/df213c16 Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/df213c16 Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/df213c16 Branch: refs/heads/master Commit: df213c16680eb4593c93afd9df9f6c9dead3b521 Parents: 8efffd9 Author: Andrew Chung <[email protected]> Authored: Tue Aug 25 22:34:29 2015 -0700 Committer: Mariia Mykhailova <[email protected]> Committed: Wed Aug 26 10:17:19 2015 -0700 ---------------------------------------------------------------------- .../reef/driver/restart/DriverRestartManager.java | 8 ++++---- .../reef/driver/restart/DriverRestartState.java | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/df213c16/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartManager.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartManager.java b/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartManager.java index d6b823c..6e422a1 100644 --- a/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartManager.java +++ b/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartManager.java @@ -40,7 +40,7 @@ public final class DriverRestartManager { private final DriverRuntimeRestartManager driverRuntimeRestartManager; private RestartEvaluators restartEvaluators; - private DriverRestartState state = DriverRestartState.NotRestarted; + private DriverRestartState state = DriverRestartState.NOT_RESTARTED; @Inject private DriverRestartManager(final DriverRuntimeRestartManager driverRuntimeRestartManager) { @@ -55,7 +55,7 @@ public final class DriverRestartManager { public synchronized boolean detectRestart() { if (this.state.hasNotRestarted() && driverRuntimeRestartManager.hasRestarted()) { // set the state machine in motion. - this.state = DriverRestartState.RestartBegan; + this.state = DriverRestartState.BEGAN; } return this.state.hasRestarted(); @@ -82,9 +82,9 @@ public final class DriverRestartManager { * as alive to the job driver. */ public synchronized void onRestart() { - if (this.state == DriverRestartState.RestartBegan) { + if (this.state == DriverRestartState.BEGAN) { restartEvaluators = driverRuntimeRestartManager.getPreviousEvaluators(); - this.state = DriverRestartState.RestartInProgress; + this.state = DriverRestartState.IN_PROGRESS; } else { final String errMsg = "Should not be setting the set of expected alive evaluators more than once."; LOG.log(Level.SEVERE, errMsg); http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/df213c16/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartState.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartState.java b/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartState.java index a20ec4c..500fa98 100644 --- a/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartState.java +++ b/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartState.java @@ -32,31 +32,31 @@ public enum DriverRestartState { /** * Driver has not begun the restart progress yet. */ - NotRestarted, + NOT_RESTARTED, /** * Driver has been notified of the restart by the runtime, but has not yet * received its set of evaluator IDs to recover yet. */ - RestartBegan, + BEGAN, /** * Driver has received its set of evaluator IDs to recover. */ - RestartInProgress, + IN_PROGRESS, /** * Driver has recovered all the evaluator IDs that it can, and the restart process is completed. */ - RestartCompleted; + COMPLETED; /** * @return true if the restart is in process. */ public boolean isRestarting() { switch (this) { - case RestartBegan: - case RestartInProgress: + case BEGAN: + case IN_PROGRESS: return true; default: return false; @@ -67,7 +67,7 @@ public enum DriverRestartState { * @return true if the driver began the restart process. Can be already done with the restart process. */ public boolean hasRestarted() { - return this != NotRestarted; + return this != NOT_RESTARTED; } /**
