Repository: aurora Updated Branches: refs/heads/master 363816f07 -> 589d901b3
Filtering explicit reconciliation tasks by SLAVE_ASSIGNED_STATES. Bugs closed: AURORA-1361 Reviewed at https://reviews.apache.org/r/35639/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/589d901b Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/589d901b Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/589d901b Branch: refs/heads/master Commit: 589d901b37b0f910d3c673062930ee1caca6051d Parents: 363816f Author: Maxim Khutornenko <[email protected]> Authored: Thu Jun 18 18:32:01 2015 -0700 Committer: Maxim Khutornenko <[email protected]> Committed: Thu Jun 18 18:32:01 2015 -0700 ---------------------------------------------------------------------- .../java/org/apache/aurora/scheduler/async/TaskReconciler.java | 5 ++++- .../org/apache/aurora/scheduler/async/TaskReconcilerTest.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/589d901b/src/main/java/org/apache/aurora/scheduler/async/TaskReconciler.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/aurora/scheduler/async/TaskReconciler.java b/src/main/java/org/apache/aurora/scheduler/async/TaskReconciler.java index ccdbc02..68d2e77 100644 --- a/src/main/java/org/apache/aurora/scheduler/async/TaskReconciler.java +++ b/src/main/java/org/apache/aurora/scheduler/async/TaskReconciler.java @@ -28,6 +28,7 @@ import com.twitter.common.quantity.Time; import com.twitter.common.stats.StatsProvider; import org.apache.aurora.scheduler.base.Query; +import org.apache.aurora.scheduler.base.Tasks; import org.apache.aurora.scheduler.mesos.Driver; import org.apache.aurora.scheduler.storage.Storage; import org.apache.aurora.scheduler.storage.entities.IScheduledTask; @@ -108,7 +109,9 @@ public class TaskReconciler extends AbstractIdleService { @Override public void run() { ImmutableSet<Protos.TaskStatus> active = FluentIterable - .from(Storage.Util.fetchTasks(storage, Query.unscoped().active())) + .from(Storage.Util.fetchTasks( + storage, + Query.unscoped().byStatus(Tasks.SLAVE_ASSIGNED_STATES))) .transform(TASK_TO_PROTO) .toSet(); http://git-wip-us.apache.org/repos/asf/aurora/blob/589d901b/src/test/java/org/apache/aurora/scheduler/async/TaskReconcilerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/aurora/scheduler/async/TaskReconcilerTest.java b/src/test/java/org/apache/aurora/scheduler/async/TaskReconcilerTest.java index 9ed1dba..0011412 100644 --- a/src/test/java/org/apache/aurora/scheduler/async/TaskReconcilerTest.java +++ b/src/test/java/org/apache/aurora/scheduler/async/TaskReconcilerTest.java @@ -24,6 +24,7 @@ import com.twitter.common.testing.easymock.EasyMockTest; import org.apache.aurora.scheduler.base.Query; import org.apache.aurora.scheduler.base.TaskTestUtil; +import org.apache.aurora.scheduler.base.Tasks; import org.apache.aurora.scheduler.mesos.Driver; import org.apache.aurora.scheduler.storage.entities.IScheduledTask; import org.apache.aurora.scheduler.storage.testing.StorageTestUtil; @@ -78,7 +79,8 @@ public class TaskReconcilerTest extends EasyMockTest { IScheduledTask task = TaskTestUtil.makeTask("id1", TaskTestUtil.JOB); storageUtil.expectOperations(); - storageUtil.expectTaskFetch(Query.unscoped().active(), task).times(5); + storageUtil.expectTaskFetch(Query.unscoped().byStatus(Tasks.SLAVE_ASSIGNED_STATES), task) + .times(5); driver.reconcileTasks(ImmutableSet.of(TASK_TO_PROTO.apply(task))); expectLastCall().times(5);
