aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [2/2] aurora git commit: Reapply deprecated thrift removal patches.
Date Wed, 10 Feb 2016 00:14:59 GMT
Reapply deprecated thrift removal patches.

Bugs closed: AURORA-1603, AURORA-1604

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


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

Branch: refs/heads/master
Commit: ec0f38a7528f8adb8f0769112a1043b98598c03f
Parents: dd79934
Author: Maxim Khutornenko <maxim@apache.org>
Authored: Tue Feb 9 16:14:40 2016 -0800
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Tue Feb 9 16:14:40 2016 -0800

----------------------------------------------------------------------
 NEWS                                            |  8 ++
 .../thrift/org/apache/aurora/gen/api.thrift     |  9 --
 .../org/apache/aurora/scheduler/base/Query.java |  9 +-
 .../aurora/scheduler/base/TaskTestUtil.java     |  4 +-
 .../configuration/ConfigurationManager.java     | 66 ++-----------
 .../storage/db/views/DbTaskConfig.java          |  4 -
 .../scheduler/storage/log/LogStorage.java       |  9 +-
 .../storage/log/SnapshotStoreImpl.java          |  7 +-
 .../scheduler/storage/log/ThriftBackfill.java   | 71 --------------
 .../thrift/SchedulerThriftInterface.java        | 11 +--
 src/main/python/apache/aurora/admin/admin.py    |  6 +-
 src/main/python/apache/aurora/client/api/sla.py |  6 +-
 .../python/apache/aurora/client/cli/jobs.py     |  6 +-
 .../python/apache/aurora/client/cli/task.py     |  2 +-
 src/main/python/apache/aurora/config/thrift.py  |  4 +-
 .../apache/aurora/executor/common/announcer.py  |  5 +-
 .../apache/aurora/executor/common/sandbox.py    |  2 +-
 .../scheduler/storage/db/CronJobMapper.xml      |  1 -
 .../scheduler/storage/db/TaskConfigMapper.xml   |  3 -
 .../aurora/scheduler/storage/db/TaskMapper.xml  |  3 -
 .../scheduler/assets/js/controllers.js          |  2 +-
 .../resources/scheduler/assets/js/services.js   | 24 +----
 .../configuration/ConfigurationManagerTest.java | 42 +++------
 .../aurora/scheduler/cron/quartz/CronIT.java    |  4 +-
 .../scheduler/cron/quartz/QuartzTestUtil.java   |  2 +-
 .../preemptor/PreemptionVictimFilterTest.java   |  7 +-
 .../storage/AbstractCronJobStoreTest.java       |  2 +-
 .../scheduler/storage/log/LogManagerTest.java   |  8 +-
 .../scheduler/storage/log/LogStorageTest.java   | 47 ++--------
 .../storage/log/SnapshotStoreImplTest.java      | 61 +++---------
 .../storage/log/ThriftBackfillTest.java         | 99 --------------------
 .../aurora/scheduler/thrift/Fixtures.java       |  8 +-
 .../thrift/ReadOnlySchedulerImplTest.java       | 64 +++++--------
 .../thrift/SchedulerThriftInterfaceTest.java    | 88 ++++-------------
 .../aurora/scheduler/updater/JobDiffTest.java   |  5 +-
 .../python/apache/aurora/admin/test_admin.py    |  6 +-
 .../python/apache/aurora/client/api/test_api.py |  3 -
 .../python/apache/aurora/client/api/test_sla.py |  6 +-
 .../apache/aurora/client/cli/test_status.py     | 15 ---
 .../python/apache/aurora/client/cli/util.py     |  4 -
 .../python/apache/aurora/config/test_thrift.py  |  5 +-
 .../aurora/executor/common/test_announcer.py    |  4 -
 .../common/test_resource_manager_integration.py |  9 +-
 .../aurora/executor/test_thermos_executor.py    |  6 +-
 44 files changed, 143 insertions(+), 614 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/NEWS
----------------------------------------------------------------------
diff --git a/NEWS b/NEWS
index bc3dcfb..669df32 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,14 @@ New/updated:
 
 - Upgraded Mesos to 0.26.0
 
+Deprecations and removals:
+
+- Removed deprecated (now redundant) fields:
+  - `Identity.role`
+  - `TaskConfig.environment`
+  - `TaskConfig.jobName`
+  - `TaskQuery.owner`
+
 0.12.0
 ------
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/api/src/main/thrift/org/apache/aurora/gen/api.thrift
----------------------------------------------------------------------
diff --git a/api/src/main/thrift/org/apache/aurora/gen/api.thrift b/api/src/main/thrift/org/apache/aurora/gen/api.thrift
index c870bcf..d4b8904 100644
--- a/api/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/api/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -38,7 +38,6 @@ const string AURORA_EXECUTOR_NAME = 'AuroraExecutor'
 
 // TODO(maxim): Remove in 0.7.0. (AURORA-749)
 struct Identity {
-  1: string role
   2: string user
 }
 
