aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [2/2] incubator-aurora git commit: Refactoring CronJobManager interface.
Date Tue, 24 Feb 2015 20:41:50 GMT
Refactoring CronJobManager interface.

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


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

Branch: refs/heads/master
Commit: 70f3bf4664fd8bb4f99fcff5eedae874c3d871ce
Parents: 19378c1
Author: Maxim Khutornenko <maxim@apache.org>
Authored: Tue Feb 24 12:37:30 2015 -0800
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Tue Feb 24 12:37:30 2015 -0800

----------------------------------------------------------------------
 .../thrift/org/apache/aurora/gen/storage.thrift |   4 +-
 .../aurora/scheduler/SchedulerLifecycle.java    |   7 +-
 .../aurora/scheduler/cron/CronJobManager.java   |  30 ------
 .../scheduler/cron/quartz/AuroraCronJob.java    |   9 +-
 .../cron/quartz/CronJobManagerImpl.java         |  36 +------
 .../scheduler/cron/quartz/CronLifecycle.java    |   8 +-
 .../aurora/scheduler/http/StructDump.java       |   7 +-
 .../aurora/scheduler/quota/QuotaManager.java    |   7 +-
 .../scheduler/storage/ForwardingStore.java      |  13 +--
 .../aurora/scheduler/storage/JobStore.java      |  26 ++---
 .../aurora/scheduler/storage/Storage.java       |  10 ++
 .../scheduler/storage/StorageBackfill.java      |  14 +--
 .../scheduler/storage/log/LogStorage.java       |   1 -
 .../storage/log/SnapshotStoreImpl.java          |   8 +-
 .../storage/log/WriteAheadStorage.java          |   7 +-
 .../scheduler/storage/mem/MemJobStore.java      |  64 ++----------
 .../scheduler/thrift/ReadOnlySchedulerImpl.java |   8 +-
 .../thrift/SchedulerThriftInterface.java        |  62 +++++------
 .../scheduler/SchedulerLifecycleTest.java       |   7 --
 .../cron/quartz/AuroraCronJobTest.java          |   9 +-
 .../aurora/scheduler/cron/quartz/CronIT.java    |   5 +-
 .../cron/quartz/CronJobManagerImplTest.java     |  17 +--
 .../scheduler/quota/QuotaManagerImplTest.java   |   9 +-
 .../scheduler/storage/StorageBackfillTest.java  |  22 +---
 .../storage/backup/StorageBackupTest.java       |   4 +-
 .../scheduler/storage/log/LogStorageTest.java   |  14 +--
 .../storage/log/SnapshotStoreImplTest.java      |   8 +-
 .../scheduler/storage/mem/MemJobStoreTest.java  |  46 +++------
 .../thrift/ReadOnlySchedulerImplTest.java       |  40 +++----
 .../thrift/SchedulerThriftInterfaceTest.java    | 103 +++++++------------
 30 files changed, 176 insertions(+), 429 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
----------------------------------------------------------------------
diff --git a/api/src/main/thrift/org/apache/aurora/gen/storage.thrift b/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
index 31b6981..d3b50d7 100644
--- a/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
+++ b/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
@@ -24,8 +24,8 @@ struct SaveFrameworkId {
   1: string id
 }
 
+// TODO(maxim): Rename this into SaveCronJob.
 struct SaveAcceptedJob {
-  1: string managerId
   2: api.JobConfiguration jobConfig
 }
 
@@ -126,8 +126,8 @@ struct Transaction {
   2: i32 schemaVersion
 }
 
