aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject [2/2] aurora git commit: Revert "Shim interfaces to preface args system overhaul."
Date Wed, 20 Jan 2016 01:47:39 GMT
Revert "Shim interfaces to preface args system overhaul."

This reverts commit fe13e4ed52d4dc0a35f9e50b5e49c6e705f64579.

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


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

Branch: refs/heads/master
Commit: 749f83502f059ae6d2b229cf76c1ed44ccf3d255
Parents: fe13e4e
Author: Bill Farner <wfarner@apache.org>
Authored: Tue Jan 19 17:47:32 2016 -0800
Committer: Bill Farner <wfarner@apache.org>
Committed: Tue Jan 19 17:47:32 2016 -0800

----------------------------------------------------------------------
 config/legacy_untested_classes.txt              |   9 +-
 .../aurora/benchmark/SchedulingBenchmarks.java  |  13 +--
 .../aurora/scheduler/SchedulerModule.java       |  52 ++-------
 .../apache/aurora/scheduler/app/AppModule.java  |  42 +-------
 .../aurora/scheduler/app/SchedulerMain.java     |  48 ++-------
 .../aurora/scheduler/async/AsyncModule.java     |  16 +--
 .../configuration/executor/ExecutorModule.java  | 101 ++++--------------
 .../scheduler/cron/quartz/CronModule.java       |  50 ++-------
 .../aurora/scheduler/http/H2ConsoleModule.java  |  15 +--
 .../scheduler/http/JettyServerModule.java       |  49 +++------
 .../aurora/scheduler/http/api/ApiModule.java    |  21 +---
 .../http/api/security/HttpSecurityModule.java   |  41 ++-----
 .../http/api/security/IniShiroRealmModule.java  |  15 +--
 .../api/security/Kerberos5ShiroRealmModule.java |  33 +-----
 .../log/mesos/MesosLogStreamModule.java         | 106 +++++--------------
 .../mesos/CommandLineDriverSettingsModule.java  |  87 +++------------
 .../aurora/scheduler/offers/OffersModule.java   |  25 +----
 .../scheduler/preemptor/PreemptorModule.java    |  65 ++++--------
 .../aurora/scheduler/pruning/PruningModule.java |  63 ++---------
 .../reconciliation/ReconciliationModule.java    |  64 ++---------
 .../scheduler/scheduling/SchedulingModule.java  |  92 ++--------------
 .../apache/aurora/scheduler/sla/SlaModule.java  |  45 +++-----
 .../scheduler/stats/AsyncStatsModule.java       |  41 ++-----
 .../aurora/scheduler/stats/StatsModule.java     |  26 +----
 .../scheduler/storage/backup/BackupModule.java  |  42 ++------
 .../aurora/scheduler/storage/db/DbModule.java   |  52 ++-------
 .../scheduler/storage/log/LogStorageModule.java |  33 +-----
 .../storage/mem/InMemStoresModule.java          |  13 +--
 .../client/flagged/FlaggedClientConfig.java     |  56 ++--------
 .../aurora/scheduler/app/SchedulerIT.java       |  14 +--
 .../scheduler/app/local/LocalSchedulerMain.java |  14 +--
 .../scheduler/http/AbstractJettyTest.java       |   2 +-
 .../http/api/security/HttpSecurityIT.java       |   4 +-
 .../preemptor/PreemptorModuleTest.java          |  24 +----
 .../aurora/scheduler/sla/SlaModuleTest.java     |  21 +---
 35 files changed, 226 insertions(+), 1168 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/config/legacy_untested_classes.txt
----------------------------------------------------------------------
diff --git a/config/legacy_untested_classes.txt b/config/legacy_untested_classes.txt
index 30d4b13..6b71fd2 100644
--- a/config/legacy_untested_classes.txt
+++ b/config/legacy_untested_classes.txt
@@ -9,7 +9,6 @@ org/apache/aurora/scheduler/app/SchedulerMain$2
 org/apache/aurora/scheduler/app/SchedulerMain$2$1
 org/apache/aurora/scheduler/app/SchedulerMain$3
 org/apache/aurora/scheduler/app/SchedulerMain$4
-org/apache/aurora/scheduler/app/SchedulerMain$Params
 org/apache/aurora/scheduler/async/OfferQueue$OfferQueueImpl$2
 org/apache/aurora/scheduler/base/Conversions$2
 org/apache/aurora/scheduler/base/Conversions$3
@@ -56,21 +55,16 @@ org/apache/aurora/scheduler/http/Utilization$5
 org/apache/aurora/scheduler/http/Utilization$Display
 org/apache/aurora/scheduler/http/Utilization$DisplayMetric
 org/apache/aurora/scheduler/http/api/security/FieldGetter$IdentityFieldGetter
-org/apache/aurora/scheduler/http/api/security/IniShiroRealmModule$1
 org/apache/aurora/scheduler/http/api/security/Kerberos5Realm
-org/apache/aurora/scheduler/http/api/security/Kerberos5ShiroRealmModule$1
 org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule
-org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule$1
+org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule$3
 org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule$4
 org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule$5
-org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule$1
 org/apache/aurora/scheduler/mesos/DriverFactoryImpl
 org/apache/aurora/scheduler/mesos/LibMesosLoadingModule
-org/apache/aurora/scheduler/preemptor/PreemptorModule$Params
 org/apache/aurora/scheduler/stats/AsyncStatsModule$OfferAdapter$1
 org/apache/aurora/scheduler/stats/TaskStatCalculator
 org/apache/aurora/scheduler/storage/CallOrderEnforcingStorage$State
-org/apache/aurora/scheduler/storage/backup/BackupModule$1
 org/apache/aurora/scheduler/storage/backup/BackupModule$LifecycleHook
 org/apache/aurora/scheduler/storage/mem/MemTaskStore$Task
 org/apache/aurora/scheduler/storage/mem/Util
@@ -81,4 +75,3 @@ org/apache/aurora/scheduler/zookeeper/guice/client/ZooKeeperClientModule$1
 org/apache/aurora/scheduler/zookeeper/guice/client/ZooKeeperClientModule$LocalClientProvider
 org/apache/aurora/scheduler/zookeeper/guice/client/ZooKeeperClientModule$TestServerService
 org/apache/aurora/scheduler/zookeeper/guice/client/flagged/FlaggedClientConfig
