aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmclaugh...@apache.org
Subject git commit: Add usernames to scheduler update operations.
Date Thu, 02 Oct 2014 02:34:39 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 41118cf63 -> 102b83c7e


Add usernames to scheduler update operations.

Bugs closed: AURORA-772

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


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

Branch: refs/heads/master
Commit: 102b83c7e94fcc061c9e4cb3d6a821857a0441bb
Parents: 41118cf
Author: David McLaughlin <david@dmclaughlin.com>
Authored: Wed Oct 1 19:30:37 2014 -0700
Committer: David McLaughlin <dmclaughlin@twitter.com>
Committed: Wed Oct 1 19:30:37 2014 -0700

----------------------------------------------------------------------
 .../thrift/SchedulerThriftInterface.java        | 15 +++---
 .../scheduler/updater/JobUpdateController.java  | 13 +++--
 .../updater/JobUpdateControllerImpl.java        | 55 ++++++++++++++------
 .../apache/aurora/scheduler/http/ui/update.html |  2 +
 .../storage/db/JobUpdateDetailsMapper.xml       |  1 +
 .../storage/db/JobUpdateEventMapper.xml         |  2 +
 .../aurora/scheduler/storage/db/schema.sql      |  3 +-
 .../thrift/org/apache/aurora/gen/api.thrift     |  3 ++
 .../storage/db/DBJobUpdateStoreTest.java        | 15 +++++-
 .../thrift/SchedulerThriftInterfaceTest.java    | 12 ++---
 .../aurora/scheduler/updater/JobUpdaterIT.java  | 14 ++---
 11 files changed, 91 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