+// TODO(maxim): rename this into StoredCronJob.
 struct StoredJob {
-  1: string jobManagerId
   3: api.JobConfiguration jobConfiguration
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java b/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
index b8830d1..3275189 100644
--- a/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
+++ b/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
@@ -46,7 +46,6 @@ import com.twitter.common.base.ExceptionalCommand;
 import com.twitter.common.quantity.Amount;
 import com.twitter.common.quantity.Time;
 import com.twitter.common.stats.StatsProvider;
-import com.twitter.common.util.Clock;
 import com.twitter.common.util.StateMachine;
 import com.twitter.common.util.StateMachine.Transition;
 import com.twitter.common.zookeeper.Group.JoinException;
@@ -127,7 +126,6 @@ public class SchedulerLifecycle implements EventSubscriber {
       Driver driver,
       LeadingOptions leadingOptions,
       ScheduledExecutorService executorService,
-      Clock clock,
       EventSink eventSink,
       ShutdownRegistry shutdownRegistry,
       StatsProvider statsProvider,
@@ -138,7 +136,6 @@ public class SchedulerLifecycle implements EventSubscriber {
         lifecycle,
         driver,
         new DefaultDelayedActions(leadingOptions, executorService),
-        clock,
         eventSink,
         shutdownRegistry,
         statsProvider,
@@ -200,7 +197,6 @@ public class SchedulerLifecycle implements EventSubscriber {
       final Lifecycle lifecycle,
       final Driver driver,
       final DelayedActions delayedActions,
-      final Clock clock,
       final EventSink eventSink,
       final ShutdownRegistry shutdownRegistry,
       StatsProvider statsProvider,
@@ -210,7 +206,6 @@ public class SchedulerLifecycle implements EventSubscriber {
     requireNonNull(lifecycle);
     requireNonNull(driver);
     requireNonNull(delayedActions);
-    requireNonNull(clock);
     requireNonNull(eventSink);
     requireNonNull(shutdownRegistry);
 
@@ -257,7 +252,7 @@ public class SchedulerLifecycle implements EventSubscriber {
         storage.start(new MutateWork.NoResult.Quiet() {
           @Override
           protected void execute(MutableStoreProvider storeProvider) {
-            StorageBackfill.backfill(storeProvider, clock);
+            StorageBackfill.backfill(storeProvider);
           }
         });
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/cron/CronJobManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/CronJobManager.java b/src/main/java/org/apache/aurora/scheduler/cron/CronJobManager.java
index fc6e443..dcd4564 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/CronJobManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/CronJobManager.java
@@ -15,7 +15,6 @@ package org.apache.aurora.scheduler.cron;
 
 import java.util.Map;
 
-import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
 
 /**
@@ -49,25 +48,6 @@ public interface CronJobManager {
   void createJob(SanitizedCronJob config) throws CronException;
 
   /**
-   * Get all cron jobs.
-   *
-   * TODO(ksweeney): Consider deprecating this and letting caller query storage directly.
-   *
-   * @return An immutable snapshot of cron jobs at some instant.
-   */
-  Iterable<IJobConfiguration> getJobs();
-
-  /**
-   * Test whether a job exists.
-   *
-   * TODO(ksweeney): Consider deprecating this and letting caller query storage directly.
-   *
-   * @param jobKey Key of the job to check.
-   * @return false when a job does not exist in storage.
-   */
-  boolean hasJob(IJobKey jobKey);
-
-  /**
    * Remove a job and deschedule it.
    *
    * @param jobKey Key of the job to delete.
@@ -82,14 +62,4 @@ public interface CronJobManager {
    * @return A map from job to the cron schedule in use for that job.
    */
   Map<IJobKey, CrontabEntry> getScheduledJobs();
-
-  /**
-   * The unique ID of this cron job manager, used as a prefix in the JobStore.
-   *
-   * TODO(ksweeney): Consider removing this from storage entirely since the JobManager abstraction
-   * is gone.
-   *
-   * @return The unique ID of the manager.
-   */
-  String getManagerKey();
 }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
index efea7ad..c883421 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
@@ -34,7 +34,6 @@ import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.configuration.ConfigurationManager;
 import org.apache.aurora.scheduler.cron.CronException;
-import org.apache.aurora.scheduler.cron.CronJobManager;
 import org.apache.aurora.scheduler.cron.SanitizedCronJob;
 import org.apache.aurora.scheduler.state.StateManager;
 import org.apache.aurora.scheduler.storage.Storage;
@@ -75,19 +74,16 @@ class AuroraCronJob implements Job {
 
   private final Storage storage;
   private final StateManager stateManager;
-  private final CronJobManager cronJobManager;
   private final BackoffHelper delayedStartBackoff;
 
   @Inject
   AuroraCronJob(
       Config config,
       Storage storage,
-      StateManager stateManager,
-      CronJobManager cronJobManager) {
+      StateManager stateManager) {
 
     this.storage = requireNonNull(storage);
     this.stateManager = requireNonNull(stateManager);
-    this.cronJobManager = requireNonNull(cronJobManager);
     this.delayedStartBackoff = requireNonNull(config.getDelayedStartBackoff());
   }
 
@@ -120,8 +116,7 @@ class AuroraCronJob implements Job {
         new Storage.MutateWork.Quiet<Optional<DeferredLaunch>>() {
           @Override
           public Optional<DeferredLaunch> apply(Storage.MutableStoreProvider storeProvider) {
-            Optional<IJobConfiguration> config =
-                storeProvider.getJobStore().fetchJob(cronJobManager.getManagerKey(), key);
+            Optional<IJobConfiguration> config = storeProvider.getJobStore().fetchJob(key);
             if (!config.isPresent()) {
               LOG.warning(String.format(
                   "Cron was triggered for %s but no job with that key was found in storage.",

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
index c5cb8ca..916cb6d 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
@@ -66,11 +66,6 @@ class CronJobManagerImpl implements CronJobManager {
   }
 
   @Override
-  public String getManagerKey() {
-    return "CRON";
-  }
-
-  @Override
   public void startJobNow(final IJobKey jobKey) throws CronException {
     requireNonNull(jobKey);
 
@@ -139,13 +134,13 @@ class CronJobManagerImpl implements CronJobManager {
   }
 
   private void checkNotExists(IJobKey jobKey, JobStore jobStore) throws CronException {
-    if (jobStore.fetchJob(getManagerKey(), jobKey).isPresent()) {
+    if (jobStore.fetchJob(jobKey).isPresent()) {
       throw new CronException(formatMessage("Job already exists for %s.", jobKey));
     }
   }
 
   private void checkCronExists(IJobKey jobKey, JobStore jobStore) throws CronException {
-    if (!jobStore.fetchJob(getManagerKey(), jobKey).isPresent()) {
+    if (!jobStore.fetchJob(jobKey).isPresent()) {
       throw new CronException(formatMessage("No cron job found for %s.", jobKey));
     }
   }
@@ -158,7 +153,7 @@ class CronJobManagerImpl implements CronJobManager {
   private void saveJob(SanitizedCronJob cronJob, JobStore.Mutable jobStore) {
     IJobConfiguration config = cronJob.getSanitizedConfig().getJobConfig();
 
-    jobStore.saveAcceptedJob(getManagerKey(), config);
+    jobStore.saveAcceptedJob(config);
     LOG.info(formatMessage("Saved new cron job %s to storage.", config.getKey()));
   }
 
@@ -175,36 +170,13 @@ class CronJobManagerImpl implements CronJobManager {
   }
 
   @Override
-  public Iterable<IJobConfiguration> getJobs() {
-    // NOTE: no synchronization is needed here since we don't touch internal quartz state.
-    return storage.read(new Work.Quiet<Iterable<IJobConfiguration>>() {
-      @Override
-      public Iterable<IJobConfiguration> apply(Storage.StoreProvider storeProvider) {
-        return storeProvider.getJobStore().fetchJobs(getManagerKey());
-      }
-    });
-  }
-
-  @Override
-  public boolean hasJob(final IJobKey jobKey) {
-    requireNonNull(jobKey);
-
-    return storage.read(new Work.Quiet<Boolean>() {
-      @Override
-      public Boolean apply(Storage.StoreProvider storeProvider) {
-        return storeProvider.getJobStore().fetchJob(getManagerKey(), jobKey).isPresent();
-      }
-    });
-  }
-
-  @Override
   public boolean deleteJob(final IJobKey jobKey) {
     requireNonNull(jobKey);
 
     return storage.write(new MutateWork.Quiet<Boolean>() {
       @Override
       public Boolean apply(Storage.MutableStoreProvider storeProvider) {
-        if (!hasJob(jobKey)) {
+        if (!storeProvider.getJobStore().fetchJob(jobKey).isPresent()) {
           return false;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
index 64d9486..ec52437 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
@@ -26,6 +26,7 @@ import com.twitter.common.stats.Stats;
 import org.apache.aurora.scheduler.configuration.ConfigurationManager;
 import org.apache.aurora.scheduler.cron.CronException;
 import org.apache.aurora.scheduler.cron.SanitizedCronJob;
+import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
@@ -44,11 +45,13 @@ class CronLifecycle extends AbstractIdleService {
 
   private final Scheduler scheduler;
   private final CronJobManagerImpl cronJobManager;
+  private final Storage storage;
 
   @Inject
-  CronLifecycle(Scheduler scheduler, CronJobManagerImpl cronJobManager) {
+  CronLifecycle(Scheduler scheduler, CronJobManagerImpl cronJobManager, Storage storage) {
     this.scheduler = requireNonNull(scheduler);
     this.cronJobManager = requireNonNull(cronJobManager);
+    this.storage = requireNonNull(storage);
   }
 
   @Override
@@ -57,8 +60,7 @@ class CronLifecycle extends AbstractIdleService {
     scheduler.start();
     RUNNING_FLAG.set(1);
 
-    // TODO(ksweeney): Refactor the interface - we really only need the job keys here.
-    for (IJobConfiguration job : cronJobManager.getJobs()) {
+    for (IJobConfiguration job : Storage.Util.fetchCronJobs(storage)) {
       try {
         SanitizedCronJob cronJob = SanitizedCronJob.fromUnsanitized(job);
         cronJobManager.scheduleJob(

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/http/StructDump.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/StructDump.java b/src/main/java/org/apache/aurora/scheduler/http/StructDump.java
index 063170a..e7ee0cf 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/StructDump.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/StructDump.java
@@ -31,7 +31,6 @@ import org.antlr.stringtemplate.StringTemplate;
 import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.scheduler.base.JobKeys;
 import org.apache.aurora.scheduler.base.Query;
-import org.apache.aurora.scheduler.cron.CronJobManager;
 import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.Storage.StoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.Work;
@@ -49,13 +48,11 @@ import static java.util.Objects.requireNonNull;
 public class StructDump extends JerseyTemplateServlet {
 
   private final Storage storage;
-  private final CronJobManager cronJobManager;
 
   @Inject
-  public StructDump(Storage storage, CronJobManager cronJobManager) {
+  public StructDump(Storage storage) {
     super("structdump");
     this.storage = requireNonNull(storage);
-    this.cronJobManager = requireNonNull(cronJobManager);
   }
 
   private static final String USAGE =
@@ -111,7 +108,7 @@ public class StructDump extends JerseyTemplateServlet {
         new Work.Quiet<Optional<? extends TBase<?, ?>>>() {
           @Override
           public Optional<JobConfiguration> apply(StoreProvider storeProvider) {
-            return storeProvider.getJobStore().fetchJob(cronJobManager.getManagerKey(), jobKey)
+            return storeProvider.getJobStore().fetchJob(jobKey)
                 .transform(IJobConfiguration.TO_BUILDER);
           }
         });

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java b/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
index dab8c05..bb72721 100644
--- a/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
@@ -38,7 +38,6 @@ import org.apache.aurora.gen.ResourceAggregate;
 import org.apache.aurora.scheduler.base.JobKeys;
 import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.ResourceAggregates;
-import org.apache.aurora.scheduler.cron.CronJobManager;
 import org.apache.aurora.scheduler.storage.JobUpdateStore;
 import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.Storage.StoreProvider;
@@ -118,12 +117,10 @@ public interface QuotaManager {
    */
   class QuotaManagerImpl implements QuotaManager {
     private final Storage storage;
-    private final CronJobManager cronJobManager;
 
     @Inject
-    QuotaManagerImpl(Storage storage, CronJobManager cronJobManager) {
+    QuotaManagerImpl(Storage storage) {
       this.storage = requireNonNull(storage);
-      this.cronJobManager = requireNonNull(cronJobManager);
     }
 
     @Override
@@ -211,7 +208,7 @@ public interface QuotaManager {
           }
 
           Map<IJobKey, IJobConfiguration> cronTemplates =
-              FluentIterable.from(cronJobManager.getJobs())
+              FluentIterable.from(storeProvider.getJobStore().fetchJobs())
                   .filter(Predicates.compose(Predicates.equalTo(role), JobKeys.CONFIG_TO_ROLE))
                   .uniqueIndex(JobKeys.FROM_CONFIG);
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/storage/ForwardingStore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/ForwardingStore.java b/src/main/java/org/apache/aurora/scheduler/storage/ForwardingStore.java
index 4d83c58..fc8e2f4 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/ForwardingStore.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/ForwardingStore.java
@@ -95,18 +95,13 @@ public class ForwardingStore implements
   }
 
   @Override
-  public Iterable<IJobConfiguration> fetchJobs(String managerId) {
-    return jobStore.fetchJobs(managerId);
+  public Iterable<IJobConfiguration> fetchJobs() {
+    return jobStore.fetchJobs();
   }
 
   @Override
-  public Optional<IJobConfiguration> fetchJob(String managerId, IJobKey jobKey) {
-    return jobStore.fetchJob(managerId, jobKey);
-  }
-
-  @Override
-  public Set<String> fetchManagerIds() {
-    return jobStore.fetchManagerIds();
+  public Optional<IJobConfiguration> fetchJob(IJobKey jobKey) {
+    return jobStore.fetchJob(jobKey);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/storage/JobStore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/JobStore.java b/src/main/java/org/apache/aurora/scheduler/storage/JobStore.java
index ad0d67a..748b2cb 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/JobStore.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/JobStore.java
@@ -13,8 +13,6 @@
  */
 package org.apache.aurora.scheduler.storage;
 
-import java.util.Set;
-
 import com.google.common.base.Optional;
 
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
@@ -26,41 +24,29 @@ import org.apache.aurora.scheduler.storage.entities.IJobKey;
 public interface JobStore {
 
   /**
-   * Fetches all {@code JobConfiguration}s for jobs owned by the manager identified by
-   * {@code managerId}; if there are none then an empty set is returned.
+   * Fetches all {@code JobConfiguration} instances.
    *
-   * @param managerId The unique identifier of the manager to find registered jobs for.
-   * @return the set of job configurations owned by the specififed job manager
+   * @return {@link Iterable} of job configurations.
    */
-  Iterable<IJobConfiguration> fetchJobs(String managerId);
+  Iterable<IJobConfiguration> fetchJobs();
 
   /**
    * Fetches the {@code JobConfiguration} for the specified {@code jobKey} if it exists.
    *
-   * @param managerId The unique identifier of the manager that accepted the job.
    * @param jobKey The jobKey identifying the job to be fetched.
    * @return the job configuration for the given {@code jobKey} or absent if none is found.
    */
-  Optional<IJobConfiguration> fetchJob(String managerId, IJobKey jobKey);
-
-  /**
-   * Fetches all the unique manager ids that are present in the job store.
-   *
-   * @return The IDs of all stored job managers.
-   */
-  Set<String> fetchManagerIds();
+  Optional<IJobConfiguration> fetchJob(IJobKey jobKey);
 
   interface Mutable extends JobStore {
     /**
-     * Saves the job configuration for a job that has been accepted by the scheduler. Acts as an
-     * update if the managerId already exists.
+     * Saves the job configuration for a job that has been accepted by the scheduler.
      * TODO(William Farner): Consider accepting SanitizedConfiguration here to require that
      * validation always happens for things entering storage.
      *
-     * @param managerId The unique id of the manager that accepted the job.
      * @param jobConfig The configuration of the accepted job.
      */
-    void saveAcceptedJob(String managerId, IJobConfiguration jobConfig);
+    void saveAcceptedJob(IJobConfiguration jobConfig);
 
     /**
      * Removes the job configuration for the job identified by {@code jobKey}.

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/storage/Storage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/Storage.java b/src/main/java/org/apache/aurora/scheduler/storage/Storage.java
index 83a59ce..41b7053 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/Storage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/Storage.java
@@ -24,6 +24,7 @@ import com.google.common.collect.ImmutableSet;
 
 import org.apache.aurora.scheduler.base.Query.Builder;
 import org.apache.aurora.scheduler.base.SchedulerException;
+import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 
 /**
@@ -282,5 +283,14 @@ public interface Storage {
         }
       });
     }
+
+    public static Iterable<IJobConfiguration> fetchCronJobs(Storage storage) {
+      return storage.read(new Work.Quiet<Iterable<IJobConfiguration>>() {
+        @Override
+        public Iterable<IJobConfiguration> apply(Storage.StoreProvider storeProvider) {
+          return storeProvider.getJobStore().fetchJobs();
+        }
+      });
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/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 52377bc..7a99afa 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java
@@ -17,7 +17,6 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.logging.Logger;
 
 import com.twitter.common.stats.Stats;
-import com.twitter.common.util.Clock;
 
 import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.gen.JobKey;
@@ -49,12 +48,10 @@ public final class StorageBackfill {
   }
 
   private static void backfillJobDefaults(JobStore.Mutable jobStore) {
-    for (String id : jobStore.fetchManagerIds()) {
-      for (JobConfiguration job : IJobConfiguration.toBuildersList(jobStore.fetchJobs(id))) {
-        populateJobKey(job.getTaskConfig(), BACKFILLED_JOB_CONFIG_KEYS);
-        ConfigurationManager.applyDefaultsIfUnset(job);
-        jobStore.saveAcceptedJob(id, IJobConfiguration.build(job));
-      }
+    for (JobConfiguration job : IJobConfiguration.toBuildersList(jobStore.fetchJobs())) {
+      populateJobKey(job.getTaskConfig(), BACKFILLED_JOB_CONFIG_KEYS);
+      ConfigurationManager.applyDefaultsIfUnset(job);
+      jobStore.saveAcceptedJob(IJobConfiguration.build(job));
     }
   }
 
@@ -74,9 +71,8 @@ public final class StorageBackfill {
    * the structs were first written.
    *
    * @param storeProvider Storage provider.
-   * @param clock Clock, used for timestamping backfilled task events.
    */
-  public static void backfill(final MutableStoreProvider storeProvider, final Clock clock) {
+  public static void backfill(final MutableStoreProvider storeProvider) {
     backfillJobDefaults(storeProvider.getJobStore());
 
     // Backfilling job keys has to be done in a separate transaction to ensure follow up scoped

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
index 384e9b5..7dec101 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
@@ -363,7 +363,6 @@ public class LogStorage implements NonVolatileStorage, DistributedSnapshotStore
           public void execute(Op op) {
             SaveAcceptedJob acceptedJob = op.getSaveAcceptedJob();
             writeBehindJobStore.saveAcceptedJob(
-                acceptedJob.getManagerId(),
                 IJobConfiguration.build(acceptedJob.getJobConfig()));
           }
         })

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
index 2798139..f08aee2 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
@@ -133,10 +133,9 @@ public class SnapshotStoreImpl implements SnapshotStore<Snapshot> {
         @Override
         public void saveToSnapshot(StoreProvider store, Snapshot snapshot) {
           ImmutableSet.Builder<StoredJob> jobs = ImmutableSet.builder();
-          for (String managerId : store.getJobStore().fetchManagerIds()) {
-            for (IJobConfiguration config : store.getJobStore().fetchJobs(managerId)) {
-              jobs.add(new StoredJob(managerId, config.newBuilder()));
-            }
+
+          for (IJobConfiguration config : store.getJobStore().fetchJobs()) {
+            jobs.add(new StoredJob(config.newBuilder()));
           }
           snapshot.setJobs(jobs.build());
         }
@@ -148,7 +147,6 @@ public class SnapshotStoreImpl implements SnapshotStore<Snapshot> {
           if (snapshot.isSetJobs()) {
             for (StoredJob job : snapshot.getJobs()) {
               store.getJobStore().saveAcceptedJob(
-                  job.getJobManagerId(),
                   IJobConfiguration.build(job.getJobConfiguration()));
             }
           }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
index 262d72c..aa22266 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
@@ -235,12 +235,11 @@ class WriteAheadStorage extends ForwardingStore implements
   }
 
   @Override
-  public void saveAcceptedJob(final String managerId, final IJobConfiguration jobConfig) {
-    requireNonNull(managerId);
+  public void saveAcceptedJob(final IJobConfiguration jobConfig) {
     requireNonNull(jobConfig);
 
-    write(Op.saveAcceptedJob(new SaveAcceptedJob(managerId, jobConfig.newBuilder())));
-    jobStore.saveAcceptedJob(managerId, jobConfig);
+    write(Op.saveAcceptedJob(new SaveAcceptedJob(jobConfig.newBuilder())));
+    jobStore.saveAcceptedJob(jobConfig);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/storage/mem/MemJobStore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/mem/MemJobStore.java b/src/main/java/org/apache/aurora/scheduler/storage/mem/MemJobStore.java
index c24a32e..c9ffc38 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/mem/MemJobStore.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/mem/MemJobStore.java
@@ -14,14 +14,8 @@
 package org.apache.aurora.scheduler.storage.mem;
 
 import java.util.Map;
-import java.util.Set;
-
-import javax.annotation.Nullable;
 
 import com.google.common.base.Optional;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Maps;
 
@@ -30,75 +24,35 @@ import org.apache.aurora.scheduler.storage.JobStore;
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
 
-import static java.util.Objects.requireNonNull;
-
 /**
  * An in-memory job store.
  */
 class MemJobStore implements JobStore.Mutable {
-
-  private final LoadingCache<String, Manager> managers = CacheBuilder.newBuilder()
-      .build(new CacheLoader<String, Manager>() {
-        @Override
-        public Manager load(String key) {
-          return new Manager();
-        }
-      });
+  private final Map<IJobKey, IJobConfiguration> jobs = Maps.newConcurrentMap();
 
   @Override
-  public void saveAcceptedJob(String managerId, IJobConfiguration jobConfig) {
-    requireNonNull(managerId);
-    requireNonNull(jobConfig);
-
+  public void saveAcceptedJob(IJobConfiguration jobConfig) {
     IJobKey key = JobKeys.assertValid(jobConfig.getKey());
-    managers.getUnchecked(managerId).jobs.put(key, jobConfig);
+    jobs.put(key, jobConfig);
   }
 
   @Override
   public void removeJob(IJobKey jobKey) {
-    requireNonNull(jobKey);
-
-    for (Manager manager : managers.asMap().values()) {
-      manager.jobs.remove(jobKey);
-    }
+    jobs.remove(jobKey);
   }
 
   @Override
   public void deleteJobs() {
-    managers.invalidateAll();
+    jobs.clear();
   }
 
   @Override
-  public Iterable<IJobConfiguration> fetchJobs(String managerId) {
-    requireNonNull(managerId);
-
-    @Nullable Manager manager = managers.getIfPresent(managerId);
-    if (manager == null) {
-      return ImmutableSet.of();
-    }
-
-    return ImmutableSet.copyOf(manager.jobs.values());
+  public Iterable<IJobConfiguration> fetchJobs() {
+    return ImmutableSet.copyOf(jobs.values());
   }
 
   @Override
-  public Optional<IJobConfiguration> fetchJob(String managerId, IJobKey jobKey) {
-    requireNonNull(managerId);
-    requireNonNull(jobKey);
-
-    Optional<Manager> manager = Optional.fromNullable(managers.getIfPresent(managerId));
-    if (manager.isPresent()) {
-      return Optional.fromNullable(manager.get().jobs.get(jobKey));
-    } else {
-      return Optional.absent();
-    }
-  }
-
-  @Override
-  public Set<String> fetchManagerIds() {
-    return ImmutableSet.copyOf(managers.asMap().keySet());
-  }
-
-  private static class Manager {
-    private final Map<IJobKey, IJobConfiguration> jobs = Maps.newConcurrentMap();
+  public Optional<IJobConfiguration> fetchJob(IJobKey jobKey) {
+    return Optional.fromNullable(jobs.get(jobKey));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java b/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
index ee76189..3476385 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
@@ -71,7 +71,6 @@ import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.configuration.ConfigurationManager.TaskDescriptionException;
 import org.apache.aurora.scheduler.configuration.SanitizedConfiguration;
-import org.apache.aurora.scheduler.cron.CronJobManager;
 import org.apache.aurora.scheduler.cron.CronPredictor;
 import org.apache.aurora.scheduler.cron.CrontabEntry;
 import org.apache.aurora.scheduler.filter.SchedulingFilter.Veto;
@@ -112,7 +111,6 @@ class ReadOnlySchedulerImpl implements ReadOnlyScheduler.Iface {
   private final Storage storage;
   private final NearestFit nearestFit;
   private final CronPredictor cronPredictor;
-  private final CronJobManager cronJobManager;
   private final QuotaManager quotaManager;
   private final LockManager lockManager;
 
@@ -121,14 +119,12 @@ class ReadOnlySchedulerImpl implements ReadOnlyScheduler.Iface {
       Storage storage,
       NearestFit nearestFit,
       CronPredictor cronPredictor,
-      CronJobManager cronJobManager,
       QuotaManager quotaManager,
       LockManager lockManager) {
 
     this.storage = requireNonNull(storage);
     this.nearestFit = requireNonNull(nearestFit);
     this.cronPredictor = requireNonNull(cronPredictor);
-    this.cronJobManager = requireNonNull(cronJobManager);
     this.quotaManager = requireNonNull(quotaManager);
     this.lockManager = requireNonNull(lockManager);
   }
@@ -237,7 +233,7 @@ class ReadOnlySchedulerImpl implements ReadOnlyScheduler.Iface {
         Tasks.SCHEDULED_TO_JOB_KEY);
 
     Multimap<String, IJobKey> cronJobsByRole = mapByRole(
-        cronJobManager.getJobs(),
+        Storage.Util.fetchCronJobs(storage),
         JobKeys.FROM_CONFIG);
 
     Set<RoleSummary> summaries = Sets.newHashSet();
@@ -396,7 +392,7 @@ class ReadOnlySchedulerImpl implements ReadOnlyScheduler.Iface {
         ? Predicates.compose(Predicates.equalTo(ownerRole.get()), JobKeys.CONFIG_TO_ROLE)
         : Predicates.<IJobConfiguration>alwaysTrue();
     jobs.putAll(Maps.uniqueIndex(
-        FluentIterable.from(cronJobManager.getJobs()).filter(configFilter),
+        FluentIterable.from(Storage.Util.fetchCronJobs(storage)).filter(configFilter),
         JobKeys.FROM_CONFIG));
 
     return jobs;

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/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 3e491d9..58ae7f8 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -32,7 +32,6 @@ import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.HashMultimap;
-import com.google.common.collect.ImmutableMultimap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
@@ -306,7 +305,7 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
 
   private void checkJobExists(StoreProvider store, IJobKey jobKey) throws JobExistsException {
     if (!store.getTaskStore().fetchTasks(Query.jobScoped(jobKey).active()).isEmpty()
-        || cronJobManager.hasJob(jobKey)) {
+        || getCronJob(store, jobKey).isPresent()) {
 
       throw new JobExistsException(jobAlreadyExistsMessage(jobKey));
     }
@@ -350,7 +349,7 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
           validateTaskLimits(template, count, quotaManager.checkInstanceAddition(template, count));
 
           // TODO(mchucarroll): Merge CronJobManager.createJob/updateJob
-          if (updateOnly || cronJobManager.hasJob(sanitized.getJobConfig().getKey())) {
+          if (updateOnly || getCronJob(storeProvider, jobKey).isPresent()) {
             // The job already has a schedule: so update it.
             cronJobManager.updateJob(SanitizedCronJob.from(sanitized));
           } else {
@@ -783,17 +782,6 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
     return ok();
   }
 
-  private static Multimap<String, IJobConfiguration> jobsByKey(JobStore jobStore, IJobKey jobKey) {
-    ImmutableMultimap.Builder<String, IJobConfiguration> matches = ImmutableMultimap.builder();
-    for (String managerId : jobStore.fetchManagerIds()) {
-      Optional<IJobConfiguration> job = jobStore.fetchJob(managerId, jobKey);
-      if (job.isPresent()) {
-        matches.put(managerId, job.get());
-      }
-    }
-    return matches.build();
-  }
-
   @Override
   public Response rewriteConfigs(final RewriteConfigsRequest request, SessionKey session) {
     if (request.getRewriteCommandsSize() == 0) {
@@ -839,28 +827,18 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
     }
 
     if (existingJob.getKey().equals(rewrittenJob.getKey())) {
-      Multimap<String, IJobConfiguration> matches = jobsByKey(jobStore, existingJob.getKey());
-      switch (matches.size()) {
-        case 0:
+      Optional<IJobConfiguration> job = jobStore.fetchJob(existingJob.getKey());
+      if (job.isPresent()) {
+        IJobConfiguration storedJob = job.get();
+        if (storedJob.equals(existingJob)) {
+          jobStore.saveAcceptedJob(rewrittenJob);
+        } else {
           error = Optional.of(
-              "No jobs found for key " + JobKeys.canonicalString(existingJob.getKey()));
-          break;
-
-        case 1:
-          Map.Entry<String, IJobConfiguration> match =
-              Iterables.getOnlyElement(matches.entries());
-          IJobConfiguration storedJob = match.getValue();
-          if (storedJob.equals(existingJob)) {
-            jobStore.saveAcceptedJob(match.getKey(), rewrittenJob);
-          } else {
-            error = Optional.of(
-                "CAS compare failed for " + JobKeys.canonicalString(storedJob.getKey()));
-          }
-          break;
-
-        default:
-          error = Optional.of("Multiple jobs found for key "
-              + JobKeys.canonicalString(existingJob.getKey()));
+              "CAS compare failed for " + JobKeys.canonicalString(storedJob.getKey()));
+        }
+      } else {
+        error = Optional.of(
+            "No jobs found for key " + JobKeys.canonicalString(existingJob.getKey()));
       }
     } else {
       error = Optional.of("Disallowing rewrite attempting to change job key.");
@@ -949,7 +927,7 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
       @Override
       public Response apply(MutableStoreProvider storeProvider) {
         try {
-          if (cronJobManager.hasJob(jobKey)) {
+          if (getCronJob(storeProvider, jobKey).isPresent()) {
             return invalidRequest("Instances may not be added to cron jobs.");
           }
 
@@ -985,6 +963,11 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
     });
   }
 
+  public Optional<IJobConfiguration> getCronJob(StoreProvider storeProvider, final IJobKey jobKey) {
+    requireNonNull(jobKey);
+    return storeProvider.getJobStore().fetchJob(jobKey);
+  }
+
   private String getRoleFromLockKey(ILockKey lockKey) {
     if (lockKey.getSetField() == _Fields.JOB) {
       JobKeys.assertValid(lockKey.getJob());
@@ -1169,9 +1152,6 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
           ConfigurationManager.validateAndPopulate(
               ITaskConfig.build(mutableRequest.getTaskConfig())).newBuilder()));
 
-      if (cronJobManager.hasJob(job)) {
-        return invalidRequest(NO_CRON);
-      }
     } catch (AuthFailedException e) {
       return error(AUTH_FAILED, e);
     } catch (TaskDescriptionException e) {
@@ -1181,6 +1161,10 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
     return storage.write(new MutateWork.Quiet<Response>() {
       @Override
       public Response apply(MutableStoreProvider storeProvider) {
+        if (getCronJob(storeProvider, job).isPresent()) {
+          return invalidRequest(NO_CRON);
+        }
+
         String updateId = uuidGenerator.createNew().toString();
         IJobUpdateSettings settings = request.getSettings();
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/SchedulerLifecycleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/SchedulerLifecycleTest.java b/src/test/java/org/apache/aurora/scheduler/SchedulerLifecycleTest.java
index 97ecb74..c9153e1 100644
--- a/src/test/java/org/apache/aurora/scheduler/SchedulerLifecycleTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/SchedulerLifecycleTest.java
@@ -21,7 +21,6 @@ import com.twitter.common.application.ShutdownRegistry;
 import com.twitter.common.base.Command;
 import com.twitter.common.base.ExceptionalCommand;
 import com.twitter.common.testing.easymock.EasyMockTest;
-import com.twitter.common.util.Clock;
 import com.twitter.common.zookeeper.SingletonService.LeaderControl;
 import com.twitter.common.zookeeper.SingletonService.LeadershipListener;
 
@@ -48,9 +47,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 public class SchedulerLifecycleTest extends EasyMockTest {
-
-  private static final String FRAMEWORK_ID = "framework id";
-
   private StorageTestUtil storageUtil;
   private ShutdownSystem shutdownRegistry;
   private Driver driver;
@@ -84,8 +80,6 @@ public class SchedulerLifecycleTest extends EasyMockTest {
     Capture<ExceptionalCommand<?>> shutdownCommand = createCapture();
     shutdownRegistry.addAction(capture(shutdownCommand));
 
-    Clock clock = createMock(Clock.class);
-
     control.replay();
 
     schedulerLifecycle = new SchedulerLifecycle(
@@ -98,7 +92,6 @@ public class SchedulerLifecycleTest extends EasyMockTest {
         }),
         driver,
         delayedActions,
-        clock,
         eventSink,
         shutdownRegistry,
         statsProvider,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobTest.java b/src/test/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobTest.java
index c99135a..7bef09e 100644
--- a/src/test/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobTest.java
@@ -25,7 +25,6 @@ import org.apache.aurora.gen.AssignedTask;
 import org.apache.aurora.gen.CronCollisionPolicy;
 import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.ScheduledTask;
-import org.apache.aurora.scheduler.cron.CronJobManager;
 import org.apache.aurora.scheduler.state.StateManager;
 import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
@@ -53,18 +52,14 @@ public class AuroraCronJobTest extends EasyMockTest {
 
   private AuroraCronJob auroraCronJob;
 
-  private static final String MANAGER_ID = "MANAGER_ID";
-
   @Before
   public void setUp() {
     storage = MemStorage.newEmptyStorage();
     stateManager = createMock(StateManager.class);
-    CronJobManager cronJobManager = createMock(CronJobManager.class);
     backoffHelper = createMock(BackoffHelper.class);
 
     auroraCronJob = new AuroraCronJob(
-        new AuroraCronJob.Config(backoffHelper), storage, stateManager, cronJobManager);
-    expect(cronJobManager.getManagerKey()).andStubReturn(MANAGER_ID);
+        new AuroraCronJob.Config(backoffHelper), storage, stateManager);
   }
 
   @Test
@@ -81,7 +76,6 @@ public class AuroraCronJobTest extends EasyMockTest {
       @Override
       protected void execute(MutableStoreProvider storeProvider) {
         storeProvider.getJobStore().saveAcceptedJob(
-            MANAGER_ID,
             IJobConfiguration.build(QuartzTestUtil.JOB.newBuilder().setCronSchedule(null)));
       }
     });
@@ -172,7 +166,6 @@ public class AuroraCronJobTest extends EasyMockTest {
       @Override
       public void execute(MutableStoreProvider storeProvider) {
         storeProvider.getJobStore().saveAcceptedJob(
-            MANAGER_ID,
             QuartzTestUtil.makeSanitizedCronJob(policy).getSanitizedConfig().getJobConfig());
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java b/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
index 915d7c8..c3f8d1b 100644
--- a/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
@@ -133,15 +133,12 @@ public class CronIT extends EasyMockTest {
     auroraCronJob.execute(isA(JobExecutionContext.class));
 
     control.replay();
-    final CronJobManager cronJobManager = injector.getInstance(CronJobManager.class);
     final Scheduler scheduler = injector.getInstance(Scheduler.class);
 
     storage.write(new Storage.MutateWork.NoResult.Quiet() {
       @Override
       public void execute(Storage.MutableStoreProvider storeProvider) {
-        storeProvider.getJobStore().saveAcceptedJob(
-            cronJobManager.getManagerKey(),
-            CRON_JOB);
+        storeProvider.getJobStore().saveAcceptedJob(CRON_JOB);
       }
     });
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImplTest.java b/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImplTest.java
index 701536f..d4c14af 100644
--- a/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImplTest.java
@@ -13,7 +13,6 @@
  */
 package org.apache.aurora.scheduler.cron.quartz;
 
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
@@ -22,7 +21,6 @@ import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
 import com.twitter.common.testing.easymock.EasyMockTest;
 
 import org.apache.aurora.gen.CronCollisionPolicy;
@@ -163,17 +161,6 @@ public class CronJobManagerImplTest extends EasyMockTest {
   }
 
   @Test
-  public void testGetJobs() throws Exception {
-    control.replay();
-    assertEquals(Collections.emptyList(), ImmutableList.copyOf(cronJobManager.getJobs()));
-
-    populateStorage();
-    assertEquals(
-        QuartzTestUtil.makeSanitizedCronJob().getSanitizedConfig().getJobConfig(),
-        Iterables.getOnlyElement(cronJobManager.getJobs()));
-  }
-
-  @Test
   public void testNoRunOverlap() throws Exception {
     SanitizedCronJob runOverlapJob = SanitizedCronJob.fromUnsanitized(
         IJobConfiguration.build(QuartzTestUtil.JOB.newBuilder()
@@ -264,7 +251,6 @@ public class CronJobManagerImplTest extends EasyMockTest {
       @Override
       protected void execute(Storage.MutableStoreProvider storeProvider) throws Exception {
         storeProvider.getJobStore().saveAcceptedJob(
-            cronJobManager.getManagerKey(),
             QuartzTestUtil.makeSanitizedCronJob().getSanitizedConfig().getJobConfig());
       }
     });
@@ -274,8 +260,7 @@ public class CronJobManagerImplTest extends EasyMockTest {
     return storage.read(new Storage.Work.Quiet<Optional<IJobConfiguration>>() {
       @Override
       public Optional<IJobConfiguration> apply(Storage.StoreProvider storeProvider) {
-        return storeProvider.getJobStore().fetchJob(cronJobManager.getManagerKey(),
-            QuartzTestUtil.AURORA_JOB_KEY);
+        return storeProvider.getJobStore().fetchJob(QuartzTestUtil.AURORA_JOB_KEY);
       }
     });
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/quota/QuotaManagerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/quota/QuotaManagerImplTest.java b/src/test/java/org/apache/aurora/scheduler/quota/QuotaManagerImplTest.java
index b0772f7..eac2033 100644
--- a/src/test/java/org/apache/aurora/scheduler/quota/QuotaManagerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/quota/QuotaManagerImplTest.java
@@ -34,7 +34,6 @@ import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.ScheduledTask;
 import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.scheduler.base.Query;
-import org.apache.aurora.scheduler.cron.CronJobManager;
 import org.apache.aurora.scheduler.quota.QuotaManager.QuotaException;
 import org.apache.aurora.scheduler.quota.QuotaManager.QuotaManagerImpl;
 import org.apache.aurora.scheduler.storage.JobUpdateStore;
@@ -70,14 +69,12 @@ public class QuotaManagerImplTest extends EasyMockTest {
   private StorageTestUtil storageUtil;
   private JobUpdateStore jobUpdateStore;
   private QuotaManagerImpl quotaManager;
-  private CronJobManager cronJobManager;
 
   @Before
   public void setUp() throws Exception {
     storageUtil = new StorageTestUtil(this);
     jobUpdateStore = storageUtil.jobUpdateStore;
-    cronJobManager = createMock(CronJobManager.class);
-    quotaManager = new QuotaManagerImpl(storageUtil.storage, cronJobManager);
+    quotaManager = new QuotaManagerImpl(storageUtil.storage);
     storageUtil.expectOperations();
   }
 
@@ -727,7 +724,7 @@ public class QuotaManagerImplTest extends EasyMockTest {
   }
 
   private IExpectationSetters<?> expectNoCronJobs() {
-    return expect(cronJobManager.getJobs()).andReturn(ImmutableSet.<IJobConfiguration>of());
+    return expect(storageUtil.jobStore.fetchJobs()).andReturn(ImmutableSet.<IJobConfiguration>of());
   }
 
   private IExpectationSetters<?> expectCronJobs(IJobConfiguration... jobs) {
@@ -736,7 +733,7 @@ public class QuotaManagerImplTest extends EasyMockTest {
       builder.add(job);
     }
 
-    return expect(cronJobManager.getJobs()).andReturn(builder.build());
+    return expect(storageUtil.jobStore.fetchJobs()).andReturn(builder.build());
   }
 
   private IExpectationSetters<Optional<IResourceAggregate>> expectQuota(IResourceAggregate quota) {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/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
index 493150b..b48994f 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/StorageBackfillTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/StorageBackfillTest.java
@@ -20,8 +20,6 @@ import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
-import com.twitter.common.util.Clock;
-import com.twitter.common.util.testing.FakeClock;
 
 import org.apache.aurora.gen.AssignedTask;
 import org.apache.aurora.gen.Constraint;
@@ -31,7 +29,6 @@ import org.apache.aurora.gen.Identity;
 import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.gen.JobKey;
 import org.apache.aurora.gen.MesosContainer;
-import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.ScheduledTask;
 import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.gen.TaskEvent;
@@ -64,12 +61,10 @@ public class StorageBackfillTest {
       new ExecutorConfig("AuroraExecutor", "executorConfig");
 
   private Storage storage;
-  private Clock clock;
 
   @Before
   public void setUp() {
     storage = MemStorage.newEmptyStorage();
-    clock = new FakeClock();
   }
 
   @Test
@@ -115,7 +110,7 @@ public class StorageBackfillTest {
     storage.write(new Storage.MutateWork.NoResult.Quiet() {
       @Override
       protected void execute(Storage.MutableStoreProvider storeProvider) {
-        storeProvider.getJobStore().saveAcceptedJob("CRON", IJobConfiguration.build(config));
+        storeProvider.getJobStore().saveAcceptedJob(IJobConfiguration.build(config));
       }
     });
 
@@ -125,7 +120,7 @@ public class StorageBackfillTest {
         storage.read(new Storage.Work.Quiet<Iterable<IJobConfiguration>>() {
           @Override
           public Iterable<IJobConfiguration> apply(Storage.StoreProvider storeProvider) {
-            return storeProvider.getJobStore().fetchJobs("CRON");
+            return storeProvider.getJobStore().fetchJobs();
           }
         }));
 
@@ -179,7 +174,7 @@ public class StorageBackfillTest {
     storage.write(new Storage.MutateWork.NoResult.Quiet() {
       @Override
       protected void execute(Storage.MutableStoreProvider storeProvider) {
-        StorageBackfill.backfill(storeProvider, clock);
+        StorageBackfill.backfill(storeProvider);
       }
     });
   }
@@ -195,13 +190,6 @@ public class StorageBackfillTest {
             .setJobName(jobKey.getName()));
   }
 
-  private static SanitizedConfiguration makeJob(IJobKey jobKey, TaskConfig task, int numTasks)
-      throws Exception {
-
-    return SanitizedConfiguration.fromUnsanitized(
-        IJobConfiguration.build(makeJobConfig(jobKey, task, numTasks)));
-  }
-
   private static TaskConfig defaultTask() {
     return new TaskConfig()
         .setOwner(OWNER)
@@ -221,8 +209,4 @@ public class StorageBackfillTest {
         storage,
         Query.taskScoped(taskId)));
   }
-
-  private Set<IScheduledTask> getTasksByStatus(ScheduleStatus status) {
-    return Storage.Util.fetchTasks(storage, Query.unscoped().byStatus(status));
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java b/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
index 479c8bd..0c73a9f 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
@@ -171,9 +171,7 @@ public class StorageBackupTest extends EasyMockTest {
             "hostA",
             ImmutableSet.of(new Attribute("attr", ImmutableSet.of("value"))))));
     snapshot.setJobs(ImmutableSet.of(
-        new StoredJob(
-            "jobManager",
-            new JobConfiguration().setKey(new JobKey("owner", "env", "jobA")))));
+        new StoredJob(new JobConfiguration().setKey(new JobKey("owner", "env", "jobA")))));
     snapshot.setQuotaConfigurations(
         ImmutableSet.of(new QuotaConfiguration("roleA", new ResourceAggregate(10, 1024, 1024))));
     snapshot.setSchedulerMetadata(new SchedulerMetadata().setFrameworkId("frameworkId"));

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/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 7e5d0ed..c846464 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
@@ -296,12 +296,9 @@ public class LogStorageTest extends EasyMockTest {
     builder.add(createTransaction(Op.saveFrameworkId(new SaveFrameworkId("bob"))));
     storageUtil.schedulerStore.saveFrameworkId("bob");
 
-    SaveAcceptedJob acceptedJob =
-        new SaveAcceptedJob().setManagerId("CRON").setJobConfig(new JobConfiguration());
+    SaveAcceptedJob acceptedJob = new SaveAcceptedJob().setJobConfig(new JobConfiguration());
     builder.add(createTransaction(Op.saveAcceptedJob(acceptedJob)));
-    storageUtil.jobStore.saveAcceptedJob(
-        acceptedJob.getManagerId(),
-        IJobConfiguration.build(acceptedJob.getJobConfig()));
+    storageUtil.jobStore.saveAcceptedJob(IJobConfiguration.build(acceptedJob.getJobConfig()));
 
     RemoveJob removeJob = new RemoveJob(JOB_KEY.newBuilder());
     builder.add(createTransaction(Op.removeJob(removeJob)));
@@ -526,20 +523,19 @@ public class LogStorageTest extends EasyMockTest {
   public void testSaveAcceptedJob() throws Exception {
     final IJobConfiguration jobConfig =
         IJobConfiguration.build(new JobConfiguration().setKey(JOB_KEY.newBuilder()));
-    final String managerId = "CRON";
     new MutationFixture() {
       @Override
       protected void setupExpectations() throws Exception {
         storageUtil.expectWrite();
-        storageUtil.jobStore.saveAcceptedJob(managerId, jobConfig);
+        storageUtil.jobStore.saveAcceptedJob(jobConfig);
         streamMatcher.expectTransaction(
-            Op.saveAcceptedJob(new SaveAcceptedJob(managerId, jobConfig.newBuilder())))
+            Op.saveAcceptedJob(new SaveAcceptedJob(jobConfig.newBuilder())))
             .andReturn(position);
       }
 
       @Override
       protected void performMutations(MutableStoreProvider storeProvider) {
-        storeProvider.getJobStore().saveAcceptedJob(managerId, jobConfig);
+        storeProvider.getJobStore().saveAcceptedJob(jobConfig);
       }
     }.run();
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java b/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
index 152e704..f430927 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
@@ -96,7 +96,6 @@ public class SnapshotStoreImplTest extends EasyMockTest {
     IHostAttributes legacyAttribute = IHostAttributes.build(
         new HostAttributes("host", ImmutableSet.<Attribute>of()));
     StoredJob job = new StoredJob(
-        "jobManager",
         new JobConfiguration().setKey(new JobKey("owner", "env", "name")));
     String frameworkId = "framework_id";
     ILock lock = ILock.build(new Lock()
@@ -129,8 +128,7 @@ public class SnapshotStoreImplTest extends EasyMockTest {
         .andReturn(ImmutableMap.of("steve", ResourceAggregates.none()));
     expect(storageUtil.attributeStore.getHostAttributes())
         .andReturn(ImmutableSet.of(attribute, legacyAttribute));
-    expect(storageUtil.jobStore.fetchManagerIds()).andReturn(ImmutableSet.of("jobManager"));
-    expect(storageUtil.jobStore.fetchJobs("jobManager"))
+    expect(storageUtil.jobStore.fetchJobs())
         .andReturn(ImmutableSet.of(IJobConfiguration.build(job.getJobConfiguration())));
     expect(storageUtil.schedulerStore.fetchFrameworkId()).andReturn(Optional.of(frameworkId));
     expect(storageUtil.lockStore.fetchLocks()).andReturn(ImmutableSet.of(lock));
@@ -144,9 +142,7 @@ public class SnapshotStoreImplTest extends EasyMockTest {
     storageUtil.taskStore.saveTasks(tasks);
     storageUtil.quotaStore.saveQuota("steve", ResourceAggregates.none());
     expect(storageUtil.attributeStore.saveHostAttributes(attribute)).andReturn(true);
-    storageUtil.jobStore.saveAcceptedJob(
-        job.getJobManagerId(),
-        IJobConfiguration.build(job.getJobConfiguration()));
+    storageUtil.jobStore.saveAcceptedJob(IJobConfiguration.build(job.getJobConfiguration()));
     storageUtil.schedulerStore.saveFrameworkId(frameworkId);
     storageUtil.lockStore.saveLock(lock);
     storageUtil.jobUpdateStore.saveJobUpdate(

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/storage/mem/MemJobStoreTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/mem/MemJobStoreTest.java b/src/test/java/org/apache/aurora/scheduler/storage/mem/MemJobStoreTest.java
index 2e0c415..b9ade45 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/mem/MemJobStoreTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/mem/MemJobStoreTest.java
@@ -27,10 +27,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
 public class MemJobStoreTest {
-
-  private static final String MANAGER_1 = "manager1";
-  private static final String MANAGER_2 = "manager2";
-
   private static final IJobConfiguration JOB_A = makeJob("a");
   private static final IJobConfiguration JOB_B = makeJob("b");
 
@@ -46,31 +42,22 @@ public class MemJobStoreTest {
 
   @Test
   public void testJobStore() {
-    assertNull(store.fetchJob(MANAGER_1, JobKeys.from("nobody", "nowhere", "noname")).orNull());
-    assertEquals(ImmutableSet.<IJobConfiguration>of(), store.fetchJobs(MANAGER_1));
-    assertEquals(ImmutableSet.<String>of(), store.fetchManagerIds());
-
-    store.saveAcceptedJob(MANAGER_1, JOB_A);
-    assertEquals(JOB_A, store.fetchJob(MANAGER_1, KEY_A).orNull());
-    assertEquals(ImmutableSet.of(JOB_A), store.fetchJobs(MANAGER_1));
+    assertNull(store.fetchJob(JobKeys.from("nobody", "nowhere", "noname")).orNull());
+    assertEquals(ImmutableSet.<IJobConfiguration>of(), store.fetchJobs());
 
-    store.saveAcceptedJob(MANAGER_1, JOB_B);
-    assertEquals(JOB_B, store.fetchJob(MANAGER_1, KEY_B).orNull());
-    assertEquals(ImmutableSet.of(JOB_A, JOB_B), store.fetchJobs(MANAGER_1));
-    assertEquals(ImmutableSet.of(MANAGER_1), store.fetchManagerIds());
+    store.saveAcceptedJob(JOB_A);
+    assertEquals(JOB_A, store.fetchJob(KEY_A).orNull());
+    assertEquals(ImmutableSet.of(JOB_A), store.fetchJobs());
 
-    store.saveAcceptedJob(MANAGER_2, JOB_B);
-    assertEquals(JOB_B, store.fetchJob(MANAGER_1, KEY_B).orNull());
-    assertEquals(ImmutableSet.of(JOB_B), store.fetchJobs(MANAGER_2));
-    assertEquals(ImmutableSet.of(MANAGER_1, MANAGER_2), store.fetchManagerIds());
+    store.saveAcceptedJob(JOB_B);
+    assertEquals(JOB_B, store.fetchJob(KEY_B).orNull());
+    assertEquals(ImmutableSet.of(JOB_A, JOB_B), store.fetchJobs());
 
     store.removeJob(KEY_B);
-    assertEquals(ImmutableSet.of(JOB_A), store.fetchJobs(MANAGER_1));
-    assertEquals(ImmutableSet.<IJobConfiguration>of(), store.fetchJobs(MANAGER_2));
+    assertEquals(ImmutableSet.of(JOB_A), store.fetchJobs());
 
     store.deleteJobs();
-    assertEquals(ImmutableSet.<IJobConfiguration>of(), store.fetchJobs(MANAGER_1));
-    assertEquals(ImmutableSet.<IJobConfiguration>of(), store.fetchJobs(MANAGER_2));
+    assertEquals(ImmutableSet.<IJobConfiguration>of(), store.fetchJobs());
   }
 
   @Test
@@ -83,18 +70,17 @@ public class MemJobStoreTest {
     stagingBuilder.getKey().setEnvironment("staging");
     IJobConfiguration staging = IJobConfiguration.build(stagingBuilder);
 
-    store.saveAcceptedJob(MANAGER_1, prod);
-    store.saveAcceptedJob(MANAGER_1, staging);
+    store.saveAcceptedJob(prod);
+    store.saveAcceptedJob(staging);
 
     assertNull(store.fetchJob(
-        MANAGER_1,
         IJobKey.build(templateConfig.getKey().newBuilder().setEnvironment("test"))).orNull());
-    assertEquals(prod, store.fetchJob(MANAGER_1, prod.getKey()).orNull());
-    assertEquals(staging, store.fetchJob(MANAGER_1, staging.getKey()).orNull());
+    assertEquals(prod, store.fetchJob(prod.getKey()).orNull());
+    assertEquals(staging, store.fetchJob(staging.getKey()).orNull());
 
     store.removeJob(prod.getKey());
-    assertNull(store.fetchJob(MANAGER_1, prod.getKey()).orNull());
-    assertEquals(staging, store.fetchJob(MANAGER_1, staging.getKey()).orNull());
+    assertNull(store.fetchJob(prod.getKey()).orNull());
+    assertEquals(staging, store.fetchJob(staging.getKey()).orNull());
   }
 
   private static IJobConfiguration makeJob(String name) {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/70f3bf46/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java b/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
index a85cba1..daaa759 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
@@ -55,7 +55,6 @@ import org.apache.aurora.scheduler.base.JobKeys;
 import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.Query.Builder;
 import org.apache.aurora.scheduler.configuration.SanitizedConfiguration;
-import org.apache.aurora.scheduler.cron.CronJobManager;
 import org.apache.aurora.scheduler.cron.CronPredictor;
 import org.apache.aurora.scheduler.cron.CrontabEntry;
 import org.apache.aurora.scheduler.filter.SchedulingFilter.Veto;
@@ -98,7 +97,6 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
   private StorageTestUtil storageUtil;
   private NearestFit nearestFit;
   private CronPredictor cronPredictor;
-  private CronJobManager cronJobManager;
   private QuotaManager quotaManager;
   private LockManager lockManager;
 
@@ -110,7 +108,6 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
     storageUtil.expectOperations();
     nearestFit = createMock(NearestFit.class);
     cronPredictor = createMock(CronPredictor.class);
-    cronJobManager = createMock(CronJobManager.class);
     quotaManager = createMock(QuotaManager.class);
     lockManager = createMock(LockManager.class);
 
@@ -118,7 +115,6 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
         storageUtil.storage,
         nearestFit,
         cronPredictor,
-        cronJobManager,
         quotaManager,
         lockManager);
   }
@@ -178,23 +174,25 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
         .andReturn(new Date(nextCronRunMs))
         .anyTimes();
 
-    expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(ownedCronJobOnly));
     storageUtil.expectTaskFetch(query);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(ownedCronJobOnly));
 
-    expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(bothCronJobs));
     storageUtil.expectTaskFetch(query);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(bothCronJobs));
 
-    expect(cronJobManager.getJobs())
-        .andReturn(IJobConfiguration.setFromBuilders(unownedCronJobOnly));
     storageUtil.expectTaskFetch(query, ownedImmediateTask);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(unownedCronJobOnly));
 
-    expect(cronJobManager.getJobs()).andReturn(ImmutableSet.<IJobConfiguration>of());
     storageUtil.expectTaskFetch(query);
+    expect(storageUtil.jobStore.fetchJobs()).andReturn(ImmutableSet.<IJobConfiguration>of());
 
     // Handle the case where a cron job has a running task (same JobKey present in both stores).
-    expect(cronJobManager.getJobs())
-        .andReturn(ImmutableList.of(IJobConfiguration.build(ownedCronJob)));
     storageUtil.expectTaskFetch(query, ownedCronJobScheduledTask);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(ImmutableSet.of(ownedCronJob)));
 
     control.replay();
 
@@ -349,7 +347,7 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
         .setTaskConfig(immediateTaskConfig);
 
     Set<JobConfiguration> crons = ImmutableSet.of(cronJobOne, cronJobTwo);
-    expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));
+    expect(storageUtil.jobStore.fetchJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));
     storageUtil.expectTaskFetch(Query.unscoped().active(), immediateTask);
 
     control.replay();
@@ -394,23 +392,25 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
         .setTaskConfig(ownedImmediateTaskInfo);
     Query.Builder query = Query.roleScoped(ROLE).active();
 
-    expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(ownedCronJobOnly));
     storageUtil.expectTaskFetch(query);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(ownedCronJobOnly));
 
-    expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(bothCronJobs));
     storageUtil.expectTaskFetch(query);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(bothCronJobs));
 
-    expect(cronJobManager.getJobs())
-        .andReturn(IJobConfiguration.setFromBuilders(unownedCronJobOnly));
     storageUtil.expectTaskFetch(query, ownedImmediateTask);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(unownedCronJobOnly));
 
-    expect(cronJobManager.getJobs()).andReturn(ImmutableSet.<IJobConfiguration>of());
+    expect(storageUtil.jobStore.fetchJobs()).andReturn(ImmutableSet.<IJobConfiguration>of());
     storageUtil.expectTaskFetch(query);
 
     // Handle the case where a cron job has a running task (same JobKey present in both stores).
-    expect(cronJobManager.getJobs())
-        .andReturn(ImmutableList.of(IJobConfiguration.build(ownedCronJob)));
     storageUtil.expectTaskFetch(query, ownedCronJobScheduledTask);
+    expect(storageUtil.jobStore.fetchJobs())
+        .andReturn(IJobConfiguration.setFromBuilders(ImmutableSet.of(ownedCronJob)));
 
     control.replay();
 
@@ -626,7 +626,7 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
 
     storageUtil.expectTaskFetch(Query.unscoped(), task1, task2, task3, task4);
 
-    expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));
+    expect(storageUtil.jobStore.fetchJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));
 
     RoleSummaryResult expectedResult = new RoleSummaryResult();
     expectedResult.addToSummaries(


Mime
View raw message