aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject git commit: Remove INSTANCE_ADDED and INSTANCE_REMOVED states.
Date Wed, 17 Sep 2014 18:38:53 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 406d0fb76 -> fe025c5c4


Remove INSTANCE_ADDED and INSTANCE_REMOVED states.

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


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

Branch: refs/heads/master
Commit: fe025c5c4b47e4268c1c85f4d0f52dbe05df25ca
Parents: 406d0fb
Author: Bill Farner <wfarner@apache.org>
Authored: Wed Sep 17 11:35:35 2014 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Wed Sep 17 11:35:35 2014 -0700

----------------------------------------------------------------------
 .../aurora/scheduler/http/ui/js/services.js     |  4 +--
 .../thrift/org/apache/aurora/gen/api.thrift     | 36 ++++++++++++--------
 .../storage/db/DBJobUpdateStoreTest.java        | 21 +++++++-----
 .../scheduler/storage/log/LogStorageTest.java   |  2 +-
 4 files changed, 35 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/fe025c5c/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
index 5d6299f..f79acd2 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
@@ -203,13 +203,11 @@
       ]);
 
       var INSTANCE_SUCCESSFUL = toSet([
-        JobUpdateAction.INSTANCE_UPDATED,
-        JobUpdateAction.INSTANCE_REMOVED
+        JobUpdateAction.INSTANCE_UPDATED
       ]);
 
       var INSTANCE_TERMINAL = toSet([
         JobUpdateAction.INSTANCE_UPDATED,
-        JobUpdateAction.INSTANCE_REMOVED,
         JobUpdateAction.INSTANCE_ROLLED_BACK,
         JobUpdateAction.INSTANCE_UPDATE_FAILED,
         JobUpdateAction.INSTANCE_ROLLBACK_FAILED

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/fe025c5c/src/main/thrift/org/apache/aurora/gen/api.thrift
----------------------------------------------------------------------
diff --git a/src/main/thrift/org/apache/aurora/gen/api.thrift b/src/main/thrift/org/apache/aurora/gen/api.thrift
index 3d0beea..9f1a28c 100644
--- a/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -545,29 +545,35 @@ enum JobUpdateStatus {
 
 /** Job update actions that can be applied to job instances. */
 enum JobUpdateAction {
-  /** An instance was updated and the updater declared the instance healthy. */
+  /**
+   * An instance was moved to the target state successfully, and declared healthy if the
desired
+   * state did not involve deleting the instance.
+   */
   INSTANCE_UPDATED = 1,
 
-  /** A new instance was added. */
-  INSTANCE_ADDED = 2,
-
-  /** The instance was removed to match the instance count. */
-  INSTANCE_REMOVED = 3,
-
-  /** An update was performed or attempted, but had to be rolled back due to update failure.
*/
-  INSTANCE_ROLLED_BACK = 5,
+  /**
+   * An instance was rolled back because the job update did not succeed.  The instance was
reverted
+   * to the original state prior to the job update, which means that the instance was removed
if
+   * the update added instances to the job.
+   */
+  INSTANCE_ROLLED_BACK = 2,
 
-  /** An update is in progress. */
-  INSTANCE_UPDATING = 6,
+  /**
+   * An instance is being moved from the original state to the desired state.
+   */
+  INSTANCE_UPDATING = 3,
 
-  /** An instance is being rolled back */
-  INSTANCE_ROLLING_BACK = 7,
+  /**
+   * An instance is being moved from the desired state back to the original state, because
the job
+   * update failed.
+   */
+  INSTANCE_ROLLING_BACK = 4,
 
   /** An instance update was attempted but failed and was not rolled back. */
-  INSTANCE_UPDATE_FAILED = 8,
+  INSTANCE_UPDATE_FAILED = 5,
 
   /** An instance rollback was attempted but failed. */
-  INSTANCE_ROLLBACK_FAILED = 9
+  INSTANCE_ROLLBACK_FAILED = 6
 }
 
 /** Job update thresholds and limits. */

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/fe025c5c/src/test/java/org/apache/aurora/scheduler/storage/db/DBJobUpdateStoreTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/db/DBJobUpdateStoreTest.java
b/src/test/java/org/apache/aurora/scheduler/storage/db/DBJobUpdateStoreTest.java
index e09caa6..5a974cf 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/db/DBJobUpdateStoreTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/db/DBJobUpdateStoreTest.java
@@ -59,7 +59,10 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.apache.aurora.gen.JobUpdateAction.INSTANCE_ADDED;
+import static org.apache.aurora.gen.JobUpdateAction.INSTANCE_ROLLBACK_FAILED;
+import static org.apache.aurora.gen.JobUpdateAction.INSTANCE_ROLLING_BACK;
+import static org.apache.aurora.gen.JobUpdateAction.INSTANCE_UPDATED;
+import static org.apache.aurora.gen.JobUpdateAction.INSTANCE_UPDATING;
 import static org.junit.Assert.assertEquals;
 
 public class DBJobUpdateStoreTest {
@@ -168,8 +171,8 @@ public class DBJobUpdateStoreTest {
   public void testSaveInstanceEvents() {
     String updateId = "u3";
     IJobUpdate update = makeJobUpdate(JOB, updateId);
-    IJobInstanceUpdateEvent event1 = makeJobInstanceEvent(0, 125L, INSTANCE_ADDED);
-    IJobInstanceUpdateEvent event2 = makeJobInstanceEvent(1, 126L, INSTANCE_ADDED);
+    IJobInstanceUpdateEvent event1 = makeJobInstanceEvent(0, 125L, INSTANCE_UPDATED);
+    IJobInstanceUpdateEvent event2 = makeJobInstanceEvent(1, 126L, INSTANCE_ROLLING_BACK);
 
     saveUpdate(update, "lock");
     assertUpdate(update);
@@ -198,7 +201,7 @@ public class DBJobUpdateStoreTest {
 
   @Test(expected = StorageException.class)
   public void testSaveInstanceEventWithoutUpdateFails() {
-    saveJobInstanceEvent(makeJobInstanceEvent(0, 125L, INSTANCE_ADDED), "u1");
+    saveJobInstanceEvent(makeJobInstanceEvent(0, 125L, INSTANCE_UPDATED), "u1");
   }
 
   @Test
@@ -250,13 +253,13 @@ public class DBJobUpdateStoreTest {
 
     IJobUpdateEvent jEvent11 = makeJobUpdateEvent(JobUpdateStatus.ROLLING_FORWARD, 456L);
     IJobUpdateEvent jEvent12 = makeJobUpdateEvent(JobUpdateStatus.ERROR, 457L);
-    IJobInstanceUpdateEvent iEvent11 = makeJobInstanceEvent(1, 451L, INSTANCE_ADDED);
-    IJobInstanceUpdateEvent iEvent12 = makeJobInstanceEvent(2, 452L, INSTANCE_ADDED);
+    IJobInstanceUpdateEvent iEvent11 = makeJobInstanceEvent(1, 451L, INSTANCE_UPDATED);
+    IJobInstanceUpdateEvent iEvent12 = makeJobInstanceEvent(2, 452L, INSTANCE_UPDATING);
 
     IJobUpdateEvent jEvent21 = makeJobUpdateEvent(JobUpdateStatus.ROLL_FORWARD_PAUSED, 567L);
     IJobUpdateEvent jEvent22 = makeJobUpdateEvent(JobUpdateStatus.ABORTED, 568L);
-    IJobInstanceUpdateEvent iEvent21 = makeJobInstanceEvent(3, 561L, INSTANCE_ADDED);
-    IJobInstanceUpdateEvent iEvent22 = makeJobInstanceEvent(4, 562L, INSTANCE_ADDED);
+    IJobInstanceUpdateEvent iEvent21 = makeJobInstanceEvent(3, 561L, INSTANCE_UPDATED);
+    IJobInstanceUpdateEvent iEvent22 = makeJobInstanceEvent(4, 562L, INSTANCE_UPDATING);
 
     saveJobEvent(jEvent11, updateId1);
     saveJobEvent(jEvent12, updateId1);
@@ -293,7 +296,7 @@ public class DBJobUpdateStoreTest {
     IJobUpdateEvent updateEvent = IJobUpdateEvent.build(
         new JobUpdateEvent(JobUpdateStatus.ROLLING_FORWARD, 123L));
     IJobInstanceUpdateEvent instanceEvent = IJobInstanceUpdateEvent.build(
-        new JobInstanceUpdateEvent(0, 125L, INSTANCE_ADDED));
+        new JobInstanceUpdateEvent(0, 125L, INSTANCE_ROLLBACK_FAILED));
 
     saveUpdate(update, "lock");
     saveJobEvent(updateEvent, updateId);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/fe025c5c/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java b/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
index ca990e7..b1d79a6 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
@@ -808,7 +808,7 @@ public class LogStorageTest extends EasyMockTest {
   @Test
   public void testSaveJobInstanceUpdateEvent() throws Exception {
     final IJobInstanceUpdateEvent event = IJobInstanceUpdateEvent.build(new JobInstanceUpdateEvent()
-        .setAction(JobUpdateAction.INSTANCE_ADDED)
+        .setAction(JobUpdateAction.INSTANCE_ROLLING_BACK)
         .setTimestampMs(12345L)
         .setInstanceId(0));
 


Mime
View raw message