aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zma...@apache.org
Subject [2/2] aurora git commit: Move Aurora to v1 Protobufs.
Date Mon, 06 Feb 2017 23:10:09 GMT
Move Aurora to v1 Protobufs.

This is the first step in moving Aurora to the V1 API from Mesos. This patch
moves most of the code to v1 Protobufs. This means all peices of code that do
not interact with Mesos now handle only v1 Protobufs.

Classes that interact with Mesos directly are:

* `org.apache.aurora.scheduler.mesos.SchedulerDriverService`
* `org.apache.aurora.scheduler.mesos.MesosSchedulerImpl`
* `org.apache.aurora.scheduler.mesos.DriverFactoryImpl`

These classes handle unversioned Protobufs and use the `ProtosConversion` class
to convert them to v1 Protobufs that can be safely passed to the rest of the
code.

Bugs closed: AURORA-1886

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


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

Branch: refs/heads/master
Commit: cd4df56c9daddce158c10210502bae5738060753
Parents: f88b7f3
Author: Zameer Manji <zmanji@apache.org>
Authored: Mon Feb 6 15:09:55 2017 -0800
Committer: Zameer Manji <zmanji@apache.org>
Committed: Mon Feb 6 15:09:55 2017 -0800

----------------------------------------------------------------------
 .../org/apache/aurora/benchmark/Offers.java     |  4 +-
 .../aurora/benchmark/StatusUpdateBenchmark.java |  5 +-
 .../aurora/benchmark/fakes/FakeDriver.java      |  2 +-
 .../benchmark/fakes/FakeOfferManager.java       |  4 +-
 .../org/apache/aurora/scheduler/HostOffer.java  |  2 +-
 .../aurora/scheduler/SchedulerModule.java       |  2 +-
 .../aurora/scheduler/TaskStatusHandler.java     |  2 +-
 .../aurora/scheduler/TaskStatusHandlerImpl.java |  2 +-
 .../aurora/scheduler/base/Conversions.java      |  8 +-
 .../apache/aurora/scheduler/base/Numbers.java   |  6 +-
 .../aurora/scheduler/base/TaskTestUtil.java     |  6 +-
 .../configuration/executor/ExecutorConfig.java  |  4 +-
 .../configuration/executor/ExecutorModule.java  | 14 +--
 .../executor/ExecutorSettingsLoader.java        |  6 +-
 .../configuration/executor/Executors.java       |  2 +-
 .../aurora/scheduler/events/PubsubEvent.java    |  4 +-
 .../mesos/CommandLineDriverSettingsModule.java  | 10 +-
 .../apache/aurora/scheduler/mesos/Driver.java   |  8 +-
 .../aurora/scheduler/mesos/DriverFactory.java   |  2 +-
 .../scheduler/mesos/DriverFactoryImpl.java      | 18 ++--
 .../aurora/scheduler/mesos/DriverSettings.java  |  2 +-
 .../scheduler/mesos/MesosSchedulerImpl.java     | 20 ++--
 .../scheduler/mesos/MesosTaskFactory.java       | 28 +++---
 .../scheduler/mesos/ProtosConversion.java       | 99 ++++++++++++++++++++
 .../scheduler/mesos/SchedulerDriverService.java | 44 ++++++---
 .../aurora/scheduler/mesos/TaskStatusStats.java |  6 +-
 .../scheduler/mesos/TestExecutorSettings.java   | 12 +--
 .../aurora/scheduler/offers/OfferManager.java   | 24 ++---
 .../preemptor/PendingTaskProcessor.java         |  2 +-
 .../aurora/scheduler/preemptor/Preemptor.java   |  4 +-
 .../reconciliation/TaskReconciler.java          |  8 +-
 .../scheduler/resources/AcceptedOffer.java      |  4 +-
 .../resources/MesosResourceConverter.java       |  4 +-
 .../scheduler/resources/ResourceManager.java    |  4 +-
 .../scheduler/resources/ResourceMapper.java     |  2 +-
 .../scheduler/resources/ResourceType.java       |  2 +-
 .../aurora/scheduler/state/StateManager.java    |  4 +-
 .../scheduler/state/StateManagerImpl.java       |  4 +-
 .../aurora/scheduler/state/TaskAssigner.java    | 10 +-
 .../scheduler/storage/AttributeStore.java       |  2 +-
 .../java/org/apache/aurora/ProtobufsTest.java   |  2 +-
 .../scheduler/TaskStatusHandlerImplTest.java    |  6 +-
 .../aurora/scheduler/app/SchedulerIT.java       | 21 ++---
 .../aurora/scheduler/app/local/FakeMaster.java  |  6 +-
 .../scheduler/app/local/LocalSchedulerMain.java |  2 +-
 .../local/simulator/ClusterSimulatorModule.java | 10 +-
 .../app/local/simulator/FakeSlaves.java         |  7 +-
 .../local/simulator/events/OfferAccepted.java   |  4 +-
 .../aurora/scheduler/base/ConversionsTest.java  |  2 +-
 .../executor/ExecutorModuleTest.java            |  4 +-
 .../executor/ExecutorSettingsLoaderTest.java    |  4 +-
 .../aurora/scheduler/http/OffersTest.java       |  4 +-
 .../CommandLineDriverSettingsModuleTest.java    |  6 +-
 .../scheduler/mesos/MesosSchedulerImplTest.java | 95 ++++++++++---------
 .../mesos/MesosTaskFactoryImplTest.java         | 32 +++----
 .../scheduler/mesos/ProtosConversionTest.java   | 41 ++++++++
 .../mesos/SchedulerDriverServiceTest.java       | 11 ++-
 .../scheduler/mesos/TaskStatusStatsTest.java    | 14 +--
 .../scheduler/offers/OfferManagerImplTest.java  | 12 +--
 .../apache/aurora/scheduler/offers/Offers.java  | 10 +-
 .../preemptor/PendingTaskProcessorTest.java     |  4 +-
 .../preemptor/PreemptionVictimFilterTest.java   |  8 +-
 .../scheduler/preemptor/PreemptorImplTest.java  |  4 +-
 .../reconciliation/TaskReconcilerTest.java      |  2 +-
 .../scheduler/resources/AcceptedOfferTest.java  |  4 +-
 .../resources/MesosResourceConverterTest.java   |  2 +-
 .../scheduler/resources/PortMapperTest.java     |  2 +-
 .../resources/ResourceManagerTest.java          | 10 +-
 .../scheduler/resources/ResourceTestUtil.java   |  6 +-
 .../scheduler/state/StateManagerImplTest.java   |  4 +-
 .../scheduler/state/TaskAssignerImplTest.java   | 30 +++---
 .../scheduler/stats/AsyncStatsModuleTest.java   |  4 +-
 .../aurora/scheduler/thrift/ThriftIT.java       |  2 +-
 73 files changed, 474 insertions(+), 297 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/jmh/java/org/apache/aurora/benchmark/Offers.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/Offers.java b/src/jmh/java/org/apache/aurora/benchmark/Offers.java
index 144f47e..2b46326 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/Offers.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/Offers.java
@@ -27,7 +27,7 @@ import org.apache.aurora.scheduler.base.Numbers;
 import org.apache.aurora.scheduler.offers.OfferManager;
 import org.apache.aurora.scheduler.resources.ResourceType;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 
 import static org.apache.aurora.scheduler.resources.ResourceType.CPUS;
 import static org.apache.aurora.scheduler.resources.ResourceType.DISK_MB;
@@ -106,7 +106,7 @@ final class Offers {
                     IntStream.range(1, ports).boxed().collect(Collectors.toSet()))))
             .setId(Protos.OfferID.newBuilder().setValue(String.format(OFFER_ID_FORMAT, id++)))
             .setFrameworkId(Protos.FrameworkID.newBuilder().setValue(FRAMEWORK_ID))
-            .setSlaveId(Protos.SlaveID.newBuilder().setValue(attributes.getSlaveId()))
+            .setAgentId(Protos.AgentID.newBuilder().setValue(attributes.getSlaveId()))
             .setHostname(String.format(attributes.getHost()))
             .build();
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java b/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
index a649239..6c2bf46 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
@@ -62,6 +62,7 @@ import org.apache.aurora.scheduler.mesos.Driver;
 import org.apache.aurora.scheduler.mesos.DriverFactory;
 import org.apache.aurora.scheduler.mesos.DriverSettings;
 import org.apache.aurora.scheduler.mesos.MesosSchedulerImpl;
