aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject git commit: Implementing support for DRAINING state.
Date Thu, 13 Feb 2014 16:24:11 GMT
Updated Branches:
  refs/heads/master 6f547490c -> 29aecee8c


Implementing support for DRAINING state.

Bugs closed: AURORA-82

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


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

Branch: refs/heads/master
Commit: 29aecee8c38cab286d269225878cebc8b11c0895
Parents: 6f54749
Author: Maxim Khutornenko <maxim@apache.org>
Authored: Thu Feb 13 08:22:16 2014 -0800
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Thu Feb 13 08:22:16 2014 -0800

----------------------------------------------------------------------
 .../scheduler/async/RescheduleCalculator.java   |  3 +-
 .../aurora/scheduler/async/TaskTimeout.java     |  3 +-
 .../aurora/scheduler/http/SchedulerzRole.java   |  1 +
 .../scheduler/state/MaintenanceController.java  |  2 +-
 .../scheduler/state/TaskStateMachine.java       | 26 +++++-
 .../scheduler/storage/StorageBackfill.java      | 13 ---
 .../thrift/org/apache/aurora/gen/api.thrift     |  1 +
 .../aurora/scheduler/async/TaskTimeoutTest.java |  3 +
 .../state/MaintenanceControllerImplTest.java    |  2 +-
 .../scheduler/state/TaskStateMachineTest.java   | 41 +++++++--
 .../scheduler/storage/StorageBackfillTest.java  | 88 --------------------
 .../org/apache/aurora/gen/api.thrift.md5        |  2 +-
 12 files changed, 70 insertions(+), 115 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java b/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
index b7e6447..bc77bf2 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
@@ -44,6 +44,7 @@ import org.apache.aurora.scheduler.storage.entities.ITaskEvent;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
+import static org.apache.aurora.gen.ScheduleStatus.DRAINING;
 import static org.apache.aurora.gen.ScheduleStatus.KILLING;
 import static org.apache.aurora.gen.ScheduleStatus.RESTARTING;
 
@@ -90,7 +91,7 @@ public interface RescheduleCalculator {
         };
 
     private static final Set<ScheduleStatus> INTERRUPTED_TASK_STATES =
-        EnumSet.of(RESTARTING, KILLING);
+        EnumSet.of(RESTARTING, KILLING, DRAINING);
 
     private final Predicate<IScheduledTask> flapped = new Predicate<IScheduledTask>()
{
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java b/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
index 609e8cc..82b483b 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
@@ -69,7 +69,8 @@ class TaskTimeout implements EventSubscriber {
       ScheduleStatus.ASSIGNED,
       ScheduleStatus.PREEMPTING,
       ScheduleStatus.RESTARTING,
-      ScheduleStatus.KILLING);
+      ScheduleStatus.KILLING,
+      ScheduleStatus.DRAINING);
 
   private final Map<TimeoutKey, Context> futures = Maps.newConcurrentMap();
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/main/java/org/apache/aurora/scheduler/http/SchedulerzRole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/SchedulerzRole.java b/src/main/java/org/apache/aurora/scheduler/http/SchedulerzRole.java
index 4cb5882..25ba7da 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/SchedulerzRole.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/SchedulerzRole.java
@@ -269,6 +269,7 @@ public class SchedulerzRole extends JerseyTemplateServlet {
                 case ASSIGNED:
                 case STARTING:
                 case RESTARTING:
+                case DRAINING:
                 case RUNNING:
                 case KILLING:
                 case PREEMPTING:

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java b/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
index 0e2c17b..155fdd1 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
@@ -133,7 +133,7 @@ public interface MaintenanceController {
             stateManager.changeState(
                 taskId,
                 Optional.<ScheduleStatus>absent(),
-                ScheduleStatus.RESTARTING,
+                ScheduleStatus.DRAINING,
                 DRAINING_MESSAGE);
           }
         }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java b/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
index 0b39b84..15d1c1f 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
@@ -42,6 +42,7 @@ import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import static org.apache.aurora.gen.ScheduleStatus.ASSIGNED;
+import static org.apache.aurora.gen.ScheduleStatus.DRAINING;
 import static org.apache.aurora.gen.ScheduleStatus.FAILED;
 import static org.apache.aurora.gen.ScheduleStatus.FINISHED;
 import static org.apache.aurora.gen.ScheduleStatus.INIT;