@@ -218,12 +217,6 @@ struct TaskConfig {
  // TODO(maxim): Remove in 0.7.0. (AURORA-749)
  /** contains the role component of JobKey */
  17: Identity owner
- // TODO(maxim): Remove in 0.7.0. (AURORA-749)
- /** contains the environment component of JobKey */
- 26: string environment
- // TODO(maxim): Remove in 0.7.0. (AURORA-749)
- /** contains the name component of JobKey */
-  3: string jobName
   7: bool isService
   8: double numCpus
   9: i64 ramMb
@@ -510,8 +503,6 @@ struct GetJobsResult {
  * (terms are AND'ed together).
  */
 struct TaskQuery {
-  // TODO(maxim): Remove in 0.7.0. (AURORA-749)
-  8: Identity owner
   14: string role
   9: string environment
   2: string jobName

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/java/org/apache/aurora/scheduler/base/Query.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Query.java b/src/main/java/org/apache/aurora/scheduler/base/Query.java
index fbadfd3..ee01eaa 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Query.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Query.java
@@ -130,15 +130,8 @@ public final class Query {
       this.query = new TaskQuery();
     }
 
-    Builder(final TaskQuery query) {
+    Builder(TaskQuery query) {
       // It is expected that the caller calls deepCopy.
-      // TODO(maxim): Safe to keep only Role here as TaskQuery is not returned back to the client.
-      // Remove in 0.7.0. (AURORA-749)
-      if (query.isSetOwner()) {
-        query.setRole(query.getOwner().getRole());
-        query.unsetOwner();
-      }
-
       this.query = query;
     }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java b/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
index 02ba1e3..4c64a1c 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
@@ -60,9 +60,7 @@ public final class TaskTestUtil {
   public static ITaskConfig makeConfig(IJobKey job) {
     return ITaskConfig.build(new TaskConfig()
         .setJob(job.newBuilder())
-        .setJobName(job.getName())
-        .setEnvironment(job.getEnvironment())
-        .setOwner(new Identity(job.getRole(), job.getRole() + "-user"))
+        .setOwner(new Identity().setUser(job.getRole() + "-user"))
         .setIsService(true)
         .setNumCpus(1.0)
         .setRamMb(1024)

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
index e4dbf06..6300e5f 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
@@ -37,7 +37,6 @@ import org.apache.aurora.scheduler.base.JobKeys;
 import org.apache.aurora.scheduler.base.UserProvidedStrings;
 import org.apache.aurora.scheduler.storage.entities.IConstraint;
 import org.apache.aurora.scheduler.storage.entities.IContainer;
-import org.apache.aurora.scheduler.storage.entities.IIdentity;
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.apache.aurora.scheduler.storage.entities.ITaskConstraint;
@@ -113,28 +112,6 @@ public class ConfigurationManager {
     this.defaultDockerParameters = Objects.requireNonNull(defaultDockerParameters);
   }
 
-  private static void requireNonNull(Object value, String error) throws TaskDescriptionException {
-    if (value == null) {
-      throw new TaskDescriptionException(error);
-    }
-  }
-
-  private static void assertOwnerValidity(IIdentity jobOwner) throws TaskDescriptionException {
-    requireNonNull(jobOwner, "No job owner specified!");
-    requireNonNull(jobOwner.getRole(), "No job role specified!");
-    requireNonNull(jobOwner.getUser(), "No job user specified!");
-
-    if (!UserProvidedStrings.isGoodIdentifier(jobOwner.getRole())) {
-      throw new TaskDescriptionException(
-          "Job role contains illegal characters: " + jobOwner.getRole());
-    }
-
-    if (!UserProvidedStrings.isGoodIdentifier(jobOwner.getUser())) {
-      throw new TaskDescriptionException(
-          "Job user contains illegal characters: " + jobOwner.getUser());
-    }
-  }
-
   private static String getRole(IValueConstraint constraint) {
     return Iterables.getOnlyElement(constraint.getValues()).split("/")[0];
   }
@@ -180,12 +157,9 @@ public class ConfigurationManager {
       throw new TaskDescriptionException("Job key " + job.getKey() + " is invalid.");
     }
 
-    if (job.isSetOwner()) {
-      assertOwnerValidity(job.getOwner());
-
-      if (!job.getKey().getRole().equals(job.getOwner().getRole())) {
-        throw new TaskDescriptionException("Role in job key must match job owner.");
-      }
+    if (job.isSetOwner() && !UserProvidedStrings.isGoodIdentifier(job.getOwner().getUser())) {
+      throw new TaskDescriptionException(
+          "Job user contains illegal characters: " + job.getOwner().getUser());
     }
 
     builder.setTaskConfig(
@@ -219,39 +193,13 @@ public class ConfigurationManager {
 
     maybeFillLinks(builder);
 
-    if (!UserProvidedStrings.isGoodIdentifier(config.getJobName())) {
-      throw new TaskDescriptionException(
-          "Job name contains illegal characters: " + config.getJobName());
-    }
-
-    if (!UserProvidedStrings.isGoodIdentifier(config.getEnvironment())) {
-      throw new TaskDescriptionException(
-          "Environment contains illegal characters: " + config.getEnvironment());
-    }
-
     if (config.isSetTier() && !UserProvidedStrings.isGoodIdentifier(config.getTier())) {
       throw new TaskDescriptionException("Tier contains illegal characters: " + config.getTier());
     }
 
-    if (config.isSetJob()) {
-      if (!JobKeys.isValid(config.getJob())) {
-        // Job key is set but invalid
-        throw new TaskDescriptionException("Job key " + config.getJob() + " is invalid.");
-      }
-
-      if (!config.getJob().getRole().equals(config.getOwner().getRole())) {
-        // Both owner and job key are set but don't match
-        throw new TaskDescriptionException("Role must match job owner.");
-      }
-    } else {
-      // TODO(maxim): Make sure both key and owner are populated to support older clients.
-      // Remove in 0.7.0. (AURORA-749).
-      // Job key is not set -> populate from owner, environment and name
-      assertOwnerValidity(config.getOwner());
-      builder.setJob(JobKeys.from(
-          config.getOwner().getRole(),
-          config.getEnvironment(),
-          config.getJobName()).newBuilder());
+    if (!JobKeys.isValid(config.getJob())) {
+      // Job key is set but invalid
+      throw new TaskDescriptionException("Job key " + config.getJob() + " is invalid.");
     }
 
     if (!builder.isSetExecutorConfig()) {
@@ -276,7 +224,7 @@ public class ConfigurationManager {
       }
 
       String dedicatedRole = getRole(valueConstraint);
-      if (!config.getOwner().getRole().equals(dedicatedRole)) {
+      if (!config.getJob().getRole().equals(dedicatedRole)) {
         throw new TaskDescriptionException(
             "Only " + dedicatedRole + " may use hosts dedicated for that role.");
       }

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/java/org/apache/aurora/scheduler/storage/db/views/DbTaskConfig.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/db/views/DbTaskConfig.java b/src/main/java/org/apache/aurora/scheduler/storage/db/views/DbTaskConfig.java
index 16f2cb1..eb848ad 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/db/views/DbTaskConfig.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/db/views/DbTaskConfig.java
@@ -32,8 +32,6 @@ public final class DbTaskConfig {
   private long rowId;
   private JobKey job;
   private Identity owner;
-  private String environment;
-  private String jobName;
   private boolean isService;
   private double numCpus;
   private long ramMb;
@@ -61,8 +59,6 @@ public final class DbTaskConfig {
     return new TaskConfig()
         .setJob(job)
         .setOwner(owner)
-        .setEnvironment(environment)
-        .setJobName(jobName)
         .setIsService(isService)
         .setNumCpus(numCpus)
         .setRamMb(ramMb)

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
index de16f2e..243c8a0 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
@@ -62,13 +62,16 @@ import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.Storage.NonVolatileStorage;
 import org.apache.aurora.scheduler.storage.TaskStore;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
+import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.aurora.scheduler.storage.entities.IJobInstanceUpdateEvent;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
+import org.apache.aurora.scheduler.storage.entities.IJobUpdate;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateEvent;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateKey;
 import org.apache.aurora.scheduler.storage.entities.ILock;
 import org.apache.aurora.scheduler.storage.entities.ILockKey;
 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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -327,7 +330,7 @@ public class LogStorage implements NonVolatileStorage, DistributedSnapshotStore
         .put(Op._Fields.SAVE_CRON_JOB, op -> {
           SaveCronJob cronJob = op.getSaveCronJob();
           writeBehindJobStore.saveAcceptedJob(
-              ThriftBackfill.backFillJobConfiguration(cronJob.getJobConfig()));
+              IJobConfiguration.build(cronJob.getJobConfig()));
         })
         .put(
             Op._Fields.REMOVE_JOB,
@@ -335,7 +338,7 @@ public class LogStorage implements NonVolatileStorage, DistributedSnapshotStore
         .put(
             Op._Fields.SAVE_TASKS,
             op -> writeBehindTaskStore.saveTasks(
-                ThriftBackfill.backFillScheduledTasks(op.getSaveTasks().getTasks())))
+                IScheduledTask.setFromBuilders(op.getSaveTasks().getTasks())))
         .put(Op._Fields.REWRITE_TASK, op -> {
           RewriteTask rewriteTask = op.getRewriteTask();
           writeBehindTaskStore.unsafeModifyInPlace(
@@ -374,7 +377,7 @@ public class LogStorage implements NonVolatileStorage, DistributedSnapshotStore
         .put(Op._Fields.SAVE_JOB_UPDATE, op -> {
           JobUpdate update = op.getSaveJobUpdate().getJobUpdate();
           writeBehindJobUpdateStore.saveJobUpdate(
-              ThriftBackfill.backFillJobUpdate(update),
+              IJobUpdate.build(update),
               Optional.fromNullable(op.getSaveJobUpdate().getLockToken()));
         })
         .put(Op._Fields.SAVE_JOB_UPDATE_EVENT, op -> {

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
index 08ea04e..db90150 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
@@ -45,6 +45,7 @@ import org.apache.aurora.scheduler.storage.Storage.Volatile;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.aurora.scheduler.storage.entities.IJobInstanceUpdateEvent;
+import org.apache.aurora.scheduler.storage.entities.IJobUpdate;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateEvent;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateKey;
 import org.apache.aurora.scheduler.storage.entities.ILock;
@@ -121,7 +122,7 @@ public class SnapshotStoreImpl implements SnapshotStore<Snapshot> {
 
           if (snapshot.isSetTasks()) {
             store.getUnsafeTaskStore().saveTasks(
-                ThriftBackfill.backFillScheduledTasks(snapshot.getTasks()));
+                IScheduledTask.setFromBuilders(snapshot.getTasks()));
           }
         }
       },
@@ -143,7 +144,7 @@ public class SnapshotStoreImpl implements SnapshotStore<Snapshot> {
           if (snapshot.isSetCronJobs()) {
             for (StoredCronJob job : snapshot.getCronJobs()) {
               store.getCronJobStore().saveAcceptedJob(
-                  ThriftBackfill.backFillJobConfiguration(job.getJobConfiguration()));
+                  IJobConfiguration.build(job.getJobConfiguration()));
             }
           }
         }
@@ -205,7 +206,7 @@ public class SnapshotStoreImpl implements SnapshotStore<Snapshot> {
             for (StoredJobUpdateDetails storedDetails : snapshot.getJobUpdateDetails()) {
               JobUpdateDetails details = storedDetails.getDetails();
               updateStore.saveJobUpdate(
-                  ThriftBackfill.backFillJobUpdate(details.getUpdate()),
+                  IJobUpdate.build(details.getUpdate()),
                   Optional.fromNullable(storedDetails.getLockToken()));
 
               if (details.getUpdateEventsSize() > 0) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/java/org/apache/aurora/scheduler/storage/log/ThriftBackfill.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/ThriftBackfill.java b/src/main/java/org/apache/aurora/scheduler/storage/log/ThriftBackfill.java
deleted file mode 100644
index 6b19795..0000000
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/ThriftBackfill.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.aurora.scheduler.storage.log;
-
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.apache.aurora.gen.InstanceTaskConfig;
-import org.apache.aurora.gen.JobConfiguration;
-import org.apache.aurora.gen.JobUpdate;
-import org.apache.aurora.gen.JobUpdateInstructions;
-import org.apache.aurora.gen.ScheduledTask;
-import org.apache.aurora.gen.TaskConfig;
-import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
-import org.apache.aurora.scheduler.storage.entities.IJobUpdate;
-import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
-
-/**
- * Populates deprecated fields to ensure backwards compatibility between scheduler releases.
- * See AURORA-1603 for more details.
- */
-final class ThriftBackfill {
-
-  private ThriftBackfill() {
-    // Utility class.
-  }
-
-  static Set<IScheduledTask> backFillScheduledTasks(Set<ScheduledTask> tasks) {
-    tasks.stream().forEach(t -> backFillTaskConfig(t.getAssignedTask().getTask()));
-    return tasks.stream().map(t -> IScheduledTask.build(t)).collect(Collectors.toSet());
-  }
-
-  static IJobConfiguration backFillJobConfiguration(JobConfiguration jobConfiguration) {
-    backFillTaskConfig(jobConfiguration.getTaskConfig());
-    jobConfiguration.getOwner().setRole(jobConfiguration.getKey().getRole());
-    return IJobConfiguration.build(jobConfiguration);
-  }
-
-  static IJobUpdate backFillJobUpdate(JobUpdate update) {
-    JobUpdateInstructions instructions = update.getInstructions();
-    if (instructions.isSetDesiredState()) {
-      backFillTaskConfig(instructions.getDesiredState().getTask());
-    }
-
-    for (InstanceTaskConfig instanceConfig : instructions.getInitialState()) {
-      backFillTaskConfig(instanceConfig.getTask());
-    }
-
-    return IJobUpdate.build(update);
-  }
-
-  private static TaskConfig backFillTaskConfig(TaskConfig task) {
-    task.setJobName(task.getJob().getName()).setEnvironment(task.getJob().getEnvironment());
-    if (task.isSetOwner()) {
-      task.getOwner().setRole(task.getJob().getRole());
-    }
-
-    return task;
-  }
-}

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/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 6767024..d217faf 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -23,7 +23,6 @@ import javax.inject.Inject;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.ContiguousSet;
 import com.google.common.collect.DiscreteDomain;
 import com.google.common.collect.FluentIterable;
@@ -453,9 +452,6 @@ class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
       }
 
       query = implicitKillQuery(Query.arbitrary(mutableQuery));
-      Preconditions.checkState(
-          !mutableQuery.isSetOwner(),
-          "The owner field in a query should have been unset by Query.Builder.");
     }
 
     return storage.write(storeProvider -> {
@@ -919,12 +915,6 @@ class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
   public Response startJobUpdate(JobUpdateRequest mutableRequest, @Nullable String message) {
     requireNonNull(mutableRequest);
 
-    // TODO(maxim): Switch to key field instead when AURORA-749 is fixed.
-    IJobKey job = JobKeys.assertValid(IJobKey.build(new JobKey()
-        .setRole(mutableRequest.getTaskConfig().getOwner().getRole())
-        .setEnvironment(mutableRequest.getTaskConfig().getEnvironment())
-        .setName(mutableRequest.getTaskConfig().getJobName())));
-
     if (!mutableRequest.getTaskConfig().isIsService()) {
       return invalidRequest(NON_SERVICE_TASK);
     }
@@ -965,6 +955,7 @@ class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
     }
 
     return storage.write(storeProvider -> {
+      IJobKey job = request.getTaskConfig().getJob();
       if (getCronJob(storeProvider, job).isPresent()) {
         return invalidRequest(NO_CRON);
       }

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/python/apache/aurora/admin/admin.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/admin/admin.py b/src/main/python/apache/aurora/admin/admin.py
index 6ecb5cb..62a2302 100644
--- a/src/main/python/apache/aurora/admin/admin.py
+++ b/src/main/python/apache/aurora/admin/admin.py
@@ -85,7 +85,7 @@ def make_admin_client(cluster):
 @app.command_option('--states', dest='states', default='RUNNING',
     help='Only match tasks with given state(s).')
 @app.command_option('-l', '--listformat', dest='listformat',
-    default="%role%/%jobName%/%instanceId% %status%",
+    default="%role%/%name%/%instanceId% %status%",
     help='Format string of job/task items to print out.')
 # TODO(ksweeney): Allow query by environment here.
 def query(args, options):
@@ -279,8 +279,8 @@ def scheduler_print_recovery_tasks(cluster):
   for task in resp.result.queryRecoveryResult.tasks:
     assigned = task.assignedTask
     conf = assigned.task
-    log.info('\t'.join((conf.job.role if conf.job else conf.owner.role,
-                        conf.job.name if conf.job else conf.jobName,
+    log.info('\t'.join((conf.job.role,
+                        conf.job.name,
                         str(assigned.instanceId),
                         ScheduleStatus._VALUES_TO_NAMES[task.status],
                         assigned.taskId)))

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/python/apache/aurora/client/api/sla.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/sla.py b/src/main/python/apache/aurora/client/api/sla.py
index 5855685..e282ec9 100644
--- a/src/main/python/apache/aurora/client/api/sla.py
+++ b/src/main/python/apache/aurora/client/api/sla.py
@@ -35,9 +35,9 @@ def job_key_from_scheduled(task, cluster):
   config = task.assignedTask.task
   return AuroraJobKey(
       cluster=cluster.name,
-      role=config.job.role if config.job else config.owner.role,
-      env=config.job.environment if config.job else config.environment,
-      name=config.job.name if config.job else config.jobName
+      role=config.job.role,
+      env=config.job.environment,
+      name=config.job.name
   )
 
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/python/apache/aurora/client/cli/jobs.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/cli/jobs.py b/src/main/python/apache/aurora/client/cli/jobs.py
index deba3a9..67ab4f0 100644
--- a/src/main/python/apache/aurora/client/cli/jobs.py
+++ b/src/main/python/apache/aurora/client/cli/jobs.py
@@ -650,9 +650,9 @@ class StatusCommand(Verb):
       task_info = assigned_task.task
       task_strings = []
       task_strings.append("\tTask role: %s, env: %s, name: %s, instance: %s, status: %s on %s" %
-             (task_info.job.role if task_info.job else task_info.owner.role,
-              task_info.job.environment if task_info.job else task_info.environment,
-              task_info.job.name if task_info.job else task_info.jobName,
+             (task_info.job.role,
+              task_info.job.environment,
+              task_info.job.name,
               assigned_task.instanceId,
               ScheduleStatus._VALUES_TO_NAMES[scheduled_task.status],
               assigned_task.slaveHost))

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/python/apache/aurora/client/cli/task.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/cli/task.py b/src/main/python/apache/aurora/client/cli/task.py
index b722cd8..a8a4edc 100644
--- a/src/main/python/apache/aurora/client/cli/task.py
+++ b/src/main/python/apache/aurora/client/cli/task.py
@@ -124,7 +124,7 @@ class SshCommand(Verb):
     ssh_command = ['ssh', '-t']
     ssh_command += context.options.ssh_options if context.options.ssh_options else []
     assigned = first_task.assignedTask
-    role = assigned.task.job.role if assigned.task.job else assigned.task.owner.role
+    role = assigned.task.job.role
     slave_host = assigned.slaveHost
 
     for tunnel in context.options.tunnels:

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/python/apache/aurora/config/thrift.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/config/thrift.py b/src/main/python/apache/aurora/config/thrift.py
index b40a7fd..be0cd68 100644
--- a/src/main/python/apache/aurora/config/thrift.py
+++ b/src/main/python/apache/aurora/config/thrift.py
@@ -176,7 +176,7 @@ THERMOS_TASK_ID_REF = Ref.from_address('thermos.task_id')
 def convert(job, metadata=frozenset(), ports=frozenset()):
   """Convert a Pystachio MesosJob to an Aurora Thrift JobConfiguration."""
 
-  owner = Identity(role=fully_interpolated(job.role()), user=getpass.getuser())
+  owner = Identity(user=getpass.getuser())
   key = JobKey(
     role=assert_valid_field('role', fully_interpolated(job.role())),
     environment=assert_valid_field('environment', fully_interpolated(job.environment())),
@@ -191,8 +191,6 @@ def convert(job, metadata=frozenset(), ports=frozenset()):
     return default if item is Empty else fully_interpolated(item)
 
   # job components
-  task.jobName = fully_interpolated(job.name())
-  task.environment = fully_interpolated(job.environment())
   task.production = fully_interpolated(job.production(), bool)
   task.isService = select_service_bit(job)
   task.maxTaskFailures = fully_interpolated(job.max_task_failures())

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/python/apache/aurora/executor/common/announcer.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/common/announcer.py b/src/main/python/apache/aurora/executor/common/announcer.py
index c89cf4c..34e36e0 100644
--- a/src/main/python/apache/aurora/executor/common/announcer.py
+++ b/src/main/python/apache/aurora/executor/common/announcer.py
@@ -121,10 +121,7 @@ class DefaultAnnouncerCheckerProvider(AnnouncerCheckerProvider):
 
   def make_zk_path(self, assigned_task):
     config = assigned_task.task
-    role, environment, name = (
-        config.job.role if config.job else config.owner.role,
-        config.job.environment if config.job else config.environment,
-        config.job.name if config.job else config.jobName)
+    role, environment, name = (config.job.role, config.job.environment, config.job.name)
     return posixpath.join(self.__root, role, environment, name)
 
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/python/apache/aurora/executor/common/sandbox.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/executor/common/sandbox.py b/src/main/python/apache/aurora/executor/common/sandbox.py
index d4c366e..4780232 100644
--- a/src/main/python/apache/aurora/executor/common/sandbox.py
+++ b/src/main/python/apache/aurora/executor/common/sandbox.py
@@ -51,7 +51,7 @@ class SandboxInterface(Interface):
 
 class SandboxProvider(Interface):
   def _get_sandbox_user(self, assigned_task):
-    return assigned_task.task.job.role if assigned_task.task.job else assigned_task.task.owner.role
+    return assigned_task.task.job.role
 
   @abstractmethod
   def from_assigned_task(self, assigned_task):

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/resources/org/apache/aurora/scheduler/storage/db/CronJobMapper.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/storage/db/CronJobMapper.xml b/src/main/resources/org/apache/aurora/scheduler/storage/db/CronJobMapper.xml
index ee603f4..1434f45 100644
--- a/src/main/resources/org/apache/aurora/scheduler/storage/db/CronJobMapper.xml
+++ b/src/main/resources/org/apache/aurora/scheduler/storage/db/CronJobMapper.xml
@@ -65,7 +65,6 @@
       type="org.apache.aurora.scheduler.storage.db.views.DbJobConfiguration">
 
     <id column="c_id" />
-    <result property="owner.role" column="j_role"/>
     <result property="owner.user" column="creator_user"/>
     <result
         property="cronCollisionPolicy"

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskConfigMapper.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskConfigMapper.xml b/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskConfigMapper.xml
index 4e8966d..b1394cf 100644
--- a/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskConfigMapper.xml
+++ b/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskConfigMapper.xml
@@ -128,9 +128,6 @@
 
   <resultMap id="taskConfigMap" type="org.apache.aurora.scheduler.storage.db.views.DbTaskConfig">
     <id column="id" property="rowId" />
-    <result column="j_role" property="owner.role"/>
-    <result column="j_environment" property="environment"/>
-    <result column="j_name" property="jobName"/>
     <result column="creator_user" property="owner.user"/>
     <result column="executor_name" property="executorConfig.name"/>
     <result column="executor_data" property="executorConfig.data"/>

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskMapper.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskMapper.xml b/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskMapper.xml
index b9615e1..ea469cc 100644
--- a/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskMapper.xml
+++ b/src/main/resources/org/apache/aurora/scheduler/storage/db/TaskMapper.xml
@@ -120,9 +120,6 @@
       <if test="role != null">
         j.role = #{role}
       </if>
-      <if test="owner != null and owner.role != null">
-        AND j.role = #{owner.role}
-      </if>
       <if test="environment != null">
         AND j.environment = #{environment}
       </if>

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/resources/scheduler/assets/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/js/controllers.js b/src/main/resources/scheduler/assets/js/controllers.js
index dff6645..84417eb 100644
--- a/src/main/resources/scheduler/assets/js/controllers.js
+++ b/src/main/resources/scheduler/assets/js/controllers.js
@@ -133,7 +133,7 @@
             return {
               role: $scope.role, // required for roleEnvLink directive
               environment: summary.job.key.environment,
-              jobName: summary.job.taskConfig.jobName,
+              jobName: summary.job.key.name,
               jobType: getJobType(summary.job),
               isProduction: summary.job.taskConfig.production ? 'yes' : '',
               pendingTasks: summary.stats.pendingTaskCount,

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/main/resources/scheduler/assets/js/services.js
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/js/services.js b/src/main/resources/scheduler/assets/js/services.js
index f9e8580..d9ce520 100644
--- a/src/main/resources/scheduler/assets/js/services.js
+++ b/src/main/resources/scheduler/assets/js/services.js
@@ -17,7 +17,6 @@
     ACTIVE_STATES:false,
     ACTIVE_JOB_UPDATE_STATES: false,
     CronCollisionPolicy: false,
-    Identity:false,
     JobKey: false,
     JobUpdateQuery:false,
     JobUpdateAction:false,
@@ -29,10 +28,8 @@
   'use strict';
 
   function makeJobTaskQuery(role, environment, jobName, instance) {
-    var id = new Identity();
-    id.role = role;
     var taskQuery = new TaskQuery();
-    taskQuery.owner = id;
+    taskQuery.role = role;
     taskQuery.environment = environment;
     taskQuery.jobName = jobName;
 
@@ -88,23 +85,6 @@
             });
           },
 
-          getTasks: function (role, environment, jobName) {
-            var id = new Identity();
-            id.role = role;
-            var taskQuery = new TaskQuery();
-            taskQuery.owner = id;
-            taskQuery.environment = environment;
-            taskQuery.jobName = jobName;
-            return async(function (deferred) {
-              auroraClient.getSchedulerClient().getTasksStatus(taskQuery, function (response) {
-                var result = auroraClient.processResponse(response);
-                result.tasks = response.result !== null ?
-                  response.result.scheduleStatusResult.tasks : [];
-                deferred.resolve(result);
-              });
-            });
-          },
-
           getTasksWithoutConfigs: function (role, environment, jobName, instance) {
             var query = makeJobTaskQuery(role, environment, jobName, instance);
 
@@ -511,7 +491,7 @@
                   var job = summary.job;
                   return job.cronSchedule !== null &&
                     job.key.environment === env &&
-                    job.taskConfig.jobName === jobName;
+                    job.key.name === jobName;
                 })
                 .map(function (summary) {
                   var collisionPolicy =

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java b/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
index 317506e..d2789d0 100644
--- a/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java
@@ -13,9 +13,9 @@
  */
 package org.apache.aurora.scheduler.configuration;
 
-import java.util.Arrays;
 import java.util.List;
 
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMultimap;
 import com.google.common.collect.ImmutableSet;
@@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableSet;
 import org.apache.aurora.gen.Constraint;
 import org.apache.aurora.gen.Container;
 import org.apache.aurora.gen.CronCollisionPolicy;
-import org.apache.aurora.gen.DockerContainer;
 import org.apache.aurora.gen.DockerParameter;
 import org.apache.aurora.gen.ExecutorConfig;
 import org.apache.aurora.gen.Identity;
@@ -33,6 +32,8 @@ import org.apache.aurora.gen.LimitConstraint;
 import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.gen.TaskConstraint;
 import org.apache.aurora.gen.ValueConstraint;
+import org.apache.aurora.scheduler.base.JobKeys;
+import org.apache.aurora.scheduler.base.TaskTestUtil;
 import org.apache.aurora.scheduler.configuration.ConfigurationManager.TaskDescriptionException;
 import org.apache.aurora.scheduler.storage.entities.IDockerParameter;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
@@ -69,9 +70,7 @@ public class ConfigurationManagerTest {
               .setIsService(false)
               .setTaskLinks(ImmutableMap.of())
               .setExecutorConfig(new ExecutorConfig("aurora", "config"))
-              .setEnvironment("devel")
               .setRequestedPorts(ImmutableSet.of())
-              .setJobName(null)
               .setPriority(0)
               .setOwner(null)
               .setContactEmail("foo@twitter.com")
@@ -97,19 +96,9 @@ public class ConfigurationManagerTest {
                           .setName(DEDICATED_ATTRIBUTE)
                           .setConstraint(TaskConstraint.value(new ValueConstraint(
                               false, ImmutableSet.of("foo"))))))
-              .setOwner(new Identity()
-                  .setRole("owner-role")
-                  .setUser("owner-user")));
-  private static final TaskConfig CONFIG_WITH_CONTAINER = ITaskConfig.build(new TaskConfig()
-      .setJobName("container-test")
-      .setEnvironment("devel")
-      .setExecutorConfig(new ExecutorConfig())
-      .setOwner(new Identity("role", "user"))
-      .setNumCpus(1)
-      .setRamMb(1)
-      .setDiskMb(1)
-      .setContainer(Container.docker(new DockerContainer("testimage"))))
-      .newBuilder();
+              .setOwner(new Identity().setUser("owner-user")));
+  private static final ITaskConfig CONFIG_WITH_CONTAINER =
+      TaskTestUtil.makeConfig(JobKeys.from("role", "env", "job"));
 
   private ConfigurationManager configurationManager;
   private ConfigurationManager dockerConfigurationManager;
@@ -135,7 +124,7 @@ public class ConfigurationManagerTest {
 
   @Test
   public void testBadContainerConfig() throws TaskDescriptionException {
-    TaskConfig taskConfig = CONFIG_WITH_CONTAINER.deepCopy();
+    TaskConfig taskConfig = CONFIG_WITH_CONTAINER.newBuilder();
     taskConfig.getContainer().getDocker().setImage(null);
 
     expectTaskDescriptionException("A container must specify an image");
@@ -144,7 +133,7 @@ public class ConfigurationManagerTest {
 
   @Test
   public void testDisallowedDockerParameters() throws TaskDescriptionException {
-    TaskConfig taskConfig = CONFIG_WITH_CONTAINER.deepCopy();
+    TaskConfig taskConfig = CONFIG_WITH_CONTAINER.newBuilder();
     taskConfig.getContainer().getDocker().addToParameters(new DockerParameter("foo", "bar"));
 
     ConfigurationManager noParamsManager = new ConfigurationManager(
@@ -157,8 +146,6 @@ public class ConfigurationManagerTest {
   @Test
   public void testInvalidTier() throws TaskDescriptionException {
     ITaskConfig config = ITaskConfig.build(UNSANITIZED_JOB_CONFIGURATION.deepCopy().getTaskConfig()
-        .setJobName("job")
-        .setEnvironment("env")
         .setTier("pr/d"));
 
     expectTaskDescriptionException("Tier contains illegal characters");
@@ -167,18 +154,20 @@ public class ConfigurationManagerTest {
 
   @Test
   public void testDefaultDockerParameters() throws TaskDescriptionException {
-    ITaskConfig result = dockerConfigurationManager.validateAndPopulate(
-        ITaskConfig.build(CONFIG_WITH_CONTAINER.deepCopy()));
+    TaskConfig builder = CONFIG_WITH_CONTAINER.newBuilder();
+    builder.getContainer().getDocker().setParameters(ImmutableList.of());
+
+    ITaskConfig result = dockerConfigurationManager.validateAndPopulate(ITaskConfig.build(builder));
 
     // The resulting task config should contain parameters supplied to the ConfigurationManager.
     List<IDockerParameter> params = result.getContainer().getDocker().getParameters();
     assertThat(
-        params, is(Arrays.asList(IDockerParameter.build(new DockerParameter("foo", "bar")))));
+        params, is(ImmutableList.of(IDockerParameter.build(new DockerParameter("foo", "bar")))));
   }
 
   @Test
   public void testPassthroughDockerParameters() throws TaskDescriptionException {
-    TaskConfig taskConfig = CONFIG_WITH_CONTAINER.deepCopy();
+    TaskConfig taskConfig = CONFIG_WITH_CONTAINER.newBuilder();
     DockerParameter userParameter = new DockerParameter("bar", "baz");
     taskConfig.getContainer().getDocker().getParameters().clear();
     taskConfig.getContainer().getDocker().addToParameters(userParameter);
@@ -188,8 +177,7 @@ public class ConfigurationManagerTest {
 
     // The resulting task config should contain parameters supplied from user config.
     List<IDockerParameter> params = result.getContainer().getDocker().getParameters();
-    assertThat(
-        params, is(Arrays.asList(IDockerParameter.build(userParameter))));
+    assertThat(params, is(ImmutableList.of(IDockerParameter.build(userParameter))));
   }
 
   private void expectTaskDescriptionException(String message) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java b/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
index 3ce78e3..469b53b 100644
--- a/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/cron/quartz/CronIT.java
@@ -57,9 +57,7 @@ public class CronIT extends EasyMockTest {
   public static final CrontabEntry CRONTAB_ENTRY = CrontabEntry.parse("* * * * *");
 
   private static final IJobKey JOB_KEY = JobKeys.from("roll", "b", "c");
-  private static final Identity IDENTITY = new Identity()
-      .setRole(JOB_KEY.getRole())
-      .setUser("user");
+  private static final Identity IDENTITY = new Identity().setUser("user");
 
   private static final IJobConfiguration CRON_JOB = IJobConfiguration.build(
       new JobConfiguration()

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/cron/quartz/QuartzTestUtil.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/cron/quartz/QuartzTestUtil.java b/src/test/java/org/apache/aurora/scheduler/cron/quartz/QuartzTestUtil.java
index ef9aae1..3c5ecd6 100644
--- a/src/test/java/org/apache/aurora/scheduler/cron/quartz/QuartzTestUtil.java
+++ b/src/test/java/org/apache/aurora/scheduler/cron/quartz/QuartzTestUtil.java
@@ -38,7 +38,7 @@ final class QuartzTestUtil {
       new JobConfiguration()
           .setCronSchedule("* * * * SUN")
           .setInstanceCount(10)
-          .setOwner(new Identity("role", "user"))
+          .setOwner(new Identity().setUser("user"))
           .setKey(AURORA_JOB_KEY.newBuilder())
           .setTaskConfig(TaskTestUtil.makeConfig(AURORA_JOB_KEY)
               .newBuilder()

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java b/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
index ef20641..b6f5e46 100644
--- a/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilterTest.java
@@ -13,7 +13,6 @@
  */
 package org.apache.aurora.scheduler.preemptor;
 
-import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -21,13 +20,13 @@ import com.google.common.base.Optional;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
 
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Data;
 import org.apache.aurora.common.testing.easymock.EasyMockTest;
 import org.apache.aurora.gen.AssignedTask;
 import org.apache.aurora.gen.Attribute;
-import org.apache.aurora.gen.Constraint;
 import org.apache.aurora.gen.HostAttributes;
 import org.apache.aurora.gen.JobKey;
 import org.apache.aurora.gen.ScheduleStatus;
@@ -550,9 +549,7 @@ public class PreemptionVictimFilterTest extends EasyMockTest {
             .setJob(new JobKey(role, env, job))
             .setPriority(priority)
             .setProduction(production)
-            .setJobName(job)
-            .setEnvironment(env)
-            .setConstraints(new HashSet<Constraint>()));
+            .setConstraints(Sets.newHashSet()));
     return new ScheduledTask().setAssignedTask(assignedTask);
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/storage/AbstractCronJobStoreTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/AbstractCronJobStoreTest.java b/src/test/java/org/apache/aurora/scheduler/storage/AbstractCronJobStoreTest.java
index 22a6b43..c316e49 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/AbstractCronJobStoreTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/AbstractCronJobStoreTest.java
@@ -138,7 +138,7 @@ public abstract class AbstractCronJobStoreTest {
         IJobConfiguration.build(
             new JobConfiguration()
                 .setKey(job.newBuilder())
-                .setOwner(new Identity(job.getRole(), "user"))
+                .setOwner(new Identity().setUser("user"))
                 .setCronSchedule("schedule")
                 .setCronCollisionPolicy(CronCollisionPolicy.CANCEL_NEW)
                 .setTaskConfig(config.newBuilder())

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/storage/log/LogManagerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/LogManagerTest.java b/src/test/java/org/apache/aurora/scheduler/storage/log/LogManagerTest.java
index 0443bb3..0256c06 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/LogManagerTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/log/LogManagerTest.java
@@ -39,9 +39,7 @@ import org.apache.aurora.common.testing.easymock.EasyMockTest;
 import org.apache.aurora.gen.AssignedTask;
 import org.apache.aurora.gen.Attribute;
 import org.apache.aurora.gen.HostAttributes;
-import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.ScheduledTask;
-import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.gen.storage.DeduplicatedSnapshot;
 import org.apache.aurora.gen.storage.Frame;
 import org.apache.aurora.gen.storage.FrameChunk;
@@ -56,6 +54,7 @@ import org.apache.aurora.gen.storage.Snapshot;
 import org.apache.aurora.gen.storage.Transaction;
 import org.apache.aurora.gen.storage.storageConstants;
 import org.apache.aurora.scheduler.base.JobKeys;
+import org.apache.aurora.scheduler.base.TaskTestUtil;
 import org.apache.aurora.scheduler.log.Log.Entry;
 import org.apache.aurora.scheduler.log.Log.Position;
 import org.apache.aurora.scheduler.log.Log.Stream;
@@ -514,10 +513,7 @@ public class LogManagerTest extends EasyMockTest {
         .setTimestamp(1L)
         .setHostAttributes(ImmutableSet.of(new HostAttributes("host",
             ImmutableSet.of(new Attribute("hostname", ImmutableSet.of("abc"))))))
-        .setTasks(ImmutableSet.of(
-            new ScheduledTask().setStatus(ScheduleStatus.RUNNING)
-                .setAssignedTask(new AssignedTask().setTaskId("task_id")
-                    .setTask(new TaskConfig().setJobName("job_name")))));
+        .setTasks(ImmutableSet.of(TaskTestUtil.makeTask("task_id", TaskTestUtil.JOB).newBuilder()));
   }
 
   private SaveTasks createSaveTasks(String... taskIds) {

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java b/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
index 7203233..7382eca 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
@@ -24,7 +24,6 @@ import com.google.common.base.Functions;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
 import com.google.common.collect.Sets;
 import com.google.common.hash.HashFunction;
 import com.google.common.hash.Hashing;
@@ -38,7 +37,6 @@ import org.apache.aurora.common.testing.easymock.EasyMockTest;
 import org.apache.aurora.gen.AssignedTask;
 import org.apache.aurora.gen.Attribute;
 import org.apache.aurora.gen.HostAttributes;
-import org.apache.aurora.gen.Identity;
 import org.apache.aurora.gen.InstanceTaskConfig;
 import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.gen.JobInstanceUpdateEvent;
@@ -123,7 +121,6 @@ import static org.easymock.EasyMock.expectLastCall;
 import static org.easymock.EasyMock.notNull;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 public class LogStorageTest extends EasyMockTest {
@@ -277,33 +274,17 @@ public class LogStorageTest extends EasyMockTest {
     builder.add(createTransaction(Op.saveFrameworkId(new SaveFrameworkId("bob"))));
     storageUtil.schedulerStore.saveFrameworkId("bob");
 
-    TaskConfig task = new TaskConfig()
-        .setJob(JOB_KEY.newBuilder())
-        .setOwner(new Identity(null, "user"));
-    TaskConfig backfilledTask = new TaskConfig(task)
-        .setJobName(JOB_KEY.getName())
-        .setEnvironment(JOB_KEY.getEnvironment());
-    backfilledTask.getOwner().setRole(JOB_KEY.getRole());
-
-    JobConfiguration jobConfig = new JobConfiguration()
-        .setKey(JOB_KEY.newBuilder())
-        .setOwner(new Identity().setUser(task.getOwner().getUser()))
-        .setTaskConfig(task);
-    JobConfiguration backfilledJobConfig = new JobConfiguration(jobConfig)
-        .setOwner(new Identity(jobConfig.getOwner()).setRole(JOB_KEY.getRole()))
-        .setTaskConfig(backfilledTask);
-
-    builder.add(createTransaction(Op.saveCronJob(new SaveCronJob().setJobConfig(jobConfig))));
-    storageUtil.jobStore.saveAcceptedJob(IJobConfiguration.build(backfilledJobConfig));
+    SaveCronJob cronJob = new SaveCronJob().setJobConfig(new JobConfiguration());
+    builder.add(createTransaction(Op.saveCronJob(cronJob)));
+    storageUtil.jobStore.saveAcceptedJob(IJobConfiguration.build(cronJob.getJobConfig()));
 
     RemoveJob removeJob = new RemoveJob(JOB_KEY.newBuilder());
     builder.add(createTransaction(Op.removeJob(removeJob)));
     storageUtil.jobStore.removeJob(JOB_KEY);
 
-    builder.add(createTransaction(Op.saveTasks(new SaveTasks(ImmutableSet.of(new ScheduledTask()
-        .setAssignedTask(new AssignedTask().setTask(task)))))));
-    storageUtil.taskStore.saveTasks(ImmutableSet.of(IScheduledTask.build(new ScheduledTask()
-        .setAssignedTask(new AssignedTask().setTask(backfilledTask)))));
+    SaveTasks saveTasks = new SaveTasks(ImmutableSet.of(new ScheduledTask()));
+    builder.add(createTransaction(Op.saveTasks(saveTasks)));
+    storageUtil.taskStore.saveTasks(IScheduledTask.setFromBuilders(saveTasks.getTasks()));
 
     RewriteTask rewriteTask = new RewriteTask("id1", new TaskConfig());
     builder.add(createTransaction(Op.rewriteTask(rewriteTask)));
@@ -346,22 +327,12 @@ public class LogStorageTest extends EasyMockTest {
     builder.add(createTransaction(Op.removeLock(removeLock)));
     storageUtil.lockStore.removeLock(ILockKey.build(removeLock.getLockKey()));
 
-    JobUpdate update = new JobUpdate()
-        .setSummary(new JobUpdateSummary().setKey(UPDATE_ID.newBuilder()))
-        .setInstructions(new JobUpdateInstructions()
-            .setDesiredState(new InstanceTaskConfig().setTask(task))
-            .setInitialState(ImmutableSet.of(new InstanceTaskConfig().setTask(task))));
-    JobUpdate backfilledUpdate = new JobUpdate(update);
-    backfilledUpdate.getInstructions()
-        .setDesiredState(new InstanceTaskConfig().setTask(backfilledTask))
-        .setInitialState(ImmutableSet.of(new InstanceTaskConfig().setTask(backfilledTask)));
+    JobUpdate update = new JobUpdate().setSummary(
+        new JobUpdateSummary().setKey(UPDATE_ID.newBuilder()));
     SaveJobUpdate saveUpdate = new SaveJobUpdate(update, "token");
-
-    assertNull(Iterables.getOnlyElement(
-        saveUpdate.getJobUpdate().getInstructions().getInitialState()).getTask().getJobName());
     builder.add(createTransaction(Op.saveJobUpdate(saveUpdate)));
     storageUtil.jobUpdateStore.saveJobUpdate(
-        IJobUpdate.build(backfilledUpdate),
+        IJobUpdate.build(saveUpdate.getJobUpdate()),
         Optional.of(saveUpdate.getLockToken()));
 
     SaveJobUpdateEvent saveUpdateEvent =

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java b/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
index 29a68bc..4407867 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
@@ -25,18 +25,14 @@ import com.google.common.collect.Maps;
 import org.apache.aurora.common.testing.easymock.EasyMockTest;
 import org.apache.aurora.common.util.testing.FakeBuildInfo;
 import org.apache.aurora.common.util.testing.FakeClock;
-import org.apache.aurora.gen.AssignedTask;
 import org.apache.aurora.gen.Attribute;
 import org.apache.aurora.gen.HostAttributes;
-import org.apache.aurora.gen.Identity;
-import org.apache.aurora.gen.InstanceTaskConfig;
 import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.gen.JobInstanceUpdateEvent;
 import org.apache.aurora.gen.JobKey;
 import org.apache.aurora.gen.JobUpdate;
 import org.apache.aurora.gen.JobUpdateDetails;
 import org.apache.aurora.gen.JobUpdateEvent;
-import org.apache.aurora.gen.JobUpdateInstructions;
 import org.apache.aurora.gen.JobUpdateKey;
 import org.apache.aurora.gen.JobUpdateStatus;
 import org.apache.aurora.gen.JobUpdateSummary;
@@ -44,7 +40,6 @@ import org.apache.aurora.gen.Lock;
 import org.apache.aurora.gen.LockKey;
 import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.ScheduledTask;
-import org.apache.aurora.gen.TaskConfig;
 import org.apache.aurora.gen.storage.QuotaConfiguration;
 import org.apache.aurora.gen.storage.SchedulerMetadata;
 import org.apache.aurora.gen.storage.Snapshot;
@@ -61,7 +56,6 @@ import org.apache.aurora.scheduler.storage.entities.IJobUpdateDetails;
 import org.apache.aurora.scheduler.storage.entities.IJobUpdateKey;
 import org.apache.aurora.scheduler.storage.entities.ILock;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
-import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.apache.aurora.scheduler.storage.testing.StorageTestUtil;
 import org.junit.Before;
 import org.junit.Test;
@@ -95,23 +89,8 @@ public class SnapshotStoreImplTest extends EasyMockTest {
 
   @Test
   public void testCreateAndRestoreNewSnapshot() {
-    // Having immutable objects is important here to overcome m -> i -> m' problem with our wrappers
-    // when some primitive fields are not set.
-    ITaskConfig task = ITaskConfig.build(
-        new TaskConfig().setJob(JOB_KEY).setOwner(new Identity(null, "user")));
-    TaskConfig taskBuilder = new TaskConfig(task.newBuilder())
-        .setJobName(JOB_KEY.getName())
-        .setEnvironment(JOB_KEY.getEnvironment());
-    taskBuilder.getOwner().setRole(JOB_KEY.getRole());
-    ITaskConfig backfilledTask = ITaskConfig.build(taskBuilder);
-
-    ImmutableSet<IScheduledTask> tasks = ImmutableSet.of(IScheduledTask.build(new ScheduledTask()
-        .setAssignedTask(new AssignedTask().setTask(task.newBuilder()))
-        .setStatus(ScheduleStatus.PENDING)));
-    ImmutableSet<IScheduledTask> backFilledTasks = ImmutableSet.of(IScheduledTask.build(
-        new ScheduledTask()
-            .setAssignedTask(new AssignedTask().setTask(backfilledTask.newBuilder()))
-            .setStatus(ScheduleStatus.PENDING)));
+    ImmutableSet<IScheduledTask> tasks = ImmutableSet.of(
+        IScheduledTask.build(new ScheduledTask().setStatus(ScheduleStatus.PENDING)));
 
     Set<QuotaConfiguration> quotas =
         ImmutableSet.of(
@@ -123,14 +102,8 @@ public class SnapshotStoreImplTest extends EasyMockTest {
     // dropped.
     IHostAttributes legacyAttribute = IHostAttributes.build(
         new HostAttributes("host", ImmutableSet.of()));
-    StoredCronJob job = new StoredCronJob(new JobConfiguration()
-        .setOwner(new Identity().setUser("user"))
-        .setKey(JOB_KEY)
-        .setTaskConfig(task.newBuilder()));
-    IJobConfiguration backFilledJob = IJobConfiguration.build(
-        new JobConfiguration(job.getJobConfiguration())
-            .setOwner(new Identity(job.getJobConfiguration().getOwner()).setRole(JOB_KEY.getRole()))
-            .setTaskConfig(backfilledTask.newBuilder()));
+    StoredCronJob job = new StoredCronJob(
+        new JobConfiguration().setKey(new JobKey("owner", "env", "name")));
     String frameworkId = "framework_id";
     ILock lock = ILock.build(new Lock()
         .setKey(LockKey.job(JobKeys.from("testRole", "testEnv", "testJob").newBuilder()))
@@ -145,26 +118,14 @@ public class SnapshotStoreImplTest extends EasyMockTest {
     IJobUpdateKey updateId1 =  makeKey("updateId1");
     IJobUpdateKey updateId2 = makeKey("updateId2");
     IJobUpdateDetails updateDetails1 = IJobUpdateDetails.build(new JobUpdateDetails()
-        .setUpdate(new JobUpdate()
-            .setSummary(new JobUpdateSummary().setKey(updateId1.newBuilder()))
-            .setInstructions(new JobUpdateInstructions()
-                .setDesiredState(new InstanceTaskConfig().setTask(task.newBuilder()))
-                .setInitialState(ImmutableSet.of(new InstanceTaskConfig().setTask(task.newBuilder()
-                )))))
+        .setUpdate(new JobUpdate().setSummary(
+            new JobUpdateSummary().setKey(updateId1.newBuilder())))
         .setUpdateEvents(ImmutableList.of(new JobUpdateEvent().setStatus(JobUpdateStatus.ERROR)))
         .setInstanceEvents(ImmutableList.of(new JobInstanceUpdateEvent().setTimestampMs(123L))));
 
-    // The saved object for update1 should be backfilled with TaskConfig fields.
-    JobUpdateDetails backFilledDetails1 = new JobUpdateDetails(updateDetails1.newBuilder());
-    backFilledDetails1.getUpdate().getInstructions().getDesiredState()
-        .setTask(backfilledTask.newBuilder());
-    Iterables.getOnlyElement(backFilledDetails1.getUpdate().getInstructions().getInitialState())
-        .setTask(backfilledTask.newBuilder());
-
     IJobUpdateDetails updateDetails2 = IJobUpdateDetails.build(new JobUpdateDetails()
-        .setUpdate(new JobUpdate()
-            .setSummary(new JobUpdateSummary().setKey(updateId2.newBuilder()))
-            .setInstructions(new JobUpdateInstructions().setInitialState(ImmutableSet.of()))));
+        .setUpdate(new JobUpdate().setSummary(
+            new JobUpdateSummary().setKey(updateId2.newBuilder()))));
 
     storageUtil.expectOperations();
     expect(storageUtil.taskStore.fetchTasks(Query.unscoped())).andReturn(tasks);
@@ -183,14 +144,14 @@ public class SnapshotStoreImplTest extends EasyMockTest {
             new StoredJobUpdateDetails(updateDetails2.newBuilder(), null)));
 
     expectDataWipe();
-    storageUtil.taskStore.saveTasks(backFilledTasks);
+    storageUtil.taskStore.saveTasks(tasks);
     storageUtil.quotaStore.saveQuota("steve", ResourceAggregates.EMPTY);
     expect(storageUtil.attributeStore.saveHostAttributes(attribute)).andReturn(true);
-    storageUtil.jobStore.saveAcceptedJob(backFilledJob);
+    storageUtil.jobStore.saveAcceptedJob(IJobConfiguration.build(job.getJobConfiguration()));
     storageUtil.schedulerStore.saveFrameworkId(frameworkId);
     storageUtil.lockStore.saveLock(lock);
     storageUtil.jobUpdateStore.saveJobUpdate(
-        IJobUpdate.build(backFilledDetails1.getUpdate()), Optional.fromNullable(lockToken));
+        updateDetails1.getUpdate(), Optional.fromNullable(lockToken));
     storageUtil.jobUpdateStore.saveJobUpdateEvent(
         updateId1,
         Iterables.getOnlyElement(updateDetails1.getUpdateEvents()));

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/storage/log/ThriftBackfillTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/ThriftBackfillTest.java b/src/test/java/org/apache/aurora/scheduler/storage/log/ThriftBackfillTest.java
deleted file mode 100644
index 467238d..0000000
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/ThriftBackfillTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.aurora.scheduler.storage.log;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-import org.apache.aurora.gen.AssignedTask;
-import org.apache.aurora.gen.Identity;
-import org.apache.aurora.gen.InstanceTaskConfig;
-import org.apache.aurora.gen.JobConfiguration;
-import org.apache.aurora.gen.JobUpdate;
-import org.apache.aurora.gen.JobUpdateInstructions;
-import org.apache.aurora.gen.ScheduledTask;
-import org.apache.aurora.gen.TaskConfig;
-import org.apache.aurora.scheduler.base.JobKeys;
-import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
-import org.apache.aurora.scheduler.storage.entities.IJobKey;
-import org.apache.aurora.scheduler.storage.entities.IJobUpdate;
-import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
-import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class ThriftBackfillTest {
-  private static final IJobKey JOB_KEY = JobKeys.from("role", "env", "name");
-  private static final ITaskConfig TASK = ITaskConfig.build(new TaskConfig()
-      .setJob(JOB_KEY.newBuilder())
-      .setOwner(new Identity(null, "user")));
-
-  @Test
-  public void testUpdateBackfill() {
-    JobUpdate update = update();
-    JobUpdate expected = update();
-    populateTask(expected.getInstructions().getDesiredState().getTask());
-    populateTask(Iterables.getOnlyElement(expected.getInstructions().getInitialState()).getTask());
-    assertEquals(IJobUpdate.build(expected), ThriftBackfill.backFillJobUpdate(update));
-  }
-
-  @Test
-  public void testTaskBackfill() {
-    ScheduledTask task =
-        new ScheduledTask().setAssignedTask(new AssignedTask().setTask(TASK.newBuilder()));
-    ScheduledTask expected = new ScheduledTask(task);
-    expected.getAssignedTask().setTask(populateTask(TASK.newBuilder()));
-
-    assertEquals(
-        ImmutableSet.of(IScheduledTask.build(expected)),
-        ThriftBackfill.backFillScheduledTasks(ImmutableSet.of(task)));
-  }
-
-  @Test
-  public void testJobConfigurationBackfill() {
-    JobConfiguration configuration = new JobConfiguration()
-        .setKey(JOB_KEY.newBuilder())
-        .setTaskConfig(TASK.newBuilder())
-        .setOwner(new Identity().setUser("user"));
-    JobConfiguration expected = new JobConfiguration(configuration);
-    expected.getOwner().setRole(JOB_KEY.getRole());
-    expected.setTaskConfig(populateTask(TASK.newBuilder()));
-
-    assertEquals(
-        IJobConfiguration.build(expected),
-        ThriftBackfill.backFillJobConfiguration(configuration));
-  }
-
-  @Test
-  public void testUpdateBackfillNoDesiredState() {
-    JobUpdate update = update();
-    update.getInstructions().setDesiredState(null);
-    JobUpdate expected = update();
-    expected.getInstructions().setDesiredState(null);
-    populateTask(Iterables.getOnlyElement(expected.getInstructions().getInitialState()).getTask());
-    assertEquals(IJobUpdate.build(expected), ThriftBackfill.backFillJobUpdate(update));
-  }
-
-  private static JobUpdate update() {
-    return new JobUpdate().setInstructions(new JobUpdateInstructions()
-        .setDesiredState(new InstanceTaskConfig().setTask(TASK.newBuilder()))
-        .setInitialState(ImmutableSet.of(new InstanceTaskConfig().setTask(TASK.newBuilder()))));
-  }
-
-  private static TaskConfig populateTask(TaskConfig task) {
-    task.setJobName("name").setEnvironment("env").getOwner().setRole("role");
-    return task;
-  }
-}

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/src/test/java/org/apache/aurora/scheduler/thrift/Fixtures.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/Fixtures.java b/src/test/java/org/apache/aurora/scheduler/thrift/Fixtures.java
index e456056..be98f38 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/Fixtures.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/Fixtures.java
@@ -62,7 +62,7 @@ import static org.junit.Assert.assertEquals;
 final class Fixtures {
   static final String ROLE = "bar_role";
   static final String USER = "foo_user";
-  static final Identity ROLE_IDENTITY = new Identity(ROLE, USER);
+  static final Identity IDENTITY = new Identity().setUser(USER);
   static final String JOB_NAME = "job_foo";
   static final IJobKey JOB_KEY = JobKeys.from(ROLE, "devel", JOB_NAME);
   static final ILockKey LOCK_KEY = ILockKey.build(LockKey.job(JOB_KEY.newBuilder()));
@@ -94,7 +94,7 @@ final class Fixtures {
 
   static JobConfiguration makeJob(TaskConfig task, int shardCount) {
     return new JobConfiguration()
-        .setOwner(ROLE_IDENTITY)
+        .setOwner(IDENTITY)
         .setInstanceCount(shardCount)
         .setTaskConfig(task)
         .setKey(JOB_KEY.newBuilder());
@@ -103,9 +103,7 @@ final class Fixtures {
   static TaskConfig defaultTask(boolean production) {
     return new TaskConfig()
         .setJob(JOB_KEY.newBuilder())
-        .setOwner(new Identity(ROLE, USER))
-        .setEnvironment("devel")
-        .setJobName(JOB_NAME)
+        .setOwner(IDENTITY)
         .setContactEmail("testing@twitter.com")
         .setExecutorConfig(new ExecutorConfig("aurora", "data"))
         .setNumCpus(1)

http://git-wip-us.apache.org/repos/asf/aurora/blob/ec0f38a7/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 0428c77..3ba0342 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java
@@ -98,11 +98,11 @@ import static org.apache.aurora.scheduler.base.Numbers.convertRanges;
 import static org.apache.aurora.scheduler.base.Numbers.toRanges;
 import static org.apache.aurora.scheduler.thrift.Fixtures.CRON_JOB;
 import static org.apache.aurora.scheduler.thrift.Fixtures.CRON_SCHEDULE;
+import static org.apache.aurora.scheduler.thrift.Fixtures.IDENTITY;
 import static org.apache.aurora.scheduler.thrift.Fixtures.JOB_KEY;
 import static org.apache.aurora.scheduler.thrift.Fixtures.LOCK;
 import static org.apache.aurora.scheduler.thrift.Fixtures.QUOTA;
 import static org.apache.aurora.scheduler.thrift.Fixtures.ROLE;
-import static org.apache.aurora.scheduler.thrift.Fixtures.ROLE_IDENTITY;
 import static org.apache.aurora.scheduler.thrift.Fixtures.UPDATE_KEY;
 import static org.apache.aurora.scheduler.thrift.Fixtures.USER;
 import static org.apache.aurora.scheduler.thrift.Fixtures.assertOkResponse;
@@ -148,27 +148,21 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
   @Test
   public void testGetJobSummary() throws Exception {
     long nextCronRunMs = 100;
-    TaskConfig ownedCronJobTask = nonProductionTask()
-        .setJob(JOB_KEY.newBuilder())
-        .setJobName(JOB_KEY.getName())
-        .setOwner(ROLE_IDENTITY)
-        .setEnvironment(JOB_KEY.getEnvironment());
+    TaskConfig ownedCronJobTask = nonProductionTask().setJob(JOB_KEY.newBuilder());
     JobConfiguration ownedCronJob = makeJob()
         .setCronSchedule(CRON_SCHEDULE)
         .setTaskConfig(ownedCronJobTask);
     IScheduledTask ownedCronJobScheduledTask = IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask().setTask(ownedCronJobTask))
         .setStatus(ScheduleStatus.ASSIGNED));
-    Identity otherOwner = new Identity("other", "other");
+    Identity otherOwner = new Identity().setUser("other");
     JobConfiguration unownedCronJob = makeJob()
         .setOwner(otherOwner)
         .setCronSchedule(CRON_SCHEDULE)
         .setKey(JOB_KEY.newBuilder().setRole("other"))
         .setTaskConfig(ownedCronJobTask.deepCopy().setOwner(otherOwner));
     TaskConfig ownedImmediateTaskInfo = defaultTask(false)
-        .setJob(JOB_KEY.newBuilder().setName("immediate"))
-        .setJobName("immediate")
-        .setOwner(ROLE_IDENTITY);
+        .setJob(JOB_KEY.newBuilder().setName("immediate"));
     Set<JobConfiguration> ownedCronJobOnly = ImmutableSet.of(ownedCronJob);
     Set<JobSummary> ownedCronJobSummaryOnly = ImmutableSet.of(
         new JobSummary()
@@ -188,7 +182,7 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
         .setStatus(ScheduleStatus.ASSIGNED));
     JobConfiguration ownedImmediateJob = new JobConfiguration()
         .setKey(JOB_KEY.newBuilder().setName("immediate"))
-        .setOwner(ROLE_IDENTITY)
+        .setOwner(IDENTITY)
         .setInstanceCount(1)
         .setTaskConfig(ownedImmediateTaskInfo);
     Builder query = Query.roleScoped(ROLE);
@@ -243,9 +237,8 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
     String cronSchedule = "* * 31 2 *";
 
     TaskConfig task = nonProductionTask()
-        .setJobName(JOB_KEY.getName())
-        .setOwner(ROLE_IDENTITY)
-        .setEnvironment(JOB_KEY.getEnvironment());
+        .setJob(JOB_KEY.newBuilder())
+        .setOwner(IDENTITY);
     JobConfiguration job = makeJob()
         .setCronSchedule(cronSchedule)
         .setTaskConfig(task);
@@ -393,15 +386,13 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
         .setKey(jobKey2)
         .setTaskConfig(nonProductionTask());
     TaskConfig immediateTaskConfig = defaultTask(false)
-        .setJob(JOB_KEY.newBuilder().setName("immediate"))
-        .setJobName("immediate")
-        .setOwner(ROLE_IDENTITY);
+        .setJob(JOB_KEY.newBuilder().setName("immediate"));
     IScheduledTask immediateTask = IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask().setTask(immediateTaskConfig))
         .setStatus(ScheduleStatus.ASSIGNED));
     JobConfiguration immediateJob = new JobConfiguration()
         .setKey(JOB_KEY.newBuilder().setName("immediate"))
-        .setOwner(ROLE_IDENTITY)
+        .setOwner(IDENTITY)
         .setInstanceCount(1)
         .setTaskConfig(immediateTaskConfig);
 
@@ -421,26 +412,21 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
 
   @Test
   public void testGetJobs() throws Exception {
-    TaskConfig ownedCronJobTask = nonProductionTask()
-        .setJobName(JOB_KEY.getName())
-        .setOwner(ROLE_IDENTITY)
-        .setEnvironment(JOB_KEY.getEnvironment());
+    TaskConfig ownedCronJobTask = nonProductionTask();
     JobConfiguration ownedCronJob = makeJob()
         .setCronSchedule(CRON_SCHEDULE)
         .setTaskConfig(ownedCronJobTask);
     IScheduledTask ownedCronJobScheduledTask = IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask().setTask(ownedCronJobTask))
         .setStatus(ScheduleStatus.ASSIGNED));
-    Identity otherOwner = new Identity("other", "other");
+    Identity otherOwner = new Identity().setUser("other");
     JobConfiguration unownedCronJob = makeJob()
         .setOwner(otherOwner)
         .setCronSchedule(CRON_SCHEDULE)
         .setKey(JOB_KEY.newBuilder().setRole("other"))
         .setTaskConfig(ownedCronJobTask.deepCopy().setOwner(otherOwner));
     TaskConfig ownedImmediateTaskInfo = defaultTask(false)
-        .setJob(JOB_KEY.newBuilder().setName("immediate"))
-        .setJobName("immediate")
-        .setOwner(ROLE_IDENTITY);
+        .setJob(JOB_KEY.newBuilder().setName("immediate"));
     Set<JobConfiguration> ownedCronJobOnly = ImmutableSet.of(ownedCronJob);
     Set<JobConfiguration> unownedCronJobOnly = ImmutableSet.of(unownedCronJob);
     Set<JobConfiguration> bothCronJobs = ImmutableSet.of(ownedCronJob, unownedCronJob);
@@ -449,7 +435,7 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
         .setStatus(ScheduleStatus.ASSIGNED));
     JobConfiguration ownedImmediateJob = new JobConfiguration()
         .setKey(JOB_KEY.newBuilder().setName("immediate"))
-        .setOwner(ROLE_IDENTITY)
+        .setOwner(IDENTITY)
         .setInstanceCount(1)
         .setTaskConfig(ownedImmediateTaskInfo);
     Query.Builder query = Query.roleScoped(ROLE).active();
@@ -649,8 +635,8 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
 
   @Test
   public void testGetRoleSummary() throws Exception {
-    final String BAZ_ROLE = "baz_role";
-    final Identity BAZ_ROLE_IDENTITY = new Identity(BAZ_ROLE, USER);
+    String bazRole = "baz_role";
+    Identity bazRoleIdentity = new Identity().setUser(USER);
 
     JobConfiguration cronJobOne = makeJob()
         .setCronSchedule("1 * * * *")
@@ -663,32 +649,28 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
 
     JobConfiguration cronJobThree = makeJob()
         .setCronSchedule("3 * * * *")
-        .setKey(JOB_KEY.newBuilder().setRole(BAZ_ROLE))
+        .setKey(JOB_KEY.newBuilder().setRole(bazRole))
         .setTaskConfig(nonProductionTask())
-        .setOwner(BAZ_ROLE_IDENTITY);
+        .setOwner(bazRoleIdentity);
 
     Set<JobConfiguration> crons = ImmutableSet.of(cronJobOne, cronJobTwo, cronJobThree);
 
     TaskConfig immediateTaskConfig = defaultTask(false)
-        .setJob(JOB_KEY.newBuilder().setName("immediate"))
-        .setJobName("immediate")
-        .setOwner(ROLE_IDENTITY);
+        .setJob(JOB_KEY.newBuilder().setName("immediate"));
     IScheduledTask task1 = IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask().setTask(immediateTaskConfig)));
     IScheduledTask task2 = IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask().setTask(immediateTaskConfig.setNumCpus(2))));
 
     TaskConfig immediateTaskConfigTwo = defaultTask(false)
-        .setJob(JOB_KEY.newBuilder().setRole(BAZ_ROLE_IDENTITY.getRole()).setName("immediateTwo"))
-        .setJobName("immediateTwo")
-        .setOwner(BAZ_ROLE_IDENTITY);
+        .setJob(JOB_KEY.newBuilder().setRole(bazRole).setName("immediateTwo"))
+        .setOwner(bazRoleIdentity);
     IScheduledTask task3 = IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask().setTask(immediateTaskConfigTwo)));
 
     TaskConfig immediateTaskConfigThree = defaultTask(false)
-        .setJob(JOB_KEY.newBuilder().setRole(BAZ_ROLE_IDENTITY.getRole()).setName("immediateThree"))
-        .setJobName("immediateThree")
-        .setOwner(BAZ_ROLE_IDENTITY);
+        .setJob(JOB_KEY.newBuilder().setRole(bazRole).setName("immediateThree"))
+        .setOwner(bazRoleIdentity);
     IScheduledTask task4 = IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask().setTask(immediateTaskConfigThree)));
 
@@ -702,7 +684,7 @@ public class ReadOnlySchedulerImplTest extends EasyMockTest {
     expectedResult.addToSummaries(
         new RoleSummary().setRole(ROLE).setCronJobCount(2).setJobCount(1));
     expectedResult.addToSummaries(
-        new RoleSummary().setRole(BAZ_ROLE).setCronJobCount(1).setJobCount(2));
+        new RoleSummary().setRole(bazRole).setCronJobCount(1).setJobCount(2));
 
     control.replay();
 


Mime
View raw message