-org/apache/aurora/scheduler/zookeeper/guice/client/flagged/FlaggedClientConfig$1

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java b/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
index 3ce266a..45ab76b 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
@@ -108,18 +108,7 @@ public class SchedulingBenchmarks {
       // TODO(maxim): Find a way to DRY it and reuse existing modules instead.
       Injector injector = Guice.createInjector(
           new StateModule(),
-          new PreemptorModule(
-              new PreemptorModule.Params() {
-                @Override
-                public Amount<Long, Time> preemptionDelay() {
-                  return NO_DELAY;
-                }
-
-                @Override
-                public Amount<Long, Time> preemptionSlotSearchInterval() {
-                  return NO_DELAY;
-                }
-              }),
+          new PreemptorModule(true, NO_DELAY, NO_DELAY),
           new PrivateModule() {
             @Override
             protected void configure() {

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java b/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
index 83e9060..ddc0d05 100644
--- a/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
@@ -74,43 +74,7 @@ public class SchedulerModule extends AbstractModule {
   @CanRead
   @CmdLine(name = "tier_config",
       help = "Configuration file defining supported task tiers, task traits and behaviors.")
-  private static final Arg<File> TIER_CONFIG_FILE = Arg.create(null);
-
-  interface Params {
-    Amount<Long, Time> maxRegistrationDelay();
-
-    Amount<Long, Time> maxLeadingDuration();
-
-    int maxStatusUpdateBatchSize();
-
-    Optional<File> tierConfig();
-  }
-
-  private final Params params;
-
-  public SchedulerModule() {
-    this.params = new Params() {
-      @Override
-      public Amount<Long, Time> maxRegistrationDelay() {
-        return MAX_REGISTRATION_DELAY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> maxLeadingDuration() {
-        return MAX_LEADING_DURATION.get();
-      }
-
-      @Override
-      public int maxStatusUpdateBatchSize() {
-        return MAX_STATUS_UPDATE_BATCH_SIZE.get();
-      }
-
-      @Override
-      public Optional<File> tierConfig() {
-        return Optional.fromNullable(TIER_CONFIG_FILE.get());
-      }
-    };
-  }
+  private static final Arg<File> TIER_CONFIG_FILE = Arg.create();
 
   @Override
   protected void configure() {
@@ -120,7 +84,7 @@ public class SchedulerModule extends AbstractModule {
       @Override
       protected void configure() {
         bind(LeadingOptions.class).toInstance(
-            new LeadingOptions(params.maxRegistrationDelay(), params.maxLeadingDuration()));
+            new LeadingOptions(MAX_REGISTRATION_DELAY.get(), MAX_LEADING_DURATION.get()));
 
         final ScheduledExecutorService executor =
             AsyncUtil.singleThreadLoggingScheduledExecutor("Lifecycle-%d", LOG);
@@ -141,7 +105,7 @@ public class SchedulerModule extends AbstractModule {
         .toInstance(new LinkedBlockingQueue<>());
     bind(new TypeLiteral<Integer>() { })
         .annotatedWith(TaskStatusHandlerImpl.MaxBatchSize.class)
-        .toInstance(params.maxStatusUpdateBatchSize());
+        .toInstance(MAX_STATUS_UPDATE_BATCH_SIZE.get());
 
     bind(TaskStatusHandler.class).to(TaskStatusHandlerImpl.class);
     bind(TaskStatusHandlerImpl.class).in(Singleton.class);
@@ -152,15 +116,17 @@ public class SchedulerModule extends AbstractModule {
     addSchedulerActiveServiceBinding(binder()).to(TaskStatusHandlerImpl.class);
   }
 
-  private Optional<String> readTierFile() {
-    return params.tierConfig().transform(file -> {
+  private static Optional<String> readTierFile() {
+    if (TIER_CONFIG_FILE.hasAppliedValue()) {
       try {
-        return Files.toString(file, StandardCharsets.UTF_8);
+        return Optional.of(Files.toString(TIER_CONFIG_FILE.get(), StandardCharsets.UTF_8));
       } catch (IOException e) {
         LOG.error("Error loading tier configuration file.");
         throw Throwables.propagate(e);
       }
-    });
+    }
+
+    return Optional.<String>absent();
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/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 58026e1..a25fa41 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
@@ -81,50 +81,14 @@ public class AppModule extends AbstractModule {
       help = "Allow to pass docker container parameters in the job.")
   private static final Arg<Boolean> ENABLE_DOCKER_PARAMETERS = Arg.create(false);
 
-  public interface Params {
-    int maxTasksPerJob();
-
-    int maxUpdateInstanceFailures();
-
-    Set<_Fields> allowedContainerTypes();
-
-    boolean enableDockerParameters();
-  }
-
-  private final Params params;
-
-  public AppModule() {
-    this.params = new Params() {
-      @Override
-      public int maxTasksPerJob() {
-        return MAX_TASKS_PER_JOB.get();
-      }
-
-      @Override
-      public int maxUpdateInstanceFailures() {
-        return MAX_UPDATE_INSTANCE_FAILURES.get();
-      }
-
-      @Override
-      public Set<_Fields> allowedContainerTypes() {
-        return ALLOWED_CONTAINER_TYPES.get();
-      }
-
-      @Override
-      public boolean enableDockerParameters() {
-        return ENABLE_DOCKER_PARAMETERS.get();
-      }
-    };
-  }
-
   @Override
   protected void configure() {
     bind(ConfigurationManager.class).toInstance(
         new ConfigurationManager(
-            ImmutableSet.copyOf(params.allowedContainerTypes()),
-            params.enableDockerParameters()));
+            ImmutableSet.copyOf(ALLOWED_CONTAINER_TYPES.get()),
+            ENABLE_DOCKER_PARAMETERS.get()));
     bind(Thresholds.class)
-        .toInstance(new Thresholds(params.maxTasksPerJob(), params.maxUpdateInstanceFailures()));
+        .toInstance(new Thresholds(MAX_TASKS_PER_JOB.get(), MAX_UPDATE_INSTANCE_FAILURES.get()));
 
     // Enable intercepted method timings and context classloader repair.
     TimedInterceptor.bind(binder());

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
index 0861c4e..0659c35 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
@@ -92,20 +92,6 @@ public class SchedulerMain {
   @CmdLine(name = "viz_job_url_prefix", help = "URL prefix for job container stats.")
   private static final Arg<String> STATS_URL_PREFIX = Arg.create("");
 
-  public interface Params {
-    String clusterName();
-
-    String serversetPath();
-
-    default List<Class<? extends Module>> extraModules() {
-      return ImmutableList.of();
-    }
-
-    default String statsUrlPrefix() {
-      return "";
-    }
-  }
-
   @Inject private SingletonService schedulerService;
   @Inject private HttpService httpService;
   @Inject private SchedulerLifecycle schedulerLifecycle;
@@ -169,7 +155,7 @@ public class SchedulerMain {
    * @param appEnvironmentModule Additional modules based on the execution environment.
    */
   @VisibleForTesting
-  public static void main(Params params, Module appEnvironmentModule) {
+  public static void flagConfiguredMain(Module appEnvironmentModule) {
     AtomicLong uncaughtExceptions = Stats.exportLong("uncaught_exceptions");
     Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
       uncaughtExceptions.incrementAndGet();
@@ -181,7 +167,7 @@ public class SchedulerMain {
         appEnvironmentModule,
         getUniversalModule(),
         new ZooKeeperClientModule(zkClientConfig),
-        new ServiceDiscoveryModule(params.serversetPath(), zkClientConfig.credentials),
+        new ServiceDiscoveryModule(SERVERSET_PATH.get(), zkClientConfig.credentials),
         new BackupModule(SnapshotStoreImpl.class),
         new ExecutorModule(),
         new AbstractModule() {
@@ -190,8 +176,8 @@ public class SchedulerMain {
             bind(IServerInfo.class).toInstance(
                 IServerInfo.build(
                     new ServerInfo()
-                        .setClusterName(params.clusterName())
-                        .setStatsUrlPrefix(params.statsUrlPrefix())));
+                        .setClusterName(CLUSTER_NAME.get())
+                        .setStatsUrlPrefix(STATS_URL_PREFIX.get())));
           }
         });
 
@@ -216,37 +202,15 @@ public class SchedulerMain {
   public static void main(String... args) {
     applyStaticArgumentValues(args);
 
-    Params params = new Params() {
-      @Override
-      public String clusterName() {
-        return CLUSTER_NAME.get();
-      }
-
-      @Override
-      public String serversetPath() {
-        return SERVERSET_PATH.get();
-      }
-
-      @Override
-      public List<Class<? extends Module>> extraModules() {
-        return EXTRA_MODULES.get();
-      }
-
-      @Override
-      public String statsUrlPrefix() {
-        return STATS_URL_PREFIX.get();
-      }
-    };
-
     List<Module> modules = ImmutableList.<Module>builder()
         .add(
             new CommandLineDriverSettingsModule(),
             new LibMesosLoadingModule(),
             new MesosLogStreamModule(FlaggedClientConfig.create()),
             new LogStorageModule())
-        .addAll(Iterables.transform(params.extraModules(), MoreModules::getModule))
+        .addAll(Iterables.transform(EXTRA_MODULES.get(), MoreModules::getModule))
         .build();
-    main(params, Modules.combine(modules));
+    flagConfiguredMain(Modules.combine(modules));
   }
 
   private static void exit(String message, Exception error) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java b/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
index d307861..da07df6 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
@@ -53,28 +53,14 @@ public class AsyncModule extends AbstractModule {
   private static final Arg<Integer> ASYNC_WORKER_THREADS = Arg.create(8);
   private final ScheduledThreadPoolExecutor afterTransaction;
 
-  interface Params {
-    int asyncWorkerThreads();
-  }
-
   @Qualifier
   @Target({ FIELD, PARAMETER, METHOD }) @Retention(RUNTIME)
   public @interface AsyncExecutor { }
 
   public AsyncModule() {
-    this(new Params() {
-      @Override
-      public int asyncWorkerThreads() {
-        return ASYNC_WORKER_THREADS.get();
-      }
-    });
-  }
-
-  private AsyncModule(Params params) {
     // Don't worry about clean shutdown, these can be daemon and cleanup-free.
     // TODO(wfarner): Should we use a bounded caching thread pool executor instead?
-    this(
-        AsyncUtil.loggingScheduledExecutor(params.asyncWorkerThreads(), "AsyncProcessor-%d", LOG));
+    this(AsyncUtil.loggingScheduledExecutor(ASYNC_WORKER_THREADS.get(), "AsyncProcessor-%d", LOG));
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
index 8c58c5b..949c299 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
@@ -15,6 +15,7 @@ package org.apache.aurora.scheduler.configuration.executor;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.util.List;
 import java.util.Optional;
@@ -95,96 +96,32 @@ public class ExecutorModule extends AbstractModule {
           + "into all (non-mesos) containers.")
   private static final Arg<List<Volume>> GLOBAL_CONTAINER_MOUNTS = Arg.create(ImmutableList.of());
 
-  public interface Params {
-    Optional<File> customExecutorConfig();
-
-    String thermosExecutorPath();
-
-    List<String> thermosExecutorResources();
-
-    Optional<String> thermosExecutorFlags();
-
-    String thermosObserverRoot();
-
-    double executorOverheadCpus();
-
-    Amount<Long, Data> executorOverheadRam();
-
-    List<Volume> globalContainerMounts();
-  }
-
-  private final Params params;
-
-  public ExecutorModule() {
-    this.params = new Params() {
-      @Override
-      public Optional<File> customExecutorConfig() {
-        return Optional.ofNullable(CUSTOM_EXECUTOR_CONFIG.get());
-      }
-
-      @Override
-      public String thermosExecutorPath() {
-        return THERMOS_EXECUTOR_PATH.get();
-      }
-
-      @Override
-      public List<String> thermosExecutorResources() {
-        return THERMOS_EXECUTOR_RESOURCES.get();
-      }
-
-      @Override
-      public Optional<String> thermosExecutorFlags() {
-        return Optional.ofNullable(THERMOS_EXECUTOR_FLAGS.get());
-      }
-
-      @Override
-      public String thermosObserverRoot() {
-        return THERMOS_OBSERVER_ROOT.get();
-      }
-
-      @Override
-      public double executorOverheadCpus() {
-        return EXECUTOR_OVERHEAD_CPUS.get();
-      }
-
-      @Override
-      public Amount<Long, Data> executorOverheadRam() {
-        return EXECUTOR_OVERHEAD_RAM.get();
-      }
-
-      @Override
-      public List<Volume> globalContainerMounts() {
-        return GLOBAL_CONTAINER_MOUNTS.get();
-      }
-    };
-  }
-
-  private CommandInfo makeExecutorCommand() {
+  private static CommandInfo makeExecutorCommand() {
     Stream<String> resourcesToFetch = Stream.concat(
-        ImmutableList.of(params.thermosExecutorPath()).stream(),
-        params.thermosExecutorResources().stream());
+        ImmutableList.of(THERMOS_EXECUTOR_PATH.get()).stream(),
+        THERMOS_EXECUTOR_RESOURCES.get().stream());
 
     return CommandInfo.newBuilder()
         // Default to the value of $MESOS_SANDBOX if present.  This is necessary for docker tasks,
         // in which case the mesos agent is responsible for setting $MESOS_SANDBOX.
-        .setValue("${MESOS_SANDBOX=.}/" + uriBasename(params.thermosExecutorPath())
-            + " " + params.thermosExecutorFlags().orElse(""))
+        .setValue("${MESOS_SANDBOX=.}/" + uriBasename(THERMOS_EXECUTOR_PATH.get())
+            + " " + Optional.ofNullable(THERMOS_EXECUTOR_FLAGS.get()).orElse(""))
         .addAllUris(resourcesToFetch
             .map(r -> URI.newBuilder().setValue(r).setExecutable(true).build())
             .collect(GuavaUtils.toImmutableList()))
         .build();
   }
 
-  private ExecutorSettings makeThermosExecutorSettings()  {
+  private static ExecutorSettings makeThermosExecutorSettings()  {
     List<Protos.Volume> volumeMounts =
         ImmutableList.<Protos.Volume>builder()
             .add(Protos.Volume.newBuilder()
-                .setHostPath(params.thermosObserverRoot())
-                .setContainerPath(params.thermosObserverRoot())
+                .setHostPath(THERMOS_OBSERVER_ROOT.get())
+                .setContainerPath(THERMOS_OBSERVER_ROOT.get())
                 .setMode(Protos.Volume.Mode.RW)
                 .build())
             .addAll(Iterables.transform(
-                params.globalContainerMounts(),
+                GLOBAL_CONTAINER_MOUNTS.get(),
                 v -> Protos.Volume.newBuilder()
                     .setHostPath(v.getHostPath())
                     .setContainerPath(v.getContainerPath())
@@ -199,16 +136,20 @@ public class ExecutorModule extends AbstractModule {
                 // Necessary as executorId is a required field.
                 .setExecutorId(Executors.PLACEHOLDER_EXECUTOR_ID)
                 .setCommand(makeExecutorCommand())
-                .addResources(makeResource(CPUS, params.executorOverheadCpus()))
-                .addResources(makeResource(RAM_MB, params.executorOverheadRam().as(Data.MB)))
+                .addResources(makeResource(CPUS, EXECUTOR_OVERHEAD_CPUS.get()))
+                .addResources(makeResource(RAM_MB, EXECUTOR_OVERHEAD_RAM.get().as(Data.MB)))
                 .build(),
             volumeMounts));
   }
 
-  private ExecutorSettings makeCustomExecutorSettings(File configFile) {
+  private static ExecutorSettings makeCustomExecutorSettings() {
     try {
-      return new ExecutorSettings(
-          ExecutorSettingsLoader.read(Files.newBufferedReader(configFile.toPath())));
+      return
+          new ExecutorSettings(
+              ExecutorSettingsLoader.read(
+                  Files.newBufferedReader(
+                      CUSTOM_EXECUTOR_CONFIG.get().toPath(),
+                      StandardCharsets.UTF_8)));
     } catch (ExecutorSettingsLoader.ExecutorConfigException | IOException e) {
       throw new IllegalArgumentException("Failed to read executor settings: " + e, e);
     }
@@ -216,8 +157,8 @@ public class ExecutorModule extends AbstractModule {
 
   @Override
   protected void configure() {
-    bind(ExecutorSettings.class).toInstance(params.customExecutorConfig().isPresent()
-        ? makeCustomExecutorSettings(params.customExecutorConfig().get())
+    bind(ExecutorSettings.class).toInstance(CUSTOM_EXECUTOR_CONFIG.hasAppliedValue()
+        ? makeCustomExecutorSettings()
         : makeThermosExecutorSettings());
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronModule.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronModule.java
index c165317..155d702 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronModule.java
@@ -70,41 +70,8 @@ public class CronModule extends AbstractModule {
   public static final Arg<Amount<Long, Time>> CRON_START_MAX_BACKOFF =
       Arg.create(Amount.of(1L, Time.MINUTES));
 
-  interface Params {
-    int cronSchedulerNumThreads();
-
-    String cronTimezone();
-
-    Amount<Long, Time> cronStartInitialBackoff();
-
-    Amount<Long, Time> cronStartMaxBackoff();
-  }
-
-  private final Params params;
-
-  public CronModule() {
-    this.params = new Params() {
-      @Override
-      public int cronSchedulerNumThreads() {
-        return NUM_THREADS.get();
-      }
-
-      @Override
-      public String cronTimezone() {
-        return CRON_TIMEZONE.get();
-      }
-
-      @Override
-      public Amount<Long, Time> cronStartInitialBackoff() {
-        return CRON_START_INITIAL_BACKOFF.get();
-      }
-
-      @Override
-      public Amount<Long, Time> cronStartMaxBackoff() {
-        return CRON_START_MAX_BACKOFF.get();
-      }
-    };
-  }
+  // Global per-JVM ID number generator for the provided Quartz Scheduler.
+  private static final AtomicLong ID_GENERATOR = new AtomicLong();
 
   @Override
   protected void configure() {
@@ -121,7 +88,7 @@ public class CronModule extends AbstractModule {
 
     bind(AuroraCronJob.class).in(Singleton.class);
     bind(AuroraCronJob.Config.class).toInstance(new AuroraCronJob.Config(
-        new BackoffHelper(params.cronStartInitialBackoff(), params.cronStartMaxBackoff())));
+        new BackoffHelper(CRON_START_INITIAL_BACKOFF.get(), CRON_START_MAX_BACKOFF.get())));
 
     bind(CronLifecycle.class).in(Singleton.class);
     SchedulerServicesModule.addSchedulerActiveServiceBinding(binder()).to(CronLifecycle.class);
@@ -129,7 +96,7 @@ public class CronModule extends AbstractModule {
 
   @Provides
   TimeZone provideTimeZone() {
-    TimeZone timeZone = TimeZone.getTimeZone(params.cronTimezone());
+    TimeZone timeZone = TimeZone.getTimeZone(CRON_TIMEZONE.get());
     TimeZone systemTimeZone = TimeZone.getDefault();
     if (!timeZone.equals(systemTimeZone)) {
       LOG.warn("Cron schedules are configured to fire according to timezone "
@@ -140,12 +107,9 @@ public class CronModule extends AbstractModule {
     return timeZone;
   }
 
-  // Global per-JVM ID number generator for the provided Quartz Scheduler.
-  private static final AtomicLong ID_GENERATOR = new AtomicLong();
-
   @Provides
   @Singleton
-  Scheduler provideScheduler(AuroraCronJobFactory jobFactory) throws SchedulerException {
+  static Scheduler provideScheduler(AuroraCronJobFactory jobFactory) throws SchedulerException {
     // There are several ways to create a quartz Scheduler instance.  This path was chosen as the
     // simplest to create a Scheduler that uses a *daemon* QuartzSchedulerThread instance.
     Properties props = new Properties();
@@ -153,9 +117,7 @@ public class CronModule extends AbstractModule {
     props.setProperty(PROP_SCHED_NAME, name);
     props.setProperty(PROP_SCHED_INSTANCE_ID, name);
     props.setProperty(PROP_THREAD_POOL_CLASS, SimpleThreadPool.class.getCanonicalName());
-    props.setProperty(
-        PROP_THREAD_POOL_PREFIX + ".threadCount",
-        String.valueOf(params.cronSchedulerNumThreads()));
+    props.setProperty(PROP_THREAD_POOL_PREFIX + ".threadCount", NUM_THREADS.get().toString());
     props.setProperty(PROP_THREAD_POOL_PREFIX + ".makeThreadsDaemons", Boolean.TRUE.toString());
 
     props.setProperty(PROP_SCHED_MAKE_SCHEDULER_THREAD_DAEMON, Boolean.TRUE.toString());

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/http/H2ConsoleModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/H2ConsoleModule.java b/src/main/java/org/apache/aurora/scheduler/http/H2ConsoleModule.java
index f965161..01d6b5d 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/H2ConsoleModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/H2ConsoleModule.java
@@ -33,23 +33,10 @@ public class H2ConsoleModule extends ServletModule {
   @CmdLine(name = "enable_h2_console", help = "Enable H2 DB management console.")
   private static final Arg<Boolean> ENABLE_H2_CONSOLE = Arg.create(false);
 
-  interface Params {
-    boolean enableH2Console();
-  }
-
   private final boolean enabled;
 
   public H2ConsoleModule() {
-    this(new Params() {
-      @Override
-      public boolean enableH2Console() {
-        return ENABLE_H2_CONSOLE.get();
-      }
-    });
-  }
-
-  public H2ConsoleModule(Params params) {
-    this(params.enableH2Console());
+    this(ENABLE_H2_CONSOLE.get());
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java b/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
index 33e3cd8..df649ff 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
@@ -114,16 +114,6 @@ public class JettyServerModule extends AbstractModule {
       help = "The port to start an HTTP server on.  Default value will choose a random port.")
   protected static final Arg<Integer> HTTP_PORT = Arg.create(0);
 
-  public interface Params {
-    default Optional<String> hostname() {
-      return Optional.absent();
-    }
-
-    default int httpPort() {
-      return 0;
-    }
-  }
-
   public static final Map<String, String> GUICE_CONTAINER_PARAMS = ImmutableMap.of(
       FEATURE_POJO_MAPPING, Boolean.TRUE.toString(),
       PROPERTY_CONTAINER_REQUEST_FILTERS, GZIPContentEncodingFilter.class.getName(),
@@ -134,30 +124,14 @@ public class JettyServerModule extends AbstractModule {
       .toString()
       .replace("assets/index.html", "");
 
-  private final Params params;
   private final boolean production;
 
   public JettyServerModule() {
-    this(new Params() {
-      @Override
-      public Optional<String> hostname() {
-        return Optional.fromNullable(HOSTNAME_OVERRIDE.get());
-      }
-
-      @Override
-      public int httpPort() {
-        return HTTP_PORT.get();
-      }
-    });
-  }
-
-  public JettyServerModule(Params params) {
-    this(params, true);
+    this(true);
   }
 
   @VisibleForTesting
-  JettyServerModule(Params params, boolean production) {
-    this.params = requireNonNull(params);
+  JettyServerModule(boolean production) {
     this.production = production;
   }
 
@@ -174,9 +148,10 @@ public class JettyServerModule extends AbstractModule {
         .annotatedWith(Names.named(HealthHandler.HEALTH_CHECKER_KEY))
         .toInstance(Suppliers.ofInstance(true));
 
-    if (params.hostname().isPresent()) {
+    final Optional<String> hostnameOverride = Optional.fromNullable(HOSTNAME_OVERRIDE.get());
+    if (hostnameOverride.isPresent()) {
       try {
-        InetAddress.getByName(params.hostname().get());
+        InetAddress.getByName(hostnameOverride.get());
       } catch (UnknownHostException e) {
         /* Possible misconfiguration, so warn the user. */
         LOG.warn("Unable to resolve name specified in -hostname. "
@@ -186,7 +161,7 @@ public class JettyServerModule extends AbstractModule {
     install(new PrivateModule() {
       @Override
       protected void configure() {
-        bind(Params.class).toInstance(params);
+        bind(new TypeLiteral<Optional<String>>() { }).toInstance(hostnameOverride);
         bind(HttpService.class).to(HttpServerLauncher.class);
         bind(HttpServerLauncher.class).in(Singleton.class);
         expose(HttpServerLauncher.class);
@@ -326,18 +301,18 @@ public class JettyServerModule extends AbstractModule {
   }
 
   public static final class HttpServerLauncher extends AbstractIdleService implements HttpService {
-    private final Params params;
     private final ServletContextListener servletContextListener;
+    private final Optional<String> advertisedHostOverride;
     private volatile Server server;
     private volatile HostAndPort serverAddress = null;
 
     @Inject
     HttpServerLauncher(
-        Params params,
-        ServletContextListener servletContextListener) {
+        ServletContextListener servletContextListener,
+        Optional<String> advertisedHostOverride) {
 
-      this.params = requireNonNull(params);
       this.servletContextListener = requireNonNull(servletContextListener);
+      this.advertisedHostOverride = requireNonNull(advertisedHostOverride);
     }
 
     private static final Map<String, String> REGEX_REWRITE_RULES =
@@ -377,7 +352,7 @@ public class JettyServerModule extends AbstractModule {
     public HostAndPort getAddress() {
       Preconditions.checkState(state() == State.RUNNING);
       return HostAndPort.fromParts(
-          params.hostname().or(serverAddress.getHostText()),
+          advertisedHostOverride.or(serverAddress.getHostText()),
           serverAddress.getPort());
     }
 
@@ -400,7 +375,7 @@ public class JettyServerModule extends AbstractModule {
       rootHandler.addHandler(servletHandler);
 
       ServerConnector connector = new ServerConnector(server);
-      connector.setPort(params.httpPort());
+      connector.setPort(HTTP_PORT.get());
       server.addConnector(connector);
       server.setHandler(getGzipHandler(getRewriteHandler(rootHandler)));
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/http/api/ApiModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/api/ApiModule.java b/src/main/java/org/apache/aurora/scheduler/http/api/ApiModule.java
index b37278b..cd5adf9 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/api/ApiModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/api/ApiModule.java
@@ -13,8 +13,6 @@
  */
 package org.apache.aurora.scheduler.http.api;
 
-import java.util.Optional;
-
 import javax.inject.Singleton;
 
 import com.google.common.collect.ImmutableMap;
@@ -49,25 +47,10 @@ public class ApiModule extends ServletModule {
       .newClassPathResource("org/apache/aurora/scheduler/gen/client")
       .toString();
 
-  interface Params {
-    Optional<String> enableCorsFor();
-  }
-
-  private final Params params;
-
-  public ApiModule() {
-    this.params = new Params() {
-      @Override
-      public Optional<String> enableCorsFor() {
-        return Optional.ofNullable(ENABLE_CORS_FOR.get());
-      }
-    };
-  }
-
   @Override
   protected void configureServlets() {
-    if (params.enableCorsFor().isPresent()) {
-      filter(API_PATH).through(new CorsFilter(params.enableCorsFor().get()));
+    if (ENABLE_CORS_FOR.get() != null) {
+      filter(API_PATH).through(new CorsFilter(ENABLE_CORS_FOR.get()));
     }
     serve(API_PATH).with(TServlet.class);
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java b/src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java
index d305112..e328620 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java
@@ -81,7 +81,7 @@ public class HttpSecurityModule extends ServletModule {
   @CmdLine(name = "shiro_after_auth_filter",
       help = "Fully qualified class name of the servlet filter to be applied after the"
           + " shiro auth filters are applied.")
-  private static final Arg<Class<? extends Filter>> SHIRO_AFTER_AUTH_FILTER = Arg.create(null);
+  private static final Arg<Class<? extends Filter>> SHIRO_AFTER_AUTH_FILTER = Arg.create();
 
   @VisibleForTesting
   static final Matcher<Method> AURORA_SCHEDULER_MANAGER_SERVICE =
@@ -112,48 +112,21 @@ public class HttpSecurityModule extends ServletModule {
   private static final Arg<HttpAuthenticationMechanism> HTTP_AUTHENTICATION_MECHANISM =
       Arg.create(HttpAuthenticationMechanism.NONE);
 
-  interface Params {
-    Set<Module> shiroRealmModule();
-
-    Optional<Class<? extends Filter>> shiroAfterAuthFilter();
-
-    HttpAuthenticationMechanism httpAuthenticationMechanism();
-  }
-
   private final HttpAuthenticationMechanism mechanism;
   private final Set<Module> shiroConfigurationModules;
   private final Optional<Key<? extends Filter>> shiroAfterAuthFilterKey;
 
   public HttpSecurityModule() {
-    this(new Params() {
-      @Override
-      public Set<Module> shiroRealmModule() {
-        return SHIRO_REALM_MODULE.get();
-      }
-
-      @Override
-      public Optional<Class<? extends Filter>> shiroAfterAuthFilter() {
-        return Optional.ofNullable(SHIRO_AFTER_AUTH_FILTER.get());
-      }
-
-      @Override
-      public HttpAuthenticationMechanism httpAuthenticationMechanism() {
-        return HTTP_AUTHENTICATION_MECHANISM.get();
-      }
-    });
-  }
-
-  public HttpSecurityModule(Params params) {
     this(
-        params.httpAuthenticationMechanism(),
-        params.shiroRealmModule(),
-        params.shiroAfterAuthFilter().map(Key::get));
+        HTTP_AUTHENTICATION_MECHANISM.get(),
+        SHIRO_REALM_MODULE.get(),
+        SHIRO_AFTER_AUTH_FILTER.hasAppliedValue() ? Key.get(SHIRO_AFTER_AUTH_FILTER.get()) : null);
   }
 
   @VisibleForTesting
   HttpSecurityModule(
       Module shiroConfigurationModule,
-      Optional<Key<? extends Filter>> shiroAfterAuthFilterKey) {
+      Key<? extends Filter> shiroAfterAuthFilterKey) {
 
     this(HttpAuthenticationMechanism.BASIC,
         ImmutableSet.of(shiroConfigurationModule),
@@ -163,11 +136,11 @@ public class HttpSecurityModule extends ServletModule {
   private HttpSecurityModule(
       HttpAuthenticationMechanism mechanism,
       Set<Module> shiroConfigurationModules,
-      Optional<Key<? extends Filter>> shiroAfterAuthFilterKey) {
+      Key<? extends Filter> shiroAfterAuthFilterKey) {
 
     this.mechanism = requireNonNull(mechanism);
     this.shiroConfigurationModules = requireNonNull(shiroConfigurationModules);
-    this.shiroAfterAuthFilterKey = requireNonNull(shiroAfterAuthFilterKey);
+    this.shiroAfterAuthFilterKey = Optional.ofNullable(shiroAfterAuthFilterKey);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/http/api/security/IniShiroRealmModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/api/security/IniShiroRealmModule.java b/src/main/java/org/apache/aurora/scheduler/http/api/security/IniShiroRealmModule.java
index 209a714..43c38dc 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/api/security/IniShiroRealmModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/api/security/IniShiroRealmModule.java
@@ -39,23 +39,10 @@ public class IniShiroRealmModule extends AbstractModule {
       help = "Path to shiro.ini for authentication and authorization configuration.")
   private static final Arg<Ini> SHIRO_INI_PATH = Arg.create(null);
 
-  interface Params {
-    Optional<Ini> shiroIniPath();
-  }
-
   private final Optional<Ini> ini;
 
   public IniShiroRealmModule() {
-    this(new Params() {
-      @Override
-      public Optional<Ini> shiroIniPath() {
-        return Optional.fromNullable(SHIRO_INI_PATH.get());
-      }
-    });
-  }
-
-  public IniShiroRealmModule(Params params) {
-    this(params.shiroIniPath());
+    this(Optional.fromNullable(SHIRO_INI_PATH.get()));
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/http/api/security/Kerberos5ShiroRealmModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/api/security/Kerberos5ShiroRealmModule.java b/src/main/java/org/apache/aurora/scheduler/http/api/security/Kerberos5ShiroRealmModule.java
index 0090567..0f8bdbb 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/api/security/Kerberos5ShiroRealmModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/api/security/Kerberos5ShiroRealmModule.java
@@ -81,44 +81,17 @@ public class Kerberos5ShiroRealmModule extends AbstractModule {
   @CmdLine(name = "kerberos_debug", help = "Produce additional Kerberos debugging output.")
   private static final Arg<Boolean> DEBUG = Arg.create(false);
 
-  interface Params {
-    Optional<File> kerberosServerKeytab();
-
-    Optional<KerberosPrincipal> kerberosServerPrincipal();
-
-    boolean kerberosDebug();
-  }
-
   private final Optional<File> serverKeyTab;
   private final Optional<KerberosPrincipal> serverPrincipal;
   private final GSSManager gssManager;
   private final boolean kerberosDebugEnabled;
 
   public Kerberos5ShiroRealmModule() {
-    this(new Params() {
-      @Override
-      public Optional<File> kerberosServerKeytab() {
-        return Optional.fromNullable(SERVER_KEYTAB.get());
-      }
-
-      @Override
-      public Optional<KerberosPrincipal> kerberosServerPrincipal() {
-        return Optional.fromNullable(SERVER_PRINCIPAL.get());
-      }
-
-      @Override
-      public boolean kerberosDebug() {
-        return DEBUG.get();
-      }
-    });
-  }
-
-  public Kerberos5ShiroRealmModule(Params params) {
     this(
-        params.kerberosServerKeytab(),
-        params.kerberosServerPrincipal(),
+        Optional.fromNullable(SERVER_KEYTAB.get()),
+        Optional.fromNullable(SERVER_PRINCIPAL.get()),
         GSSManager.getInstance(),
-        params.kerberosDebug());
+        DEBUG.get());
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule.java b/src/main/java/org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule.java
index 9482d74..5daafa9 100644
--- a/src/main/java/org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/log/mesos/MesosLogStreamModule.java
@@ -15,14 +15,14 @@ package org.apache.aurora.scheduler.log.mesos;
 
 import java.io.File;
 import java.util.List;
-import java.util.Optional;
+import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
 import javax.inject.Singleton;
 
 import com.google.common.base.Joiner;
-import com.google.common.collect.FluentIterable;
+import com.google.common.collect.Iterables;
 import com.google.inject.PrivateModule;
 import com.google.inject.Provides;
 import com.google.inject.TypeLiteral;
@@ -40,8 +40,6 @@ import org.apache.aurora.scheduler.zookeeper.guice.client.ZooKeeperClientModule.
 import org.apache.mesos.Log;
 import org.apache.zookeeper.common.PathUtils;
 
-import static java.util.Objects.requireNonNull;
-
 /**
  * Binds a native mesos Log implementation.
  *
@@ -95,87 +93,38 @@ public class MesosLogStreamModule extends PrivateModule {
   private static final Arg<Amount<Long, Time>> WRITE_TIMEOUT =
       Arg.create(Amount.of(3L, Time.SECONDS));
 
-  private static void requireParam(Optional<?> arg, String name) {
-    if (!arg.isPresent()) {
+  private static <T> T getRequiredArg(Arg<T> arg, String name) {
+    if (!arg.hasAppliedValue()) {
       throw new IllegalStateException(
           String.format("A value for the -%s flag must be supplied", name));
     }
+    return arg.get();
   }
 
-  interface Params {
-    int nativeLogQuorumSize();
-
-    Optional<File> nativeLogFilePath();
-
-    Optional<String> nativeLogZkGroupPath();
-
-    Amount<Long, Time> nativeLogElectionTimeout();
-
-    int nativeLogElectionRetries();
-
-    Amount<Long, Time> nativeLogReadTimeout();
-
-    Amount<Long, Time> nativeLogWriteTimeout();
-  }
-
-  private final Params params;
   private final ClientConfig zkClientConfig;
+  private final File logPath;
+  private final String zkLogGroupPath;
 
   public MesosLogStreamModule(ClientConfig zkClientConfig) {
-    this(
-        new Params() {
-          @Override
-          public int nativeLogQuorumSize() {
-            return QUORUM_SIZE.get();
-          }
-
-          @Override
-          public Optional<File> nativeLogFilePath() {
-            return Optional.ofNullable(LOG_PATH.get());
-          }
-
-          @Override
-          public Optional<String> nativeLogZkGroupPath() {
-            return Optional.ofNullable(ZK_LOG_GROUP_PATH.get());
-          }
-
-          @Override
-          public Amount<Long, Time> nativeLogElectionTimeout() {
-            return COORDINATOR_ELECTION_TIMEOUT.get();
-          }
-
-          @Override
-          public int nativeLogElectionRetries() {
-            return COORDINATOR_ELECTION_RETRIES.get();
-          }
-
-          @Override
-          public Amount<Long, Time> nativeLogReadTimeout() {
-            return READ_TIMEOUT.get();
-          }
-
-          @Override
-          public Amount<Long, Time> nativeLogWriteTimeout() {
-            return WRITE_TIMEOUT.get();
-          }
-        },
-        zkClientConfig);
+    this(zkClientConfig,
+        getRequiredArg(LOG_PATH, "native_log_file_path"),
+        getRequiredArg(ZK_LOG_GROUP_PATH, "native_log_zk_group_path"));
   }
 
-  public MesosLogStreamModule(Params params, ClientConfig zkClientConfig) {
-    requireParam(params.nativeLogFilePath(), "native_log_file_path");
-    requireParam(params.nativeLogZkGroupPath(), "native_log_zk_group_path");
-    PathUtils.validatePath(params.nativeLogZkGroupPath().get());
-    this.params = requireNonNull(params);
-    this.zkClientConfig = requireNonNull(zkClientConfig);
+  public MesosLogStreamModule(ClientConfig zkClientConfig, File logPath, String zkLogGroupPath) {
+    this.zkClientConfig = Objects.requireNonNull(zkClientConfig);
+    this.logPath = Objects.requireNonNull(logPath);
+
+    PathUtils.validatePath(zkLogGroupPath); // This checks for null.
+    this.zkLogGroupPath = zkLogGroupPath;
   }
 
   @Override
   protected void configure() {
     bind(new TypeLiteral<Amount<Long, Time>>() { }).annotatedWith(MesosLog.ReadTimeout.class)
-        .toInstance(params.nativeLogReadTimeout());
+        .toInstance(READ_TIMEOUT.get());
     bind(new TypeLiteral<Amount<Long, Time>>() { }).annotatedWith(MesosLog.WriteTimeout.class)
-        .toInstance(params.nativeLogWriteTimeout());
+        .toInstance(WRITE_TIMEOUT.get());
 
     bind(org.apache.aurora.scheduler.log.Log.class).to(MesosLog.class);
     bind(MesosLog.class).in(Singleton.class);
@@ -185,23 +134,21 @@ public class MesosLogStreamModule extends PrivateModule {
   @Provides
   @Singleton
   Log provideLog() {
-    File logPath = params.nativeLogFilePath().get();
     File parentDir = logPath.getParentFile();
     if (!parentDir.exists() && !parentDir.mkdirs()) {
       addError("Failed to create parent directory to store native log at: %s", parentDir);
     }
 
-    String zkConnectString = FluentIterable.from(zkClientConfig.servers)
-        .transform(InetSocketAddressHelper::toString)
-        .join(Joiner.on(','));
+    String zkConnectString = Joiner.on(',').join(
+        Iterables.transform(zkClientConfig.servers, InetSocketAddressHelper::toString));
 
     return new Log(
-        params.nativeLogQuorumSize(),
+        QUORUM_SIZE.get(),
         logPath.getAbsolutePath(),
         zkConnectString,
         zkClientConfig.sessionTimeout.getValue(),
         zkClientConfig.sessionTimeout.getUnit().getTimeUnit(),
-        params.nativeLogZkGroupPath().get(),
+        zkLogGroupPath,
         zkClientConfig.credentials.scheme(),
         zkClientConfig.credentials.authToken());
   }
@@ -213,12 +160,9 @@ public class MesosLogStreamModule extends PrivateModule {
 
   @Provides
   Log.Writer provideWriter(Log log) {
-    Amount<Long, Time> electionTimeout = params.nativeLogElectionTimeout();
-    return new Log.Writer(
-        log,
-        electionTimeout.getValue(),
-        electionTimeout.getUnit().getTimeUnit(),
-        params.nativeLogElectionRetries());
+    Amount<Long, Time> electionTimeout = COORDINATOR_ELECTION_TIMEOUT.get();
+    return new Log.Writer(log, electionTimeout.getValue(), electionTimeout.getUnit().getTimeUnit(),
+        COORDINATOR_ELECTION_RETRIES.get());
   }
 
   @Provides

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java b/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
index 4c41576..7de8f4c 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
@@ -62,7 +62,7 @@ public class CommandLineDriverSettingsModule extends AbstractModule {
       help = "Properties file which contains framework credentials to authenticate with Mesos"
           + "master. Must contain the properties '" + PRINCIPAL_KEY + "' and "
           + "'" + SECRET_KEY + "'.")
-  private static final Arg<File> FRAMEWORK_AUTHENTICATION_FILE = Arg.create(null);
+  private static final Arg<File> FRAMEWORK_AUTHENTICATION_FILE = Arg.create();
 
   @CmdLine(name = "framework_failover_timeout",
       help = "Time after which a framework is considered deleted.  SHOULD BE VERY HIGH.")
@@ -93,92 +93,37 @@ public class CommandLineDriverSettingsModule extends AbstractModule {
       help = "The Mesos role this framework will register as. The default is to left this empty, "
           + "and the framework will register without any role and only receive unreserved "
           + "resources in offer.")
-  private static final Arg<String> MESOS_ROLE = Arg.create(null);
-
-  interface Params {
-    String mesosMasterAddress();
-
-    Optional<File> frameworkAuthenticationFile();
-
-    Amount<Long, Time> frameworkFailoverTimeout();
-
-    boolean frameworkAnnouncePrincipal();
-
-    String executorUser();
-
-    boolean receiveRevocableResources();
-
-    Optional<String> mesosRole();
-  }
+  private static final Arg<String> MESOS_ROLE = Arg.create();
 
   // TODO(wfarner): Figure out a way to change this without risk of fallout (MESOS-703).
   private static final String TWITTER_FRAMEWORK_NAME = "TwitterScheduler";
 
-  private final Params params;
-
-  public CommandLineDriverSettingsModule() {
-    this.params = new Params() {
-      @Override
-      public String mesosMasterAddress() {
-        return MESOS_MASTER_ADDRESS.get();
-      }
-
-      @Override
-      public Optional<File> frameworkAuthenticationFile() {
-        return Optional.fromNullable(FRAMEWORK_AUTHENTICATION_FILE.get());
-      }
-
-      @Override
-      public Amount<Long, Time> frameworkFailoverTimeout() {
-        return FRAMEWORK_FAILOVER_TIMEOUT.get();
-      }
-
-      @Override
-      public boolean frameworkAnnouncePrincipal() {
-        return FRAMEWORK_ANNOUNCE_PRINCIPAL.get();
-      }
-
-      @Override
-      public String executorUser() {
-        return EXECUTOR_USER.get();
-      }
-
-      @Override
-      public boolean receiveRevocableResources() {
-        return RECEIVE_REVOCABLE_RESOURCES.get();
-      }
-
-      @Override
-      public Optional<String> mesosRole() {
-        return Optional.fromNullable(MESOS_ROLE.get());
-      }
-    };
-  }
-
   @Override
   protected void configure() {
     Optional<Protos.Credential> credentials = getCredentials();
-    Optional<String> principal = params.frameworkAnnouncePrincipal() && credentials.isPresent()
-        ? Optional.of(credentials.get().getPrincipal())
-        : Optional.absent();
+    Optional<String> principal = Optional.absent();
+    if (FRAMEWORK_ANNOUNCE_PRINCIPAL.get() && credentials.isPresent()) {
+      principal = Optional.of(credentials.get().getPrincipal());
+    }
+    Optional<String> role =
+        MESOS_ROLE.hasAppliedValue() ? Optional.of(MESOS_ROLE.get()) : Optional.absent();
     DriverSettings settings = new DriverSettings(
-        params.mesosMasterAddress(),
+        MESOS_MASTER_ADDRESS.get(),
         credentials,
         buildFrameworkInfo(
-            params.executorUser(),
+            EXECUTOR_USER.get(),
             principal,
-            params.frameworkFailoverTimeout(),
-            params.receiveRevocableResources(),
-            params.mesosRole()));
+            FRAMEWORK_FAILOVER_TIMEOUT.get(),
+            RECEIVE_REVOCABLE_RESOURCES.get(),
+            role));
     bind(DriverSettings.class).toInstance(settings);
   }
 
-  private Optional<Protos.Credential> getCredentials() {
-    if (params.frameworkAuthenticationFile().isPresent()) {
+  private static Optional<Protos.Credential> getCredentials() {
+    if (FRAMEWORK_AUTHENTICATION_FILE.hasAppliedValue()) {
       Properties properties;
       try {
-        properties =
-            parseCredentials(new FileInputStream(params.frameworkAuthenticationFile().get()));
+        properties = parseCredentials(new FileInputStream(FRAMEWORK_AUTHENTICATION_FILE.get()));
       } catch (FileNotFoundException e) {
         LOG.error("Authentication File not Found");
         throw Throwables.propagate(e);

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/offers/OffersModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/offers/OffersModule.java b/src/main/java/org/apache/aurora/scheduler/offers/OffersModule.java
index 39b4ab1..90f8abf 100644
--- a/src/main/java/org/apache/aurora/scheduler/offers/OffersModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/offers/OffersModule.java
@@ -43,27 +43,6 @@ public class OffersModule extends AbstractModule {
   private static final Arg<Amount<Integer, Time>> OFFER_HOLD_JITTER_WINDOW =
       Arg.create(Amount.of(1, Time.MINUTES));
 
-  interface Params {
-    Amount<Integer, Time> minOfferHoldTime();
-
-    Amount<Integer, Time> offerHoldJitterWindow();
-  }
-  private final Params params;
-
-  public OffersModule() {
-    params = new Params() {
-      @Override
-      public Amount<Integer, Time> minOfferHoldTime() {
-        return MIN_OFFER_HOLD_TIME.get();
-      }
-
-      @Override
-      public Amount<Integer, Time> offerHoldJitterWindow() {
-        return OFFER_HOLD_JITTER_WINDOW.get();
-      }
-    };
-  }
-
   @Override
   protected void configure() {
     install(new PrivateModule() {
@@ -71,8 +50,8 @@ public class OffersModule extends AbstractModule {
       protected void configure() {
         bind(OfferManager.OfferReturnDelay.class).toInstance(
             new RandomJitterReturnDelay(
-                params.minOfferHoldTime().as(Time.MILLISECONDS),
-                params.offerHoldJitterWindow().as(Time.MILLISECONDS),
+                MIN_OFFER_HOLD_TIME.get().as(Time.MILLISECONDS),
+                OFFER_HOLD_JITTER_WINDOW.get().as(Time.MILLISECONDS),
                 Random.Util.newDefaultRandom()));
         bind(OfferManager.class).to(OfferManager.OfferManagerImpl.class);
         bind(OfferManager.OfferManagerImpl.class).in(Singleton.class);

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorModule.java b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorModule.java
index e58688a..23d1c12 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorModule.java
@@ -59,49 +59,23 @@ public class PreemptorModule extends AbstractModule {
   private static final Arg<Amount<Long, Time>> PREEMPTION_SLOT_SEARCH_INTERVAL =
       Arg.create(Amount.of(1L, Time.MINUTES));
 
-  public interface Params {
-    default boolean enablePreemptor() {
-      return true;
-    }
-
-    Amount<Long, Time> preemptionDelay();
-
-    default Amount<Long, Time> preemptionSlotHoldTime() {
-      return Amount.of(5L, Time.MINUTES);
-    }
-
-    Amount<Long, Time> preemptionSlotSearchInterval();
-  }
-
-  private final Params params;
+  private final boolean enablePreemptor;
+  private final Amount<Long, Time> preemptionDelay;
+  private final Amount<Long, Time> slotSearchInterval;
 
   @VisibleForTesting
-  public PreemptorModule(Params params) {
-    this.params = requireNonNull(params);
+  public PreemptorModule(
+      boolean enablePreemptor,
+      Amount<Long, Time> preemptionDelay,
+      Amount<Long, Time> slotSearchInterval) {
+
+    this.enablePreemptor = enablePreemptor;
+    this.preemptionDelay = requireNonNull(preemptionDelay);
+    this.slotSearchInterval = requireNonNull(slotSearchInterval);
   }
 
   public PreemptorModule() {
-    this(new Params() {
-      @Override
-      public boolean enablePreemptor() {
-        return ENABLE_PREEMPTOR.get();
-      }
-
-      @Override
-      public Amount<Long, Time> preemptionDelay() {
-        return PREEMPTION_DELAY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> preemptionSlotHoldTime() {
-        return PREEMPTION_SLOT_HOLD_TIME.get();
-      }
-
-      @Override
-      public Amount<Long, Time> preemptionSlotSearchInterval() {
-        return PREEMPTION_SLOT_SEARCH_INTERVAL.get();
-      }
-    });
+    this(ENABLE_PREEMPTOR.get(), PREEMPTION_DELAY.get(), PREEMPTION_SLOT_SEARCH_INTERVAL.get());
   }
 
   @Override
@@ -109,7 +83,7 @@ public class PreemptorModule extends AbstractModule {
     install(new PrivateModule() {
       @Override
       protected void configure() {
-        if (params.enablePreemptor()) {
+        if (enablePreemptor) {
           LOG.info("Preemptor Enabled.");
           bind(PreemptorMetrics.class).in(Singleton.class);
           bind(PreemptionVictimFilter.class)
@@ -119,9 +93,9 @@ public class PreemptorModule extends AbstractModule {
           bind(Preemptor.PreemptorImpl.class).in(Singleton.class);
           bind(new TypeLiteral<Amount<Long, Time>>() { })
               .annotatedWith(PendingTaskProcessor.PreemptionDelay.class)
-              .toInstance(params.preemptionDelay());
+              .toInstance(preemptionDelay);
           bind(BiCacheSettings.class).toInstance(
-              new BiCacheSettings(params.preemptionSlotHoldTime(), "preemption_slot_cache_size"));
+              new BiCacheSettings(PREEMPTION_SLOT_HOLD_TIME.get(), "preemption_slot_cache_size"));
           bind(new TypeLiteral<BiCache<PreemptionProposal, TaskGroupKey>>() { })
               .in(Singleton.class);
           bind(PendingTaskProcessor.class).in(Singleton.class);
@@ -133,8 +107,8 @@ public class PreemptorModule extends AbstractModule {
           bind(AbstractScheduledService.Scheduler.class).toInstance(
               AbstractScheduledService.Scheduler.newFixedRateSchedule(
                   0L,
-                  params.preemptionSlotSearchInterval().getValue(),
-                  params.preemptionSlotSearchInterval().getUnit().getTimeUnit()));
+                  slotSearchInterval.getValue(),
+                  slotSearchInterval.getUnit().getTimeUnit()));
 
           expose(PreemptorService.class);
           expose(PendingTaskProcessor.class);
@@ -150,8 +124,9 @@ public class PreemptorModule extends AbstractModule {
     // and private modules due to multiple injectors.  We accept the added complexity here to keep
     // the other bindings private.
     PubsubEventModule.bindSubscriber(binder(), ClusterStateImpl.class);
-    if (params.enablePreemptor()) {
-      SchedulerServicesModule.addSchedulerActiveServiceBinding(binder()).to(PreemptorService.class);
+    if (enablePreemptor) {
+      SchedulerServicesModule.addSchedulerActiveServiceBinding(binder())
+          .to(PreemptorService.class);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/pruning/PruningModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/pruning/PruningModule.java b/src/main/java/org/apache/aurora/scheduler/pruning/PruningModule.java
index be10bff..735199a 100644
--- a/src/main/java/org/apache/aurora/scheduler/pruning/PruningModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/pruning/PruningModule.java
@@ -66,56 +66,6 @@ public class PruningModule extends AbstractModule {
   private static final Arg<Amount<Long, Time>> JOB_UPDATE_HISTORY_PRUNING_THRESHOLD =
       Arg.create(Amount.of(30L, Time.DAYS));
 
-  interface Params {
-    Amount<Long, Time> historyPruneThreshold();
-
-    int historyMaxPerJobThreshold();
-
-    Amount<Long, Time> historyMinRetentionThreshold();
-
-    int jobUpdateHistoryPerJobThreshold();
-
-    Amount<Long, Time> jobUpdateHistoryPruningInterval();
-
-    Amount<Long, Time> jobUpdateHistoryPruningThreshold();
-  }
-
-  private final Params params;
-
-  public PruningModule() {
-    this.params = new Params() {
-      @Override
-      public Amount<Long, Time> historyPruneThreshold() {
-        return HISTORY_PRUNE_THRESHOLD.get();
-      }
-
-      @Override
-      public int historyMaxPerJobThreshold() {
-        return HISTORY_MAX_PER_JOB_THRESHOLD.get();
-      }
-
-      @Override
-      public Amount<Long, Time> historyMinRetentionThreshold() {
-        return HISTORY_MIN_RETENTION_THRESHOLD.get();
-      }
-
-      @Override
-      public int jobUpdateHistoryPerJobThreshold() {
-        return JOB_UPDATE_HISTORY_PER_JOB_THRESHOLD.get();
-      }
-
-      @Override
-      public Amount<Long, Time> jobUpdateHistoryPruningInterval() {
-        return JOB_UPDATE_HISTORY_PRUNING_INTERVAL.get();
-      }
-
-      @Override
-      public Amount<Long, Time> jobUpdateHistoryPruningThreshold() {
-        return JOB_UPDATE_HISTORY_PRUNING_THRESHOLD.get();
-      }
-    };
-  }
-
   @Override
   protected void configure() {
     install(new PrivateModule() {
@@ -124,9 +74,10 @@ public class PruningModule extends AbstractModule {
         // TODO(ksweeney): Create a configuration validator module so this can be injected.
         // TODO(William Farner): Revert this once large task counts is cheap ala hierarchichal store
         bind(HistoryPrunnerSettings.class).toInstance(new HistoryPrunnerSettings(
-            params.historyPruneThreshold(),
-            params.historyMinRetentionThreshold(),
-            params.historyMaxPerJobThreshold()));
+            HISTORY_PRUNE_THRESHOLD.get(),
+            HISTORY_MIN_RETENTION_THRESHOLD.get(),
+            HISTORY_MAX_PER_JOB_THRESHOLD.get()
+        ));
 
         bind(TaskHistoryPruner.class).in(Singleton.class);
         expose(TaskHistoryPruner.class);
@@ -139,9 +90,9 @@ public class PruningModule extends AbstractModule {
       protected void configure() {
         bind(JobUpdateHistoryPruner.HistoryPrunerSettings.class).toInstance(
             new JobUpdateHistoryPruner.HistoryPrunerSettings(
-                params.jobUpdateHistoryPruningInterval(),
-                params.jobUpdateHistoryPruningThreshold(),
-                params.jobUpdateHistoryPerJobThreshold()));
+                JOB_UPDATE_HISTORY_PRUNING_INTERVAL.get(),
+                JOB_UPDATE_HISTORY_PRUNING_THRESHOLD.get(),
+                JOB_UPDATE_HISTORY_PER_JOB_THRESHOLD.get()));
 
         bind(ScheduledExecutorService.class).toInstance(
             AsyncUtil.singleThreadLoggingScheduledExecutor("JobUpdatePruner-%d", LOG));

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/reconciliation/ReconciliationModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/reconciliation/ReconciliationModule.java b/src/main/java/org/apache/aurora/scheduler/reconciliation/ReconciliationModule.java
index b8e2c0a..cccee08 100644
--- a/src/main/java/org/apache/aurora/scheduler/reconciliation/ReconciliationModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/reconciliation/ReconciliationModule.java
@@ -88,56 +88,6 @@ public class ReconciliationModule extends AbstractModule {
   private static final Arg<Amount<Long, Time>> RECONCILIATION_SCHEDULE_SPREAD =
       Arg.create(Amount.of(30L, Time.MINUTES));
 
-  interface Params {
-    Amount<Long, Time> transientTaskStateTimeout();
-
-    Amount<Long, Time> initialTaskKillRetryInterval();
-
-    Amount<Long, Time> reconciliationInitialDelay();
-
-    Amount<Long, Time> reconciliationExplicitInterval();
-
-    Amount<Long, Time> reconciliationImplicitInterval();
-
-    Amount<Long, Time> reconciliationScheduleSpread();
-  }
-
-  private final Params params;
-
-  public ReconciliationModule() {
-    this.params = new Params() {
-      @Override
-      public Amount<Long, Time> transientTaskStateTimeout() {
-        return TRANSIENT_TASK_STATE_TIMEOUT.get();
-      }
-
-      @Override
-      public Amount<Long, Time> initialTaskKillRetryInterval() {
-        return INITIAL_TASK_KILL_RETRY_INTERVAL.get();
-      }
-
-      @Override
-      public Amount<Long, Time> reconciliationInitialDelay() {
-        return RECONCILIATION_INITIAL_DELAY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> reconciliationExplicitInterval() {
-        return RECONCILIATION_EXPLICIT_INTERVAL.get();
-      }
-
-      @Override
-      public Amount<Long, Time> reconciliationImplicitInterval() {
-        return RECONCILIATION_IMPLICIT_INTERVAL.get();
-      }
-
-      @Override
-      public Amount<Long, Time> reconciliationScheduleSpread() {
-        return RECONCILIATION_SCHEDULE_SPREAD.get();
-      }
-    };
-  }
-
   @Qualifier
   @Target({ FIELD, PARAMETER, METHOD }) @Retention(RUNTIME)
   @interface BackgroundWorker { }
@@ -148,7 +98,7 @@ public class ReconciliationModule extends AbstractModule {
       @Override
       protected void configure() {
         bind(new TypeLiteral<Amount<Long, Time>>() { })
-            .toInstance(params.transientTaskStateTimeout());
+            .toInstance(TRANSIENT_TASK_STATE_TIMEOUT.get());
 
         bind(TaskTimeout.class).in(Singleton.class);
         expose(TaskTimeout.class);
@@ -162,8 +112,8 @@ public class ReconciliationModule extends AbstractModule {
       protected void configure() {
         bind(BackoffStrategy.class).toInstance(
             new TruncatedBinaryBackoff(
-                params.initialTaskKillRetryInterval(),
-                params.transientTaskStateTimeout()));
+                INITIAL_TASK_KILL_RETRY_INTERVAL.get(),
+                TRANSIENT_TASK_STATE_TIMEOUT.get()));
         bind(KillRetry.class).in(Singleton.class);
         expose(KillRetry.class);
       }
@@ -174,10 +124,10 @@ public class ReconciliationModule extends AbstractModule {
       @Override
       protected void configure() {
         bind(TaskReconcilerSettings.class).toInstance(new TaskReconcilerSettings(
-            params.reconciliationInitialDelay(),
-            params.reconciliationExplicitInterval(),
-            params.reconciliationImplicitInterval(),
-            params.reconciliationScheduleSpread()));
+            RECONCILIATION_INITIAL_DELAY.get(),
+            RECONCILIATION_EXPLICIT_INTERVAL.get(),
+            RECONCILIATION_IMPLICIT_INTERVAL.get(),
+            RECONCILIATION_SCHEDULE_SPREAD.get()));
         bind(ScheduledExecutorService.class).annotatedWith(BackgroundWorker.class)
             .toInstance(AsyncUtil.loggingScheduledExecutor(1, "TaskReconciler-%d", LOG));
         bind(TaskReconciler.class).in(Singleton.class);

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/scheduling/SchedulingModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/scheduling/SchedulingModule.java b/src/main/java/org/apache/aurora/scheduler/scheduling/SchedulingModule.java
index 150c654..577edcb 100644
--- a/src/main/java/org/apache/aurora/scheduler/scheduling/SchedulingModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/scheduling/SchedulingModule.java
@@ -29,7 +29,6 @@ import org.apache.aurora.common.util.TruncatedBinaryBackoff;
 import org.apache.aurora.scheduler.base.TaskGroupKey;
 import org.apache.aurora.scheduler.events.PubsubEventModule;
 import org.apache.aurora.scheduler.preemptor.BiCache;
-import org.apache.aurora.scheduler.preemptor.BiCache.BiCacheSettings;
 import org.apache.aurora.scheduler.scheduling.RescheduleCalculator.RescheduleCalculatorImpl;
 
 /**
@@ -84,96 +83,23 @@ public class SchedulingModule extends AbstractModule {
   private static final Arg<Amount<Long, Time>> RESERVATION_DURATION =
       Arg.create(Amount.of(3L, Time.MINUTES));
 
-  interface Params {
-    double maxScheduleAttemptsPerSec();
-
-    Amount<Long, Time> flappingTaskThreshold();
-
-    Amount<Long, Time> initialFlappingTaskDelay();
-
-    Amount<Long, Time> maxFlappingTaskDelay();
-
-    Amount<Integer, Time> maxRescheduleTaskDelayOnStartup();
-
-    Amount<Long, Time> firstScheduleDelay();
-
-    Amount<Long, Time> initialSchedulePenalty();
-
-    Amount<Long, Time> maxSchedulePenalty();
-
-    Amount<Long, Time> offerReservationDuration();
-  }
-
-  private final Params params;
-
-  public SchedulingModule() {
-    this.params = new Params() {
-      @Override
-      public double maxScheduleAttemptsPerSec() {
-        return MAX_SCHEDULE_ATTEMPTS_PER_SEC.get();
-      }
-
-      @Override
-      public Amount<Long, Time> flappingTaskThreshold() {
-        return FLAPPING_THRESHOLD.get();
-      }
-
-      @Override
-      public Amount<Long, Time> initialFlappingTaskDelay() {
-        return INITIAL_FLAPPING_DELAY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> maxFlappingTaskDelay() {
-        return MAX_FLAPPING_DELAY.get();
-      }
-
-      @Override
-      public Amount<Integer, Time> maxRescheduleTaskDelayOnStartup() {
-        return MAX_RESCHEDULING_DELAY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> firstScheduleDelay() {
-        return FIRST_SCHEDULE_DELAY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> initialSchedulePenalty() {
-        return INITIAL_SCHEDULE_PENALTY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> maxSchedulePenalty() {
-        return MAX_SCHEDULE_PENALTY.get();
-      }
-
-      @Override
-      public Amount<Long, Time> offerReservationDuration() {
-        return RESERVATION_DURATION.get();
-      }
-    };
-  }
-
   @Override
   protected void configure() {
     install(new PrivateModule() {
       @Override
       protected void configure() {
         bind(TaskGroups.TaskGroupsSettings.class).toInstance(new TaskGroups.TaskGroupsSettings(
-            params.firstScheduleDelay(),
+            FIRST_SCHEDULE_DELAY.get(),
             new TruncatedBinaryBackoff(
-                params.initialSchedulePenalty(),
-                params.maxSchedulePenalty()),
-            RateLimiter.create(params.maxScheduleAttemptsPerSec())));
+                INITIAL_SCHEDULE_PENALTY.get(),
+                MAX_SCHEDULE_PENALTY.get()),
+            RateLimiter.create(MAX_SCHEDULE_ATTEMPTS_PER_SEC.get())));
 
         bind(RescheduleCalculatorImpl.RescheduleCalculatorSettings.class)
             .toInstance(new RescheduleCalculatorImpl.RescheduleCalculatorSettings(
-                new TruncatedBinaryBackoff(
-                    params.initialFlappingTaskDelay(),
-                    params.maxFlappingTaskDelay()),
-                params.flappingTaskThreshold(),
-                params.maxRescheduleTaskDelayOnStartup()));
+                new TruncatedBinaryBackoff(INITIAL_FLAPPING_DELAY.get(), MAX_FLAPPING_DELAY.get()),
+                FLAPPING_THRESHOLD.get(),
+                MAX_RESCHEDULING_DELAY.get()));
 
         bind(RescheduleCalculator.class).to(RescheduleCalculatorImpl.class).in(Singleton.class);
         expose(RescheduleCalculator.class);
@@ -187,8 +113,8 @@ public class SchedulingModule extends AbstractModule {
       @Override
       protected void configure() {
         bind(new TypeLiteral<BiCache<String, TaskGroupKey>>() { }).in(Singleton.class);
-        bind(BiCacheSettings.class).toInstance(
-            new BiCacheSettings(params.offerReservationDuration(), "reservation_cache_size"));
+        bind(BiCache.BiCacheSettings.class).toInstance(
+            new BiCache.BiCacheSettings(RESERVATION_DURATION.get(), "reservation_cache_size"));
         bind(TaskScheduler.class).to(TaskScheduler.TaskSchedulerImpl.class);
         bind(TaskScheduler.TaskSchedulerImpl.class).in(Singleton.class);
         expose(TaskScheduler.class);

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/sla/SlaModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/sla/SlaModule.java b/src/main/java/org/apache/aurora/scheduler/sla/SlaModule.java
index 159a884..d569241 100644
--- a/src/main/java/org/apache/aurora/scheduler/sla/SlaModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/sla/SlaModule.java
@@ -72,52 +72,37 @@ public class SlaModule extends AbstractModule {
   private static final Arg<Set<MetricCategory>> SLA_NON_PROD_METRICS =
       Arg.<Set<MetricCategory>>create(ImmutableSet.of());
 
-  public interface Params {
-    Amount<Long, Time> slaStatRefreshInterval();
-
-    Set<MetricCategory> slaProdMetrics();
-
-    Set<MetricCategory> slaNonProdMetrics();
-  }
-
   @VisibleForTesting
   @Qualifier
   @Target({ FIELD, PARAMETER, METHOD }) @Retention(RUNTIME)
   @interface SlaExecutor { }
 
-  private final Params params;
+  private final Amount<Long, Time> refreshInterval;
+  private final Set<MetricCategory> prodMetrics;
+  private final Set<MetricCategory> nonProdMetrics;
 
   @VisibleForTesting
-  SlaModule(Params params) {
-    this.params = requireNonNull(params);
+  SlaModule(
+      Amount<Long, Time> refreshInterval,
+      Set<MetricCategory> prodMetrics,
+      Set<MetricCategory> nonProdMetrics) {
+
+    this.refreshInterval = refreshInterval;
+    this.prodMetrics = prodMetrics;
+    this.nonProdMetrics = nonProdMetrics;
   }
 
   public SlaModule() {
-    this(new Params() {
-      @Override
-      public Amount<Long, Time> slaStatRefreshInterval() {
-        return SLA_REFRESH_INTERVAL.get();
-      }
-
-      @Override
-      public Set<MetricCategory> slaProdMetrics() {
-        return SLA_PROD_METRICS.get();
-      }
-
-      @Override
-      public Set<MetricCategory> slaNonProdMetrics() {
-        return SLA_NON_PROD_METRICS.get();
-      }
-    });
+    this(SLA_REFRESH_INTERVAL.get(), SLA_PROD_METRICS.get(), SLA_NON_PROD_METRICS.get());
   }
 
   @Override
   protected void configure() {
     bind(MetricCalculatorSettings.class)
         .toInstance(new MetricCalculatorSettings(
-            params.slaStatRefreshInterval().as(Time.MILLISECONDS),
-            params.slaProdMetrics(),
-            params.slaNonProdMetrics()));
+            refreshInterval.as(Time.MILLISECONDS),
+            prodMetrics,
+            nonProdMetrics));
 
     bind(MetricCalculator.class).in(Singleton.class);
     bind(ScheduledExecutorService.class)

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/stats/AsyncStatsModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/stats/AsyncStatsModule.java b/src/main/java/org/apache/aurora/scheduler/stats/AsyncStatsModule.java
index e8d1e14..08eb6d6 100644
--- a/src/main/java/org/apache/aurora/scheduler/stats/AsyncStatsModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/stats/AsyncStatsModule.java
@@ -58,35 +58,6 @@ public class AsyncStatsModule extends AbstractModule {
   private static final Arg<Amount<Long, Time>> SLOT_STAT_INTERVAL =
       Arg.create(Amount.of(1L, Time.MINUTES));
 
-  interface Params {
-    Amount<Long, Time> asyncTaskStatUpdateInterval();
-
-    Amount<Long, Time> asyncSlotStatUpdateInterval();
-  }
-
-  private final Params params;
-
-  public AsyncStatsModule() {
-    this.params = new Params() {
-      @Override
-      public Amount<Long, Time> asyncTaskStatUpdateInterval() {
-        return TASK_STAT_INTERVAL.get();
-      }
-
-      @Override
-      public Amount<Long, Time> asyncSlotStatUpdateInterval() {
-        return SLOT_STAT_INTERVAL.get();
-      }
-    };
-  }
-
-  private static Scheduler fromDuration(Amount<Long, Time> duration) {
-    return Scheduler.newFixedDelaySchedule(
-        duration.getValue(),
-        duration.getValue(),
-        duration.getUnit().getTimeUnit());
-  }
-
   @Override
   protected void configure() {
     bind(TaskStatCalculator.class).in(Singleton.class);
@@ -98,7 +69,11 @@ public class AsyncStatsModule extends AbstractModule {
       @Override
       protected void configure() {
         bind(TaskStatUpdaterService.class).in(Singleton.class);
-        bind(Scheduler.class).toInstance(fromDuration(params.asyncTaskStatUpdateInterval()));
+        bind(Scheduler.class).toInstance(
+            Scheduler.newFixedRateSchedule(
+                TASK_STAT_INTERVAL.get().getValue(),
+                TASK_STAT_INTERVAL.get().getValue(),
+                TASK_STAT_INTERVAL.get().getUnit().getTimeUnit()));
         expose(TaskStatUpdaterService.class);
       }
     });
@@ -109,7 +84,11 @@ public class AsyncStatsModule extends AbstractModule {
       @Override
       protected void configure() {
         bind(SlotSizeCounterService.class).in(Singleton.class);
-        bind(Scheduler.class).toInstance(fromDuration(params.asyncSlotStatUpdateInterval()));
+        bind(Scheduler.class).toInstance(
+            Scheduler.newFixedRateSchedule(
+                SLOT_STAT_INTERVAL.get().getValue(),
+                SLOT_STAT_INTERVAL.get().getValue(),
+                SLOT_STAT_INTERVAL.get().getUnit().getTimeUnit()));
         expose(SlotSizeCounterService.class);
       }
     });

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/stats/StatsModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/stats/StatsModule.java b/src/main/java/org/apache/aurora/scheduler/stats/StatsModule.java
index c56ff3c..4767ef1 100644
--- a/src/main/java/org/apache/aurora/scheduler/stats/StatsModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/stats/StatsModule.java
@@ -45,28 +45,6 @@ public class StatsModule extends AbstractModule {
   private static final Arg<Amount<Long, Time>> RETENTION_PERIOD =
       Arg.create(Amount.of(1L, Time.HOURS));
 
-  interface Params {
-    Amount<Long, Time> statSamplingInterval();
-
-    Amount<Long, Time> statRetentionPeriod();
-  }
-
-  private final Params params;
-
-  public StatsModule() {
-    this.params = new Params() {
-      @Override
-      public Amount<Long, Time> statSamplingInterval() {
-        return SAMPLING_INTERVAL.get();
-      }
-
-      @Override
-      public Amount<Long, Time> statRetentionPeriod() {
-        return RETENTION_PERIOD.get();
-      }
-    };
-  }
-
   @Override
   protected void configure() {
     requireBinding(ShutdownRegistry.class);
@@ -75,10 +53,10 @@ public class StatsModule extends AbstractModule {
     bind(StatRegistry.class).toInstance(Stats.STAT_REGISTRY);
     bind(new TypeLiteral<Amount<Long, Time>>() { })
         .annotatedWith(Names.named(TimeSeriesRepositoryImpl.SAMPLE_RETENTION_PERIOD))
-        .toInstance(params.statRetentionPeriod());
+        .toInstance(RETENTION_PERIOD.get());
     bind(new TypeLiteral<Amount<Long, Time>>() { })
         .annotatedWith(Names.named(TimeSeriesRepositoryImpl.SAMPLE_PERIOD))
-        .toInstance(params.statSamplingInterval());
+        .toInstance(SAMPLING_INTERVAL.get());
     bind(TimeSeriesRepository.class).to(TimeSeriesRepositoryImpl.class);
     bind(TimeSeriesRepositoryImpl.class).in(Singleton.class);
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java b/src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java
index 38bf1aa..cded40b 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java
@@ -64,20 +64,8 @@ public class BackupModule extends PrivateModule {
       help = "Directory to store backups under. Will be created if it does not exist.")
   private static final Arg<File> BACKUP_DIR = Arg.create();
 
-  public interface Params {
-    default Amount<Long, Time> backupInterval() {
-      return Amount.of(1L, Time.HOURS);
-    }
-
-    default int maxSavedBackups() {
-      return 48;
-    }
-
-    File backupDir();
-  }
-
-  private final Params params;
   private final Class<? extends SnapshotStore<Snapshot>> snapshotStore;
+  private final File unvalidatedBackupDir;
 
   /**
    * Creates a new backup module.
@@ -85,35 +73,18 @@ public class BackupModule extends PrivateModule {
    * @param snapshotStore Snapshot store implementation class.
    */
   public BackupModule(Class<? extends SnapshotStore<Snapshot>> snapshotStore) {
-    this(
-        new Params() {
-          @Override
-          public Amount<Long, Time> backupInterval() {
-            return BACKUP_INTERVAL.get();
-          }
-
-          @Override
-          public int maxSavedBackups() {
-            return MAX_SAVED_BACKUPS.get();
-          }
-
-          @Override
-          public File backupDir() {
-            return BACKUP_DIR.get();
-          }
-        },
-        snapshotStore);
+    this(BACKUP_DIR.get(), snapshotStore);
   }
 
   /**
    * Creates a new backup module using a given backupDir instead of a flagged one.
    *
-   * @param params Module configuration parameters.
+   * @param backupDir Directory to write backups to.
    * @param snapshotStore Snapshot store implementation class.
    */
   @VisibleForTesting
-  public BackupModule(Params params, Class<? extends SnapshotStore<Snapshot>> snapshotStore) {
-    this.params = requireNonNull(params);
+  public BackupModule(File backupDir, Class<? extends SnapshotStore<Snapshot>> snapshotStore) {
+    this.unvalidatedBackupDir = requireNonNull(backupDir);
     this.snapshotStore = requireNonNull(snapshotStore);
   }
 
@@ -155,7 +126,6 @@ public class BackupModule extends PrivateModule {
 
   @Provides
   File provideBackupDir() {
-    File unvalidatedBackupDir = params.backupDir();
     if (!unvalidatedBackupDir.exists()) {
       if (unvalidatedBackupDir.mkdirs()) {
         LOG.info("Created backup dir " + unvalidatedBackupDir.getPath() + ".");
@@ -175,6 +145,6 @@ public class BackupModule extends PrivateModule {
 
   @Provides
   BackupConfig provideBackupConfig(File backupDir) {
-    return new BackupConfig(backupDir, params.maxSavedBackups(), params.backupInterval());
+    return new BackupConfig(backupDir, MAX_SAVED_BACKUPS.get(), BACKUP_INTERVAL.get());
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/749f8350/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java b/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
index b4deef0..2b3ee7b 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
@@ -75,25 +75,10 @@ public final class DbModule extends PrivateModule {
   private static final Arg<Amount<Long, Time>> SLOW_QUERY_LOG_THRESHOLD =
       Arg.create(Amount.of(25L, Time.MILLISECONDS));
 
-  interface Params {
-    boolean useBetaDbTaskStore();
-
-    Amount<Long, Time> slowQueryLogThreshold();
-  }
-
-  private static Params paramsFromCommandLine() {
-    return new Params() {
-      @Override
-      public boolean useBetaDbTaskStore() {
-        return USE_DB_TASK_STORE.get();
-      }
-
-      @Override
-      public Amount<Long, Time> slowQueryLogThreshold() {
-        return SLOW_QUERY_LOG_THRESHOLD.get();
-      }
-    };
-  }
+  @CmdLine(name = "db_row_gc_interval",
+      help = "Interval on which to scan the database for unused row references.")
+  private static final Arg<Amount<Long, Time>> DB_ROW_GC_INTERVAL =
+      Arg.create(Amount.of(2L, Time.HOURS));
 
   private static final Set<Class<?>> MAPPER_CLASSES = ImmutableSet.<Class<?>>builder()
       .add(AttributeMapper.class)
@@ -207,7 +192,7 @@ public final class DbModule extends PrivateModule {
   }
 
   private static Module getTaskStoreModule(KeyFactory keyFactory) {
-    return paramsFromCommandLine().useBetaDbTaskStore()
+    return USE_DB_TASK_STORE.get()
         ? new TaskStoreModule(keyFactory)
         : new InMemStoresModule(keyFactory);
   }
@@ -243,8 +228,7 @@ public final class DbModule extends PrivateModule {
 
         addTypeHandlersClasses(TypeHandlers.getAll());
 
-        bind(new TypeLiteral<Amount<Long, Time>>() { })
-            .toInstance(paramsFromCommandLine().slowQueryLogThreshold());
+        bind(new TypeLiteral<Amount<Long, Time>>() { }).toInstance(SLOW_QUERY_LOG_THRESHOLD.get());
 
         // Exposed for unit tests.
         bind(TaskConfigManager.class);
@@ -311,26 +295,6 @@ public final class DbModule extends PrivateModule {
    * Module that sets up a periodic database garbage-collection routine.
    */
   public static class GarbageCollectorModule extends AbstractModule {
-    @CmdLine(name = "db_row_gc_interval",
-        help = "Interval on which to scan the database for unused row references.")
-    private static final Arg<Amount<Long, Time>> DB_ROW_GC_INTERVAL =
-        Arg.create(Amount.of(2L, Time.HOURS));
-
-    interface Params {
-      Amount<Long, Time> dbRowGcInterval();
-    }
-
-    private final Params params;
-
-    public GarbageCollectorModule() {
-      this.params = new Params() {
-        @Override
-        public Amount<Long, Time> dbRowGcInterval() {
-          return DB_ROW_GC_INTERVAL.get();
-        }
-      };
-    }
-
     @Override
     protected void configure() {
       install(new PrivateModule() {
@@ -340,8 +304,8 @@ public final class DbModule extends PrivateModule {
           bind(AbstractScheduledService.Scheduler.class).toInstance(
               AbstractScheduledService.Scheduler.newFixedRateSchedule(
                   0L,
-                  params.dbRowGcInterval().getValue(),
-                  params.dbRowGcInterval().getUnit().getTimeUnit()));
+                  DB_ROW_GC_INTERVAL.get().getValue(),
+                  DB_ROW_GC_INTERVAL.get().getUnit().getTimeUnit()));
           expose(RowGarbageCollector.class);
         }
       });


Mime
View raw message