aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject incubator-aurora git commit: Handle TASK_ERROR and TASK_STAGING states.
Date Wed, 25 Feb 2015 20:02:56 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 81641a17b -> 895d03ba6


Handle TASK_ERROR and TASK_STAGING states.

Bugs closed: AURORA-1001

Reviewed at https://reviews.apache.org/r/31421/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/895d03ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/895d03ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/895d03ba

Branch: refs/heads/master
Commit: 895d03ba60a2bfd8bd24dbbeaef484ba7bf9cad3
Parents: 81641a1
Author: Bill Farner <wfarner@apache.org>
Authored: Wed Feb 25 12:01:53 2015 -0800
Committer: Bill Farner <wfarner@apache.org>
Committed: Wed Feb 25 12:01:53 2015 -0800

----------------------------------------------------------------------
 .../aurora/scheduler/base/Conversions.java      |  2 ++
 .../aurora/scheduler/base/ConversionsTest.java  | 28 ++++++++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/895d03ba/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Conversions.java b/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
index 7b7650d..ad66cd8 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
@@ -50,11 +50,13 @@ public final class Conversions {
   private static final Map<TaskState, ScheduleStatus> STATE_TRANSLATION =
       new ImmutableMap.Builder<TaskState, ScheduleStatus>()
           .put(TaskState.TASK_STARTING, ScheduleStatus.STARTING)
+          .put(TaskState.TASK_STAGING, ScheduleStatus.STARTING)
           .put(TaskState.TASK_RUNNING, ScheduleStatus.RUNNING)
           .put(TaskState.TASK_FINISHED, ScheduleStatus.FINISHED)
           .put(TaskState.TASK_FAILED, ScheduleStatus.FAILED)
           .put(TaskState.TASK_KILLED, ScheduleStatus.KILLED)
           .put(TaskState.TASK_LOST, ScheduleStatus.LOST)
+          .put(TaskState.TASK_ERROR, ScheduleStatus.LOST)
           .build();
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/895d03ba/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java b/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java
new file mode 100644
index 0000000..9f94a98
--- /dev/null
+++ b/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java
@@ -0,0 +1,28 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.aurora.scheduler.base;
+
+import org.apache.mesos.Protos;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNotNull;
+
+public class ConversionsTest {
+  @Test
+  public void testAllStatesHandled() {
+    for (Protos.TaskState state : Protos.TaskState.values()) {
+      assertNotNull(Conversions.convertProtoState(state));
+    }
+  }
+}


Mime
View raw message