aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kevi...@apache.org
Subject aurora git commit: Remove all public static com.google.common.base.Functions
Date Thu, 23 Jul 2015 18:00:39 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 96b56b885 -> eee70d638


Remove all public static com.google.common.base.Functions

This change removes all public static Functions and either replaces them
with static methods or inlines them (if they could have been replaced by
method references). The benefit of this change is that these library
functions are now usable as `com.google.common.base.Function`s (in the
case of guava methods), `java.util.function.Function`s (in the case of
the Java 8 standard library), and directly (by callers that were
previously invoking them via `.apply`).

This change was almost entirely IDE-driven, with the exception of the
direct calls (IntelliJ inlines
`Tasks.ASSIGNED_TO_ID.apply(assignedTask)` as `((Function<IAssignedTask,
String) IAssignedTask::getId).apply(assignedTask)` rather than
`assignedTask.getId()`).

Since overloads work now and we generally don't repeat the type in the
method name, some names were shortened (for example
`Tasks.SCHEDULED_TO_INSTANCE_ID` was renamed to
`Tasks#getInstanceId(ScheduledTask)`.

I chose to only include `public static` Functions in this review to
avoid a diff size explosion.

Testing Done:
./gradlew -Pq build

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


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

Branch: refs/heads/master
Commit: eee70d638e7098be11c9b265332b2d254ff5a330
Parents: 96b56b8
Author: Kevin Sweeney <kevints@apache.org>
Authored: Thu Jul 23 11:00:32 2015 -0700
Committer: Kevin Sweeney <kevints@apache.org>
Committed: Thu Jul 23 11:00:32 2015 -0700

----------------------------------------------------------------------
 src/main/java/org/apache/aurora/Protobufs.java  |  11 --
 .../apache/aurora/scheduler/base/JobKeys.java   |  39 +------
 .../aurora/scheduler/base/TaskGroupKey.java     |   2 +-
 .../org/apache/aurora/scheduler/base/Tasks.java | 111 ++++---------------
 .../scheduler/filter/AttributeAggregate.java    |   2 +-
 .../aurora/scheduler/http/Maintenance.java      |   7 +-
 .../scheduler/mesos/MesosTaskFactory.java       |   4 +-
 .../aurora/scheduler/metadata/NearestFit.java   |   2 +-
 .../preemptor/PendingTaskProcessor.java         |   3 +-
 .../scheduler/pruning/TaskHistoryPruner.java    |   4 +-
 .../aurora/scheduler/quota/QuotaManager.java    |  27 +++--
 .../scheduling/RescheduleCalculator.java        |   4 +-
 .../aurora/scheduler/scheduling/TaskGroups.java |   2 +-
 .../scheduler/scheduling/TaskScheduler.java     |   4 +-
 .../aurora/scheduler/sla/MetricCalculator.java  |   8 +-
 .../aurora/scheduler/sla/SlaAlgorithm.java      |   5 +-
 .../apache/aurora/scheduler/sla/SlaGroup.java   |   2 +-
 .../scheduler/state/MaintenanceController.java  |   2 +-
 .../scheduler/state/StateManagerImpl.java       |   6 +-
 .../scheduler/state/TaskStateMachine.java       |   2 +-
 .../aurora/scheduler/stats/ResourceCounter.java |   2 +-
 .../scheduler/storage/AttributeStore.java       |  14 +--
 .../storage/backup/TemporaryStorage.java        |   2 +-
 .../storage/log/WriteAheadStorage.java          |   2 +-
 .../scheduler/storage/mem/MemTaskStore.java     |   8 +-
 .../scheduler/thrift/ReadOnlySchedulerImpl.java |  16 +--
 .../thrift/SchedulerThriftInterface.java        |   8 +-
 .../scheduler/updater/InstanceUpdater.java      |   3 +-
 .../aurora/scheduler/updater/JobDiff.java       |   4 +-
 .../updater/JobUpdateEventSubscriber.java       |   4 +-
 .../pruning/TaskHistoryPrunerTest.java          |   2 +-
 .../scheduling/TaskSchedulerImplTest.java       |   3 +-
 .../scheduler/stats/ResourceCounterTest.java    |  10 +-
 .../storage/AbstractTaskStoreTest.java          |   8 +-
 .../storage/mem/StorageTransactionTest.java     |   2 +-
 .../thrift/ReadOnlySchedulerImplTest.java       |  10 +-
 .../aurora/scheduler/updater/JobUpdaterIT.java  |   4 +-
 37 files changed, 112 insertions(+), 237 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/Protobufs.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/Protobufs.java b/src/main/java/org/apache/aurora/Protobufs.java
index 7f17895..c3aadfa 100644
--- a/src/main/java/org/apache/aurora/Protobufs.java
+++ b/src/main/java/org/apache/aurora/Protobufs.java
@@ -13,7 +13,6 @@
  */
 package org.apache.aurora;
 
-import com.google.common.base.Function;
 import com.google.protobuf.Message;
 import com.google.protobuf.TextFormat;
 
@@ -27,16 +26,6 @@ public final class Protobufs {
   }
 
   /**
-   * Function to call {@link #toString(Message)} on message objects.
-   */
-  public static final Function<Message, String> SHORT_TOSTRING = new Function<Message, String>() {
-    @Override
-    public String apply(Message message) {
-      return Protobufs.toString(message);
-    }
-  };
-
-  /**
    * Alternative to the default protobuf toString implementation, which omits newlines.
    *
    * @param message Message to print.

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/base/JobKeys.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/JobKeys.java b/src/main/java/org/apache/aurora/scheduler/base/JobKeys.java
index 38d2863..0ffec91 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/JobKeys.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/JobKeys.java
@@ -18,8 +18,6 @@ import java.util.Set;
 
 import javax.annotation.Nullable;
 
-import com.google.common.base.Function;
-import com.google.common.base.Functions;
 import com.google.common.base.Optional;
 import com.google.common.base.Splitter;
 import com.google.common.collect.ImmutableSet;
@@ -40,40 +38,9 @@ public final class JobKeys {
     // Utility class.
   }
 
-  public static final Function<IJobConfiguration, IJobKey> FROM_CONFIG =
-      new Function<IJobConfiguration, IJobKey>() {
-        @Override
-        public IJobKey apply(IJobConfiguration job) {
-          return job.getKey();
-        }
-      };
-
-  public static final Function<IJobKey, String> TO_ROLE =
-      new Function<IJobKey, String>() {
-        @Override
-        public String apply(IJobKey jobKey) {
-          return jobKey.getRole();
-        }
-      };
-
-  public static final Function<IJobKey, String> TO_ENVIRONMENT =
-      new Function<IJobKey, String>() {
-        @Override
-        public String apply(IJobKey jobKey) {
-          return jobKey.getEnvironment();
-        }
-      };
-
-  public static final Function<IJobKey, String> TO_JOB_NAME =
-      new Function<IJobKey, String>() {
-        @Override
-        public String apply(IJobKey jobKey) {
-          return jobKey.getName();
-        }
-      };
-
-  public static final Function<IJobConfiguration, String> CONFIG_TO_ROLE =
-      Functions.compose(TO_ROLE, FROM_CONFIG);
+  public static String getRole(IJobConfiguration jobConfiguration) {
+    return jobConfiguration.getKey().getRole();
+  }
 
   /**
    * Check that a jobKey struct is valid.

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/base/TaskGroupKey.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/TaskGroupKey.java b/src/main/java/org/apache/aurora/scheduler/base/TaskGroupKey.java
index 47e4d48..06fc584 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/TaskGroupKey.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/TaskGroupKey.java
@@ -65,6 +65,6 @@ public final class TaskGroupKey {
 
   @Override
   public String toString() {
-    return JobKeys.canonicalString(Tasks.INFO_TO_JOB_KEY.apply(canonicalTask));
+    return JobKeys.canonicalString(canonicalTask.getJob());
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/base/Tasks.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Tasks.java b/src/main/java/org/apache/aurora/scheduler/base/Tasks.java
index 52d37e2..9f625c7 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Tasks.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Tasks.java
@@ -20,9 +20,7 @@ import java.util.Set;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
-import com.google.common.base.Functions;
 import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
@@ -51,80 +49,25 @@ public final class Tasks {
           .addAll(apiConstants.ACTIVE_STATES)
           .build();
 
-  public static final Function<IScheduledTask, IAssignedTask> SCHEDULED_TO_ASSIGNED =
-      new Function<IScheduledTask, IAssignedTask>() {
-        @Override
-        public IAssignedTask apply(IScheduledTask task) {
-          return task.getAssignedTask();
-        }
-      };
-
-  public static final Function<IAssignedTask, ITaskConfig> ASSIGNED_TO_INFO =
-      new Function<IAssignedTask, ITaskConfig>() {
-        @Override
-        public ITaskConfig apply(IAssignedTask task) {
-          return task.getTask();
-        }
-      };
-
-  // TODO(wfarner): Rename to SCHEDULED_TO_CONFIG.
-  public static final Function<IScheduledTask, ITaskConfig> SCHEDULED_TO_INFO =
-      Functions.compose(ASSIGNED_TO_INFO, SCHEDULED_TO_ASSIGNED);
-
-  public static final Function<IAssignedTask, String> ASSIGNED_TO_ID =
-      new Function<IAssignedTask, String>() {
-        @Override
-        public String apply(IAssignedTask task) {
-          return task.getTaskId();
-        }
-      };
-
-  public static final Function<IScheduledTask, String> SCHEDULED_TO_ID =
-      Functions.compose(ASSIGNED_TO_ID, SCHEDULED_TO_ASSIGNED);
-
-  public static final Function<IAssignedTask, Integer> ASSIGNED_TO_INSTANCE_ID =
-      new Function<IAssignedTask, Integer>() {
-        @Override
-        public Integer apply(IAssignedTask task) {
-          return task.getInstanceId();
-        }
-      };
-
-  public static final Function<IScheduledTask, Integer> SCHEDULED_TO_INSTANCE_ID =
-      Functions.compose(ASSIGNED_TO_INSTANCE_ID, SCHEDULED_TO_ASSIGNED);
-
-  public static final Function<ITaskConfig, IJobKey> INFO_TO_JOB_KEY =
-      new Function<ITaskConfig, IJobKey>() {
-        @Override
-        public IJobKey apply(ITaskConfig task) {
-          return task.getJob();
-        }
-      };
-
-  public static final Function<IAssignedTask, IJobKey> ASSIGNED_TO_JOB_KEY =
-      Functions.compose(INFO_TO_JOB_KEY, ASSIGNED_TO_INFO);
+  public static ITaskConfig getConfig(IScheduledTask scheduledTask) {
+    return scheduledTask.getAssignedTask().getTask();
+  }
 
-  public static final Function<IScheduledTask, IJobKey> SCHEDULED_TO_JOB_KEY =
-      Functions.compose(ASSIGNED_TO_JOB_KEY, SCHEDULED_TO_ASSIGNED);
+  public static int getInstanceId(IScheduledTask scheduledTask) {
+    return scheduledTask.getAssignedTask().getInstanceId();
+  }
 
-  public static final Function<IAssignedTask, String> ASSIGNED_TO_SLAVE_HOST =
-      new Function<IAssignedTask, String>() {
-        @Override
-        public String apply(IAssignedTask task) {
-          return task.getSlaveHost();
-        }
-      };
+  public static IJobKey getJob(IAssignedTask assignedTask) {
+    return assignedTask.getTask().getJob();
+  }
 
-  public static final Function<IScheduledTask, String> SCHEDULED_TO_SLAVE_HOST =
-      Functions.compose(ASSIGNED_TO_SLAVE_HOST, SCHEDULED_TO_ASSIGNED);
+  public static IJobKey getJob(IScheduledTask scheduledTask) {
+    return getJob(scheduledTask.getAssignedTask());
+  }
 
-  public static final Function<ITaskEvent, ScheduleStatus> TASK_EVENT_TO_STATUS =
-      new Function<ITaskEvent, ScheduleStatus>() {
-        @Override
-        public ScheduleStatus apply(ITaskEvent input) {
-          return input.getStatus();
-        }
-      };
+  public static String scheduledToSlaveHost(IScheduledTask scheduledTask) {
+    return scheduledTask.getAssignedTask().getSlaveHost();
+  }
 
   /**
    * Different states that an active task may be in.
@@ -144,22 +87,6 @@ public final class Tasks {
   public static final Set<ScheduleStatus> SLAVE_ASSIGNED_STATES =
       EnumSet.copyOf(apiConstants.SLAVE_ASSIGNED_STATES);
 
-  public static final Predicate<ITaskConfig> IS_PRODUCTION =
-      new Predicate<ITaskConfig>() {
-        @Override
-        public boolean apply(ITaskConfig task) {
-          return task.isProduction();
-        }
-      };
-
-  public static final Function<IScheduledTask, ScheduleStatus> GET_STATUS =
-      new Function<IScheduledTask, ScheduleStatus>() {
-        @Override
-        public ScheduleStatus apply(IScheduledTask task) {
-          return task.getStatus();
-        }
-      };
-
   private Tasks() {
     // Utility class.
   }
@@ -171,7 +98,7 @@ public final class Tasks {
    * @return A multi-map of tasks keyed by job key.
    */
   public static Multimap<IJobKey, IScheduledTask> byJobKey(Iterable<IScheduledTask> tasks) {
-    return Multimaps.index(tasks, Tasks.SCHEDULED_TO_JOB_KEY);
+    return Multimaps.index(tasks, Tasks::getJob);
   }
 
   public static boolean isActive(ScheduleStatus status) {
@@ -192,7 +119,7 @@ public final class Tasks {
   }
 
   public static Set<String> ids(Iterable<IScheduledTask> tasks) {
-    return ImmutableSet.copyOf(Iterables.transform(tasks, SCHEDULED_TO_ID));
+    return ImmutableSet.copyOf(Iterables.transform(tasks, Tasks::id));
   }
 
   public static Set<String> ids(IScheduledTask... tasks) {
@@ -200,7 +127,7 @@ public final class Tasks {
   }
 
   public static Map<String, IScheduledTask> mapById(Iterable<IScheduledTask> tasks) {
-    return Maps.uniqueIndex(tasks, SCHEDULED_TO_ID);
+    return Maps.uniqueIndex(tasks, Tasks::id);
   }
 
   /**
@@ -213,7 +140,7 @@ public final class Tasks {
     Preconditions.checkArgument(Iterables.size(tasks) != 0);
 
     return Ordering.explicit(ORDERED_TASK_STATUSES)
-        .onResultOf(GET_STATUS)
+        .onResultOf(IScheduledTask::getStatus)
         .compound(LATEST_ACTIVITY)
         .max(tasks);
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java b/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
index ae7458c..104bd0b 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
@@ -95,7 +95,7 @@ public final class AttributeAggregate {
           @Override
           public Iterable<IAttribute> apply(Iterable<IScheduledTask> tasks) {
             return FluentIterable.from(tasks)
-                .transform(Tasks.SCHEDULED_TO_SLAVE_HOST)
+                .transform(Tasks::scheduledToSlaveHost)
                 .transformAndConcat(getHostAttributes);
           }
         },

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/http/Maintenance.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/Maintenance.java b/src/main/java/org/apache/aurora/scheduler/http/Maintenance.java
index 303f05c..5268759 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/Maintenance.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/Maintenance.java
@@ -32,7 +32,6 @@ import com.google.common.collect.Multimaps;
 import org.apache.aurora.gen.MaintenanceMode;
 import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.Tasks;
-import org.apache.aurora.scheduler.storage.AttributeStore;
 import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.Storage.StoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.Work;
@@ -65,7 +64,7 @@ public class Maintenance {
             Multimaps.transformValues(
               Multimaps.index(
                   storeProvider.getAttributeStore().getHostAttributes(),
-                  AttributeStore.Util.GET_MODE),
+                  IHostAttributes::getMode),
               HOST_NAME);
 
         Map<MaintenanceMode, Object> hosts = Maps.newHashMap();
@@ -81,8 +80,8 @@ public class Maintenance {
     ImmutableSet.Builder<IScheduledTask> drainingTasks = ImmutableSet.builder();
     drainingTasks.addAll(provider.getTaskStore().fetchTasks(Query.slaveScoped(hosts).active()));
     return Multimaps.transformValues(
-        Multimaps.index(drainingTasks.build(), Tasks.SCHEDULED_TO_SLAVE_HOST),
-        Tasks.SCHEDULED_TO_ID);
+        Multimaps.index(drainingTasks.build(), Tasks::scheduledToSlaveHost),
+        Tasks::id);
   }
 
   private static final Function<IHostAttributes, String> HOST_NAME =

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/mesos/MesosTaskFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/MesosTaskFactory.java b/src/main/java/org/apache/aurora/scheduler/mesos/MesosTaskFactory.java
index c91c0ea..4562b3b 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/MesosTaskFactory.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/MesosTaskFactory.java
@@ -141,11 +141,11 @@ public interface MesosTaskFactory {
 
       if (LOG.isLoggable(Level.FINE)) {
         LOG.fine("Setting task resources to "
-            + Iterables.transform(resources, Protobufs.SHORT_TOSTRING));
+            + Iterables.transform(resources, Protobufs::toString));
       }
       TaskInfo.Builder taskBuilder =
           TaskInfo.newBuilder()
-              .setName(JobKeys.canonicalString(Tasks.ASSIGNED_TO_JOB_KEY.apply(task)))
+              .setName(JobKeys.canonicalString(Tasks.getJob(task)))
               .setTaskId(TaskID.newBuilder().setValue(task.getTaskId()))
               .setSlaveId(slaveId)
               .addAllResources(resources)

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java b/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
index 2b194e5..9e44744 100644
--- a/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
+++ b/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
@@ -98,7 +98,7 @@ public class NearestFit implements EventSubscriber {
             return TaskGroupKey.from(task);
           }
         },
-        Tasks.SCHEDULED_TO_INFO)));
+        Tasks::getConfig)));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessor.java b/src/main/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessor.java
index f1b075a..9032c02 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessor.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessor.java
@@ -66,7 +66,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
 import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
-import static org.apache.aurora.scheduler.base.Tasks.SCHEDULED_TO_ASSIGNED;
 
 /**
  * Attempts to find preemption slots for all PENDING tasks eligible for preemption.
@@ -187,7 +186,7 @@ public class PendingTaskProcessor implements Runnable {
     Multiset<TaskGroupKey> taskGroupCounts = HashMultiset.create(
         FluentIterable.from(store.getTaskStore().fetchTasks(Query.statusScoped(PENDING)))
             .filter(Predicates.and(isIdleTask, Predicates.not(hasCachedSlot)))
-            .transform(Functions.compose(ASSIGNED_TO_GROUP_KEY, SCHEDULED_TO_ASSIGNED)));
+            .transform(Functions.compose(ASSIGNED_TO_GROUP_KEY, IScheduledTask::getAssignedTask)));
 
     return getPreemptionSequence(taskGroupCounts);
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/pruning/TaskHistoryPruner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/pruning/TaskHistoryPruner.java b/src/main/java/org/apache/aurora/scheduler/pruning/TaskHistoryPruner.java
index e6e76cd..fa9a09c 100644
--- a/src/main/java/org/apache/aurora/scheduler/pruning/TaskHistoryPruner.java
+++ b/src/main/java/org/apache/aurora/scheduler/pruning/TaskHistoryPruner.java
@@ -115,7 +115,7 @@ public class TaskHistoryPruner implements EventSubscriber {
           ? clock.nowMillis()
           : Iterables.getLast(change.getTask().getTaskEvents()).getTimestamp();
       registerInactiveTask(
-          Tasks.SCHEDULED_TO_JOB_KEY.apply(change.getTask()),
+          Tasks.getJob(change.getTask()),
           change.getTaskId(),
           calculateTimeout(timeoutBasis));
     }
@@ -165,7 +165,7 @@ public class TaskHistoryPruner implements EventSubscriber {
               .from(Tasks.LATEST_ACTIVITY.sortedCopy(inactiveTasks))
               .filter(safeToDelete)
               .limit(tasksToPrune)
-              .transform(Tasks.SCHEDULED_TO_ID)
+              .transform(Tasks::id)
               .toSet();
           deleteTasks(toPrune);
         }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java b/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
index 61b8e57..7f5e45b 100644
--- a/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java
@@ -35,6 +35,7 @@ import org.apache.aurora.gen.ResourceAggregate;
 import org.apache.aurora.scheduler.base.JobKeys;
 import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.ResourceAggregates;
+import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.storage.JobUpdateStore;
 import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.StoreProvider;
@@ -48,17 +49,13 @@ import org.apache.aurora.scheduler.storage.entities.IJobUpdateQuery;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateSummary;
 import org.apache.aurora.scheduler.storage.entities.IRange;
 import org.apache.aurora.scheduler.storage.entities.IResourceAggregate;
+import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.apache.aurora.scheduler.updater.Updates;
 
 import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.scheduler.base.ResourceAggregates.EMPTY;
-import static org.apache.aurora.scheduler.base.Tasks.ASSIGNED_TO_INFO;
-import static org.apache.aurora.scheduler.base.Tasks.ASSIGNED_TO_JOB_KEY;
-import static org.apache.aurora.scheduler.base.Tasks.INFO_TO_JOB_KEY;
-import static org.apache.aurora.scheduler.base.Tasks.IS_PRODUCTION;
-import static org.apache.aurora.scheduler.base.Tasks.SCHEDULED_TO_ASSIGNED;
 import static org.apache.aurora.scheduler.quota.QuotaCheckResult.Result.SUFFICIENT_QUOTA;
 import static org.apache.aurora.scheduler.updater.Updates.getInstanceIds;
 
@@ -249,7 +246,7 @@ public interface QuotaManager {
 
       FluentIterable<IAssignedTask> tasks = FluentIterable
           .from(storeProvider.getTaskStore().fetchTasks(Query.roleScoped(role).active()))
-          .transform(SCHEDULED_TO_ASSIGNED);
+          .transform(IScheduledTask::getAssignedTask);
 
       Map<IJobKey, IJobUpdateInstructions> updates = Maps.newHashMap(
           fetchActiveJobUpdates(storeProvider.getJobUpdateStore(), role));
@@ -265,8 +262,8 @@ public interface QuotaManager {
 
       Map<IJobKey, IJobConfiguration> cronTemplates =
           FluentIterable.from(storeProvider.getCronJobStore().fetchJobs())
-              .filter(Predicates.compose(Predicates.equalTo(role), JobKeys.CONFIG_TO_ROLE))
-              .uniqueIndex(JobKeys.FROM_CONFIG);
+              .filter(Predicates.compose(Predicates.equalTo(role), JobKeys::getRole))
+              .uniqueIndex(IJobConfiguration::getKey);
 
       IResourceAggregate prodConsumed = getConsumption(tasks, updates, cronTemplates, true);
 
@@ -284,14 +281,16 @@ public interface QuotaManager {
         Map<IJobKey, IJobConfiguration> cronTemplatesByKey,
         boolean isProd) {
 
-      Predicate<ITaskConfig> prodFilter = isProd ? IS_PRODUCTION : Predicates.not(IS_PRODUCTION);
+      Predicate<ITaskConfig> prodFilter = isProd
+          ? ITaskConfig::isProduction
+          : Predicates.not(ITaskConfig::isProduction);
 
       FluentIterable<IAssignedTask> filteredTasks =
-          tasks.filter(Predicates.compose(prodFilter, ASSIGNED_TO_INFO));
+          tasks.filter(Predicates.compose(prodFilter, IAssignedTask::getTask));
 
       Predicate<IAssignedTask> excludeCron = Predicates.compose(
           Predicates.not(Predicates.in(cronTemplatesByKey.keySet())),
-          ASSIGNED_TO_JOB_KEY);
+          Tasks::getJob);
 
       IResourceAggregate nonCronConsumption = getNonCronConsumption(
           updatesByKey,
@@ -302,7 +301,7 @@ public interface QuotaManager {
           Iterables.filter(
               cronTemplatesByKey.values(),
               Predicates.compose(prodFilter, IJobConfiguration::getTaskConfig)),
-          filteredTasks.transform(ASSIGNED_TO_INFO));
+          filteredTasks.transform(IAssignedTask::getTask));
 
       return add(nonCronConsumption, cronConsumption);
     }
@@ -325,7 +324,7 @@ public interface QuotaManager {
 
       IResourceAggregate nonUpdateConsumption = fromTasks(tasks
           .filter(buildNonUpdatingTasksFilter(updatesByKey))
-          .transform(ASSIGNED_TO_INFO));
+          .transform(IAssignedTask::getTask));
 
       final Predicate<IInstanceTaskConfig> instanceFilter =
           Predicates.compose(configFilter, IInstanceTaskConfig::getTask);
@@ -348,7 +347,7 @@ public interface QuotaManager {
       // cron scheduling, it's the simplest approach possible given the system constraints (e.g.:
       // lack of enforcement on a cron job run duration).
 
-      final Multimap<IJobKey, ITaskConfig> taskConfigsByKey = tasks.index(INFO_TO_JOB_KEY);
+      final Multimap<IJobKey, ITaskConfig> taskConfigsByKey = tasks.index(ITaskConfig::getJob);
       return addAll(Iterables.transform(
           cronTemplates,
           new Function<IJobConfiguration, IResourceAggregate>() {

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/scheduling/RescheduleCalculator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/scheduling/RescheduleCalculator.java b/src/main/java/org/apache/aurora/scheduler/scheduling/RescheduleCalculator.java
index bfc23cd..968a926 100644
--- a/src/main/java/org/apache/aurora/scheduler/scheduling/RescheduleCalculator.java
+++ b/src/main/java/org/apache/aurora/scheduler/scheduling/RescheduleCalculator.java
@@ -93,7 +93,7 @@ public interface RescheduleCalculator {
 
         // Avoid penalizing tasks that were interrupted by outside action, such as a user
         // restarting them.
-        if (Iterables.any(Iterables.transform(events, Tasks.TASK_EVENT_TO_STATUS),
+        if (Iterables.any(Iterables.transform(events, ITaskEvent::getStatus),
             Predicates.in(INTERRUPTED_TASK_STATES))) {
           return false;
         }
@@ -104,7 +104,7 @@ public interface RescheduleCalculator {
 
         ITaskEvent activeEvent = Iterables.find(
             events,
-            Predicates.compose(IS_ACTIVE_STATUS, Tasks.TASK_EVENT_TO_STATUS));
+            Predicates.compose(IS_ACTIVE_STATUS, ITaskEvent::getStatus));
 
         long thresholdMs = settings.flappingTaskThreashold.as(Time.MILLISECONDS);
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/scheduling/TaskGroups.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/scheduling/TaskGroups.java b/src/main/java/org/apache/aurora/scheduler/scheduling/TaskGroups.java
index 3f262bf..e60daad 100644
--- a/src/main/java/org/apache/aurora/scheduler/scheduling/TaskGroups.java
+++ b/src/main/java/org/apache/aurora/scheduler/scheduling/TaskGroups.java
@@ -224,7 +224,7 @@ public class TaskGroups implements EventSubscriber {
   @Subscribe
   public synchronized void tasksDeleted(TasksDeleted deleted) {
     for (IAssignedTask task
-        : Iterables.transform(deleted.getTasks(), Tasks.SCHEDULED_TO_ASSIGNED)) {
+        : Iterables.transform(deleted.getTasks(), IScheduledTask::getAssignedTask)) {
       TaskGroup group = groups.get(TaskGroupKey.from(task.getTask()));
       if (group != null) {
         group.remove(task.getTaskId());

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/scheduling/TaskScheduler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/scheduling/TaskScheduler.java b/src/main/java/org/apache/aurora/scheduler/scheduling/TaskScheduler.java
index 04e5063..d4bd529 100644
--- a/src/main/java/org/apache/aurora/scheduler/scheduling/TaskScheduler.java
+++ b/src/main/java/org/apache/aurora/scheduler/scheduling/TaskScheduler.java
@@ -33,7 +33,6 @@ import com.twitter.common.stats.Stats;
 import org.apache.aurora.scheduler.HostOffer;
 import org.apache.aurora.scheduler.base.Query;
 import org.apache.aurora.scheduler.base.TaskGroupKey;
-import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
 import org.apache.aurora.scheduler.events.PubsubEvent.TaskStateChange;
 import org.apache.aurora.scheduler.filter.AttributeAggregate;
@@ -48,6 +47,7 @@ import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.MutateWork;
 import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
+import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 
 import static java.lang.annotation.ElementType.FIELD;
@@ -178,7 +178,7 @@ public interface TaskScheduler extends EventSubscriber {
       IAssignedTask assignedTask = Iterables.getOnlyElement(
           Iterables.transform(
               store.getTaskStore().fetchTasks(Query.taskScoped(taskId).byStatus(PENDING)),
-              Tasks.SCHEDULED_TO_ASSIGNED),
+              IScheduledTask::getAssignedTask),
           null);
 
       if (assignedTask == null) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/sla/MetricCalculator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/sla/MetricCalculator.java b/src/main/java/org/apache/aurora/scheduler/sla/MetricCalculator.java
index 7dca574..a47da09 100644
--- a/src/main/java/org/apache/aurora/scheduler/sla/MetricCalculator.java
+++ b/src/main/java/org/apache/aurora/scheduler/sla/MetricCalculator.java
@@ -186,12 +186,12 @@ class MetricCalculator implements Runnable {
         FluentIterable.from(Storage.Util.fetchTasks(storage, Query.unscoped()));
 
     List<IScheduledTask> prodTasks = tasks.filter(Predicates.compose(
-        Predicates.and(Tasks.IS_PRODUCTION, IS_SERVICE),
-        Tasks.SCHEDULED_TO_INFO)).toList();
+        Predicates.and(ITaskConfig::isProduction, IS_SERVICE),
+        Tasks::getConfig)).toList();
 
     List<IScheduledTask> nonProdTasks = tasks.filter(Predicates.compose(
-        Predicates.and(Predicates.not(Tasks.IS_PRODUCTION), IS_SERVICE),
-        Tasks.SCHEDULED_TO_INFO)).toList();
+        Predicates.and(Predicates.not(ITaskConfig::isProduction), IS_SERVICE),
+        Tasks::getConfig)).toList();
 
     long nowMs = clock.nowMillis();
     Range<Long> timeRange = Range.closedOpen(nowMs - settings.refreshRateMs, nowMs);

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/sla/SlaAlgorithm.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/sla/SlaAlgorithm.java b/src/main/java/org/apache/aurora/scheduler/sla/SlaAlgorithm.java
index 42967df..fe7ff37 100644
--- a/src/main/java/org/apache/aurora/scheduler/sla/SlaAlgorithm.java
+++ b/src/main/java/org/apache/aurora/scheduler/sla/SlaAlgorithm.java
@@ -118,7 +118,8 @@ interface SlaAlgorithm {
     @Override
     public Number calculate(Iterable<IScheduledTask> tasks, Range<Long> timeFrame) {
       Iterable<IScheduledTask> activeTasks = FluentIterable.from(tasks)
-          .filter(Predicates.compose(Predicates.in(Tasks.ACTIVE_STATES), Tasks.GET_STATUS));
+          .filter(
+              Predicates.compose(Predicates.in(Tasks.ACTIVE_STATES), IScheduledTask::getStatus));
 
       List<Long> waitTimes = Lists.newLinkedList();
       for (IScheduledTask task : activeTasks) {
@@ -156,7 +157,7 @@ interface SlaAlgorithm {
     private static final Predicate<IScheduledTask> IS_RUNNING =
         Predicates.compose(
             Predicates.in(ImmutableSet.of(RUNNING)),
-            Tasks.GET_STATUS);
+            IScheduledTask::getStatus);
 
     private static final Function<IScheduledTask, ITaskEvent> TASK_TO_EVENT =
         new Function<IScheduledTask, ITaskEvent>() {

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/sla/SlaGroup.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/sla/SlaGroup.java b/src/main/java/org/apache/aurora/scheduler/sla/SlaGroup.java
index a1d6c9d..d9a3c48 100644
--- a/src/main/java/org/apache/aurora/scheduler/sla/SlaGroup.java
+++ b/src/main/java/org/apache/aurora/scheduler/sla/SlaGroup.java
@@ -119,7 +119,7 @@ interface SlaGroup {
         public String apply(IJobKey jobKey) {
           return "sla_" + JobKeys.canonicalString(jobKey) + "_";
         }
-      }, Tasks.SCHEDULED_TO_JOB_KEY));
+      }, Tasks::getJob));
     }
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java b/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
index 441f828..617ee54 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/MaintenanceController.java
@@ -120,7 +120,7 @@ public interface MaintenanceController {
         // If there are no tasks on the host, immediately transition to DRAINED.
         Query.Builder query = Query.slaveScoped(host).active();
         Set<String> activeTasks = FluentIterable.from(store.getTaskStore().fetchTasks(query))
-            .transform(Tasks.SCHEDULED_TO_ID)
+            .transform(Tasks::id)
             .toSet();
         if (activeTasks.isEmpty()) {
           LOG.info("No tasks to drain for host: " + host);

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java b/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
index 08844d0..4f41cc9 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
@@ -132,7 +132,7 @@ public class StateManagerImpl implements StateManager {
         Query.jobScoped(task.getJob()).active());
 
     Set<Integer> existingInstanceIds =
-        FluentIterable.from(existingTasks).transform(Tasks.SCHEDULED_TO_INSTANCE_ID).toSet();
+        FluentIterable.from(existingTasks).transform(Tasks::getInstanceId).toSet();
 
     if (!Sets.intersection(existingInstanceIds, instanceIds).isEmpty()) {
       throw new IllegalArgumentException("Instance ID collision detected.");
@@ -208,7 +208,7 @@ public class StateManagerImpl implements StateManager {
     return Iterables.getOnlyElement(
         Iterables.transform(
             storeProvider.getTaskStore().fetchTasks(query),
-            Tasks.SCHEDULED_TO_ASSIGNED));
+            IScheduledTask::getAssignedTask));
   }
 
   @VisibleForTesting
@@ -408,7 +408,7 @@ public class StateManagerImpl implements StateManager {
   public void deleteTasks(MutableStoreProvider storeProvider, final Set<String> taskIds) {
     Map<String, IScheduledTask> tasks = Maps.uniqueIndex(
         storeProvider.getTaskStore().fetchTasks(Query.taskScoped(taskIds)),
-        Tasks.SCHEDULED_TO_ID);
+        Tasks::id);
 
     for (Map.Entry<String, IScheduledTask> entry : tasks.entrySet()) {
       updateTaskAndExternalState(

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java b/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
index 4f453e4..d2fbbf0 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
@@ -99,7 +99,7 @@ class TaskStateMachine {
       };
 
   private static final Function<IScheduledTask, TaskState> SCHEDULED_TO_TASK_STATE =
-      Functions.compose(STATUS_TO_TASK_STATE, Tasks.GET_STATUS);
+      Functions.compose(STATUS_TO_TASK_STATE, IScheduledTask::getStatus);
 
   /**
    * ScheduleStatus enum extension to account for cases where no direct state mapping exists.

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/stats/ResourceCounter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/stats/ResourceCounter.java b/src/main/java/org/apache/aurora/scheduler/stats/ResourceCounter.java
index ca0c0b5..6dbc5d6 100644
--- a/src/main/java/org/apache/aurora/scheduler/stats/ResourceCounter.java
+++ b/src/main/java/org/apache/aurora/scheduler/stats/ResourceCounter.java
@@ -54,7 +54,7 @@ public class ResourceCounter {
   private Iterable<ITaskConfig> getTasks(Query.Builder query) throws StorageException {
     return Iterables.transform(
         Storage.Util.fetchTasks(storage, query),
-        Tasks.SCHEDULED_TO_INFO);
+        Tasks::getConfig);
   }
 
   private static final Function<MetricType, GlobalMetric> TO_GLOBAL_METRIC =

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/storage/AttributeStore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/AttributeStore.java b/src/main/java/org/apache/aurora/scheduler/storage/AttributeStore.java
index 36bdc81..981bdcf 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/AttributeStore.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/AttributeStore.java
@@ -15,7 +15,6 @@ package org.apache.aurora.scheduler.storage;
 
 import java.util.Set;
 
-import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 
@@ -114,14 +113,6 @@ public interface AttributeStore {
       }
     }
 
-    public static final Function<IHostAttributes, MaintenanceMode> GET_MODE =
-        new Function<IHostAttributes, MaintenanceMode>() {
-          @Override
-          public MaintenanceMode apply(IHostAttributes attrs) {
-            return attrs.getMode();
-          }
-        };
-
     /**
      * Merges the attributes from an offer, applying the default maintenance mode.
      *
@@ -131,8 +122,9 @@ public interface AttributeStore {
      */
     public static IHostAttributes mergeOffer(AttributeStore store, Protos.Offer offer) {
       IHostAttributes fromOffer = Conversions.getAttributes(offer);
-      MaintenanceMode mode =
-          store.getHostAttributes(fromOffer.getHost()).transform(GET_MODE).or(MaintenanceMode.NONE);
+      MaintenanceMode mode = store.getHostAttributes(fromOffer.getHost())
+          .transform(IHostAttributes::getMode)
+          .or(MaintenanceMode.NONE);
       return IHostAttributes.build(fromOffer.newBuilder().setMode(mode));
     }
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
index fc7c792..221a2f0 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java
@@ -79,7 +79,7 @@ interface TemporaryStorage {
             @Override
             public void execute(MutableStoreProvider storeProvider) {
               Set<String> ids = FluentIterable.from(storeProvider.getTaskStore().fetchTasks(query))
-                  .transform(Tasks.SCHEDULED_TO_ID)
+                  .transform(Tasks::id)
                   .toSet();
               storeProvider.getUnsafeTaskStore().deleteTasks(ids);
             }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
index 0b55304..89dd8aa 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/WriteAheadStorage.java
@@ -197,7 +197,7 @@ class WriteAheadStorage extends ForwardingStore implements
     Map<String, IScheduledTask> tasksById = Tasks.mapById(mutated);
     if (log.isLoggable(Level.FINE)) {
       log.fine("Storing updated tasks to log: "
-          + Maps.transformValues(tasksById, Tasks.GET_STATUS));
+          + Maps.transformValues(tasksById, IScheduledTask::getStatus));
     }
 
     // TODO(William Farner): Avoid writing an op when mutated is empty.

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java b/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
index 42c1119..e766ede 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
@@ -111,12 +111,12 @@ class MemTaskStore implements TaskStore.Mutable {
   MemTaskStore(StatsProvider statsProvider) {
     secondaryIndices = ImmutableList.of(
         new SecondaryIndex<>(
-            Tasks.SCHEDULED_TO_JOB_KEY,
+            Tasks::getJob,
             QUERY_TO_JOB_KEY,
             statsProvider,
             "job"),
         new SecondaryIndex<>(
-            Tasks.SCHEDULED_TO_SLAVE_HOST,
+            Tasks::scheduledToSlaveHost,
             QUERY_TO_SLAVE_HOST,
             statsProvider,
             "host"));
@@ -145,7 +145,7 @@ class MemTaskStore implements TaskStore.Mutable {
   @Override
   public Set<IJobKey> getJobKeys() {
     return FluentIterable.from(fetchTasks(Query.unscoped()))
-        .transform(Tasks.SCHEDULED_TO_JOB_KEY)
+        .transform(Tasks::getJob)
         .toSet();
   }
 
@@ -299,7 +299,7 @@ class MemTaskStore implements TaskStore.Mutable {
       };
 
   private static final Function<Task, String> TO_ID =
-      Functions.compose(Tasks.SCHEDULED_TO_ID, TO_SCHEDULED);
+      Functions.compose(Tasks::id, TO_SCHEDULED);
 
   private static class Task {
     private final IScheduledTask storedTask;

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java b/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
index 92c970c..92cf86f 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
@@ -211,10 +211,10 @@ class ReadOnlySchedulerImpl implements ReadOnlyScheduler.Iface {
 
     Iterable<IAssignedTask> assignedTasks = Iterables.transform(
         Storage.Util.fetchTasks(storage, Query.jobScoped(jobKey).active()),
-        Tasks.SCHEDULED_TO_ASSIGNED);
+        IScheduledTask::getAssignedTask);
     Map<Integer, ITaskConfig> tasksByInstance = Maps.transformValues(
-        Maps.uniqueIndex(assignedTasks, Tasks.ASSIGNED_TO_INSTANCE_ID),
-        Tasks.ASSIGNED_TO_INFO);
+        Maps.uniqueIndex(assignedTasks, IAssignedTask::getInstanceId),
+        IAssignedTask::getTask);
     Multimap<ITaskConfig, Integer> instancesByDetails = Multimaps.invertFrom(
         Multimaps.forMap(tasksByInstance),
         HashMultimap.create());
@@ -230,13 +230,13 @@ class ReadOnlySchedulerImpl implements ReadOnlyScheduler.Iface {
     Multimap<String, IJobKey> jobsByRole = storage.read(new Quiet<Multimap<String, IJobKey>>() {
       @Override
       public Multimap<String, IJobKey> apply(StoreProvider storeProvider) {
-        return Multimaps.index(storeProvider.getTaskStore().getJobKeys(), JobKeys.TO_ROLE);
+        return Multimaps.index(storeProvider.getTaskStore().getJobKeys(), IJobKey::getRole);
       }
     });
 
     Multimap<String, IJobKey> cronJobsByRole = Multimaps.index(
-        Iterables.transform(Storage.Util.fetchCronJobs(storage), JobKeys.FROM_CONFIG),
-        JobKeys.TO_ROLE);
+        Iterables.transform(Storage.Util.fetchCronJobs(storage), IJobConfiguration::getKey),
+        IJobKey::getRole);
 
     Set<RoleSummary> summaries = FluentIterable.from(
         Sets.union(jobsByRole.keySet(), cronJobsByRole.keySet()))
@@ -399,11 +399,11 @@ class ReadOnlySchedulerImpl implements ReadOnlyScheduler.Iface {
     // template JobConfiguration for a cron job will overwrite the synthesized one that could have
     // been created above.
     Predicate<IJobConfiguration> configFilter = ownerRole.isPresent()
-        ? Predicates.compose(Predicates.equalTo(ownerRole.get()), JobKeys.CONFIG_TO_ROLE)
+        ? Predicates.compose(Predicates.equalTo(ownerRole.get()), JobKeys::getRole)
         : Predicates.alwaysTrue();
     jobs.putAll(Maps.uniqueIndex(
         FluentIterable.from(Storage.Util.fetchCronJobs(storage)).filter(configFilter),
-        JobKeys.FROM_CONFIG));
+        IJobConfiguration::getKey));
 
     return jobs;
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
index 062cce0..75929ae 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -186,7 +186,7 @@ class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
 
   private static final Function<IScheduledTask, String> GET_ROLE = Functions.compose(
       task -> task.getJob().getRole(),
-      Tasks.SCHEDULED_TO_INFO);
+      Tasks::getConfig);
 
   private final NonVolatileStorage storage;
   private final LockManager lockManager;
@@ -477,7 +477,7 @@ class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
       throws LockException {
 
     ImmutableSet<IJobKey> uniqueKeys = FluentIterable.from(tasks)
-        .transform(Tasks.SCHEDULED_TO_JOB_KEY)
+        .transform(Tasks::getJob)
         .toSet();
 
     // Validate lock against every unique job key derived from the tasks.
@@ -500,7 +500,7 @@ class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
     // role-scoped query.
     ImmutableSet.Builder<String> targetRoles = ImmutableSet.builder();
     Set<IJobKey> keys = JobKeys.from(taskQuery).or(ImmutableSet.of());
-    targetRoles.addAll(FluentIterable.from(keys).transform(JobKeys.TO_ROLE));
+    targetRoles.addAll(FluentIterable.from(keys).transform(IJobKey::getRole));
 
     if (taskQuery.get().isSetRole()) {
       targetRoles.add(taskQuery.get().getRole());
@@ -867,7 +867,7 @@ class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
             .active());
     Optional<IAssignedTask> task =
         Optional.fromNullable(Iterables.getOnlyElement(tasks, null))
-            .transform(Tasks.SCHEDULED_TO_ASSIGNED);
+            .transform(IScheduledTask::getAssignedTask);
 
     if (task.isPresent()) {
       if (task.get().getTask().newBuilder().equals(instanceRewrite.getOldTask())) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java b/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
index 722dba4..b4b109e 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
@@ -27,6 +27,7 @@ import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
+import org.apache.aurora.scheduler.storage.entities.ITaskEvent;
 
 import static java.util.Objects.requireNonNull;
 
@@ -75,7 +76,7 @@ class InstanceUpdater implements StateEvaluator<Optional<IScheduledTask>> {
     boolean wasKilling =
         Iterables.any(
             task.getTaskEvents(),
-            Predicates.compose(Predicates.equalTo(KILLING), Tasks.TASK_EVENT_TO_STATUS));
+            Predicates.compose(Predicates.equalTo(KILLING), ITaskEvent::getStatus));
     return task.getStatus() != KILLING && wasKilling;
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java b/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
index ab540a5..0a1a292 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
@@ -181,8 +181,8 @@ public final class JobDiff {
         Maps.transformValues(
             Maps.uniqueIndex(
                 taskStore.fetchTasks(Query.jobScoped(job).active()),
-                Tasks.SCHEDULED_TO_INSTANCE_ID),
-            Tasks.SCHEDULED_TO_INFO));
+                Tasks::getInstanceId),
+            Tasks::getConfig));
 
     JobDiff diff = computeUnscoped(currentState, job, proposedState);
     if (scope.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateEventSubscriber.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateEventSubscriber.java b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateEventSubscriber.java
index 134cd54..a76b4c1 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateEventSubscriber.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/JobUpdateEventSubscriber.java
@@ -67,9 +67,7 @@ class JobUpdateEventSubscriber extends AbstractIdleService implements PubsubEven
       try {
         if (!Tasks.isTerminated(task.getStatus())) {
           controller.instanceDeleted(
-              InstanceKeys.from(
-                  Tasks.SCHEDULED_TO_JOB_KEY.apply(task),
-                  task.getAssignedTask().getInstanceId()));
+              InstanceKeys.from(Tasks.getJob(task), task.getAssignedTask().getInstanceId()));
         }
       } catch (RuntimeException e) {
         LOG.log(Level.SEVERE, "Failed to handle instance deletion: " + e, e);

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/test/java/org/apache/aurora/scheduler/pruning/TaskHistoryPrunerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/pruning/TaskHistoryPrunerTest.java b/src/test/java/org/apache/aurora/scheduler/pruning/TaskHistoryPrunerTest.java
index 461c4d0..532b0ea 100644
--- a/src/test/java/org/apache/aurora/scheduler/pruning/TaskHistoryPrunerTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/pruning/TaskHistoryPrunerTest.java
@@ -339,7 +339,7 @@ public class TaskHistoryPrunerTest extends EasyMockTest {
     );
 
     IJobKey jobKey = Iterables.getOnlyElement(
-        FluentIterable.from(tasksInJob).transform(Tasks.SCHEDULED_TO_JOB_KEY).toSet());
+        FluentIterable.from(tasksInJob).transform(Tasks::getJob).toSet());
     storageUtil.expectTaskFetch(TaskHistoryPruner.jobHistoryQuery(jobKey), tasksInJob);
     if (pruned.length > 0) {
       stateManager.deleteTasks(storageUtil.mutableStoreProvider, Tasks.ids(pruned));

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/test/java/org/apache/aurora/scheduler/scheduling/TaskSchedulerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/scheduling/TaskSchedulerImplTest.java b/src/test/java/org/apache/aurora/scheduler/scheduling/TaskSchedulerImplTest.java
index b964f81..a2e2d4c 100644
--- a/src/test/java/org/apache/aurora/scheduler/scheduling/TaskSchedulerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/scheduling/TaskSchedulerImplTest.java
@@ -52,6 +52,7 @@ import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 import org.apache.aurora.scheduler.storage.Storage.MutateWork;
 import org.apache.aurora.scheduler.storage.db.DbUtil;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
+import org.apache.aurora.scheduler.storage.entities.IJobKey;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.testing.StorageTestUtil;
 import org.apache.aurora.scheduler.testing.FakeStatsProvider;
@@ -317,7 +318,7 @@ public class TaskSchedulerImplTest extends EasyMockTest {
 
   private void expectActiveJobFetch(IScheduledTask task) {
     storageUtil.expectTaskFetch(
-        Query.jobScoped(Tasks.SCHEDULED_TO_JOB_KEY.apply(task))
+        Query.jobScoped(((Function<IScheduledTask, IJobKey>) Tasks::getJob).apply(task))
             .byStatus(Tasks.SLAVE_ASSIGNED_STATES),
         ImmutableSet.of());
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/test/java/org/apache/aurora/scheduler/stats/ResourceCounterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/stats/ResourceCounterTest.java b/src/test/java/org/apache/aurora/scheduler/stats/ResourceCounterTest.java
index a9c6d1d..f2facfa 100644
--- a/src/test/java/org/apache/aurora/scheduler/stats/ResourceCounterTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/stats/ResourceCounterTest.java
@@ -37,6 +37,7 @@ import org.apache.aurora.scheduler.storage.db.DbUtil;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
 import org.apache.aurora.scheduler.storage.entities.IResourceAggregate;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
+import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -47,8 +48,6 @@ import static org.apache.aurora.gen.ScheduleStatus.KILLING;
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
 import static org.apache.aurora.gen.ScheduleStatus.RESTARTING;
 import static org.apache.aurora.gen.ScheduleStatus.RUNNING;
-import static org.apache.aurora.scheduler.base.Tasks.INFO_TO_JOB_KEY;
-import static org.apache.aurora.scheduler.base.Tasks.IS_PRODUCTION;
 import static org.apache.aurora.scheduler.stats.ResourceCounter.GlobalMetric;
 import static org.apache.aurora.scheduler.stats.ResourceCounter.Metric;
 import static org.apache.aurora.scheduler.stats.ResourceCounter.MetricType.DEDICATED_CONSUMED;
@@ -84,7 +83,7 @@ public class ResourceCounterTest {
     Map<IJobKey, Metric> aggregates = resourceCounter.computeAggregates(
         Query.unscoped(),
         Predicates.alwaysTrue(),
-        INFO_TO_JOB_KEY);
+        ITaskConfig::getJob);
     assertEquals(ImmutableMap.of(), aggregates);
 
     for (Metric metric : resourceCounter.computeConsumptionTotals()) {
@@ -149,7 +148,10 @@ public class ResourceCounterTest {
             JobKeys.from("bob", "test", "jobA"), new Metric(1, 1 * GB, 1 * GB),
             JobKeys.from("bob", "test", "jobB"), new Metric(2, 2 * GB, 2 * GB)
         ),
-        resourceCounter.computeAggregates(Query.roleScoped("bob"), IS_PRODUCTION, INFO_TO_JOB_KEY)
+        resourceCounter.computeAggregates(
+            Query.roleScoped("bob"),
+            ITaskConfig::isProduction,
+            ITaskConfig::getJob)
     );
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java b/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
index 55ebcb8..9739f27 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
@@ -411,17 +411,17 @@ public abstract class AbstractTaskStoreTest extends TearDownTestCase {
     Set<IScheduledTask> inserted = ImmutableSet.of(a, b, c);
 
     Set<ITaskConfig> storedConfigs = FluentIterable.from(fetchTasks(Query.unscoped()))
-        .transform(Tasks.SCHEDULED_TO_INFO)
+        .transform(Tasks::getConfig)
         .toSet();
     assertEquals(
-        FluentIterable.from(inserted).transform(Tasks.SCHEDULED_TO_INFO).toSet(),
+        FluentIterable.from(inserted).transform(Tasks::getConfig).toSet(),
         storedConfigs);
     Map<ITaskConfig, ITaskConfig> identityMap = Maps.newIdentityHashMap();
     for (ITaskConfig stored : storedConfigs) {
       identityMap.put(stored, stored);
     }
     assertEquals(
-        ImmutableMap.of(Tasks.SCHEDULED_TO_INFO.apply(a), Tasks.SCHEDULED_TO_INFO.apply(a)),
+        ImmutableMap.of(Tasks.getConfig(a), Tasks.getConfig(a)),
         identityMap);
   }
 
@@ -537,7 +537,7 @@ public abstract class AbstractTaskStoreTest extends TearDownTestCase {
 
   private Set<IJobKey> toJobKeys(IScheduledTask... tasks) {
     return FluentIterable.from(ImmutableSet.copyOf(tasks))
-        .transform(Tasks.SCHEDULED_TO_JOB_KEY)
+        .transform(Tasks::getJob)
         .toSet();
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java b/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
index 791ec14..3e963f1 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
@@ -130,7 +130,7 @@ public class StorageTransactionTest extends TearDownTestCase {
       public Void apply(StoreProvider storeProvider) {
         Query.Builder query = Query.unscoped();
         Set<String> ids = FluentIterable.from(storeProvider.getTaskStore().fetchTasks(query))
-            .transform(Tasks.SCHEDULED_TO_ID)
+            .transform(Tasks::id)
             .toSet();
         assertEquals(ImmutableSet.<String>builder().add(taskIds).build(), ids);
         return null;

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java b/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
index ddabb4c..6df8d8d 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
@@ -132,9 +132,9 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
     long nextCronRunMs = 100;
     TaskConfig ownedCronJobTask = nonProductionTask()
         .setJob(JOB_KEY.newBuilder())
-        .setJobName(JobKeys.TO_JOB_NAME.apply(JOB_KEY))
+        .setJobName(JOB_KEY.getName())
         .setOwner(ROLE_IDENTITY)
-        .setEnvironment(JobKeys.TO_ENVIRONMENT.apply(JOB_KEY));
+        .setEnvironment(JOB_KEY.getEnvironment());
     JobConfiguration ownedCronJob = makeJob()
         .setCronSchedule(CRON_SCHEDULE)
         .setTaskConfig(ownedCronJobTask);
@@ -374,9 +374,9 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
   @Test
   public void testGetJobs() throws Exception {
     TaskConfig ownedCronJobTask = nonProductionTask()
-        .setJobName(JobKeys.TO_JOB_NAME.apply(JOB_KEY))
+        .setJobName(JOB_KEY.getName())
         .setOwner(ROLE_IDENTITY)
-        .setEnvironment(JobKeys.TO_ENVIRONMENT.apply(JOB_KEY));
+        .setEnvironment(JOB_KEY.getEnvironment());
     JobConfiguration ownedCronJob = makeJob()
         .setCronSchedule(CRON_SCHEDULE)
         .setTaskConfig(ownedCronJobTask);
@@ -638,7 +638,7 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
 
     expect(storageUtil.taskStore.getJobKeys()).andReturn(
         FluentIterable.from(ImmutableSet.of(task1, task2, task3, task4))
-            .transform(Tasks.SCHEDULED_TO_JOB_KEY)
+            .transform(Tasks::getJob)
             .toSet());
     expect(storageUtil.jobStore.fetchJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/eee70d63/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java b/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
index 0d0ee94..5f6303a 100644
--- a/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/updater/JobUpdaterIT.java
@@ -327,10 +327,10 @@ public class JobUpdaterIT extends EasyMockTest {
         Storage.Util.fetchTasks(storage, Query.jobScoped(job).active());
 
     Map<Integer, IScheduledTask> tasksByInstance =
-        Maps.uniqueIndex(tasks, Tasks.SCHEDULED_TO_INSTANCE_ID);
+        Maps.uniqueIndex(tasks, Tasks::getInstanceId);
     assertEquals(
         expected,
-        ImmutableMap.copyOf(Maps.transformValues(tasksByInstance, Tasks.SCHEDULED_TO_INFO)));
+        ImmutableMap.copyOf(Maps.transformValues(tasksByInstance, Tasks::getConfig)));
   }
 
   @Test


Mime
View raw message