@@ -224,8 +225,8 @@ class TaskStateMachine {
             .withCallback(deleteIfKilling))
         .addState(
             Rule.from(ASSIGNED)
-                .to(STARTING, RUNNING, FINISHED, FAILED, RESTARTING, KILLED,
-                    KILLING, LOST, PREEMPTING)
+                .to(STARTING, RUNNING, FINISHED, FAILED, RESTARTING, DRAINING,
+                    KILLED, KILLING, LOST, PREEMPTING)
                 .withCallback(
                     new Closure<Transition<ScheduleStatus>>() {
                       @Override
@@ -247,6 +248,10 @@ class TaskStateMachine {
                             addFollowup(KILL);
                             break;
 
+                          case DRAINING:
+                            addFollowup(KILL);
+                            break;
+
                           case KILLED:
                             addFollowup(RESCHEDULE);
                             break;
@@ -268,7 +273,8 @@ class TaskStateMachine {
                 ))
         .addState(
             Rule.from(STARTING)
-                .to(RUNNING, FINISHED, FAILED, RESTARTING, KILLING, KILLED, LOST, PREEMPTING)
+                .to(RUNNING, FINISHED, FAILED, RESTARTING, DRAINING, KILLING,
+                    KILLED, LOST, PREEMPTING)
                 .withCallback(
                     new Closure<Transition<ScheduleStatus>>() {
                       @Override
@@ -282,6 +288,10 @@ class TaskStateMachine {
                             addFollowup(KILL);
                             break;
 
+                          case DRAINING:
+                            addFollowup(KILL);
+                            break;
+
                           case PREEMPTING:
                             addFollowup(KILL);
                             break;
@@ -316,7 +326,7 @@ class TaskStateMachine {
                 ))
         .addState(
             Rule.from(RUNNING)
-                .to(FINISHED, RESTARTING, FAILED, KILLING, KILLED, LOST, PREEMPTING)
+                .to(FINISHED, RESTARTING, DRAINING, FAILED, KILLING, KILLED, LOST, PREEMPTING)
                 .withCallback(
                     new Closure<Transition<ScheduleStatus>>() {
                       @Override
@@ -334,6 +344,10 @@ class TaskStateMachine {
                             addFollowup(KILL);
                             break;
 
+                          case DRAINING:
+                            addFollowup(KILL);
+                            break;
+
                           case FAILED:
                             incrementFailuresMaybeReschedule.execute();
                             break;
@@ -373,6 +387,10 @@ class TaskStateMachine {
                 .to(FINISHED, FAILED, KILLING, KILLED, LOST)
                 .withCallback(manageRestartingTask))
         .addState(
+            Rule.from(DRAINING)
+                .to(FINISHED, FAILED, KILLING, KILLED, LOST)
+                .withCallback(manageRestartingTask))
+        .addState(
             Rule.from(FAILED)
                 .to(UNKNOWN)
                 .withCallback(manageTerminatedTasks))

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java b/src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java
index 714bceb..6622216 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java
@@ -102,18 +102,6 @@ public final class StorageBackfill {
   }
 
   /**
-   * Ensures backwards-compatibility of the DRAINING state, which exists in this version
but is
-   * not handled.
-   *
-   * @param task Task to possibly rewrite.
-   */
-  private static void rewriteDrainingState(ScheduledTask task) {
-    if (ScheduleStatus.DRAINING == task.getStatus()) {
-      task.setStatus(ScheduleStatus.RESTARTING);
-    }
-  }
-
-  /**
    * Backfills the storage to make it match any assumptions that may have changed since
    * the structs were first written.
    *
@@ -132,7 +120,6 @@ public final class StorageBackfill {
         // TODO(ksweeney): Guarantee tasks pass current validation code here and quarantine
if they
         // don't.
         guaranteeShardUniqueness(builder, storeProvider.getUnsafeTaskStore(), clock);
-        rewriteDrainingState(builder);
         return IScheduledTask.build(builder);
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/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 23883cf..43a2496 100644
--- a/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -285,6 +285,7 @@ const set<ScheduleStatus> SLAVE_ASSIGNED_STATES = [ScheduleStatus.ASSIGNED,
 const set<ScheduleStatus> LIVE_STATES = [ScheduleStatus.KILLING,
                                          ScheduleStatus.PREEMPTING,
                                          ScheduleStatus.RESTARTING,
+                                         ScheduleStatus.DRAINING,
                                          ScheduleStatus.RUNNING]
 
 // States a completed task may be in.

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/test/java/org/apache/aurora/scheduler/async/TaskTimeoutTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/async/TaskTimeoutTest.java b/src/test/java/org/apache/aurora/scheduler/async/TaskTimeoutTest.java
index d4685f6..71d6a9e 100644
--- a/src/test/java/org/apache/aurora/scheduler/async/TaskTimeoutTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/async/TaskTimeoutTest.java
@@ -47,6 +47,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 import static org.apache.aurora.gen.ScheduleStatus.ASSIGNED;
+import static org.apache.aurora.gen.ScheduleStatus.DRAINING;
 import static org.apache.aurora.gen.ScheduleStatus.FINISHED;
 import static org.apache.aurora.gen.ScheduleStatus.INIT;
 import static org.apache.aurora.gen.ScheduleStatus.KILLED;
@@ -280,6 +281,7 @@ public class TaskTimeoutTest extends EasyMockTest {
     checkOutstandingTimer(ASSIGNED, 0);
     checkOutstandingTimer(PREEMPTING, 0);
     checkOutstandingTimer(RESTARTING, 0);
+    checkOutstandingTimer(DRAINING, 0);
     checkOutstandingTimer(KILLING, 0);
 
     changeState("a", PENDING, ASSIGNED);
@@ -309,6 +311,7 @@ public class TaskTimeoutTest extends EasyMockTest {
     checkOutstandingTimer(ASSIGNED, 0);
     checkOutstandingTimer(PREEMPTING, 0);
     checkOutstandingTimer(RESTARTING, 0);
+    checkOutstandingTimer(DRAINING, 0);
     checkOutstandingTimer(KILLING, 0);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/test/java/org/apache/aurora/scheduler/state/MaintenanceControllerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/state/MaintenanceControllerImplTest.java
b/src/test/java/org/apache/aurora/scheduler/state/MaintenanceControllerImplTest.java
index 56b691e..faa3885 100644
--- a/src/test/java/org/apache/aurora/scheduler/state/MaintenanceControllerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/state/MaintenanceControllerImplTest.java
@@ -105,7 +105,7 @@ public class MaintenanceControllerImplTest extends EasyMockTest {
     expect(stateManager.changeState(
         Tasks.id(task),
         Optional.<ScheduleStatus>absent(),
-        ScheduleStatus.RESTARTING,
+        ScheduleStatus.DRAINING,
         MaintenanceControllerImpl.DRAINING_MESSAGE))
         .andReturn(true);
     expectMaintenanceModeChange(HOST_A, DRAINING);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/test/java/org/apache/aurora/scheduler/state/TaskStateMachineTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/state/TaskStateMachineTest.java b/src/test/java/org/apache/aurora/scheduler/state/TaskStateMachineTest.java
index a2aaeeb..77380d9 100644
--- a/src/test/java/org/apache/aurora/scheduler/state/TaskStateMachineTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/state/TaskStateMachineTest.java
@@ -179,6 +179,27 @@ public class TaskStateMachineTest {
   }
 
   @Test
+  public void testDrainedTask() {
+    expectUpdateStateOnTransitionTo(PENDING, ASSIGNED, STARTING, RUNNING);
+    legalTransition(DRAINING, Action.SAVE_STATE, Action.KILL);
+    legalTransition(FINISHED, Action.SAVE_STATE, Action.RESCHEDULE);
+  }
+
+  @Test
+  public void testRogueDrainedTask() {
+    expectUpdateStateOnTransitionTo(PENDING, ASSIGNED, STARTING, RUNNING);
+    legalTransition(DRAINING, Action.SAVE_STATE, Action.KILL);
+    illegalTransition(RUNNING, Action.KILL);
+  }
+
+  @Test
+  public void testPendingDrainedTask() {
+    expectUpdateStateOnTransitionTo(PENDING);
+    // PENDING -> DRAINING should not be allowed.
+    illegalTransition(DRAINING);
+  }
+
+  @Test
   public void testAllowsSkipStartingAndRunning() {
     expectUpdateStateOnTransitionTo(PENDING, ASSIGNED, FINISHED);
   }
@@ -384,6 +405,7 @@ public class TaskStateMachineTest {
           .put(new TestCase(true, ASSIGNED, FINISHED), SAVE)
           .put(new TestCase(true, ASSIGNED, PREEMPTING), SAVE_AND_KILL)
           .put(new TestCase(true, ASSIGNED, RESTARTING), SAVE_AND_KILL)
+          .put(new TestCase(true, ASSIGNED, DRAINING), SAVE_AND_KILL)
           .put(new TestCase(true, ASSIGNED, FAILED), RECORD_FAILURE)
           .put(new TestCase(true, ASSIGNED, KILLED), SAVE_AND_RESCHEDULE)
           .put(new TestCase(true, ASSIGNED, KILLING), SAVE_AND_KILL)
@@ -395,6 +417,7 @@ public class TaskStateMachineTest {
           .put(new TestCase(true, STARTING, FINISHED), SAVE)
           .put(new TestCase(true, STARTING, PREEMPTING), SAVE_AND_KILL)
           .put(new TestCase(true, STARTING, RESTARTING), SAVE_AND_KILL)
+          .put(new TestCase(true, STARTING, DRAINING), SAVE_AND_KILL)
           .put(new TestCase(true, STARTING, FAILED), RECORD_FAILURE)
           .put(new TestCase(true, STARTING, KILLED), SAVE_AND_RESCHEDULE)
           .put(new TestCase(true, STARTING, KILLING), SAVE_AND_KILL)
@@ -406,6 +429,7 @@ public class TaskStateMachineTest {
           .put(new TestCase(true, RUNNING, FINISHED), SAVE)
           .put(new TestCase(true, RUNNING, PREEMPTING), SAVE_AND_KILL)
           .put(new TestCase(true, RUNNING, RESTARTING), SAVE_AND_KILL)
+          .put(new TestCase(true, RUNNING, DRAINING), SAVE_AND_KILL)
           .put(new TestCase(true, RUNNING, FAILED), RECORD_FAILURE)
           .put(new TestCase(true, RUNNING, KILLED), SAVE_AND_RESCHEDULE)
           .put(new TestCase(true, RUNNING, KILLING), SAVE_AND_KILL)
@@ -442,6 +466,18 @@ public class TaskStateMachineTest {
           .put(new TestCase(true, RESTARTING, KILLING), SAVE)
           .put(new TestCase(true, RESTARTING, LOST), SAVE_KILL_AND_RESCHEDULE)
           .put(new TestCase(true, RESTARTING, UNKNOWN), MARK_LOST)
+          .put(new TestCase(true, DRAINING, ASSIGNED), ILLEGAL_KILL)
+          .put(new TestCase(false, DRAINING, ASSIGNED), ILLEGAL_KILL)
+          .put(new TestCase(true, DRAINING, STARTING), ILLEGAL_KILL)
+          .put(new TestCase(false, DRAINING, STARTING), ILLEGAL_KILL)
+          .put(new TestCase(true, DRAINING, RUNNING), ILLEGAL_KILL)
+          .put(new TestCase(false, DRAINING, RUNNING), ILLEGAL_KILL)
+          .put(new TestCase(true, DRAINING, FINISHED), SAVE_AND_RESCHEDULE)
+          .put(new TestCase(true, DRAINING, FAILED), SAVE_AND_RESCHEDULE)
+          .put(new TestCase(true, DRAINING, KILLED), SAVE_AND_RESCHEDULE)
+          .put(new TestCase(true, DRAINING, KILLING), SAVE)
+          .put(new TestCase(true, DRAINING, LOST), SAVE_KILL_AND_RESCHEDULE)
+          .put(new TestCase(true, DRAINING, UNKNOWN), MARK_LOST)
           .put(new TestCase(true, FAILED, ASSIGNED), ILLEGAL_KILL)
           .put(new TestCase(false, FAILED, ASSIGNED), ILLEGAL_KILL)
           .put(new TestCase(true, FAILED, STARTING), ILLEGAL_KILL)
@@ -512,11 +548,6 @@ public class TaskStateMachineTest {
             machine = new TaskStateMachine("name");
           }
 
-          // TODO(maximk): Drop when DRAINING support is implemented.
-          if (from == DRAINING || to == DRAINING) {
-            continue;
-          }
-
           assertEquals(
               "Unexpected behavior for " + testCase,
               expectation,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/test/java/org/apache/aurora/scheduler/storage/StorageBackfillTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/StorageBackfillTest.java b/src/test/java/org/apache/aurora/scheduler/storage/StorageBackfillTest.java
deleted file mode 100644
index c0cc0a4..0000000
--- a/src/test/java/org/apache/aurora/scheduler/storage/StorageBackfillTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright 2014 Apache Software Foundation
- *
- * 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.storage;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.twitter.common.util.testing.FakeClock;
-
-import org.apache.aurora.gen.AssignedTask;
-import org.apache.aurora.gen.Constraint;
-import org.apache.aurora.gen.Identity;
-import org.apache.aurora.gen.LimitConstraint;
-import org.apache.aurora.gen.ScheduleStatus;
-import org.apache.aurora.gen.ScheduledTask;
-import org.apache.aurora.gen.TaskConfig;
-import org.apache.aurora.gen.TaskConstraint;
-import org.apache.aurora.scheduler.base.Query;
-import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
-import org.apache.aurora.scheduler.storage.mem.MemStorage;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class StorageBackfillTest {
-
-  private Storage storage;
-  private FakeClock clock;
-
-  @Before
-  public void setUp() {
-    storage = MemStorage.newEmptyStorage();
-    clock = new FakeClock();
-  }
-
-  @Test
-  public void testRewriteDrainingState() {
-    final String taskId = "id";
-    final IScheduledTask savedTask =
-        IScheduledTask.build(makeTask(taskId).newBuilder().setStatus(ScheduleStatus.DRAINING));
-
-    storage.write(new Storage.MutateWork.NoResult.Quiet() {
-      @Override
-      protected void execute(Storage.MutableStoreProvider storeProvider) {
-        storeProvider.getUnsafeTaskStore().saveTasks(ImmutableSet.of(savedTask));
-        StorageBackfill.backfill(storeProvider, clock);
-      }
-    });
-
-    assertEquals(
-        IScheduledTask.build(savedTask.newBuilder().setStatus(ScheduleStatus.RESTARTING)),
-        Iterables.getOnlyElement(Storage.Util.consistentFetchTasks(
-            storage,
-            Query.taskScoped(taskId))));
-  }
-
-  private static IScheduledTask makeTask(String id) {
-    TaskConfig config = new TaskConfig()
-        .setOwner(new Identity("user", "role"))
-        .setEnvironment("test")
-        .setJobName("jobName")
-        .setProduction(false)
-        .setRequestedPorts(ImmutableSet.<String>of())
-        .setTaskLinks(ImmutableMap.<String, String>of())
-        .setMaxTaskFailures(1)
-        .setConstraints(ImmutableSet.of(
-            new Constraint("host", TaskConstraint.limit(new LimitConstraint(1)))));
-
-    ScheduledTask task = new ScheduledTask().setAssignedTask(new AssignedTask().setTask(config));
-    task.getAssignedTask().setTaskId(id);
-
-    return IScheduledTask.build(task);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/29aecee8/src/test/resources/org/apache/aurora/gen/api.thrift.md5
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/aurora/gen/api.thrift.md5 b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
index 2bdd038..10f5cda 100644
--- a/src/test/resources/org/apache/aurora/gen/api.thrift.md5
+++ b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
@@ -1 +1 @@
-049d4b884c2d698e27c627796bd46e65
+152048bed66e3b7a92e5f0343c556bee


Mime
View raw message