index 01fc345..23115fb 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -1464,8 +1464,9 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
       public Response apply(MutableStoreProvider storeProvider) {
         try {
           IJobKey jobKey = JobKeys.assertValid(IJobKey.build(requireNonNull(mutableJobKey)));
-          sessionValidator.checkAuthenticated(session, ImmutableSet.of(jobKey.getRole()));
-          jobUpdateController.pause(jobKey);
+          SessionContext context = sessionValidator
+              .checkAuthenticated(session, ImmutableSet.of(jobKey.getRole()));
+          jobUpdateController.pause(jobKey, context.getIdentity());
           return okEmptyResponse();
         } catch (AuthFailedException e) {
           return errorResponse(AUTH_FAILED, e);
@@ -1483,8 +1484,9 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
       public Response apply(MutableStoreProvider storeProvider) {
         try {
           IJobKey jobKey = JobKeys.assertValid(IJobKey.build(requireNonNull(mutableJobKey)));
-          sessionValidator.checkAuthenticated(session, ImmutableSet.of(jobKey.getRole()));
-          jobUpdateController.resume(jobKey);
+          SessionContext context = sessionValidator
+              .checkAuthenticated(session, ImmutableSet.of(jobKey.getRole()));
+          jobUpdateController.resume(jobKey, context.getIdentity());
           return okEmptyResponse();
         } catch (AuthFailedException e) {
           return errorResponse(AUTH_FAILED, e);
@@ -1502,8 +1504,9 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
       public Response apply(MutableStoreProvider storeProvider) {
         try {
           IJobKey jobKey = JobKeys.assertValid(IJobKey.build(requireNonNull(mutableJobKey)));
-          sessionValidator.checkAuthenticated(session, ImmutableSet.of(jobKey.getRole()));
-          jobUpdateController.abort(jobKey);
+          SessionContext context = sessionValidator
+              .checkAuthenticated(session, ImmutableSet.of(jobKey.getRole()));
+          jobUpdateController.abort(jobKey, context.getIdentity());
           return okEmptyResponse();
         } catch (AuthFailedException e) {
           return errorResponse(AUTH_FAILED, e);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateController.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateController.java b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateController.java
index b8dafe0..d3b30d4 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateController.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateController.java
@@ -47,12 +47,13 @@ public interface JobUpdateController {
   /**
    * Pauses an in-progress update.
    * <p>
-   * A paused update may be resumed by invoking {@link #resume(IJobKey)}.
+   * A paused update may be resumed by invoking {@link #resume(IJobKey, String)}.
    *
    * @param job Job whose update should be paused.
+   * @param pausingUser The name of the user who is pausing the update.
    * @throws UpdateStateException If the job update is not in a state that may be paused.
    */
-  void pause(IJobKey job) throws UpdateStateException;
+  void pause(IJobKey job, String pausingUser) throws UpdateStateException;
 
   /**
    * Resumes a paused in-progress update.
@@ -62,9 +63,10 @@ public interface JobUpdateController {
    * resume rolling back.
    *
    * @param job Job whose update should be resumed.
+   * @param resumingUser The name of the user who is resuming the update.
    * @throws UpdateStateException If the job update is not in a state that may be resumed.
    */
-  void resume(IJobKey job) throws UpdateStateException;
+  void resume(IJobKey job, String resumingUser) throws UpdateStateException;
 
   /**
    * Aborts an in-progress update.
@@ -73,9 +75,10 @@ public interface JobUpdateController {
    * update. An aborted update may not be resumed.
    *
    * @param job Job whose update should be aborted.
+   * @param abortingUser The name of the user who is aborting the update.
    * @throws UpdateStateException If there is no active update for the job.
    */
-  void abort(IJobKey job) throws UpdateStateException;
+  void abort(IJobKey job, String abortingUser) throws UpdateStateException;
 
   /**
    * Notifies the updater that the state of an instance has changed. A state change could
also mean
@@ -94,7 +97,7 @@ public interface JobUpdateController {
 
   /**
    * Restores active updates that have been halted due to the scheduler restarting.
-   * This is distinct from {@link #resume(IJobKey)} in that it does not change the state
of
+   * This is distinct from {@link #resume(IJobKey, String)} in that it does not change the
state of
    * updates, but resumes after a restart of the scheduler process.
    */
   void systemResume();

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
index faa2136..6ec130f 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateControllerImpl.java
@@ -163,33 +163,34 @@ class JobUpdateControllerImpl implements JobUpdateController {
             storeProvider.getTaskStore(),
             summary.getUpdateId(),
             job,
-            ROLLING_FORWARD);
+            ROLLING_FORWARD,
+            Optional.of(updatingUser));
       }
     });
   }
 
   @Override
-  public void pause(final IJobKey job) throws UpdateStateException {
+  public void pause(final IJobKey job, String user) throws UpdateStateException {
     requireNonNull(job);
     LOG.info("Attempting to pause update for " + job);
-    unscopedChangeUpdateStatus(job, JobUpdateStateMachine.GET_PAUSE_STATE);
+    unscopedChangeUpdateStatus(job, JobUpdateStateMachine.GET_PAUSE_STATE, Optional.of(user));
   }
 
-  public void resume(IJobKey job) throws UpdateStateException {
+  public void resume(IJobKey job, String user) throws UpdateStateException {
     requireNonNull(job);
     LOG.info("Attempting to resume update for " + job);
-    unscopedChangeUpdateStatus(job, JobUpdateStateMachine.GET_RESUME_STATE);
+    unscopedChangeUpdateStatus(job, JobUpdateStateMachine.GET_RESUME_STATE, Optional.of(user));
   }
 
   @Override
-  public void abort(IJobKey job) throws UpdateStateException {
+  public void abort(IJobKey job, String user) throws UpdateStateException {
     requireNonNull(job);
     unscopedChangeUpdateStatus(job, new Function<JobUpdateStatus, JobUpdateStatus>()
{
       @Override
       public JobUpdateStatus apply(JobUpdateStatus input) {
         return ABORTED;
       }
-    });
+    }, Optional.of(user));
   }
 
   @Override
@@ -207,6 +208,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
               summary.getUpdateId(),
               summary.getJobKey(),
               summary.getState().getStatus(),
+              Optional.<String>absent(),
               false);
         }
       }
@@ -277,12 +279,14 @@ class JobUpdateControllerImpl implements JobUpdateController {
    *
    * @param job Job whose update state should be changed.
    * @param stateChange State change computation, based on the current state of the update.
+   * @param user The user who is changing the state.
    * @throws UpdateStateException If no active update exists for the provided {@code job},
or
    *                              if the proposed state transition is not allowed.
    */
   private void unscopedChangeUpdateStatus(
       final IJobKey job,
-      final Function<JobUpdateStatus, JobUpdateStatus> stateChange)
+      final Function<JobUpdateStatus, JobUpdateStatus> stateChange,
+      final Optional<String> user)
       throws UpdateStateException {
 
     storage.write(new MutateWork.NoResult<UpdateStateException>() {
@@ -302,7 +306,8 @@ class JobUpdateControllerImpl implements JobUpdateController {
             storeProvider.getJobUpdateStore(),
             storeProvider.getTaskStore(),
             update,
-            newStatus);
+            newStatus,
+            user);
       }
     });
   }