+import org.apache.aurora.scheduler.mesos.ProtosConversion;
 import org.apache.aurora.scheduler.mesos.TestExecutorSettings;
 import org.apache.aurora.scheduler.offers.OfferManager;
 import org.apache.aurora.scheduler.preemptor.ClusterStateImpl;
@@ -72,8 +73,8 @@ import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
 import org.apache.aurora.scheduler.storage.db.DbUtil;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.IServerInfo;
-import org.apache.mesos.Protos;
 import org.apache.mesos.Scheduler;
+import org.apache.mesos.v1.Protos;
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Fork;
@@ -278,7 +279,7 @@ public class StatusUpdateBenchmark {
           .setTaskId(Protos.TaskID.newBuilder().setValue(taskId).build())
           .build();
 
-      scheduler.statusUpdate(new FakeSchedulerDriver(), status);
+      scheduler.statusUpdate(new FakeSchedulerDriver(), ProtosConversion.convert(status));
     }
 
     // Wait for all task transitions to complete.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeDriver.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeDriver.java b/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeDriver.java
index 9674c76..45f59c0 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeDriver.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeDriver.java
@@ -18,7 +18,7 @@ import java.util.Collection;
 import com.google.common.util.concurrent.AbstractIdleService;
 
 import org.apache.aurora.scheduler.mesos.Driver;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 
 public class FakeDriver extends AbstractIdleService implements Driver {
   @Override

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeOfferManager.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeOfferManager.java b/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeOfferManager.java
index fbd24ea..6f2ca35 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeOfferManager.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/fakes/FakeOfferManager.java
@@ -19,7 +19,7 @@ import org.apache.aurora.scheduler.HostOffer;
 import org.apache.aurora.scheduler.base.TaskGroupKey;
 import org.apache.aurora.scheduler.events.PubsubEvent;
 import org.apache.aurora.scheduler.offers.OfferManager;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 
 public class FakeOfferManager implements OfferManager {
   @Override
@@ -58,7 +58,7 @@ public class FakeOfferManager implements OfferManager {
   }
 
   @Override
-  public Optional<HostOffer> getOffer(Protos.SlaveID slaveId) {
+  public Optional<HostOffer> getOffer(Protos.AgentID agentId) {
     return Optional.absent();
   }
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/HostOffer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/HostOffer.java b/src/main/java/org/apache/aurora/scheduler/HostOffer.java
index ad30bf9..23f0600 100644
--- a/src/main/java/org/apache/aurora/scheduler/HostOffer.java
+++ b/src/main/java/org/apache/aurora/scheduler/HostOffer.java
@@ -27,7 +27,7 @@ import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.scheduler.resources.ResourceManager.bagFromMesosResources;
 import static org.apache.aurora.scheduler.resources.ResourceManager.getOfferResources;
-import static org.apache.mesos.Protos.Offer;
+import static org.apache.mesos.v1.Protos.Offer;
 
 /**
  * An available resource in the cluster.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java b/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
index 2ec3967..a62bb06 100644
--- a/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/SchedulerModule.java
@@ -36,7 +36,7 @@ import org.apache.aurora.scheduler.TaskIdGenerator.TaskIdGeneratorImpl;
 import org.apache.aurora.scheduler.base.AsyncUtil;
 import org.apache.aurora.scheduler.events.PubsubEventModule;
 import org.apache.aurora.scheduler.storage.Storage;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/TaskStatusHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TaskStatusHandler.java b/src/main/java/org/apache/aurora/scheduler/TaskStatusHandler.java
index 3e132ee..b8a8450 100644
--- a/src/main/java/org/apache/aurora/scheduler/TaskStatusHandler.java
+++ b/src/main/java/org/apache/aurora/scheduler/TaskStatusHandler.java
@@ -13,7 +13,7 @@
  */
 package org.apache.aurora.scheduler;
 
-import org.apache.mesos.Protos.TaskStatus;
+import org.apache.mesos.v1.Protos.TaskStatus;
 
 /**
  * A handler of task status updates.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java b/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
index 6afafe8..1aacecf 100644
--- a/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
@@ -37,7 +37,7 @@ import org.apache.aurora.scheduler.state.StateManager;
 import org.apache.aurora.scheduler.stats.CachedCounters;
 import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
-import org.apache.mesos.Protos.TaskStatus;
+import org.apache.mesos.v1.Protos.TaskStatus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Conversions.java b/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
index d08b6cf..8295216 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Conversions.java
@@ -30,9 +30,9 @@ import org.apache.aurora.gen.HostAttributes;
 import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.scheduler.configuration.ConfigurationManager;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.Offer;
-import org.apache.mesos.Protos.TaskState;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.Offer;
+import org.apache.mesos.v1.Protos.TaskState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -136,7 +136,7 @@ public final class Conversions {
         FluentIterable.from(valuesByName.asMap().entrySet())
             .transform(ATTRIBUTE_CONVERTER)
             .toSet())
-        .setSlaveId(offer.getSlaveId().getValue()));
+        .setSlaveId(offer.getAgentId().getValue()));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Numbers.java b/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
index 1b278e2..4f0d120 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Sets;
 
 import org.apache.aurora.GuavaUtils;
 import org.apache.aurora.scheduler.storage.entities.IRange;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 
 /**
  * Utility class for working with numbers.
@@ -43,9 +43,9 @@ public final class Numbers {
           .build();
 
   /**
-   * Convert {@link org.apache.mesos.Protos.Value.Range} to set of integers.
+   * Convert {@link org.apache.mesos.v1.Protos.Value.Range} to set of integers.
    */
-  public static final Function<org.apache.mesos.Protos.Value.Range, Set<Integer>> RANGE_TO_MEMBERS =
+  public static final Function<Protos.Value.Range, Set<Integer>> RANGE_TO_MEMBERS =
       range -> ContiguousSet.create(
           Range.closed((int) range.getBegin(), (int) range.getEnd()),
           DiscreteDomain.integers());

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/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 aba7300..f0b148c 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java
@@ -50,9 +50,9 @@ import org.apache.aurora.scheduler.storage.entities.IJobKey;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.apache.aurora.scheduler.storage.log.ThriftBackfill;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.ExecutorID;
-import org.apache.mesos.Protos.ExecutorInfo;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.ExecutorID;
+import org.apache.mesos.v1.Protos.ExecutorInfo;
 
 /**
  * Convenience methods for working with tasks.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorConfig.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorConfig.java b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorConfig.java
index 32bafb2..805a349 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorConfig.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorConfig.java
@@ -18,8 +18,8 @@ import java.util.Objects;
 
 import com.google.common.base.MoreObjects;
 
-import org.apache.mesos.Protos.ExecutorInfo;
-import org.apache.mesos.Protos.Volume;
+import org.apache.mesos.v1.Protos.ExecutorInfo;
+import org.apache.mesos.v1.Protos.Volume;
 
 import static java.util.Objects.requireNonNull;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
index 0d6a8c9..4dac975 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModule.java
@@ -38,13 +38,13 @@ import org.apache.aurora.common.quantity.Data;
 import org.apache.aurora.gen.Volume;
 import org.apache.aurora.gen.apiConstants;
 import org.apache.aurora.scheduler.resources.ResourceType;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.CommandInfo;
-import org.apache.mesos.Protos.CommandInfo.URI;
-import org.apache.mesos.Protos.ExecutorInfo;
-import org.apache.mesos.Protos.Resource;
-import org.apache.mesos.Protos.Value.Scalar;
-import org.apache.mesos.Protos.Value.Type;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.CommandInfo;
+import org.apache.mesos.v1.Protos.CommandInfo.URI;
+import org.apache.mesos.v1.Protos.ExecutorInfo;
+import org.apache.mesos.v1.Protos.Resource;
+import org.apache.mesos.v1.Protos.Value.Scalar;
+import org.apache.mesos.v1.Protos.Value.Type;
 
 import static org.apache.aurora.scheduler.resources.ResourceType.CPUS;
 import static org.apache.aurora.scheduler.resources.ResourceType.RAM_MB;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoader.java b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoader.java
index 18ff2e2..af28913 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoader.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoader.java
@@ -26,9 +26,9 @@ import com.google.common.io.CharStreams;
 import com.hubspot.jackson.datatype.protobuf.ProtobufModule;
 
 import org.apache.aurora.GuavaUtils;
-import org.apache.mesos.Protos.ExecutorID;
-import org.apache.mesos.Protos.ExecutorInfo;
-import org.apache.mesos.Protos.Volume;
+import org.apache.mesos.v1.Protos.ExecutorID;
+import org.apache.mesos.v1.Protos.ExecutorInfo;
+import org.apache.mesos.v1.Protos.Volume;
 
 import static com.fasterxml.jackson.databind.PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/configuration/executor/Executors.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/executor/Executors.java b/src/main/java/org/apache/aurora/scheduler/configuration/executor/Executors.java
index 6ac2d00..d2db535 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/executor/Executors.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/executor/Executors.java
@@ -13,7 +13,7 @@
  */
 package org.apache.aurora.scheduler.configuration.executor;
 
-import org.apache.mesos.Protos.ExecutorID;
+import org.apache.mesos.v1.Protos.ExecutorID;
 
 /**
  * Utility class for executor-related fields.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java b/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
index 70b5470..0637eb7 100644
--- a/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
+++ b/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
@@ -26,8 +26,8 @@ import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.filter.SchedulingFilter.Veto;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.TaskStatus;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.TaskStatus;
 
 import static java.util.Objects.requireNonNull;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java b/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
index 36c69be..ad6110a 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModule.java
@@ -30,14 +30,14 @@ import org.apache.aurora.common.args.CmdLine;
 import org.apache.aurora.common.args.constraints.NotNull;
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.mesos.Protos.FrameworkInfo;
-import static org.apache.mesos.Protos.FrameworkInfo.Capability;
-import static org.apache.mesos.Protos.FrameworkInfo.Capability.Type.GPU_RESOURCES;
-import static org.apache.mesos.Protos.FrameworkInfo.Capability.Type.REVOCABLE_RESOURCES;
+import static org.apache.mesos.v1.Protos.FrameworkInfo;
+import static org.apache.mesos.v1.Protos.FrameworkInfo.Capability;
+import static org.apache.mesos.v1.Protos.FrameworkInfo.Capability.Type.GPU_RESOURCES;
+import static org.apache.mesos.v1.Protos.FrameworkInfo.Capability.Type.REVOCABLE_RESOURCES;
 
 /**
  * Creates and binds {@link DriverSettings} based on values found on the command line.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/Driver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/Driver.java b/src/main/java/org/apache/aurora/scheduler/mesos/Driver.java
index bb208ea..71547ce 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/Driver.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/Driver.java
@@ -17,10 +17,10 @@ import java.util.Collection;
 
 import com.google.common.util.concurrent.Service;
 
-import org.apache.mesos.Protos.Filters;
-import org.apache.mesos.Protos.Offer.Operation;
-import org.apache.mesos.Protos.OfferID;
-import org.apache.mesos.Protos.TaskStatus;
+import org.apache.mesos.v1.Protos.Filters;
+import org.apache.mesos.v1.Protos.Offer.Operation;
+import org.apache.mesos.v1.Protos.OfferID;
+import org.apache.mesos.v1.Protos.TaskStatus;
 
 /**
  * Wraps the mesos Scheduler driver to ensure its used in a valid lifecycle; namely:

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactory.java b/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactory.java
index 92d8924..88a12b8 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactory.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactory.java
@@ -15,9 +15,9 @@ package org.apache.aurora.scheduler.mesos;
 
 import com.google.common.base.Optional;
 
-import org.apache.mesos.Protos;
 import org.apache.mesos.Scheduler;
 import org.apache.mesos.SchedulerDriver;
+import org.apache.mesos.v1.Protos;
 
 /**
  * A layer over the constructor for {@link org.apache.mesos.MesosSchedulerDriver}. This is needed

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactoryImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactoryImpl.java b/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactoryImpl.java
index a5f5e99..2fc37e4 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactoryImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/DriverFactoryImpl.java
@@ -16,11 +16,13 @@ package org.apache.aurora.scheduler.mesos;
 import com.google.common.base.Optional;
 
 import org.apache.mesos.MesosSchedulerDriver;
-import org.apache.mesos.Protos;
+import org.apache.mesos.Protos.Credential;
+import org.apache.mesos.Protos.FrameworkInfo;
 import org.apache.mesos.Scheduler;
 import org.apache.mesos.SchedulerDriver;
+import org.apache.mesos.v1.Protos;
 
-import static org.apache.mesos.Protos.FrameworkInfo;
+import static org.apache.aurora.scheduler.mesos.ProtosConversion.convert;
 
 /**
  * A minimal shim over the constructor to {@link MesosSchedulerDriver} to minimize code that
@@ -32,19 +34,23 @@ class DriverFactoryImpl implements DriverFactory {
   public SchedulerDriver create(
       Scheduler scheduler,
       Optional<Protos.Credential> credentials,
-      FrameworkInfo frameworkInfo,
+      Protos.FrameworkInfo frameworkInfo,
       String master) {
+
+    FrameworkInfo convertedFrameworkInfo = convert(frameworkInfo);
+    Optional<Credential> convertedCredentials = credentials.transform(ProtosConversion::convert);
+
     if (credentials.isPresent()) {
       return new MesosSchedulerDriver(
           scheduler,
-          frameworkInfo,
+          convertedFrameworkInfo,
           master,
           false, // Disable implicit acknowledgements.
-          credentials.get());
+          convertedCredentials.get());
     } else {
       return new MesosSchedulerDriver(
           scheduler,
-          frameworkInfo,
+          convertedFrameworkInfo,
           master,
           false); // Disable implicit acknowledgements.
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/DriverSettings.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/DriverSettings.java b/src/main/java/org/apache/aurora/scheduler/mesos/DriverSettings.java
index 85d471f..f477404 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/DriverSettings.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/DriverSettings.java
@@ -16,7 +16,7 @@ package org.apache.aurora.scheduler.mesos;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 
 import static java.util.Objects.requireNonNull;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java b/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
index 7b2614f..1730103 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
@@ -47,6 +47,7 @@ import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 import org.apache.mesos.Protos.ExecutorID;
 import org.apache.mesos.Protos.FrameworkID;
 import org.apache.mesos.Protos.MasterInfo;
+import org.apache.mesos.Protos.Offer;
 import org.apache.mesos.Protos.OfferID;
 import org.apache.mesos.Protos.SlaveID;
 import org.apache.mesos.Protos.TaskStatus;
@@ -61,7 +62,6 @@ import static java.lang.annotation.ElementType.PARAMETER;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 import static java.util.Objects.requireNonNull;
 
-import static org.apache.mesos.Protos.Offer;
 import static org.apache.mesos.Protos.TaskStatus.Reason.REASON_RECONCILIATION;
 
 /**
@@ -190,12 +190,13 @@ public class MesosSchedulerImpl implements Scheduler {
       //                offers when the host attributes cannot be found. (AURORA-137)
       storage.write((NoResult.Quiet) storeProvider -> {
         for (Offer offer : offers) {
+          org.apache.mesos.v1.Protos.Offer o = ProtosConversion.convert(offer);
           IHostAttributes attributes =
-              AttributeStore.Util.mergeOffer(storeProvider.getAttributeStore(), offer);
+              AttributeStore.Util.mergeOffer(storeProvider.getAttributeStore(), o);
           storeProvider.getAttributeStore().saveHostAttributes(attributes);
           log.debug("Received offer: {}", offer);
           counters.get("scheduler_resource_offers").incrementAndGet();
-          offerManager.addOffer(new HostOffer(offer, attributes));
+          offerManager.addOffer(new HostOffer(o, attributes));
         }
       });
     });
@@ -204,7 +205,7 @@ public class MesosSchedulerImpl implements Scheduler {
   @Override
   public void offerRescinded(SchedulerDriver schedulerDriver, OfferID offerId) {
     log.info("Offer rescinded: " + offerId);
-    offerManager.cancelOffer(offerId);
+    offerManager.cancelOffer(ProtosConversion.convert(offerId));
     offersRescinded.incrementAndGet();
   }
 
@@ -240,15 +241,16 @@ public class MesosSchedulerImpl implements Scheduler {
   @Override
   public void statusUpdate(SchedulerDriver driver, TaskStatus status) {
     logStatusUpdate(log, status);
+    org.apache.mesos.v1.Protos.TaskStatus converted = ProtosConversion.convert(status);
     eventSink.post(new TaskStatusReceived(
-        status.getState(),
-        Optional.fromNullable(status.getSource()),
-        status.hasReason() ? Optional.of(status.getReason()) : Optional.absent(),
-        Optional.fromNullable(status.getTimestamp()).transform(SECONDS_TO_MICROS)));
+        converted.getState(),
+        Optional.fromNullable(converted.getSource()),
+        converted.hasReason() ? Optional.of(converted.getReason()) : Optional.absent(),
+        Optional.fromNullable(converted.getTimestamp()).transform(SECONDS_TO_MICROS)));
 
     try {
       // The status handler is responsible for acknowledging the update.
-      taskStatusHandler.statusUpdate(status);
+      taskStatusHandler.statusUpdate(converted);
     } catch (SchedulerException e) {
       log.error("Status update failed due to scheduler exception: " + e, e);
       // We re-throw the exception here to trigger an abort of the driver.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/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 3d5c3bd..0d639f6 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/MesosTaskFactory.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/MesosTaskFactory.java
@@ -44,19 +44,19 @@ import org.apache.aurora.scheduler.storage.entities.IJobKey;
 import org.apache.aurora.scheduler.storage.entities.IMesosContainer;
 import org.apache.aurora.scheduler.storage.entities.IServerInfo;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.CommandInfo;
-import org.apache.mesos.Protos.ContainerInfo;
-import org.apache.mesos.Protos.DiscoveryInfo;
-import org.apache.mesos.Protos.ExecutorID;
-import org.apache.mesos.Protos.ExecutorInfo;
-import org.apache.mesos.Protos.Label;
-import org.apache.mesos.Protos.Labels;
-import org.apache.mesos.Protos.Offer;
-import org.apache.mesos.Protos.Port;
-import org.apache.mesos.Protos.Resource;
-import org.apache.mesos.Protos.TaskID;
-import org.apache.mesos.Protos.TaskInfo;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.CommandInfo;
+import org.apache.mesos.v1.Protos.ContainerInfo;
+import org.apache.mesos.v1.Protos.DiscoveryInfo;
+import org.apache.mesos.v1.Protos.ExecutorID;
+import org.apache.mesos.v1.Protos.ExecutorInfo;
+import org.apache.mesos.v1.Protos.Label;
+import org.apache.mesos.v1.Protos.Labels;
+import org.apache.mesos.v1.Protos.Offer;
+import org.apache.mesos.v1.Protos.Port;
+import org.apache.mesos.v1.Protos.Resource;
+import org.apache.mesos.v1.Protos.TaskID;
+import org.apache.mesos.v1.Protos.TaskInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -184,7 +184,7 @@ public interface MesosTaskFactory {
       TaskInfo.Builder taskBuilder = TaskInfo.newBuilder()
           .setName(JobKeys.canonicalString(Tasks.getJob(task)))
           .setTaskId(TaskID.newBuilder().setValue(task.getTaskId()))
-          .setSlaveId(offer.getSlaveId())
+          .setAgentId(offer.getAgentId())
           .addAllResources(resources);
 
       configureTaskLabels(config, taskBuilder);

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/ProtosConversion.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/ProtosConversion.java b/src/main/java/org/apache/aurora/scheduler/mesos/ProtosConversion.java
new file mode 100644
index 0000000..bc9e23b
--- /dev/null
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/ProtosConversion.java
@@ -0,0 +1,99 @@
+/**
+ * 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.mesos;
+
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import com.google.protobuf.MessageLite;
+
+import org.apache.mesos.v1.Protos;
+
+/**
+ * Utility class to convert to and from v1 and unversioned Mesos protobufs.
+ *
+ * The conversion process is the same process Mesos takes internally.
+ *
+ * Note that this should be package private, but some local simulator code needs to convert too.
+ */
+public final class ProtosConversion {
+  private ProtosConversion() {
+    // Utility Class
+  }
+
+  @SuppressWarnings("unchecked")
+  private static <T extends MessageLite> T convert(MessageLite m, T.Builder builder) {
+    ByteString data = m.toByteString();
+    builder.clear();
+
+    try {
+      builder.mergeFrom(data);
+    } catch (InvalidProtocolBufferException e) {
+      throw new RuntimeException(e);
+    }
+
+    return (T) builder.build();
+  }
+
+  // Methods to convert from unversioned to V1.
+
+  public static Protos.Offer convert(org.apache.mesos.Protos.Offer o) {
+    return convert(o, Protos.Offer.newBuilder());
+  }
+
+  public static Protos.OfferID convert(org.apache.mesos.Protos.OfferID id) {
+    return convert(id, Protos.OfferID.newBuilder());
+  }
+
+  public static Protos.TaskStatus convert(org.apache.mesos.Protos.TaskStatus s) {
+    return convert(s, Protos.TaskStatus.newBuilder());
+  }
+
+  // Methods to convert from V1 to unversioned.
+
+  public static org.apache.mesos.Protos.FrameworkID convert(Protos.FrameworkID id) {
+    return convert(id, org.apache.mesos.Protos.FrameworkID.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.TaskID convert(Protos.TaskID id) {
+    return convert(id, org.apache.mesos.Protos.TaskID.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.OfferID convert(Protos.OfferID id) {
+    return convert(id, org.apache.mesos.Protos.OfferID.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.Offer.Operation convert(Protos.Offer.Operation op) {
+    return convert(op, org.apache.mesos.Protos.Offer.Operation.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.Filters convert(Protos.Filters f) {
+    return convert(f, org.apache.mesos.Protos.Filters.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.TaskStatus convert(Protos.TaskStatus f) {
+    return convert(f, org.apache.mesos.Protos.TaskStatus.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.FrameworkInfo convert(Protos.FrameworkInfo f) {
+    return convert(f, org.apache.mesos.Protos.FrameworkInfo.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.Credential convert(Protos.Credential f) {
+    return convert(f, org.apache.mesos.Protos.Credential.newBuilder());
+  }
+
+  public static org.apache.mesos.Protos.Offer convert(Protos.Offer f) {
+    return convert(f, org.apache.mesos.Protos.Offer.newBuilder());
+  }
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/SchedulerDriverService.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/SchedulerDriverService.java b/src/main/java/org/apache/aurora/scheduler/mesos/SchedulerDriverService.java
index c89be79..f65a29d 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/SchedulerDriverService.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/SchedulerDriverService.java
@@ -20,6 +20,7 @@ import java.util.concurrent.atomic.AtomicLong;
 import javax.inject.Inject;
 
 import com.google.common.base.Optional;
+import com.google.common.collect.Collections2;
 import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.AbstractIdleService;
 import com.google.common.util.concurrent.Futures;
@@ -27,12 +28,15 @@ import com.google.common.util.concurrent.SettableFuture;
 
 import org.apache.aurora.common.stats.Stats;
 import org.apache.aurora.scheduler.storage.Storage;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.FrameworkID;
-import org.apache.mesos.Protos.FrameworkInfo;
+import org.apache.mesos.Protos.Filters;
 import org.apache.mesos.Protos.Offer.Operation;
+import org.apache.mesos.Protos.OfferID;
+import org.apache.mesos.Protos.Status;
+import org.apache.mesos.Protos.TaskID;
+import org.apache.mesos.Protos.TaskStatus;
 import org.apache.mesos.Scheduler;
 import org.apache.mesos.SchedulerDriver;
+import org.apache.mesos.v1.Protos;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,11 +83,11 @@ class SchedulerDriverService extends AbstractIdleService implements Driver {
       LOG.warn("Connecting to master without authentication!");
     }
 
-    FrameworkInfo.Builder frameworkBuilder = driverSettings.getFrameworkInfo().toBuilder();
+    Protos.FrameworkInfo.Builder frameworkBuilder = driverSettings.getFrameworkInfo().toBuilder();
 
     if (frameworkId.isPresent()) {
       LOG.info("Found persisted framework ID: " + frameworkId);
-      frameworkBuilder.setId(FrameworkID.newBuilder().setValue(frameworkId.get()));
+      frameworkBuilder.setId(Protos.FrameworkID.newBuilder().setValue(frameworkId.get()));
     } else {
       LOG.warn("Did not find a persisted framework ID, connecting as a new framework.");
     }
@@ -93,7 +97,7 @@ class SchedulerDriverService extends AbstractIdleService implements Driver {
         driverSettings.getCredentials(),
         frameworkBuilder.build(),
         driverSettings.getMasterUri());
-    Protos.Status status = schedulerDriver.start();
+    Status status = schedulerDriver.start();
     LOG.info("Driver started with code " + status);
 
     driverFuture.set(schedulerDriver);
@@ -119,25 +123,34 @@ class SchedulerDriverService extends AbstractIdleService implements Driver {
   @Override
   public void acceptOffers(
       Protos.OfferID offerId,
-      Collection<Operation> operations,
+      Collection<Protos.Offer.Operation> operations,
       Protos.Filters filter) {
     ensureRunning();
 
+    OfferID convertedOfferId = ProtosConversion.convert(offerId);
+    Collection<Operation> convertedOperations =
+        Collections2.transform(operations, ProtosConversion::convert);
+    Filters convertedFilter = ProtosConversion.convert(filter);
+
     Futures.getUnchecked(driverFuture)
-        .acceptOffers(ImmutableList.of(offerId), operations, filter);
+        .acceptOffers(ImmutableList.of(convertedOfferId), convertedOperations, convertedFilter);
   }
 
   @Override
   public void declineOffer(Protos.OfferID offerId, Protos.Filters filter) {
     ensureRunning();
-    Futures.getUnchecked(driverFuture).declineOffer(offerId, filter);
+
+    OfferID convertedOfferId = ProtosConversion.convert(offerId);
+    Filters convertedFilter = ProtosConversion.convert(filter);
+
+    Futures.getUnchecked(driverFuture).declineOffer(convertedOfferId, convertedFilter);
   }
 
   @Override
   public void killTask(String taskId) {
     ensureRunning();
-    Protos.Status status = Futures.getUnchecked(driverFuture).killTask(
-        Protos.TaskID.newBuilder().setValue(taskId).build());
+    Status status = Futures.getUnchecked(driverFuture).killTask(
+        TaskID.newBuilder().setValue(taskId).build());
 
     if (status != DRIVER_RUNNING) {
       LOG.error("Attempt to kill task {} failed with code {}", taskId, status);
@@ -148,13 +161,18 @@ class SchedulerDriverService extends AbstractIdleService implements Driver {
   @Override
   public void acknowledgeStatusUpdate(Protos.TaskStatus status) {
     ensureRunning();
-    Futures.getUnchecked(driverFuture).acknowledgeStatusUpdate(status);
+
+    TaskStatus convertedStatus = ProtosConversion.convert(status);
+    Futures.getUnchecked(driverFuture).acknowledgeStatusUpdate(convertedStatus);
   }
 
   @Override
   public void reconcileTasks(Collection<Protos.TaskStatus> statuses) {
     ensureRunning();
-    Futures.getUnchecked(driverFuture).reconcileTasks(statuses);
+
+    Collection<TaskStatus> convertedStatuses =
+        Collections2.transform(statuses, ProtosConversion::convert);
+    Futures.getUnchecked(driverFuture).reconcileTasks(convertedStatuses);
   }
 
   private void ensureRunning() {

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/TaskStatusStats.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/TaskStatusStats.java b/src/main/java/org/apache/aurora/scheduler/mesos/TaskStatusStats.java
index 5573638..70a50ee 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/TaskStatusStats.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/TaskStatusStats.java
@@ -27,9 +27,9 @@ import org.apache.aurora.common.stats.StatsProvider.RequestTimer;
 import org.apache.aurora.common.util.Clock;
 import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
 import org.apache.aurora.scheduler.events.PubsubEvent.TaskStatusReceived;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.TaskStatus.Reason;
-import org.apache.mesos.Protos.TaskStatus.Source;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.TaskStatus.Reason;
+import org.apache.mesos.v1.Protos.TaskStatus.Source;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java b/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
index fe54411..e1cd81e 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/TestExecutorSettings.java
@@ -21,12 +21,12 @@ import org.apache.aurora.scheduler.configuration.executor.ExecutorConfig;
 import org.apache.aurora.scheduler.configuration.executor.ExecutorSettings;
 import org.apache.aurora.scheduler.configuration.executor.Executors;
 import org.apache.aurora.scheduler.resources.ResourceType;
-import org.apache.mesos.Protos.CommandInfo;
-import org.apache.mesos.Protos.CommandInfo.URI;
-import org.apache.mesos.Protos.ExecutorInfo;
-import org.apache.mesos.Protos.Resource;
-import org.apache.mesos.Protos.Value.Scalar;
-import org.apache.mesos.Protos.Value.Type;
+import org.apache.mesos.v1.Protos.CommandInfo;
+import org.apache.mesos.v1.Protos.CommandInfo.URI;
+import org.apache.mesos.v1.Protos.ExecutorInfo;
+import org.apache.mesos.v1.Protos.Resource;
+import org.apache.mesos.v1.Protos.Value.Scalar;
+import org.apache.mesos.v1.Protos.Value.Type;
 
 /**
  * Test utility class for executor fields.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/offers/OfferManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/offers/OfferManager.java b/src/main/java/org/apache/aurora/scheduler/offers/OfferManager.java
index 2b12696..8c000cb 100644
--- a/src/main/java/org/apache/aurora/scheduler/offers/OfferManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/offers/OfferManager.java
@@ -46,10 +46,10 @@ import org.apache.aurora.scheduler.events.PubsubEvent.DriverDisconnected;
 import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
 import org.apache.aurora.scheduler.mesos.Driver;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.Offer.Operation;
-import org.apache.mesos.Protos.OfferID;
-import org.apache.mesos.Protos.SlaveID;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.AgentID;
+import org.apache.mesos.v1.Protos.Offer.Operation;
+import org.apache.mesos.v1.Protos.OfferID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -127,7 +127,7 @@ public interface OfferManager extends EventSubscriber {
    * @param slaveId Slave ID to get offer for.
    * @return An offer for the slave ID.
    */
-  Optional<HostOffer> getOffer(SlaveID slaveId);
+  Optional<HostOffer> getOffer(AgentID slaveId);
 
   /**
    * Thrown when there was an unexpected failure trying to launch a task.
@@ -182,11 +182,11 @@ public interface OfferManager extends EventSubscriber {
       // them after the return delay.
       // There's also a chance that we return an offer for compaction ~simultaneously with the
       // same-host offer being canceled/returned.  This is also fine.
-      Optional<HostOffer> sameSlave = hostOffers.get(offer.getOffer().getSlaveId());
+      Optional<HostOffer> sameSlave = hostOffers.get(offer.getOffer().getAgentId());
       if (sameSlave.isPresent()) {
         // If there are existing offers for the slave, decline all of them so the master can
         // compact all of those offers into a single offer and send them back.
-        LOG.info("Returning offers for " + offer.getOffer().getSlaveId().getValue()
+        LOG.info("Returning offers for " + offer.getOffer().getAgentId().getValue()
             + " for compaction.");
         decline(offer.getOffer().getId());
         removeAndDecline(sameSlave.get().getOffer().getId());
@@ -239,7 +239,7 @@ public interface OfferManager extends EventSubscriber {
     }
 
     @Override
-    public Optional<HostOffer> getOffer(SlaveID slaveId) {
+    public Optional<HostOffer> getOffer(AgentID slaveId) {
       return hostOffers.get(slaveId);
     }
 
@@ -285,7 +285,7 @@ public interface OfferManager extends EventSubscriber {
 
       private final Set<HostOffer> offers = new ConcurrentSkipListSet<>(PREFERENCE_COMPARATOR);
       private final Map<OfferID, HostOffer> offersById = Maps.newHashMap();
-      private final Map<SlaveID, HostOffer> offersBySlave = Maps.newHashMap();
+      private final Map<AgentID, HostOffer> offersBySlave = Maps.newHashMap();
       private final Map<String, HostOffer> offersByHost = Maps.newHashMap();
       // TODO(maxim): Expose via a debug endpoint. AURORA-1136.
       // Keep track of offer->groupKey mappings that will never be matched to avoid redundant
@@ -299,14 +299,14 @@ public interface OfferManager extends EventSubscriber {
         statsProvider.makeGauge(STATICALLY_BANNED_OFFERS, () -> staticallyBannedOffers.size());
       }
 
-      synchronized Optional<HostOffer> get(SlaveID slaveId) {
+      synchronized Optional<HostOffer> get(AgentID slaveId) {
         return Optional.fromNullable(offersBySlave.get(slaveId));
       }
 
       synchronized void add(HostOffer offer) {
         offers.add(offer);
         offersById.put(offer.getOffer().getId(), offer);
-        offersBySlave.put(offer.getOffer().getSlaveId(), offer);
+        offersBySlave.put(offer.getOffer().getAgentId(), offer);
         offersByHost.put(offer.getOffer().getHostname(), offer);
       }
 
@@ -314,7 +314,7 @@ public interface OfferManager extends EventSubscriber {
         HostOffer removed = offersById.remove(id);
         if (removed != null) {
           offers.remove(removed);
-          offersBySlave.remove(removed.getOffer().getSlaveId());
+          offersBySlave.remove(removed.getOffer().getAgentId());
           offersByHost.remove(removed.getOffer().getHostname());
           staticallyBannedOffers.removeAll(id);
         }

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/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 dad1cbb..766d3b2 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessor.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessor.java
@@ -273,5 +273,5 @@ public class PendingTaskProcessor implements Runnable {
   };
 
   private static final Function<HostOffer, String> OFFER_TO_SLAVE_ID =
-      offer -> offer.getOffer().getSlaveId().getValue();
+      offer -> offer.getOffer().getAgentId().getValue();
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/preemptor/Preemptor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/preemptor/Preemptor.java b/src/main/java/org/apache/aurora/scheduler/preemptor/Preemptor.java
index 6b807e0..82a0ff6 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/Preemptor.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/Preemptor.java
@@ -26,7 +26,7 @@ import org.apache.aurora.scheduler.offers.OfferManager;
 import org.apache.aurora.scheduler.state.StateManager;
 import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
-import org.apache.mesos.Protos.SlaveID;
+import org.apache.mesos.v1.Protos.AgentID;
 
 import static java.util.Objects.requireNonNull;
 
@@ -88,7 +88,7 @@ public interface Preemptor {
         slotCache.remove(slot, groupKey);
 
         // Validate PreemptionProposal is still valid for the given task.
-        SlaveID slaveId = SlaveID.newBuilder().setValue(slot.getSlaveId()).build();
+        AgentID slaveId = AgentID.newBuilder().setValue(slot.getSlaveId()).build();
         Optional<ImmutableSet<PreemptionVictim>> validatedVictims =
             preemptionVictimFilter.filterPreemptionVictims(
                 pendingTask.getTask(),

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/reconciliation/TaskReconciler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/reconciliation/TaskReconciler.java b/src/main/java/org/apache/aurora/scheduler/reconciliation/TaskReconciler.java
index 003fe53..ec7ccaf 100644
--- a/src/main/java/org/apache/aurora/scheduler/reconciliation/TaskReconciler.java
+++ b/src/main/java/org/apache/aurora/scheduler/reconciliation/TaskReconciler.java
@@ -37,8 +37,8 @@ import org.apache.aurora.scheduler.mesos.Driver;
 import org.apache.aurora.scheduler.reconciliation.ReconciliationModule.BackgroundWorker;
 import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.TaskStatus;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.TaskStatus;
 
 import static java.util.Objects.requireNonNull;
 
@@ -184,8 +184,8 @@ public class TaskReconciler extends AbstractIdleService {
       // accepting task IDs instead. AURORA-1326 tracks solution on the scheduler side.
       // Setting TASK_RUNNING as a safe dummy value here.
       .setState(Protos.TaskState.TASK_RUNNING)
-      .setSlaveId(
-          Protos.SlaveID.newBuilder().setValue(t.getAssignedTask().getSlaveId()).build())
+      .setAgentId(
+          Protos.AgentID.newBuilder().setValue(t.getAssignedTask().getSlaveId()).build())
       .setTaskId(Protos.TaskID.newBuilder().setValue(t.getAssignedTask().getTaskId()).build())
       .build();
 }

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/resources/AcceptedOffer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/resources/AcceptedOffer.java b/src/main/java/org/apache/aurora/scheduler/resources/AcceptedOffer.java
index c100e80..291d5c9 100644
--- a/src/main/java/org/apache/aurora/scheduler/resources/AcceptedOffer.java
+++ b/src/main/java/org/apache/aurora/scheduler/resources/AcceptedOffer.java
@@ -22,8 +22,8 @@ import com.google.common.collect.ImmutableList;
 
 import org.apache.aurora.scheduler.TierInfo;
 import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
-import org.apache.mesos.Protos.Offer;
-import org.apache.mesos.Protos.Resource;
+import org.apache.mesos.v1.Protos.Offer;
+import org.apache.mesos.v1.Protos.Resource;
 
 import static java.util.Objects.requireNonNull;
 import static java.util.stream.Collectors.toList;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/resources/MesosResourceConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/resources/MesosResourceConverter.java b/src/main/java/org/apache/aurora/scheduler/resources/MesosResourceConverter.java
index 3123506..7040004 100644
--- a/src/main/java/org/apache/aurora/scheduler/resources/MesosResourceConverter.java
+++ b/src/main/java/org/apache/aurora/scheduler/resources/MesosResourceConverter.java
@@ -21,8 +21,8 @@ import com.google.common.collect.Iterables;
 import com.google.common.collect.Sets;
 
 import org.apache.aurora.scheduler.base.Numbers;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.Resource;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.Resource;
 
 import static org.apache.aurora.scheduler.base.Numbers.RANGE_TRANSFORM;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/resources/ResourceManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/resources/ResourceManager.java b/src/main/java/org/apache/aurora/scheduler/resources/ResourceManager.java
index d751d01..9aa263a 100644
--- a/src/main/java/org/apache/aurora/scheduler/resources/ResourceManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/resources/ResourceManager.java
@@ -33,11 +33,11 @@ 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.storage.log.ThriftBackfill;
-import org.apache.mesos.Protos.Resource;
+import org.apache.mesos.v1.Protos.Resource;
 
 import static org.apache.aurora.scheduler.resources.ResourceType.BY_MESOS_NAME;
 import static org.apache.aurora.scheduler.resources.ResourceType.fromResource;
-import static org.apache.mesos.Protos.Offer;
+import static org.apache.mesos.v1.Protos.Offer;
 
 /**
  * Manages resources and provides Aurora/Mesos translation.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/resources/ResourceMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/resources/ResourceMapper.java b/src/main/java/org/apache/aurora/scheduler/resources/ResourceMapper.java
index dc57d57..375f93c 100644
--- a/src/main/java/org/apache/aurora/scheduler/resources/ResourceMapper.java
+++ b/src/main/java/org/apache/aurora/scheduler/resources/ResourceMapper.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Range;
 
 import org.apache.aurora.gen.AssignedTask;
 import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
-import org.apache.mesos.Protos.Offer;
+import org.apache.mesos.v1.Protos.Offer;
 
 import static java.util.stream.StreamSupport.stream;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/resources/ResourceType.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/resources/ResourceType.java b/src/main/java/org/apache/aurora/scheduler/resources/ResourceType.java
index 178466f..c884284 100644
--- a/src/main/java/org/apache/aurora/scheduler/resources/ResourceType.java
+++ b/src/main/java/org/apache/aurora/scheduler/resources/ResourceType.java
@@ -24,7 +24,7 @@ import com.google.common.collect.Maps;
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.gen.Resource._Fields;
 import org.apache.aurora.scheduler.storage.entities.IResource;
-import org.apache.mesos.Protos.Resource;
+import org.apache.mesos.v1.Protos.Resource;
 import org.apache.thrift.TEnum;
 
 import static java.util.Objects.requireNonNull;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/state/StateManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/StateManager.java b/src/main/java/org/apache/aurora/scheduler/state/StateManager.java
index d395104..b09787f 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/StateManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/StateManager.java
@@ -21,7 +21,7 @@ import com.google.common.base.Optional;
 import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
-import org.apache.mesos.Protos.SlaveID;
+import org.apache.mesos.v1.Protos.AgentID;
 
 import static org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
 
@@ -69,7 +69,7 @@ public interface StateManager {
       MutableStoreProvider storeProvider,
       String taskId,
       String slaveHost,
-      SlaveID slaveId,
+      AgentID slaveId,
       Function<IAssignedTask, IAssignedTask> resourceAssigner);
 
   /**

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/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 7b70c41..7387821 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
@@ -54,7 +54,7 @@ import org.apache.aurora.scheduler.storage.TaskStore;
 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 org.apache.mesos.Protos.SlaveID;
+import org.apache.mesos.v1.Protos.AgentID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -163,7 +163,7 @@ public class StateManagerImpl implements StateManager {
       MutableStoreProvider storeProvider,
       String taskId,
       String slaveHost,
-      SlaveID slaveId,
+      AgentID slaveId,
       Function<IAssignedTask, IAssignedTask> resourceAssigner) {
 
     checkNotBlank(taskId);

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/main/java/org/apache/aurora/scheduler/state/TaskAssigner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/TaskAssigner.java b/src/main/java/org/apache/aurora/scheduler/state/TaskAssigner.java
index a030ceb..da378e8 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/TaskAssigner.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/TaskAssigner.java
@@ -41,7 +41,7 @@ import org.apache.aurora.scheduler.offers.OfferManager;
 import org.apache.aurora.scheduler.resources.ResourceManager;
 import org.apache.aurora.scheduler.resources.ResourceType;
 import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
-import org.apache.mesos.Protos.TaskInfo;
+import org.apache.mesos.v1.Protos.TaskInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,7 +50,7 @@ import static java.util.Objects.requireNonNull;
 import static org.apache.aurora.gen.ScheduleStatus.LOST;
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
 import static org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
-import static org.apache.mesos.Protos.Offer;
+import static org.apache.mesos.v1.Protos.Offer;
 
 /**
  * Responsible for matching a task against an offer and launching it.
@@ -133,11 +133,11 @@ public interface TaskAssigner {
           storeProvider,
           taskId,
           host,
-          offer.getSlaveId(),
+          offer.getAgentId(),
           task -> mapAndAssignResources(offer, task));
       LOG.info(
           "Offer on agent {} (id {}) is being assigned task for {}.",
-          host, offer.getSlaveId().getValue(), taskId);
+          host, offer.getAgentId().getValue(), taskId);
       return taskFactory.createFrom(assigned, offer);
     }
 
@@ -163,7 +163,7 @@ public interface TaskAssigner {
         evaluatedOffers.incrementAndGet();
 
         Optional<TaskGroupKey> reservedGroup = Optional.fromNullable(
-            slaveReservations.get(offer.getOffer().getSlaveId().getValue()));
+            slaveReservations.get(offer.getOffer().getAgentId().getValue()));
 
         if (reservedGroup.isPresent() && !reservedGroup.get().equals(groupKey)) {
           // This slave is reserved for a different task group -> skip.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/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 981bdcf..95632b3 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/AttributeStore.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/AttributeStore.java
@@ -23,7 +23,7 @@ import org.apache.aurora.scheduler.base.Conversions;
 import org.apache.aurora.scheduler.storage.Storage.StoreProvider;
 import org.apache.aurora.scheduler.storage.entities.IAttribute;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 
 /**
  * Storage interface for host attributes.

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/ProtobufsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/ProtobufsTest.java b/src/test/java/org/apache/aurora/ProtobufsTest.java
index 6c38885..0f25615 100644
--- a/src/test/java/org/apache/aurora/ProtobufsTest.java
+++ b/src/test/java/org/apache/aurora/ProtobufsTest.java
@@ -16,7 +16,7 @@ package org.apache.aurora;
 
 import com.google.protobuf.Message;
 
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java b/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
index b28d703..56a6b0c 100644
--- a/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/TaskStatusHandlerImplTest.java
@@ -28,9 +28,9 @@ import org.apache.aurora.scheduler.stats.CachedCounters;
 import org.apache.aurora.scheduler.storage.Storage.StorageException;
 import org.apache.aurora.scheduler.storage.testing.StorageTestUtil;
 import org.apache.aurora.scheduler.testing.FakeStatsProvider;
-import org.apache.mesos.Protos.TaskID;
-import org.apache.mesos.Protos.TaskState;
-import org.apache.mesos.Protos.TaskStatus;
+import org.apache.mesos.v1.Protos.TaskID;
+import org.apache.mesos.v1.Protos.TaskState;
+import org.apache.mesos.v1.Protos.TaskStatus;
 import org.easymock.EasyMock;
 import org.junit.After;
 import org.junit.Before;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
index 29a3b4a..0551804 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
@@ -82,11 +82,10 @@ import org.apache.aurora.scheduler.storage.log.SnapshotStoreImpl;
 import org.apache.aurora.scheduler.storage.log.testing.LogOpMatcher;
 import org.apache.aurora.scheduler.storage.log.testing.LogOpMatcher.StreamMatcher;
 import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.FrameworkID;
-import org.apache.mesos.Protos.MasterInfo;
-import org.apache.mesos.Protos.Status;
 import org.apache.mesos.Scheduler;
 import org.apache.mesos.SchedulerDriver;
+import org.apache.mesos.v1.Protos.FrameworkInfo;
+import org.apache.mesos.v1.Protos.Resource;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
@@ -101,7 +100,6 @@ import static org.apache.aurora.common.testing.easymock.EasyMockTest.createCaptu
 import static org.apache.aurora.scheduler.resources.ResourceTestUtil.mesosScalar;
 import static org.apache.aurora.scheduler.resources.ResourceType.CPUS;
 import static org.apache.aurora.scheduler.resources.ResourceType.RAM_MB;
-import static org.apache.mesos.Protos.FrameworkInfo;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.createControl;
 import static org.easymock.EasyMock.eq;
@@ -186,7 +184,7 @@ public class SchedulerIT extends BaseZooKeeperClientTest {
         bind(DriverFactory.class).toInstance(driverFactory);
         bind(DriverSettings.class).toInstance(SETTINGS);
         bind(Log.class).toInstance(log);
-        Set<Protos.Resource> overhead = ImmutableSet.of(
+        Set<Resource> overhead = ImmutableSet.of(
             mesosScalar(CPUS, 0.1),
             mesosScalar(RAM_MB, 1));
         bind(ExecutorSettings.class)
@@ -319,25 +317,26 @@ public class SchedulerIT extends BaseZooKeeperClientTest {
     CountDownLatch driverStarted = new CountDownLatch(1);
     expect(driver.start()).andAnswer(() -> {
       driverStarted.countDown();
-      return Status.DRIVER_RUNNING;
+      return Protos.Status.DRIVER_RUNNING;
     });
 
     // Try to be a good test suite citizen by releasing the blocked thread when the test case exits.
     CountDownLatch testCompleted = new CountDownLatch(1);
     expect(driver.join()).andAnswer(() -> {
       testCompleted.await();
-      return Status.DRIVER_STOPPED;
+      return Protos.Status.DRIVER_STOPPED;
     });
     addTearDown(testCompleted::countDown);
-    expect(driver.stop(true)).andReturn(Status.DRIVER_STOPPED).anyTimes();
+    expect(driver.stop(true)).andReturn(Protos.Status.DRIVER_STOPPED).anyTimes();
 
     control.replay();
     startScheduler();
 
     driverStarted.await();
-    scheduler.getValue().registered(driver,
-        FrameworkID.newBuilder().setValue(FRAMEWORK_ID).build(),
-        MasterInfo.getDefaultInstance());
+    scheduler.getValue().registered(
+        driver,
+        Protos.FrameworkID.newBuilder().setValue(FRAMEWORK_ID).build(),
+        Protos.MasterInfo.getDefaultInstance());
 
     awaitSchedulerReady();
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/app/local/FakeMaster.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/local/FakeMaster.java b/src/test/java/org/apache/aurora/scheduler/app/local/FakeMaster.java
index 965bfa7..63e8485 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/local/FakeMaster.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/local/FakeMaster.java
@@ -36,7 +36,6 @@ import com.google.common.util.concurrent.SettableFuture;
 
 import org.apache.aurora.scheduler.app.local.simulator.events.Started;
 import org.apache.aurora.scheduler.mesos.DriverFactory;
-import org.apache.mesos.Protos;
 import org.apache.mesos.Protos.ExecutorID;
 import org.apache.mesos.Protos.Filters;
 import org.apache.mesos.Protos.FrameworkID;
@@ -52,13 +51,12 @@ import org.apache.mesos.Protos.TaskState;
 import org.apache.mesos.Protos.TaskStatus;
 import org.apache.mesos.Scheduler;
 import org.apache.mesos.SchedulerDriver;
+import org.apache.mesos.v1.Protos;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static java.util.Objects.requireNonNull;
 
-import static org.apache.mesos.Protos.FrameworkInfo;
-
 /**
  * A simulated master for use in scheduler testing.
  */
@@ -107,7 +105,7 @@ public class FakeMaster implements SchedulerDriver, DriverFactory {
   public SchedulerDriver create(
       Scheduler scheduler,
       Optional<Protos.Credential> credentials,
-      FrameworkInfo frameworkInfo,
+      Protos.FrameworkInfo frameworkInfo,
       String master) {
 
     schedulerFuture.set(scheduler);

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/app/local/LocalSchedulerMain.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/local/LocalSchedulerMain.java b/src/test/java/org/apache/aurora/scheduler/app/local/LocalSchedulerMain.java
index 80fd223..7151b81 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/local/LocalSchedulerMain.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/local/LocalSchedulerMain.java
@@ -36,8 +36,8 @@ import org.apache.aurora.scheduler.storage.DistributedSnapshotStore;
 import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.Storage.NonVolatileStorage;
 import org.apache.aurora.scheduler.storage.log.SnapshotStoreImpl;
-import org.apache.mesos.Protos;
 import org.apache.mesos.SchedulerDriver;
+import org.apache.mesos.v1.Protos;
 import org.apache.shiro.io.ResourceUtils;
 
 /**

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/app/local/simulator/ClusterSimulatorModule.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/local/simulator/ClusterSimulatorModule.java b/src/test/java/org/apache/aurora/scheduler/app/local/simulator/ClusterSimulatorModule.java
index 8c0d179..963e4dc 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/local/simulator/ClusterSimulatorModule.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/local/simulator/ClusterSimulatorModule.java
@@ -24,8 +24,8 @@ import com.google.inject.AbstractModule;
 import com.google.inject.multibindings.Multibinder;
 
 import org.apache.aurora.scheduler.SchedulerServicesModule;
-import org.apache.mesos.Protos;
-import org.apache.mesos.Protos.Offer;
+import org.apache.mesos.v1.Protos;
+import org.apache.mesos.v1.Protos.Offer;
 
 import static java.util.Objects.requireNonNull;
 
@@ -34,8 +34,8 @@ import static org.apache.aurora.scheduler.resources.ResourceType.CPUS;
 import static org.apache.aurora.scheduler.resources.ResourceType.DISK_MB;
 import static org.apache.aurora.scheduler.resources.ResourceType.PORTS;
 import static org.apache.aurora.scheduler.resources.ResourceType.RAM_MB;
-import static org.apache.mesos.Protos.Value.Type.RANGES;
-import static org.apache.mesos.Protos.Value.Type.SCALAR;
+import static org.apache.mesos.v1.Protos.Value.Type.RANGES;
+import static org.apache.mesos.v1.Protos.Value.Type.SCALAR;
 
 /**
  * Module that sets up bindings to simulate fake cluster resources.
@@ -108,7 +108,7 @@ public class ClusterSimulatorModule extends AbstractModule {
         .addAttributes(Protos.Attribute.newBuilder().setType(Protos.Value.Type.TEXT)
             .setName("rack")
             .setText(Protos.Value.Text.newBuilder().setValue(rack)))
-        .setSlaveId(Protos.SlaveID.newBuilder().setValue(slaveId))
+        .setAgentId(Protos.AgentID.newBuilder().setValue(slaveId))
         .setHostname(host)
         .setFrameworkId(Protos.FrameworkID.newBuilder().setValue("frameworkId").build())
         .setId(Protos.OfferID.newBuilder().setValue(UUID.randomUUID().toString()))

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/app/local/simulator/FakeSlaves.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/local/simulator/FakeSlaves.java b/src/test/java/org/apache/aurora/scheduler/app/local/simulator/FakeSlaves.java
index d8724e4..4b7bc76 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/local/simulator/FakeSlaves.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/local/simulator/FakeSlaves.java
@@ -26,6 +26,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.aurora.scheduler.app.local.FakeMaster;
 import org.apache.aurora.scheduler.app.local.simulator.events.OfferAccepted;
 import org.apache.aurora.scheduler.app.local.simulator.events.Started;
+import org.apache.aurora.scheduler.mesos.ProtosConversion;
 import org.apache.mesos.Protos.Offer;
 import org.apache.mesos.Protos.TaskState;
 
@@ -58,10 +59,12 @@ class FakeSlaves {
     // Move the task to starting after a delay.
     executor.schedule(
         () -> {
-          master.changeState(accepted.task.getTaskId(), TaskState.TASK_STARTING);
+          master.changeState(
+              ProtosConversion.convert(accepted.task.getTaskId()), TaskState.TASK_STARTING);
 
           executor.schedule(
-              () -> master.changeState(accepted.task.getTaskId(), TaskState.TASK_RUNNING),
+              () -> master.changeState(
+                  ProtosConversion.convert(accepted.task.getTaskId()), TaskState.TASK_RUNNING),
               1,
               TimeUnit.SECONDS);
         },

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/app/local/simulator/events/OfferAccepted.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/local/simulator/events/OfferAccepted.java b/src/test/java/org/apache/aurora/scheduler/app/local/simulator/events/OfferAccepted.java
index 2fd9c5e..bb64993 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/local/simulator/events/OfferAccepted.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/local/simulator/events/OfferAccepted.java
@@ -13,8 +13,8 @@
  */
 package org.apache.aurora.scheduler.app.local.simulator.events;
 
-import org.apache.mesos.Protos.OfferID;
-import org.apache.mesos.Protos.TaskInfo;
+import org.apache.mesos.v1.Protos.OfferID;
+import org.apache.mesos.v1.Protos.TaskInfo;
 
 import static java.util.Objects.requireNonNull;
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java b/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java
index 9f94a98..676d9b2 100644
--- a/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/base/ConversionsTest.java
@@ -13,7 +13,7 @@
  */
 package org.apache.aurora.scheduler.base;
 
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 import org.junit.Test;
 
 import static org.junit.Assert.assertNotNull;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModuleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModuleTest.java b/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModuleTest.java
index d597b13..12eb86b 100644
--- a/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModuleTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorModuleTest.java
@@ -18,8 +18,8 @@ import java.util.List;
 import com.google.common.collect.ImmutableList;
 
 import org.apache.aurora.GuavaUtils;
-import org.apache.mesos.Protos.CommandInfo;
-import org.apache.mesos.Protos.CommandInfo.URI;
+import org.apache.mesos.v1.Protos.CommandInfo;
+import org.apache.mesos.v1.Protos.CommandInfo.URI;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoaderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoaderTest.java b/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoaderTest.java
index b8cfbaa..7c30479 100644
--- a/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoaderTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/configuration/executor/ExecutorSettingsLoaderTest.java
@@ -24,8 +24,8 @@ import com.google.common.collect.ImmutableMap;
 import org.apache.aurora.gen.apiConstants;
 import org.apache.aurora.scheduler.configuration.executor.ExecutorSettingsLoader.ExecutorConfigException;
 import org.apache.aurora.scheduler.mesos.TestExecutorSettings;
-import org.apache.mesos.Protos.Volume;
-import org.apache.mesos.Protos.Volume.Mode;
+import org.apache.mesos.v1.Protos.Volume;
+import org.apache.mesos.v1.Protos.Volume.Mode;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/http/OffersTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/OffersTest.java b/src/test/java/org/apache/aurora/scheduler/http/OffersTest.java
index add0eb8..3069959 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/OffersTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/OffersTest.java
@@ -28,7 +28,7 @@ import org.apache.aurora.gen.HostAttributes;
 import org.apache.aurora.scheduler.HostOffer;
 import org.apache.aurora.scheduler.offers.OfferManager;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -64,7 +64,7 @@ public class OffersTest extends EasyMockTest {
         Protos.Offer.newBuilder()
             .setId(Protos.OfferID.newBuilder().setValue("offer_id"))
             .setFrameworkId(Protos.FrameworkID.newBuilder().setValue("framework_id"))
-            .setSlaveId(Protos.SlaveID.newBuilder().setValue("slave_id"))
+            .setAgentId(Protos.AgentID.newBuilder().setValue("slave_id"))
             .setHostname("host_name")
             .addResources(Protos.Resource.newBuilder()
                 .setName("cpus")

http://git-wip-us.apache.org/repos/asf/aurora/blob/cd4df56c/src/test/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModuleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModuleTest.java b/src/test/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModuleTest.java
index ffc960c..d2c829e 100644
--- a/src/test/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModuleTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/mesos/CommandLineDriverSettingsModuleTest.java
@@ -23,11 +23,11 @@ import com.google.common.base.Throwables;
 
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
-import org.apache.mesos.Protos;
+import org.apache.mesos.v1.Protos;
 import org.junit.Test;
 
-import static org.apache.mesos.Protos.FrameworkInfo.Capability.Type.GPU_RESOURCES;
-import static org.apache.mesos.Protos.FrameworkInfo.Capability.Type.REVOCABLE_RESOURCES;
+import static org.apache.mesos.v1.Protos.FrameworkInfo.Capability.Type.GPU_RESOURCES;
+import static org.apache.mesos.v1.Protos.FrameworkInfo.Capability.Type.REVOCABLE_RESOURCES;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;


Mime
View raw message