aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jco...@apache.org
Subject aurora git commit: Introduce "preemptible" flag in TierInfo with backward compatible support for "production" flag in TaskConfig.
Date Wed, 30 Mar 2016 23:02:48 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 55a2422f1 -> 193f17ee4


Introduce "preemptible" flag in TierInfo with backward compatible support for "production" flag in
TaskConfig.

Bugs closed: AURORA-1616

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


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

Branch: refs/heads/master
Commit: 193f17ee4800b8f1ecd4e2db2ea0edad1bc2d205
Parents: 55a2422
Author: Amol Deshmukh <amol@apache.org>
Authored: Wed Mar 30 16:02:20 2016 -0700
Committer: Joshua Cohen <jcohen@apache.org>
Committed: Wed Mar 30 16:02:20 2016 -0700

----------------------------------------------------------------------
 RELEASE-NOTES.md                                |  1 +
 docs/reference/configuration.md                 |  2 +-
 .../org/apache/aurora/benchmark/Offers.java     |  4 +-
 .../org/apache/aurora/scheduler/TierInfo.java   | 30 ++++++---
 .../apache/aurora/scheduler/TierManager.java    | 10 ++-
 .../apache/aurora/scheduler/app/AppModule.java  | 12 ++--
 .../aurora/scheduler/base/TaskTestUtil.java     | 30 ++++++---
 .../configuration/ConfigurationManager.java     | 66 +++++++++++++-------
 .../scheduler/mesos/TestExecutorSettings.java   |  4 +-
 .../preemptor/PreemptionVictimFilter.java       | 26 ++++----
 .../org/apache/aurora/scheduler/tiers.json      |  7 +++
 .../aurora/scheduler/AcceptedOfferTest.java     | 15 ++---
 .../aurora/scheduler/ResourceSlotTest.java      |  4 +-
 .../apache/aurora/scheduler/ResourcesTest.java  |  4 +-
 .../aurora/scheduler/TierManagerTest.java       | 23 ++++---
 .../apache/aurora/scheduler/TierModuleTest.java |  6 +-
 .../configuration/ConfigurationManagerTest.java | 15 +++--
 .../mesos/MesosTaskFactoryImplTest.java         | 18 +++---
 .../preemptor/PreemptionVictimFilterTest.java   | 64 ++++++++++++++-----
 .../scheduler/state/TaskAssignerImplTest.java   | 14 ++---
 .../aurora/scheduler/thrift/ThriftIT.java       | 12 ++--
 21 files changed, 237 insertions(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/RELEASE-NOTES.md
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 4eebc9d..6fc3afe 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -18,6 +18,7 @@
   for more detail.
 - Support for ZooKeeper authentication in the executor announcer. See
   [here](docs/operations/security.md#announcer-authentication) for details.
+- Jobs referencing invalid tier name will be rejected by the scheduler.
 
 ### Deprecations and removals:
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/docs/reference/configuration.md
----------------------------------------------------------------------
diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md
index c9459fe..9fcfdfc 100644
--- a/docs/reference/configuration.md
+++ b/docs/reference/configuration.md
@@ -348,7 +348,7 @@ Job Schema
   ```health_check_config``` | ```HealthCheckConfig``` object | Parameters for controlling a task's health checks. HTTP health check is only used if a  health port was assigned with a command line wildcard.
   ```container``` | ```Container``` object | An optional container to run all processes inside of.
   ```lifecycle``` | ```LifecycleConfig``` object | An optional task lifecycle configuration that dictates commands to be executed on startup/teardown.  HTTP lifecycle is enabled by default if the "health" port is requested.  See [LifecycleConfig Objects](#lifecycleconfig-objects) for more information.
-  ```tier``` | String | Task tier type. When set to `revocable` requires the task to run with Mesos revocable resources. This is work [in progress](https://issues.apache.org/jira/browse/AURORA-1343) and is currently only supported for the revocable tasks. The ultimate goal is to simplify task configuration by hiding various configuration knobs behind a task tier definition. See AURORA-1343 and AURORA-1443 for more details.
+  ```tier``` | String | Task tier type. The default scheduler tier configuration allows for 3 tiers: `revocable`, `preemptible`, and `preferred`. The `revocable` tier requires the task to run with Mesos revocable resources. Setting the task's tier to `preemptible` allows for the possibility of that task being preempted by other tasks when cluster is running low on resources. The `preferred` tier prevents the task from using revocable resources and from being preempted. Since it is possible that a cluster is configured with a custom tier configuration, users should consult their cluster administrator to be informed of the tiers supported by the cluster. Attempts to schedule jobs with an unsupported tier will be rejected by the scheduler.
 
 
 ### UpdateConfig Objects

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/jmh/java/org/apache/aurora/benchmark/Offers.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/Offers.java b/src/jmh/java/org/apache/aurora/benchmark/Offers.java
index 055a2ff..4c232f6 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/Offers.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/Offers.java
@@ -25,7 +25,7 @@ import org.apache.aurora.scheduler.offers.OfferManager;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 import org.apache.mesos.Protos;
 
-import static org.apache.aurora.scheduler.TierInfo.DEFAULT;
+import static org.apache.aurora.scheduler.base.TaskTestUtil.DEV_TIER;
 
 /**
  * Offer factory.
@@ -91,7 +91,7 @@ final class Offers {
       for (IHostAttributes attributes : hostAttributes) {
         Protos.Offer offer = Protos.Offer.newBuilder()
             .addAllResources(new ResourceSlot(cpu, ram, disk, ports)
-                .toResourceList(DEFAULT))
+                .toResourceList(DEV_TIER))
             .setId(Protos.OfferID.newBuilder().setValue(String.format(OFFER_ID_FORMAT, id++)))
             .setFrameworkId(Protos.FrameworkID.newBuilder().setValue(FRAMEWORK_ID))
             .setSlaveId(Protos.SlaveID.newBuilder().setValue(attributes.getSlaveId()))

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/java/org/apache/aurora/scheduler/TierInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TierInfo.java b/src/main/java/org/apache/aurora/scheduler/TierInfo.java
index b4611b9..ac8901f 100644
--- a/src/main/java/org/apache/aurora/scheduler/TierInfo.java
+++ b/src/main/java/org/apache/aurora/scheduler/TierInfo.java
@@ -17,23 +17,37 @@ import java.util.Objects;
 
 import com.google.common.base.MoreObjects;
 
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.annotate.JsonProperty;
+
 /**
  * Defines common task tier traits and behaviors.
  */
 public final class TierInfo {
-  public static final TierInfo DEFAULT = new TierInfo();
 
+  private final boolean preemptible;
   private final boolean revocable;
 
-  private TierInfo() {
-    this(false);
-  }
+  @JsonCreator
+  public TierInfo(
+      @JsonProperty("preemptible") boolean preemptible,
+      @JsonProperty("revocable") boolean revocable) {
 
-  public TierInfo(boolean revocable) {
+    this.preemptible = preemptible;
     this.revocable = revocable;
   }
 
   /**
+   * Checks if this tier intends to run tasks as preemptible.
+   *
+   * @return {@code true} if this tier will result in tasks being run as preemptible, {@code false}
+   * otherwise.
+   */
+  public boolean isPreemptible() {
+    return preemptible;
+  }
+
+  /**
    * Checks if this tier intends to run with Mesos revocable resource offers.
    *
    * @return {@code true} if this tier requires revocable resource offers, {@code false} otherwise.
@@ -44,7 +58,7 @@ public final class TierInfo {
 
   @Override
   public int hashCode() {
-    return Objects.hashCode(revocable);
+    return Objects.hash(preemptible, revocable);
   }
 
   @Override
@@ -54,12 +68,14 @@ public final class TierInfo {
     }
 
     TierInfo other = (TierInfo) obj;
-    return Objects.equals(revocable, other.revocable);
+    return Objects.equals(preemptible, other.preemptible)
+        && Objects.equals(revocable, other.revocable);
   }
 
   @Override
   public String toString() {
     return MoreObjects.toStringHelper(this)
+        .add("preemptible", preemptible)
         .add("revocable", revocable)
         .toString();
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/java/org/apache/aurora/scheduler/TierManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TierManager.java b/src/main/java/org/apache/aurora/scheduler/TierManager.java
index 480c485..b96189b 100644
--- a/src/main/java/org/apache/aurora/scheduler/TierManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/TierManager.java
@@ -73,8 +73,14 @@ public interface TierManager {
           !taskConfig.isSetTier() || tierConfig.tiers.containsKey(taskConfig.getTier()),
           format("Invalid tier '%s' in TaskConfig.", taskConfig.getTier()));
 
-      // Backward compatibility mode until tier is required in TaskConfig (AURORA-1624).
-      return taskConfig.isSetTier() ? tierConfig.tiers.get(taskConfig.getTier()) : TierInfo.DEFAULT;
+      return taskConfig.isSetTier()
+          ? tierConfig.tiers.get(taskConfig.getTier())
+          : tierConfig.getTiers().values().stream()
+              // Backward compatibility mode until tier is required in TaskConfig (AURORA-1624).
+              .filter(v -> v.isPreemptible() == !taskConfig.isProduction() && !v.isRevocable())
+              .findFirst()
+              .orElseThrow(() -> new IllegalStateException(
+                  format("No matching implicit tier for task of job %s", taskConfig.getJob())));
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/AppModule.java b/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
index 97d87ff..c81bd79 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
@@ -36,7 +36,7 @@ import org.apache.aurora.gen.Container._Fields;
 import org.apache.aurora.scheduler.SchedulerModule;
 import org.apache.aurora.scheduler.SchedulerServicesModule;
 import org.apache.aurora.scheduler.async.AsyncModule;
-import org.apache.aurora.scheduler.configuration.ConfigurationManager;
+import org.apache.aurora.scheduler.configuration.ConfigurationManager.ConfigurationManagerSettings;
 import org.apache.aurora.scheduler.events.PubsubEventModule;
 import org.apache.aurora.scheduler.filter.SchedulingFilterImpl;
 import org.apache.aurora.scheduler.http.JettyServerModule;
@@ -94,15 +94,15 @@ public class AppModule extends AbstractModule {
       help = "If false, Docker tasks may run without an executor (EXPERIMENTAL)")
   private static final Arg<Boolean> REQUIRE_DOCKER_USE_EXECUTOR = Arg.create(true);
 
-  private final ConfigurationManager configurationManager;
+  private final ConfigurationManagerSettings configurationManagerSettings;
 
   @VisibleForTesting
-  public AppModule(ConfigurationManager configurationManager) {
-    this.configurationManager = requireNonNull(configurationManager);
+  public AppModule(ConfigurationManagerSettings configurationManagerSettings) {
+    this.configurationManagerSettings = requireNonNull(configurationManagerSettings);
   }
 
   public AppModule() {
-    this(new ConfigurationManager(
+    this(new ConfigurationManagerSettings(
         ImmutableSet.copyOf(ALLOWED_CONTAINER_TYPES.get()),
         ENABLE_DOCKER_PARAMETERS.get(),
         DEFAULT_DOCKER_PARAMETERS.get(),
@@ -111,7 +111,7 @@ public class AppModule extends AbstractModule {
 
   @Override
   protected void configure() {
-    bind(ConfigurationManager.class).toInstance(configurationManager);
+    bind(ConfigurationManagerSettings.class).toInstance(configurationManagerSettings);
     bind(Thresholds.class)
         .toInstance(new Thresholds(MAX_TASKS_PER_JOB.get(), MAX_UPDATE_INSTANCE_FAILURES.get()));
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java b/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
index 9cf8002..d91c742 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
@@ -35,8 +35,10 @@ import org.apache.aurora.gen.TaskConstraint;
 import org.apache.aurora.gen.TaskEvent;
 import org.apache.aurora.gen.ValueConstraint;
 import org.apache.aurora.scheduler.TierInfo;
+import org.apache.aurora.scheduler.TierManager;
 import org.apache.aurora.scheduler.TierManager.TierManagerImpl.TierConfig;
 import org.apache.aurora.scheduler.configuration.ConfigurationManager;
+import org.apache.aurora.scheduler.configuration.ConfigurationManager.ConfigurationManagerSettings;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
@@ -49,15 +51,25 @@ import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
  */
 public final class TaskTestUtil {
 
-  public static final IJobKey JOB = JobKeys.from("role", "env", "job");
-  public static final TierInfo REVOCABLE_TIER = new TierInfo(true);
+  public static final IJobKey JOB = JobKeys.from("role", "dev", "job");
+  public static final TierInfo REVOCABLE_TIER =
+      new TierInfo(true /* preemptible */, true /* revocable */);
+  public static final TierInfo DEV_TIER =
+      new TierInfo(true /* preemptible */, false /* revocable */);
+  public static final TierInfo PREFERRED_TIER =
+      new TierInfo(false /* preemptible */, false /* revocable */);
+  public static final String DEV_TIER_NAME = "tier-dev";
   public static final TierConfig DEV_TIER_CONFIG =
-      new TierConfig(ImmutableMap.of("tier-dev", new TierInfo(false)));
-  public static final ConfigurationManager CONFIGURATION_MANAGER = new ConfigurationManager(
-      ImmutableSet.of(_Fields.MESOS),
-      false,
-      ImmutableMultimap.of(),
-      true);
+      new TierConfig(ImmutableMap.of(DEV_TIER_NAME, DEV_TIER));
+  public static final TierManager DEV_TIER_MANAGER = taskConfig -> DEV_TIER;
+  public static final ConfigurationManagerSettings CONFIGURATION_MANAGER_SETTINGS =
+      new ConfigurationManagerSettings(
+          ImmutableSet.of(_Fields.MESOS),
+          false,
+          ImmutableMultimap.of(),
+          true);
+  public static final ConfigurationManager CONFIGURATION_MANAGER =
+      new ConfigurationManager(CONFIGURATION_MANAGER_SETTINGS, DEV_TIER_MANAGER);
 
   private TaskTestUtil() {
     // Utility class.
@@ -74,7 +86,7 @@ public final class TaskTestUtil {
         .setPriority(1)
         .setMaxTaskFailures(-1)
         .setProduction(true)
-        .setTier("tier-" + job.getEnvironment())
+        .setTier(DEV_TIER_NAME)
         .setConstraints(ImmutableSet.of(
             new Constraint(
                 "valueConstraint",

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
index 9d2bc82..68573ba 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
@@ -14,9 +14,9 @@
 package org.apache.aurora.scheduler.configuration;
 
 import java.util.Map;
-import java.util.Objects;
 
 import javax.annotation.Nullable;
+import javax.inject.Inject;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
@@ -34,6 +34,7 @@ import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.gen.TaskConfig._Fields;
 import org.apache.aurora.gen.TaskConstraint;
+import org.apache.aurora.scheduler.TierManager;
 import org.apache.aurora.scheduler.base.JobKeys;
 import org.apache.aurora.scheduler.base.UserProvidedStrings;
 import org.apache.aurora.scheduler.storage.entities.IConstraint;
@@ -43,6 +44,8 @@ import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.apache.aurora.scheduler.storage.entities.ITaskConstraint;
 import org.apache.aurora.scheduler.storage.entities.IValueConstraint;
 
+import static java.util.Objects.requireNonNull;
+
 /**
  * Manages translation from a string-mapped configuration to a concrete configuration type, and
  * defaults for optional values.
@@ -99,21 +102,32 @@ public class ConfigurationManager {
           new RequiredFieldValidator<>(_Fields.RAM_MB, new GreaterThan(0.0, "ram_mb")),
           new RequiredFieldValidator<>(_Fields.DISK_MB, new GreaterThan(0.0, "disk_mb")));
 
-  private final ImmutableSet<Container._Fields> allowedContainerTypes;
-  private final boolean allowDockerParameters;
-  private final Multimap<String, String> defaultDockerParameters;
-  private final boolean requireDockerUseExecutor;
-
-  public ConfigurationManager(
-      ImmutableSet<Container._Fields> allowedContainerTypes,
-      boolean allowDockerParameters,
-      Multimap<String, String> defaultDockerParameters,
-      boolean requireDockerUseExecutor) {
-
-    this.allowedContainerTypes = Objects.requireNonNull(allowedContainerTypes);
-    this.allowDockerParameters = allowDockerParameters;
-    this.defaultDockerParameters = Objects.requireNonNull(defaultDockerParameters);
-    this.requireDockerUseExecutor = requireDockerUseExecutor;
+  public static class ConfigurationManagerSettings {
+    private final ImmutableSet<Container._Fields> allowedContainerTypes;
+    private final boolean allowDockerParameters;
+    private final Multimap<String, String> defaultDockerParameters;
+    private final boolean requireDockerUseExecutor;
+
+    public ConfigurationManagerSettings(
+        ImmutableSet<Container._Fields> allowedContainerTypes,
+        boolean allowDockerParameters,
+        Multimap<String, String> defaultDockerParameters,
+        boolean requireDockerUseExecutor) {
+
+      this.allowedContainerTypes = requireNonNull(allowedContainerTypes);
+      this.allowDockerParameters = allowDockerParameters;
+      this.defaultDockerParameters = requireNonNull(defaultDockerParameters);
+      this.requireDockerUseExecutor = requireDockerUseExecutor;
+    }
+  }
+
+  private final ConfigurationManagerSettings settings;
+  private final TierManager tierManager;
+
+  @Inject
+  public ConfigurationManager(ConfigurationManagerSettings settings, TierManager tierManager) {
+    this.settings = requireNonNull(settings);
+    this.tierManager = requireNonNull(tierManager);
   }
 
   private static String getRole(IValueConstraint constraint) {
@@ -145,7 +159,7 @@ public class ConfigurationManager {
   public IJobConfiguration validateAndPopulate(IJobConfiguration job)
       throws TaskDescriptionException {
 
-    Objects.requireNonNull(job);
+    requireNonNull(job);
 
     if (!job.isSetTaskConfig()) {
       throw new TaskDescriptionException("Job configuration must have taskConfig set.");
@@ -209,6 +223,12 @@ public class ConfigurationManager {
       throw new TaskDescriptionException("Tier contains illegal characters: " + config.getTier());
     }
 
+    try {
+      tierManager.getTier(config);
+    } catch (IllegalArgumentException e) {
+      throw new TaskDescriptionException(e.getMessage(), e);
+    }
+
     if (!JobKeys.isValid(config.getJob())) {
       // Job key is set but invalid
       throw new TaskDescriptionException("Job key " + config.getJob() + " is invalid.");
@@ -254,17 +274,17 @@ public class ConfigurationManager {
           throw new TaskDescriptionException("A container must specify an image.");
         }
         if (containerConfig.getDocker().getParameters().isEmpty()) {
-          for (Map.Entry<String, String> e : this.defaultDockerParameters.entries()) {
+          for (Map.Entry<String, String> e : settings.defaultDockerParameters.entries()) {
             builder.getContainer().getDocker().addToParameters(
                 new DockerParameter(e.getKey(), e.getValue()));
           }
         } else {
-          if (!allowDockerParameters) {
+          if (!settings.allowDockerParameters) {
             throw new TaskDescriptionException(NO_DOCKER_PARAMETERS);
           }
         }
 
-        if (requireDockerUseExecutor && !config.isSetExecutorConfig()) {
+        if (settings.requireDockerUseExecutor && !config.isSetExecutorConfig()) {
           throw new TaskDescriptionException(EXECUTOR_REQUIRED_WITH_DOCKER);
         }
       }
@@ -275,7 +295,7 @@ public class ConfigurationManager {
     if (!containerType.isPresent()) {
       throw new TaskDescriptionException("A job must have a container type.");
     }
-    if (!allowedContainerTypes.contains(containerType.get())) {
+    if (!settings.allowedContainerTypes.contains(containerType.get())) {
       throw new TaskDescriptionException(
           "This scheduler is not configured to allow the container type "
               + containerType.get().toString());
@@ -311,6 +331,10 @@ public class ConfigurationManager {
    * Thrown when an invalid task or job configuration is encountered.
    */
   public static class TaskDescriptionException extends Exception {
+    public TaskDescriptionException(String msg, Exception e) {
+      super(msg, e);
+    }
+
     public TaskDescriptionException(String msg) {
       super(msg);
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java b/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
index 16fa2d3..7110fbd 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
@@ -17,7 +17,7 @@ import com.google.common.collect.ImmutableList;
 
 import org.apache.aurora.scheduler.ResourceSlot;
 import org.apache.aurora.scheduler.ResourceType;
-import org.apache.aurora.scheduler.TierInfo;
+import org.apache.aurora.scheduler.base.TaskTestUtil;
 import org.apache.aurora.scheduler.configuration.executor.ExecutorConfig;
 import org.apache.aurora.scheduler.configuration.executor.ExecutorSettings;
 import org.apache.aurora.scheduler.configuration.executor.Executors;
@@ -71,7 +71,7 @@ public final class TestExecutorSettings {
   public static ExecutorSettings thermosOnlyWithOverhead(ResourceSlot overhead) {
     ExecutorConfig config = THERMOS_EXECUTOR.getExecutorConfig();
     ExecutorInfo.Builder executor = config.getExecutor().toBuilder();
-    executor.clearResources().addAllResources(overhead.toResourceList(TierInfo.DEFAULT));
+    executor.clearResources().addAllResources(overhead.toResourceList(TaskTestUtil.DEV_TIER));
     return new ExecutorSettings(new ExecutorConfig(executor.build(), config.getVolumeMounts()));
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilter.java b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilter.java
index 7f84e90..d3b7963 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilter.java
@@ -13,6 +13,7 @@
  */
 package org.apache.aurora.scheduler.preemptor;
 
+import java.util.List;
 import java.util.Set;
 
 import javax.inject.Inject;
@@ -143,15 +144,13 @@ public interface PreemptionVictimFilter {
       FluentIterable<PreemptionVictim> preemptableTasks = FluentIterable.from(possibleVictims)
           .filter(preemptionFilter(pendingTask));
 
-      if (preemptableTasks.isEmpty()) {
+      List<PreemptionVictim> sortedVictims = resourceOrder.immutableSortedCopy(preemptableTasks);
+      if (sortedVictims.isEmpty()) {
         return Optional.absent();
       }
 
       Set<PreemptionVictim> toPreemptTasks = Sets.newHashSet();
 
-      Iterable<PreemptionVictim> sortedVictims =
-          resourceOrder.immutableSortedCopy(preemptableTasks);
-
       Optional<IHostAttributes> attributes =
           storeProvider.getAttributeStore().getHostAttributes(Iterables.getOnlyElement(hosts));
 
@@ -160,12 +159,10 @@ public interface PreemptionVictimFilter {
         return Optional.absent();
       }
 
+      ResourceSlot totalResource = slackResources;
       for (PreemptionVictim victim : sortedVictims) {
         toPreemptTasks.add(victim);
-
-        ResourceSlot totalResource =
-            sum(Iterables.transform(toPreemptTasks, victimToResources)).add(slackResources);
-
+        totalResource = totalResource.add(victimToResources.apply(victim));
         Set<Veto> vetoes = schedulingFilter.filter(
             new UnusedResource(totalResource, attributes.get()),
             new ResourceRequest(pendingTask, jobState));
@@ -184,15 +181,16 @@ public interface PreemptionVictimFilter {
      * @return A filter that will compare the priorities and resources required by other tasks
      *     with {@code preemptableTask}.
      */
-    private static Predicate<PreemptionVictim> preemptionFilter(final ITaskConfig pendingTask) {
+    private Predicate<PreemptionVictim> preemptionFilter(final ITaskConfig pendingTask) {
       return possibleVictim -> {
-        boolean pendingIsProduction = pendingTask.isProduction();
-        boolean victimIsProduction = possibleVictim.isProduction();
+        boolean pendingIsPreemptible = tierManager.getTier(pendingTask).isPreemptible();
+        boolean victimIsPreemptible =
+            tierManager.getTier(possibleVictim.getConfig()).isPreemptible();
 
-        if (pendingIsProduction && !victimIsProduction) {
+        if (!pendingIsPreemptible && victimIsPreemptible) {
           return true;
-        } else if (pendingIsProduction == victimIsProduction) {
-          // If production flags are equal, preemption is based on priority within the same role.
+        } else if (pendingIsPreemptible == victimIsPreemptible) {
+          // If preemptible flags are equal, preemption is based on priority within the same role.
           if (pendingTask.getJob().getRole().equals(possibleVictim.getRole())) {
             return pendingTask.getPriority() > possibleVictim.getPriority();
           } else {

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/main/resources/org/apache/aurora/scheduler/tiers.json
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/tiers.json b/src/main/resources/org/apache/aurora/scheduler/tiers.json
index 1870105..f724c5a 100644
--- a/src/main/resources/org/apache/aurora/scheduler/tiers.json
+++ b/src/main/resources/org/apache/aurora/scheduler/tiers.json
@@ -3,10 +3,17 @@
   {
     "preferred":
     {
+      "preemptible": false,
+      "revocable": false
+    },
+    "preemptible":
+    {
+      "preemptible": true,
       "revocable": false
     },
     "revocable":
     {
+      "preemptible": true,
       "revocable": true
     }
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/AcceptedOfferTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/AcceptedOfferTest.java b/src/test/java/org/apache/aurora/scheduler/AcceptedOfferTest.java
index 39096af..49ced12 100644
--- a/src/test/java/org/apache/aurora/scheduler/AcceptedOfferTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/AcceptedOfferTest.java
@@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableSet;
 
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Data;
+import org.apache.aurora.scheduler.base.TaskTestUtil;
 import org.apache.mesos.Protos;
 import org.apache.mesos.Protos.Resource;
 import org.junit.Test;
@@ -60,7 +61,7 @@ public class AcceptedOfferTest {
         ResourceSlot.NONE,
         ResourceSlot.NONE,
         ImmutableSet.of(),
-        TierInfo.DEFAULT);
+        TaskTestUtil.DEV_TIER);
     assertEquals(Collections.emptyList(), acceptedOffer.getTaskResources());
     assertEquals(Collections.emptyList(), acceptedOffer.getExecutorResources());
   }
@@ -76,7 +77,7 @@ public class AcceptedOfferTest {
         ResourceSlot.NONE,
         ResourceSlot.NONE,
         ImmutableSet.of(80, 90, 100),
-        TierInfo.DEFAULT);
+        TaskTestUtil.DEV_TIER);
 
     List<Resource> expected = ImmutableList.<Resource>builder()
         // Because we prefer reserved resources and handle them before non-reserved resources,
@@ -98,7 +99,7 @@ public class AcceptedOfferTest {
         ResourceSlot.NONE,
         ResourceSlot.NONE,
         ImmutableSet.of(80, 90, 100),
-        TierInfo.DEFAULT);
+        TaskTestUtil.DEV_TIER);
   }
 
   @Test
@@ -122,7 +123,7 @@ public class AcceptedOfferTest {
     Protos.Offer offer = fakeOffer(resources);
 
     AcceptedOffer offerAllocation = AcceptedOffer.create(
-        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(cpuRevocable));
+        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(false, cpuRevocable));
 
     List<Resource> taskList = ImmutableList.<Resource>builder()
         .add(makeScalar(ResourceType.CPUS.getName(), role, cpuRevocable, TASK_SLOT.getNumCpus()))
@@ -158,7 +159,7 @@ public class AcceptedOfferTest {
     Protos.Offer offer = fakeOffer(resources);
 
     AcceptedOffer.create(
-        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(false));
+        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(false, false));
   }
 
   @Test
@@ -199,7 +200,7 @@ public class AcceptedOfferTest {
     Protos.Offer offer = fakeOffer(resources);
 
     AcceptedOffer offerAllocation = AcceptedOffer.create(
-        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(cpuRevocable));
+        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(false, cpuRevocable));
 
     List<Resource> taskList = ImmutableList.<Resource>builder()
         // We intentionally sliced the offer resource to not align with TASK_SLOT's num cpus.
@@ -263,7 +264,7 @@ public class AcceptedOfferTest {
     Protos.Offer offer = fakeOffer(resources);
     // We don't have enough resource to satisfy a non-revocable request.
     AcceptedOffer.create(
-        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(false));
+        offer, TASK_SLOT, EXECUTOR_SLOT, TASK_PORTS_SET, new TierInfo(false, false));
   }
 
   private static Resource makePortResource(Optional<String> role, Integer... values) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java b/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
index 52113b8..6564e82 100644
--- a/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/ResourceSlotTest.java
@@ -34,7 +34,7 @@ import static org.apache.aurora.scheduler.ResourceType.CPUS;
 import static org.apache.aurora.scheduler.ResourceType.DISK_MB;
 import static org.apache.aurora.scheduler.ResourceType.PORTS;
 import static org.apache.aurora.scheduler.ResourceType.RAM_MB;
-import static org.apache.aurora.scheduler.TierInfo.DEFAULT;
+import static org.apache.aurora.scheduler.base.TaskTestUtil.DEV_TIER;
 import static org.apache.aurora.scheduler.base.TaskTestUtil.REVOCABLE_TIER;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
@@ -95,7 +95,7 @@ public class ResourceSlotTest {
             makeMesosResource(CPUS, TASK.getNumCpus(), false),
             makeMesosResource(RAM_MB, TASK.getRamMb(), false),
             makeMesosResource(DISK_MB, TASK.getDiskMb(), false)),
-        ImmutableSet.copyOf(resources.toResourceList(DEFAULT)));
+        ImmutableSet.copyOf(resources.toResourceList(DEV_TIER)));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java b/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
index 4fe8c51..ea74842 100644
--- a/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/ResourcesTest.java
@@ -33,7 +33,7 @@ import static org.apache.aurora.scheduler.ResourceType.CPUS;
 import static org.apache.aurora.scheduler.ResourceType.DISK_MB;
 import static org.apache.aurora.scheduler.ResourceType.PORTS;
 import static org.apache.aurora.scheduler.ResourceType.RAM_MB;
-import static org.apache.aurora.scheduler.TierInfo.DEFAULT;
+import static org.apache.aurora.scheduler.base.TaskTestUtil.DEV_TIER;
 import static org.apache.aurora.scheduler.base.TaskTestUtil.REVOCABLE_TIER;
 import static org.apache.mesos.Protos.Value.Type.RANGES;
 import static org.junit.Assert.assertEquals;
@@ -136,7 +136,7 @@ public class ResourcesTest {
 
     assertEquals(
         new ResourceSlot(8.0, Amount.of(1024L, MB), Amount.of(0L, MB), 0),
-        Resources.from(createOffer(resources)).filter(DEFAULT).slot());
+        Resources.from(createOffer(resources)).filter(DEV_TIER).slot());
   }
 
   private Resource createPortRange(Pair<Integer, Integer> range) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/TierManagerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/TierManagerTest.java b/src/test/java/org/apache/aurora/scheduler/TierManagerTest.java
index a662100..95174bb 100644
--- a/src/test/java/org/apache/aurora/scheduler/TierManagerTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/TierManagerTest.java
@@ -15,6 +15,7 @@ package org.apache.aurora.scheduler;
 
 import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.scheduler.TierManager.TierManagerImpl;
+import org.apache.aurora.scheduler.base.TaskTestUtil;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.junit.Test;
 
@@ -23,29 +24,27 @@ import static org.apache.aurora.scheduler.base.TaskTestUtil.REVOCABLE_TIER;
 import static org.junit.Assert.assertEquals;
 
 public class TierManagerTest {
+  private static final TierManager TIER_MANAGER = new TierManagerImpl(
+      parseTierConfig("{\"tiers\":{"
+          + "\"preferred\": {\"revocable\": false, \"preemptible\": false},"
+          + "\"preemptible\": {\"revocable\": false, \"preemptible\": true},"
+          + "\"revocable\": {\"revocable\": true, \"preemptible\": true}"
+          + "}}"));
+
   @Test
   public void testRevocable() {
-    TierManager manager = new TierManagerImpl(
-        parseTierConfig("{\"tiers\":{"
-            + "\"revocable\": {\"revocable\": true},"
-            + "\"preferred\": {\"revocable\": false}"
-            + "}}"));
     assertEquals(
         REVOCABLE_TIER,
-        manager.getTier(ITaskConfig.build(new TaskConfig().setTier("revocable"))));
+        TIER_MANAGER.getTier(ITaskConfig.build(new TaskConfig().setTier("revocable"))));
   }
 
   @Test(expected = IllegalArgumentException.class)
   public void testNameMismatch() {
-    TierManager manager = new TierManagerImpl(
-        parseTierConfig("{\"tiers\":{\"revocable\": {\"revocable\": true}}}"));
-    manager.getTier(ITaskConfig.build(new TaskConfig().setTier("Revocable")));
+    TIER_MANAGER.getTier(ITaskConfig.build(new TaskConfig().setTier("Revocable")));
   }
 
   @Test
   public void testNoTierInTaskConfig() {
-    TierManager manager = new TierManagerImpl(
-        parseTierConfig("{\"tiers\":{\"revocable\": {\"revocable\": true}}}"));
-    assertEquals(TierInfo.DEFAULT, manager.getTier(ITaskConfig.build(new TaskConfig())));
+    assertEquals(TaskTestUtil.DEV_TIER, TIER_MANAGER.getTier(ITaskConfig.build(new TaskConfig())));
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/TierModuleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/TierModuleTest.java b/src/test/java/org/apache/aurora/scheduler/TierModuleTest.java
index e0601c8..6b4e7a0 100644
--- a/src/test/java/org/apache/aurora/scheduler/TierModuleTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/TierModuleTest.java
@@ -51,7 +51,11 @@ public class TierModuleTest {
   public void testTierConfigFile() {
     assertEquals(
         ImmutableMap.of("revocable", REVOCABLE_TIER),
-        parseTierConfig("{\"tiers\":{\"revocable\": {\"revocable\": true}}}").getTiers());
+        parseTierConfig(
+            "{\"tiers\":{"
+            + "\"revocable\": {\"revocable\": true, \"preemptible\": true}"
+            + "}}")
+            .getTiers());
   }
 
   @Test(expected = RuntimeException.class)

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java b/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
index 1a520b3..ecd48ec 100644
--- a/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
@@ -34,6 +34,7 @@ import org.apache.aurora.gen.TaskConstraint;
 import org.apache.aurora.gen.ValueConstraint;
 import org.apache.aurora.scheduler.base.JobKeys;
 import org.apache.aurora.scheduler.base.TaskTestUtil;
+import org.apache.aurora.scheduler.configuration.ConfigurationManager.ConfigurationManagerSettings;
 import org.apache.aurora.scheduler.configuration.ConfigurationManager.TaskDescriptionException;
 import org.apache.aurora.scheduler.storage.entities.IDockerParameter;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
@@ -102,15 +103,19 @@ public class ConfigurationManagerTest {
       TaskTestUtil.makeConfig(JobKeys.from("role", "env", "job"));
 
   private static final ConfigurationManager CONFIGURATION_MANAGER = new ConfigurationManager(
+      new ConfigurationManagerSettings(
       ALL_CONTAINER_TYPES,
       false,
       ImmutableMultimap.of(),
-      true);
+      true),
+      TaskTestUtil.DEV_TIER_MANAGER);
   private static final ConfigurationManager DOCKER_CONFIGURATION_MANAGER = new ConfigurationManager(
-      ALL_CONTAINER_TYPES,
-      true,
-      ImmutableMultimap.of("foo", "bar"),
-      false);
+      new ConfigurationManagerSettings(
+        ALL_CONTAINER_TYPES,
+        true,
+        ImmutableMultimap.of("foo", "bar"),
+        false),
+      TaskTestUtil.DEV_TIER_MANAGER);
 
   @Test
   public void testIsGoodIdentifier() {

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java b/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
index 5103bd0..3a60486 100644
--- a/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
@@ -53,7 +53,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 import static org.apache.aurora.scheduler.ResourceSlot.makeMesosRangeResource;
-import static org.apache.aurora.scheduler.TierInfo.DEFAULT;
+import static org.apache.aurora.scheduler.base.TaskTestUtil.DEV_TIER;
 import static org.apache.aurora.scheduler.base.TaskTestUtil.REVOCABLE_TIER;
 import static org.apache.aurora.scheduler.mesos.MesosTaskFactory.MesosTaskFactoryImpl.METADATA_LABEL_PREFIX;
 import static org.apache.aurora.scheduler.mesos.TaskExecutors.NO_OVERHEAD_EXECUTOR;
@@ -96,14 +96,14 @@ public class MesosTaskFactoryImplTest extends EasyMockTest {
       .setHostname("slave-hostname")
       .addAllResources(
           ResourceSlot.from(TASK_CONFIG).add(THERMOS_EXECUTOR.getExecutorOverhead())
-              .toResourceList(DEFAULT))
+              .toResourceList(DEV_TIER))
       .addResources(makeMesosRangeResource(ResourceType.PORTS, ImmutableSet.of(80)))
       .build();
   private static final Offer OFFER_SOME_OVERHEAD_EXECUTOR = OFFER_THERMOS_EXECUTOR.toBuilder()
       .clearResources()
       .addAllResources(
               ResourceSlot.from(TASK_CONFIG).add(SOME_OVERHEAD_EXECUTOR.getExecutorOverhead())
-                      .toResourceList(DEFAULT))
+                      .toResourceList(DEV_TIER))
       .addResources(makeMesosRangeResource(ResourceType.PORTS, ImmutableSet.of(80)))
       .build();
 
@@ -141,7 +141,7 @@ public class MesosTaskFactoryImplTest extends EasyMockTest {
 
   @Test
   public void testExecutorInfoUnchanged() {
-    expect(tierManager.getTier(TASK_CONFIG)).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK_CONFIG)).andReturn(DEV_TIER);
     taskFactory = new MesosTaskFactoryImpl(config, tierManager);
 
     control.replay();
@@ -178,7 +178,7 @@ public class MesosTaskFactoryImplTest extends EasyMockTest {
     builder.getTask().unsetRequestedPorts();
     builder.unsetAssignedPorts();
     IAssignedTask assignedTask = IAssignedTask.build(builder);
-    expect(tierManager.getTier(assignedTask.getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(assignedTask.getTask())).andReturn(DEV_TIER);
     taskFactory = new MesosTaskFactoryImpl(config, tierManager);
 
     control.replay();
@@ -192,7 +192,7 @@ public class MesosTaskFactoryImplTest extends EasyMockTest {
     // Here the ram required for the executor is greater than the sum of task resources
     // + executor overhead. We need to ensure we allocate a non-zero amount of ram in this case.
     config = NO_OVERHEAD_EXECUTOR;
-    expect(tierManager.getTier(TASK_CONFIG)).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK_CONFIG)).andReturn(DEV_TIER);
     taskFactory = new MesosTaskFactoryImpl(config, tierManager);
 
     control.replay();
@@ -221,7 +221,7 @@ public class MesosTaskFactoryImplTest extends EasyMockTest {
   private TaskInfo getDockerTaskInfo(IAssignedTask task) {
     config = SOME_OVERHEAD_EXECUTOR;
 
-    expect(tierManager.getTier(task.getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(task.getTask())).andReturn(DEV_TIER);
     taskFactory = new MesosTaskFactoryImpl(config, tierManager);
 
     control.replay();
@@ -255,7 +255,7 @@ public class MesosTaskFactoryImplTest extends EasyMockTest {
                 .setMode(Mode.RO)
                 .build())));
 
-    expect(tierManager.getTier(TASK_WITH_DOCKER.getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK_WITH_DOCKER.getTask())).andReturn(DEV_TIER);
     taskFactory = new MesosTaskFactoryImpl(config, tierManager);
 
     control.replay();
@@ -268,7 +268,7 @@ public class MesosTaskFactoryImplTest extends EasyMockTest {
 
   @Test
   public void testMetadataLabelMapping() {
-    expect(tierManager.getTier(TASK.getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK.getTask())).andReturn(DEV_TIER);
     taskFactory = new MesosTaskFactoryImpl(config, tierManager);
 
     control.replay();

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java b/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
index b6f5e46..bb1b01e 100644
--- a/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
@@ -35,6 +35,7 @@ import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.gen.TaskEvent;
 import org.apache.aurora.scheduler.HostOffer;
 import org.apache.aurora.scheduler.ResourceSlot;
+import org.apache.aurora.scheduler.TierInfo;
 import org.apache.aurora.scheduler.TierManager;
 import org.apache.aurora.scheduler.filter.SchedulingFilter;
 import org.apache.aurora.scheduler.filter.SchedulingFilter.Veto;
@@ -55,7 +56,8 @@ import org.junit.Test;
 import static org.apache.aurora.gen.MaintenanceMode.NONE;
 import static org.apache.aurora.gen.ScheduleStatus.RUNNING;
 import static org.apache.aurora.scheduler.ResourceType.CPUS;
-import static org.apache.aurora.scheduler.TierInfo.DEFAULT;
+import static org.apache.aurora.scheduler.base.TaskTestUtil.DEV_TIER;
+import static org.apache.aurora.scheduler.base.TaskTestUtil.PREFERRED_TIER;
 import static org.apache.aurora.scheduler.base.TaskTestUtil.REVOCABLE_TIER;
 import static org.apache.aurora.scheduler.filter.AttributeAggregate.EMPTY;
 import static org.apache.aurora.scheduler.preemptor.PreemptorMetrics.MISSING_ATTRIBUTES_NAME;
@@ -123,11 +125,12 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     setUpHost();
 
     schedulingFilter = createMock(SchedulingFilter.class);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
     ScheduledTask lowPriority = makeTask(USER_A, JOB_A, TASK_ID_A);
     assignToHost(lowPriority);
+    expectGetTier(lowPriority, DEV_TIER).times(2);
 
     ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 100);
+    expectGetTier(highPriority, DEV_TIER);
 
     expectFiltering();
 
@@ -140,14 +143,15 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     setUpHost();
 
     schedulingFilter = createMock(SchedulingFilter.class);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
     ScheduledTask lowPriority = makeTask(USER_A, JOB_A, TASK_ID_A, 10);
     assignToHost(lowPriority);
 
     ScheduledTask lowerPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 1);
     assignToHost(lowerPriority);
+    expectGetTier(lowerPriority, DEV_TIER).atLeastOnce();
 
     ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_C, 100);
+    expectGetTier(highPriority, DEV_TIER);
 
     expectFiltering();
 
@@ -160,17 +164,20 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     setUpHost();
 
     schedulingFilter = createMock(SchedulingFilter.class);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
     ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_A, 100);
     assignToHost(highPriority);
+    expectGetTier(highPriority, DEV_TIER);
 
     ScheduledTask lowerPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 99);
     assignToHost(lowerPriority);
+    expectGetTier(lowerPriority, DEV_TIER);
 
     ScheduledTask lowestPriority = makeTask(USER_A, JOB_A, TASK_ID_C, 1);
     assignToHost(lowestPriority);
+    expectGetTier(lowestPriority, DEV_TIER).times(2);
 
     ScheduledTask pendingPriority = makeTask(USER_A, JOB_A, TASK_ID_D, 98);
+    expectGetTier(pendingPriority, DEV_TIER).times(3);
 
     expectFiltering();
 
@@ -185,8 +192,10 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     schedulingFilter = createMock(SchedulingFilter.class);
     ScheduledTask highPriority = makeTask(USER_A, JOB_A, TASK_ID_B, 100);
     assignToHost(highPriority);
+    expectGetTier(highPriority, DEV_TIER);
 
     ScheduledTask task = makeTask(USER_A, JOB_A, TASK_ID_A);
+    expectGetTier(task, DEV_TIER);
 
     control.replay();
     assertNoVictims(runFilter(task, NO_OFFER, highPriority));
@@ -197,10 +206,11 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     setUpHost();
 
     schedulingFilter = createMock(SchedulingFilter.class);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
     // Use a very low priority for the production task to show that priority is irrelevant.
     ScheduledTask p1 = makeProductionTask(USER_A, JOB_A, TASK_ID_A + "_p1", -1000);
+    expectGetTier(p1, PREFERRED_TIER);
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_B + "_a1", 100);
+    expectGetTier(a1, DEV_TIER).times(2);
     assignToHost(a1);
 
     expectFiltering();
@@ -214,11 +224,12 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     setUpHost();
 
     schedulingFilter = createMock(SchedulingFilter.class);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
     // Use a very low priority for the production task to show that priority is irrelevant.
     ScheduledTask p1 = makeProductionTask(USER_A, JOB_A, TASK_ID_A + "_p1", -1000);
+    expectGetTier(p1, PREFERRED_TIER);
     ScheduledTask a1 = makeTask(USER_B, JOB_A, TASK_ID_B + "_a1", 100);
     assignToHost(a1);
+    expectGetTier(a1, DEV_TIER).times(2);
 
     expectFiltering();
 
@@ -230,7 +241,9 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   public void testProductionUsersDoNotPreemptEachOther() throws Exception {
     schedulingFilter = createMock(SchedulingFilter.class);
     ScheduledTask p1 = makeProductionTask(USER_A, JOB_A, TASK_ID_A + "_p1", 1000);
+    expectGetTier(p1, PREFERRED_TIER);
     ScheduledTask a1 = makeProductionTask(USER_B, JOB_A, TASK_ID_B + "_a1", 0);
+    expectGetTier(a1, PREFERRED_TIER);
     assignToHost(a1);
 
     control.replay();
@@ -241,12 +254,13 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testProductionPreemptingManyNonProduction() throws Exception {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT).times(5);
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
+    expectGetTier(a1, DEV_TIER).atLeastOnce();
 
     ScheduledTask b1 = makeTask(USER_B, JOB_B, TASK_ID_B + "_b1");
     b1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
+    expectGetTier(b1, DEV_TIER).atLeastOnce();
 
     setUpHost();
 
@@ -255,6 +269,7 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
 
     ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);
+    expectGetTier(p1, PREFERRED_TIER).times(2);
 
     control.replay();
     assertVictims(runFilter(p1, NO_OFFER, a1, b1), a1, b1);
@@ -264,15 +279,17 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testMinimalSetPreempted() throws Exception {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT).atLeastOnce();
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(4).setRamMb(4096);
+    expectGetTier(a1, DEV_TIER).atLeastOnce();
 
     ScheduledTask b1 = makeTask(USER_B, JOB_B, TASK_ID_B + "_b1");
     b1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
+    expectGetTier(b1, DEV_TIER).anyTimes();
 
     ScheduledTask b2 = makeTask(USER_B, JOB_B, TASK_ID_B + "_b2");
     b2.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
+    expectGetTier(b2, DEV_TIER).anyTimes();
 
     setUpHost();
 
@@ -282,6 +299,7 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
 
     ScheduledTask p1 = makeProductionTask(USER_C, JOB_C, TASK_ID_C + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);
+    expectGetTier(p1, PREFERRED_TIER).times(3);
 
     control.replay();
     assertVictims(runFilter(p1, NO_OFFER, b1, b2, a1), a1);
@@ -293,6 +311,7 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
     ScheduledTask p1 = makeProductionTask(USER_A, JOB_A, TASK_ID_A + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);
+    expectGetTier(p1, PREFERRED_TIER);
 
     setUpHost();
 
@@ -300,6 +319,7 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
 
     ScheduledTask p2 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p2");
     p2.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
+    expectGetTier(p2, PREFERRED_TIER);
 
     control.replay();
     assertNoVictims(runFilter(p2, NO_OFFER, p1));
@@ -309,16 +329,17 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testPreemptWithOfferAndTask() throws Exception {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
 
     setUpHost();
 
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a1);
+    expectGetTier(a1, DEV_TIER).times(2);
 
     ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);
+    expectGetTier(p1, PREFERRED_TIER);
 
     control.replay();
     assertVictims(
@@ -333,16 +354,17 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testRevocableOfferFiltered() throws Exception {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
 
     setUpHost();
 
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a1);
+    expectGetTier(a1, DEV_TIER).times(2);
 
     ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);
+    expectGetTier(p1, PREFERRED_TIER);
 
     control.replay();
     assertNoVictims(runFilter(
@@ -355,16 +377,17 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testRevocableVictimsFiltered() throws Exception {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(REVOCABLE_TIER);
 
     setUpHost();
 
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a1);
+    expectGetTier(a1, REVOCABLE_TIER).times(2);
 
     ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);
+    expectGetTier(p1, PREFERRED_TIER);
 
     control.replay();
     assertNoVictims(runFilter(
@@ -377,16 +400,17 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testRevocableVictimRamUsed() throws Exception {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(REVOCABLE_TIER);
 
     setUpHost();
 
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a1);
+    expectGetTier(a1, REVOCABLE_TIER).times(2);
 
     ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(2).setRamMb(1024);
+    expectGetTier(p1, PREFERRED_TIER);
 
     control.replay();
     assertVictims(
@@ -401,20 +425,22 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testPreemptWithOfferAndMultipleTasks() throws Exception {
     schedulingFilter = new SchedulingFilterImpl(TaskExecutors.NO_OVERHEAD_EXECUTOR);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT).times(5);
 
     setUpHost();
 
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a1);
+    expectGetTier(a1, DEV_TIER).atLeastOnce();
 
     ScheduledTask a2 = makeTask(USER_A, JOB_B, TASK_ID_A + "_a2");
     a2.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a2);
+    expectGetTier(a2, DEV_TIER).atLeastOnce();
 
     ScheduledTask p1 = makeProductionTask(USER_B, JOB_B, TASK_ID_B + "_p1");
     p1.getAssignedTask().getTask().setNumCpus(4).setRamMb(2048);
+    expectGetTier(p1, PREFERRED_TIER).times(2);
 
     control.replay();
     Optional<HostOffer> offer =
@@ -437,10 +463,12 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
     schedulingFilter = createMock(SchedulingFilter.class);
     ScheduledTask task = makeProductionTask(USER_A, JOB_A, TASK_ID_A);
     assignToHost(task);
+    expectGetTier(task, PREFERRED_TIER);
 
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a1);
+    expectGetTier(a1, DEV_TIER);
 
     expect(storageUtil.attributeStore.getHostAttributes(HOST_A)).andReturn(Optional.absent());
 
@@ -453,13 +481,14 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
   @Test
   public void testAllVictimsVetoed() {
     schedulingFilter = createMock(SchedulingFilter.class);
-    expect(tierManager.getTier(EasyMock.anyObject())).andReturn(DEFAULT);
     ScheduledTask task = makeProductionTask(USER_A, JOB_A, TASK_ID_A);
     assignToHost(task);
+    expectGetTier(task, PREFERRED_TIER);
 
     ScheduledTask a1 = makeTask(USER_A, JOB_A, TASK_ID_A + "_a1");
     a1.getAssignedTask().getTask().setNumCpus(1).setRamMb(512);
     assignToHost(a1);
+    expectGetTier(a1, DEV_TIER).times(2);
 
     setUpHost();
     expectFiltering(Optional.of(Veto.constraintMismatch("ban")));
@@ -495,7 +524,7 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
       boolean revocable) {
 
     List<Resource> resources =
-        new ResourceSlot(cpu, ram, disk, numPorts).toResourceList(DEFAULT);
+        new ResourceSlot(cpu, ram, disk, numPorts).toResourceList(DEV_TIER);
     if (revocable) {
       resources = ImmutableList.<Resource>builder()
           .addAll(FluentIterable.from(resources)
@@ -535,6 +564,11 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
             veto::asSet);
   }
 
+  private IExpectationSetters<TierInfo> expectGetTier(ScheduledTask task, TierInfo tier) {
+    return expect(tierManager.getTier(ITaskConfig.build(task.getAssignedTask().getTask())))
+        .andReturn(tier);
+  }
+
   static ScheduledTask makeTask(
       String role,
       String job,

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/state/TaskAssignerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/state/TaskAssignerImplTest.java b/src/test/java/org/apache/aurora/scheduler/state/TaskAssignerImplTest.java
index b00add0..0698f78 100644
--- a/src/test/java/org/apache/aurora/scheduler/state/TaskAssignerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/state/TaskAssignerImplTest.java
@@ -55,7 +55,7 @@ import org.junit.Test;
 
 import static org.apache.aurora.gen.ScheduleStatus.LOST;
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
-import static org.apache.aurora.scheduler.TierInfo.DEFAULT;
+import static org.apache.aurora.scheduler.base.TaskTestUtil.DEV_TIER;
 import static org.apache.aurora.scheduler.filter.AttributeAggregate.EMPTY;
 import static org.apache.aurora.scheduler.state.TaskAssigner.TaskAssignerImpl.LAUNCH_FAILED_MSG;
 import static org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
@@ -126,7 +126,7 @@ public class TaskAssignerImplTest extends EasyMockTest {
   public void testAssignNoVetoes() throws Exception {
     expect(offerManager.getOffers(GROUP_KEY)).andReturn(ImmutableSet.of(OFFER));
     offerManager.launchTask(MESOS_OFFER.getId(), TASK_INFO);
-    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEV_TIER);
     expect(filter.filter(UNUSED, RESOURCE_REQUEST)).andReturn(ImmutableSet.of());
     expect(stateManager.assignTask(
         storeProvider,
@@ -152,7 +152,7 @@ public class TaskAssignerImplTest extends EasyMockTest {
   public void testAssignVetoesWithStaticBan() throws Exception {
     expect(offerManager.getOffers(GROUP_KEY)).andReturn(ImmutableSet.of(OFFER));
     offerManager.banOffer(MESOS_OFFER.getId(), GROUP_KEY);
-    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEV_TIER);
     expect(filter.filter(UNUSED, RESOURCE_REQUEST))
         .andReturn(ImmutableSet.of(Veto.constraintMismatch("denied")));
 
@@ -169,7 +169,7 @@ public class TaskAssignerImplTest extends EasyMockTest {
   @Test
   public void testAssignVetoesWithNoStaticBan() throws Exception {
     expect(offerManager.getOffers(GROUP_KEY)).andReturn(ImmutableSet.of(OFFER));
-    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEV_TIER);
     expect(filter.filter(UNUSED, RESOURCE_REQUEST))
         .andReturn(ImmutableSet.of(Veto.unsatisfiedLimit("limit")));
 
@@ -188,7 +188,7 @@ public class TaskAssignerImplTest extends EasyMockTest {
     expect(offerManager.getOffers(GROUP_KEY)).andReturn(ImmutableSet.of(OFFER));
     offerManager.launchTask(MESOS_OFFER.getId(), TASK_INFO);
     expectLastCall().andThrow(new OfferManager.LaunchException("expected"));
-    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEV_TIER);
     expect(filter.filter(UNUSED, RESOURCE_REQUEST)).andReturn(ImmutableSet.of());
     expect(stateManager.assignTask(
         storeProvider,
@@ -252,7 +252,7 @@ public class TaskAssignerImplTest extends EasyMockTest {
         IHostAttributes.build(new HostAttributes()));
 
     expect(offerManager.getOffers(GROUP_KEY)).andReturn(ImmutableSet.of(offer, OFFER));
-    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEFAULT);
+    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEV_TIER);
     expect(filter.filter(UNUSED, RESOURCE_REQUEST)).andReturn(ImmutableSet.of());
     expect(stateManager.assignTask(
         storeProvider,
@@ -293,7 +293,7 @@ public class TaskAssignerImplTest extends EasyMockTest {
         IHostAttributes.build(new HostAttributes()));
 
     expect(offerManager.getOffers(GROUP_KEY)).andReturn(ImmutableSet.of(mismatched, OFFER));
-    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEFAULT).times(2);
+    expect(tierManager.getTier(TASK.getAssignedTask().getTask())).andReturn(DEV_TIER).times(2);
     expect(filter.filter(
         new UnusedResource(
             Resources.from(mismatched.getOffer()).slot(),

http://git-wip-us.apache.org/repos/asf/aurora/blob/193f17ee/src/test/java/org/apache/aurora/scheduler/thrift/ThriftIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/ThriftIT.java b/src/test/java/org/apache/aurora/scheduler/thrift/ThriftIT.java
index b1c71a6..80e8ebe 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/ThriftIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/ThriftIT.java
@@ -48,7 +48,7 @@ import org.apache.aurora.scheduler.app.AppModule;
 import org.apache.aurora.scheduler.app.LifecycleModule;
 import org.apache.aurora.scheduler.app.local.FakeNonVolatileStorage;
 import org.apache.aurora.scheduler.base.TaskTestUtil;
-import org.apache.aurora.scheduler.configuration.ConfigurationManager;
+import org.apache.aurora.scheduler.configuration.ConfigurationManager.ConfigurationManagerSettings;
 import org.apache.aurora.scheduler.configuration.executor.ExecutorSettings;
 import org.apache.aurora.scheduler.cron.quartz.CronModule;
 import org.apache.aurora.scheduler.mesos.DriverFactory;
@@ -80,7 +80,7 @@ public class ThriftIT extends EasyMockTest {
 
   private AuroraAdmin.Iface thrift;
 
-  private void createThrift(ConfigurationManager configurationManager) {
+  private void createThrift(ConfigurationManagerSettings configurationManagerSettings) {
     Injector injector = Guice.createInjector(
         new ThriftModule(),
         new AbstractModule() {
@@ -100,7 +100,7 @@ public class ThriftIT extends EasyMockTest {
             install(new TierModule(TaskTestUtil.DEV_TIER_CONFIG));
             bind(ExecutorSettings.class).toInstance(TestExecutorSettings.THERMOS_EXECUTOR);
 
-            install(new AppModule(configurationManager));
+            install(new AppModule(configurationManagerSettings));
 
             bind(NonVolatileStorage.class).to(FakeNonVolatileStorage.class);
 
@@ -138,7 +138,7 @@ public class ThriftIT extends EasyMockTest {
 
   @Test
   public void testSetQuota() throws Exception {
-    createThrift(TaskTestUtil.CONFIGURATION_MANAGER);
+    createThrift(TaskTestUtil.CONFIGURATION_MANAGER_SETTINGS);
 
     control.replay();
 
@@ -153,13 +153,13 @@ public class ThriftIT extends EasyMockTest {
 
   @Test
   public void testSubmitNoExecutorDockerTask() throws Exception {
-    ConfigurationManager configurationManager = new ConfigurationManager(
+    ConfigurationManagerSettings configurationManagerSettings = new ConfigurationManagerSettings(
         ImmutableSet.of(_Fields.DOCKER),
         true,
         ImmutableMultimap.of(),
         false);
 
-    createThrift(configurationManager);
+    createThrift(configurationManagerSettings);
 
     control.replay();
 


Mime
View raw message