@@ -311,7 +316,8 @@ class JobUpdateControllerImpl implements JobUpdateController {
       JobUpdateStore.Mutable updateStore,
       TaskStore taskStore,
       IJobUpdateSummary updateSummary,
-      JobUpdateStatus newStatus) {
+      JobUpdateStatus newStatus,
+      Optional<String> user) {
 
     if (updateSummary.getState().getStatus() == newStatus) {
       return;
@@ -323,7 +329,8 @@ class JobUpdateControllerImpl implements JobUpdateController {
         taskStore,
         updateSummary.getUpdateId(),
         updateSummary.getJobKey(),
-        newStatus);
+        newStatus,
+        user);
   }
 
   private void recordAndChangeJobUpdateStatus(
@@ -331,9 +338,10 @@ class JobUpdateControllerImpl implements JobUpdateController {
       TaskStore taskStore,
       String updateId,
       IJobKey job,
-      JobUpdateStatus status) {
+      JobUpdateStatus status,
+      Optional<String> user) {
 
-    changeJobUpdateStatus(updateStore, taskStore, updateId, job, status, true);
+    changeJobUpdateStatus(updateStore, taskStore, updateId, job, status, user, true);
   }
 
   private static final Set<JobUpdateStatus> UNLOCK_STATES = ImmutableSet.of(
@@ -350,6 +358,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
       String updateId,
       IJobKey job,
       JobUpdateStatus newStatus,
+      Optional<String> user,
       boolean recordChange) {
 
     JobUpdateStatus status;
@@ -371,6 +380,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
       updateStore.saveJobUpdateEvent(
           IJobUpdateEvent.build(new JobUpdateEvent()
               .setStatus(status)
+              .setUser(user.orNull())
               .setTimestampMs(clock.nowMillis())),
           updateId);
     }
@@ -397,7 +407,7 @@ class JobUpdateControllerImpl implements JobUpdateController {
         update = updateFactory.newUpdate(jobUpdate.getInstructions(), action == ROLL_FORWARD);
       } catch (RuntimeException e) {
         LOG.log(Level.WARNING, "Uncaught exception: " + e, e);
-        changeJobUpdateStatus(updateStore, taskStore, updateId, job, ERROR, true);
+        changeJobUpdateStatus(updateStore, taskStore, updateId, job, ERROR, user, true);
         return;
       }
       updates.put(job, update);
@@ -438,7 +448,8 @@ class JobUpdateControllerImpl implements JobUpdateController {
           taskStore,
           summary.getUpdateId(),
           job,
-          ERROR);
+          ERROR,
+          Optional.<String>absent());
       return;
     }
 
