You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by wf...@apache.org on 2014/12/05 01:46:15 UTC

incubator-aurora git commit: Remove redundant storage.write.

Repository: incubator-aurora
Updated Branches:
  refs/heads/master d26a30ea3 -> fd37f0df5


Remove redundant storage.write.

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


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

Branch: refs/heads/master
Commit: fd37f0df50d731de97571f56c5d604ae93f3a7a7
Parents: d26a30e
Author: Bill Farner <wf...@apache.org>
Authored: Thu Dec 4 16:23:17 2014 -0800
Committer: Bill Farner <wf...@apache.org>
Committed: Thu Dec 4 16:23:17 2014 -0800

----------------------------------------------------------------------
 .../thrift/SchedulerThriftInterface.java        | 24 ++++++++------------
 1 file changed, 9 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/fd37f0df/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 f0d910d..6e3caa1 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -780,21 +780,15 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
           cronJobKilled = false;
         }
 
-        final boolean tasksKilled = storage.write(new MutateWork.Quiet<Boolean>() {
-          @Override
-          public Boolean apply(MutableStoreProvider storeProvider) {
-            boolean match = false;
-            for (String taskId : Tasks.ids(tasks)) {
-              match |= stateManager.changeState(
-                  storeProvider,
-                  taskId,
-                  Optional.<ScheduleStatus>absent(),
-                  ScheduleStatus.KILLING,
-                  killedByMessage(context.getIdentity()));
-            }
-            return match;
-          }
-        });
+        boolean tasksKilled = false;
+        for (String taskId : Tasks.ids(tasks)) {
+          tasksKilled |= stateManager.changeState(
+              storeProvider,
+              taskId,
+              Optional.<ScheduleStatus>absent(),
+              ScheduleStatus.KILLING,
+              killedByMessage(context.getIdentity()));
+        }
 
         return cronJobKilled || tasksKilled
             ? okEmptyResponse()