Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public static State toState(@Nullable String stateName) {
case "JOB_STATE_UNKNOWN":
return State.UNKNOWN;
case "JOB_STATE_STOPPED":
case "JOB_STATE_PAUSED": // Job is paused; the closest mapping is STOPPED
return State.STOPPED;
case "JOB_STATE_FAILED":
return State.FAILED;
Expand All @@ -224,6 +225,7 @@ public static State toState(@Nullable String stateName) {
case "JOB_STATE_PENDING": // Job has not yet started; closest mapping is RUNNING
case "JOB_STATE_DRAINING": // Job is still active; the closest mapping is RUNNING
case "JOB_STATE_CANCELLING": // Job is still active; the closest mapping is RUNNING
case "JOB_STATE_PAUSING": // Job is still active; the closest mapping is RUNNING
case "JOB_STATE_RESOURCE_CLEANING_UP": // Job is still active; the closest mapping is RUNNING
return State.RUNNING;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ public void testToStateNormal() {
assertEquals(State.UPDATED, MonitoringUtil.toState("JOB_STATE_UPDATED"));

// Non-trivially mapped cases
assertEquals(State.STOPPED, MonitoringUtil.toState("JOB_STATE_PAUSED"));
assertEquals(State.RUNNING, MonitoringUtil.toState("JOB_STATE_DRAINING"));
assertEquals(State.RUNNING, MonitoringUtil.toState("JOB_STATE_PAUSING"));
assertEquals(State.DONE, MonitoringUtil.toState("JOB_STATE_DRAINED"));
}

Expand Down
Loading