@@ -494,9 +505,19 @@ class JobUpdateControllerImpl implements JobUpdateController {
       }
 
       if (status == SUCCEEDED) {
-        changeUpdateStatus(updateStore, taskStore, summary, update.getSuccessStatus());
+        changeUpdateStatus(
+            updateStore,
+            taskStore,
+            summary,
+            update.getSuccessStatus(),
+            Optional.<String>absent());
       } else {
-        changeUpdateStatus(updateStore, taskStore, summary, update.getFailureStatus());
+        changeUpdateStatus(
+            updateStore,
+            taskStore,
+            summary,
+            update.getFailureStatus(),
+            Optional.<String>absent());
       }
     } else {
       LOG.info("Executing side-effects for update of " + job + ": " + result.getSideEffects());

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/main/resources/org/apache/aurora/scheduler/http/ui/update.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/update.html b/src/main/resources/org/apache/aurora/scheduler/http/ui/update.html
index aaff5b2..2ce13b4 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/update.html
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/update.html
@@ -87,10 +87,12 @@
             <tr>
               <th>event</th>
               <th>time</th>
+              <th>user</th>
             </tr>
             <tr ng-repeat="e in update.updateEvents">
               <td>{{e.status | toNiceStatus}}</td>
               <td>{{e.timestampMs | toElapsedTime }} ago</td>
+              <td>{{e.user}}</td>
             </tr>
           </table>
         </div>

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateDetailsMapper.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateDetailsMapper.xml
b/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateDetailsMapper.xml
index 631ab25..2a81a94 100644
--- a/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateDetailsMapper.xml
+++ b/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateDetailsMapper.xml
@@ -338,6 +338,7 @@
       <include refid="job_update_columns" />,
       e.id AS e_id,
       e.status AS e_status,
+      e.user AS e_user,
       e.timestamp_ms AS e_timestamp_ms,
       i.id AS i_id,
       i.action AS i_action,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateEventMapper.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateEventMapper.xml
b/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateEventMapper.xml
index 9b7e8ba..9f23c4b 100644
--- a/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateEventMapper.xml
+++ b/src/main/resources/org/apache/aurora/scheduler/storage/db/JobUpdateEventMapper.xml
@@ -21,6 +21,7 @@
     INSERT INTO job_update_events (
       update_id,
       status,
+      user,
       timestamp_ms
     ) VALUES (
       (
@@ -29,6 +30,7 @@
         WHERE update_id = #{updateId}
       ),
       #{event.status, typeHandler=org.apache.aurora.scheduler.storage.db.typehandlers.JobUpdateStatusTypeHandler},
+      #{event.user},
       #{event.timestampMs}
     )
   </insert>

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql b/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
index 2894b61..db6a871 100644
--- a/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
+++ b/src/main/resources/org/apache/aurora/scheduler/storage/db/schema.sql
@@ -157,7 +157,8 @@ CREATE TABLE job_update_events(
   id IDENTITY,
   update_id BIGINT NOT NULL REFERENCES job_updates(id) ON DELETE CASCADE,
   status INT NOT NULL REFERENCES job_update_statuses(id),
-  timestamp_ms BIGINT NOT NULL
+  timestamp_ms BIGINT NOT NULL,
+  user VARCHAR
 );
 
 CREATE TABLE job_instance_update_events(

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/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 a1217ed..8794731 100644
--- a/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -621,6 +621,9 @@ struct JobUpdateEvent {
 
   /** Epoch timestamp in milliseconds. */
   2: i64 timestampMs
+
+  /** User who performed this event (if user-initiated). */
+  3: optional string user
 }
 
 /** Event marking a state transition in job instance update lifecycle. */

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/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 1b1160f..dbf0bad 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
@@ -217,9 +217,10 @@ public class DBJobUpdateStoreTest {
   @Test
   public void testSaveJobEvents() {
     String updateId = "u3";
+    String user = "test";
     IJobUpdate update = makeJobUpdate(JOB, updateId);
-    IJobUpdateEvent event1 = makeJobUpdateEvent(ROLLING_FORWARD, 124L);
-    IJobUpdateEvent event2 = makeJobUpdateEvent(ROLL_FORWARD_PAUSED, 125L);
+    IJobUpdateEvent event1 = makeJobUpdateEvent(ROLLING_FORWARD, 124L, user);
+    IJobUpdateEvent event2 = makeJobUpdateEvent(ROLL_FORWARD_PAUSED, 125L, user);
 
     saveUpdate(update, Optional.of("lock1"));
     assertUpdate(update);
@@ -680,10 +681,20 @@ public class DBJobUpdateStoreTest {
         new JobUpdateEvent(status, timestampMs));
   }
 
+  private static IJobUpdateEvent makeJobUpdateEvent(
+      JobUpdateStatus status,
+      long timestampMs,
+      String user) {
+
+    return IJobUpdateEvent.build(
+        new JobUpdateEvent(status, timestampMs).setUser(user));
+  }
+
   private IJobInstanceUpdateEvent makeJobInstanceEvent(
       int instanceId,
       long timestampMs,
       JobUpdateAction action) {
+
     return IJobInstanceUpdateEvent.build(
         new JobInstanceUpdateEvent(instanceId, timestampMs, action));
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
index 60c1582..b21dce6 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
@@ -2434,7 +2434,7 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   @Test
   public void testPauseJobUpdate() throws Exception {
     expectAuth(ROLE, true);
-    jobUpdateController.pause(JOB_KEY);
+    jobUpdateController.pause(JOB_KEY, USER);
 
     control.replay();
 
@@ -2453,7 +2453,7 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   @Test
   public void testPauseJobUpdateFailsInController() throws Exception {
     expectAuth(ROLE, true);
-    jobUpdateController.pause(JOB_KEY);
+    jobUpdateController.pause(JOB_KEY, USER);
     expectLastCall().andThrow(new UpdateStateException("failed"));
 
     control.replay();
@@ -2464,7 +2464,7 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   @Test
   public void testResumeJobUpdate() throws Exception {
     expectAuth(ROLE, true);
-    jobUpdateController.resume(JOB_KEY);
+    jobUpdateController.resume(JOB_KEY, USER);
 
     control.replay();
 
@@ -2483,7 +2483,7 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   @Test
   public void testResumeJobUpdateFailsInController() throws Exception {
     expectAuth(ROLE, true);
-    jobUpdateController.resume(JOB_KEY);
+    jobUpdateController.resume(JOB_KEY, USER);
     expectLastCall().andThrow(new UpdateStateException("failed"));
 
     control.replay();
@@ -2494,7 +2494,7 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   @Test
   public void testAbortJobUpdate() throws Exception {
     expectAuth(ROLE, true);
-    jobUpdateController.abort(JOB_KEY);
+    jobUpdateController.abort(JOB_KEY, USER);
 
     control.replay();
 
@@ -2513,7 +2513,7 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   @Test
   public void testAbortJobUpdateFailsInController() throws Exception {
     expectAuth(ROLE, true);
-    jobUpdateController.abort(JOB_KEY);
+    jobUpdateController.abort(JOB_KEY, USER);
     expectLastCall().andThrow(new UpdateStateException("failed"));
 
     control.replay();

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/102b83c7/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java b/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
index 8843990..6758b7b 100644
--- a/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
@@ -325,14 +325,14 @@ public class JobUpdaterIT extends EasyMockTest {
 
     // Updates may be paused for arbitrarily-long amounts of time, and the updater should
not
     // take action while paused.
-    updater.pause(JOB);
-    updater.pause(JOB);  // Pausing again is a no-op.
+    updater.pause(JOB, USER);
+    updater.pause(JOB, USER);  // Pausing again is a no-op.
     assertState(ROLL_FORWARD_PAUSED, actions.build());
     clock.advance(ONE_DAY);
     changeState(JOB, 1, FAILED, ASSIGNED, STARTING, RUNNING);
     changeState(JOB, 2, FAILED, ASSIGNED, STARTING, RUNNING);
     clock.advance(WATCH_TIMEOUT);
-    updater.resume(JOB);
+    updater.resume(JOB, USER);
 
     actions.putAll(1, INSTANCE_UPDATING, INSTANCE_UPDATED)
         .put(2, INSTANCE_UPDATING);
@@ -476,10 +476,10 @@ public class JobUpdaterIT extends EasyMockTest {
     clock.advance(WATCH_TIMEOUT);
 
     // A rollback may be paused.
-    updater.pause(JOB);
+    updater.pause(JOB, USER);
     assertState(ROLL_BACK_PAUSED, actions.build());
     clock.advance(ONE_DAY);
-    updater.resume(JOB);
+    updater.resume(JOB, USER);
     actions.putAll(1, INSTANCE_ROLLING_BACK)
         .putAll(2, INSTANCE_ROLLING_BACK, INSTANCE_ROLLED_BACK);
     assertState(ROLLING_BACK, actions.build());
@@ -565,7 +565,7 @@ public class JobUpdaterIT extends EasyMockTest {
     actions.putAll(0, INSTANCE_UPDATING, INSTANCE_UPDATED)
         .putAll(1, INSTANCE_UPDATING);
 
-    updater.abort(JOB);
+    updater.abort(JOB, USER);
     assertState(ABORTED, actions.build());
     clock.advance(WATCH_TIMEOUT);
     assertJobState(JOB, ImmutableMap.of(0, NEW_CONFIG, 1, NEW_CONFIG, 2, OLD_CONFIG));
@@ -931,7 +931,7 @@ public class JobUpdaterIT extends EasyMockTest {
   public void testPauseUnknownUpdate() throws Exception {
     control.replay();
 
-    updater.pause(JOB);
+    updater.pause(JOB, USER);
   }
 
   private static IJobUpdateSummary makeUpdateSummary() {


Mime
View raw message