aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zma...@apache.org
Subject aurora git commit: Upgrade to Guava 18
Date Mon, 31 Aug 2015 02:27:29 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 4899e2de3 -> 68447b385


Upgrade to Guava 18

Upgrades the Gauva dep to 18. Full release notes can be found here:
* https://code.google.com/p/guava-libraries/wiki/Release17
* https://code.google.com/p/guava-libraries/wiki/Release18

Relevant changes are the introduction of `MoreObjects`, removal of
`InputSupplier` and `OutputSupplier` interfaces and replacing
`MoreExecutors.sameThreadExecutor()` with
`MoreExecutors.newDirectExecutorService()`.

Bugs closed: AURORA-586

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


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

Branch: refs/heads/master
Commit: 68447b3852d47e8e5f97b8a8df873ca13ab716e0
Parents: 4899e2d
Author: Zameer Manji <zmanji@apache.org>
Authored: Sun Aug 30 19:27:13 2015 -0700
Committer: Zameer Manji <zmanji@apache.org>
Committed: Sun Aug 30 19:27:13 2015 -0700

----------------------------------------------------------------------
 build.gradle                                    |  2 +-
 .../aurora/common/args/apt/Configuration.java   | 54 ++++++--------------
 .../common/net/http/handlers/AssetHandler.java  | 14 ++---
 .../net/http/handlers/AssetHandlerTest.java     | 18 +++----
 .../org/apache/aurora/scheduler/HostOffer.java  |  4 +-
 .../aurora/scheduler/TaskStatusHandlerImpl.java |  2 +-
 .../org/apache/aurora/scheduler/TierInfo.java   |  3 +-
 .../org/apache/aurora/scheduler/base/Query.java |  3 +-
 .../aurora/scheduler/cron/SanitizedCronJob.java | 10 ++--
 .../aurora/scheduler/events/PubsubEvent.java    |  9 ++--
 .../scheduler/filter/SchedulingFilter.java      |  4 +-
 .../scheduler/preemptor/PreemptionProposal.java |  3 +-
 .../scheduler/preemptor/PreemptionVictim.java   |  4 +-
 .../aurora/scheduler/quota/QuotaInfo.java       |  4 +-
 .../aurora/scheduler/spi/Permissions.java       |  2 +-
 .../scheduler/state/TransitionResult.java       |  3 +-
 .../aurora/scheduler/updater/JobDiff.java       |  3 +-
 .../scheduler/updater/OneWayJobUpdater.java     |  3 +-
 .../aurora/scheduler/updater/SideEffect.java    |  3 +-
 19 files changed, 74 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 7b9a082..ce99f3a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -82,7 +82,7 @@ For more details, please see https://issues.apache.org/jira/browse/AURORA-1169
   ext.junitRev = '4.12'
   ext.log4jRev = '1.2.17'
   ext.gsonRev = '2.3.1'
-  ext.guavaRev = '16.0'
+  ext.guavaRev = '18.0'
   ext.slf4jRev = '1.7.12'
   ext.thriftRev = '0.9.1'
   ext.guiceRev = '3.0'

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/commons-args/src/main/java/org/apache/aurora/common/args/apt/Configuration.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/org/apache/aurora/common/args/apt/Configuration.java
b/commons-args/src/main/java/org/apache/aurora/common/args/apt/Configuration.java
index e8e6447..d06ec69 100644
--- a/commons-args/src/main/java/org/apache/aurora/common/args/apt/Configuration.java
+++ b/commons-args/src/main/java/org/apache/aurora/common/args/apt/Configuration.java
@@ -14,32 +14,35 @@
 package org.apache.aurora.common.args.apt;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.PrintWriter;
 import java.io.Reader;
 import java.io.Writer;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.logging.Logger;
 
+import javax.annotation.Nullable;
+
 import com.google.common.base.CharMatcher;
-import com.google.common.base.Charsets;
 import com.google.common.base.Function;
 import com.google.common.base.Functions;
 import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Iterators;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
+import com.google.common.io.ByteSource;
+import com.google.common.io.CharSource;
 import com.google.common.io.CharStreams;
 import com.google.common.io.InputSupplier;
 import com.google.common.io.LineProcessor;
+import com.google.common.io.Resources;
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
@@ -74,41 +77,16 @@ public final class Configuration {
   private static final Logger LOG = Logger.getLogger(Configuration.class.getName());
 
   private static final CharMatcher IDENTIFIER_START =
-      CharMatcher.forPredicate(new Predicate<Character>() {
-        @Override public boolean apply(Character c) {
-          return Character.isJavaIdentifierStart(c);
-        }
-      });
+      CharMatcher.forPredicate(Character::isJavaIdentifierStart);
 
   private static final CharMatcher IDENTIFIER_REST =
-      CharMatcher.forPredicate(new Predicate<Character>() {
-        @Override public boolean apply(Character c) {
-          return Character.isJavaIdentifierPart(c);
-        }
-      });
-
-  private static final Function<URL, InputSupplier<? extends InputStream>> URL_TO_INPUT
=
-      new Function<URL, InputSupplier<? extends InputStream>>() {
-        @Override public InputSupplier<? extends InputStream> apply(final URL resource)
{
-          return new InputSupplier<InputStream>() {
-            @Override public InputStream getInput() throws IOException {
-              return resource.openStream();
-            }
-          };
-        }
-      };
-
-  private static final Function<InputSupplier<? extends InputStream>,
-                                InputSupplier<? extends Reader>> INPUT_TO_READER
=
-      new Function<InputSupplier<? extends InputStream>, InputSupplier<? extends
Reader>>() {
-        @Override public InputSupplier<? extends Reader> apply(
-            final InputSupplier<? extends InputStream> input) {
-          return CharStreams.newReaderSupplier(input, Charsets.UTF_8);
-        }
-      };
+      CharMatcher.forPredicate(Character::isJavaIdentifierPart);
 
-  private static final Function<URL, InputSupplier<? extends Reader>> URL_TO_READER
=
-      Functions.compose(INPUT_TO_READER, URL_TO_INPUT);
+  private static final Function<URL, CharSource> URL_TO_SOURCE = new Function<URL,
CharSource>() {
+    @Override public CharSource apply(URL input) {
+      return Resources.asCharSource(input, StandardCharsets.UTF_8);
+    }
+  };
 
   private static final String DEFAULT_RESOURCE_NAME = "cmdline.arg.info.txt";
 
@@ -441,8 +419,10 @@ public final class Configuration {
 
   private static Configuration load(int nextIndex, List<URL> configs)
       throws ConfigurationException, IOException {
-    InputSupplier<Reader> input = CharStreams.join(Iterables.transform(configs, URL_TO_READER));
-    return CharStreams.readLines(input, new ConfigurationParser(nextIndex));
+    CharSource input = CharSource.concat(Iterables.transform(configs, URL_TO_SOURCE));
+    try(Reader reader = input.openStream()) {
+      return CharStreams.readLines(reader, new ConfigurationParser(nextIndex));
+    }
   }
 
   public boolean isEmpty() {

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/commons/src/main/java/org/apache/aurora/common/net/http/handlers/AssetHandler.java
----------------------------------------------------------------------
diff --git a/commons/src/main/java/org/apache/aurora/common/net/http/handlers/AssetHandler.java
b/commons/src/main/java/org/apache/aurora/common/net/http/handlers/AssetHandler.java
index a514f14..7a44f07 100644
--- a/commons/src/main/java/org/apache/aurora/common/net/http/handlers/AssetHandler.java
+++ b/commons/src/main/java/org/apache/aurora/common/net/http/handlers/AssetHandler.java
@@ -16,9 +16,9 @@ package org.apache.aurora.common.net.http.handlers;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Splitter;
 import com.google.common.collect.Iterables;
+import com.google.common.io.ByteSource;
 import com.google.common.io.ByteStreams;
 import com.google.common.io.Closeables;
-import com.google.common.io.InputSupplier;
 
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
@@ -55,7 +55,7 @@ public class AssetHandler extends HttpServlet {
   private final StaticAsset staticAsset;
 
   public static class StaticAsset {
-    private final InputSupplier<? extends InputStream> inputSupplier;
+    private final ByteSource byteSource;
     private final String contentType;
     private final boolean cacheLocally;
 
@@ -65,14 +65,14 @@ public class AssetHandler extends HttpServlet {
     /**
      * Creates a new static asset.
      *
-     * @param inputSupplier Supplier of the input stream from which to load the asset.
+     * @param byteSource Source of the asset.
      * @param contentType HTTP content type of the asset.
      * @param cacheLocally If {@code true} the asset will be loaded once and stored in memory,
if
      *    {@code false} it will be loaded on each request.
      */
-    public StaticAsset(InputSupplier<? extends InputStream> inputSupplier,
+    public StaticAsset(ByteSource byteSource,
         String contentType, boolean cacheLocally) {
-      this.inputSupplier = checkNotNull(inputSupplier);
+      this.byteSource = checkNotNull(byteSource);
       this.contentType = checkNotNull(contentType);
       this.cacheLocally = cacheLocally;
     }
@@ -111,7 +111,9 @@ public class AssetHandler extends HttpServlet {
     private void load() throws IOException {
       ByteArrayOutputStream gzipBaos = new ByteArrayOutputStream();
       GZIPOutputStream gzipStream = new GZIPOutputStream(gzipBaos);
-      ByteStreams.copy(inputSupplier, gzipStream);
+      try (InputStream inputStream = byteSource.openStream()) {
+        ByteStreams.copy(inputStream, gzipStream);
+      }
       gzipStream.flush();  // copy() does not flush or close output stream.
       gzipStream.close();
       gzipData = gzipBaos.toByteArray();

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/commons/src/test/java/org/apache/aurora/common/net/http/handlers/AssetHandlerTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/net/http/handlers/AssetHandlerTest.java
b/commons/src/test/java/org/apache/aurora/common/net/http/handlers/AssetHandlerTest.java
index d82816b..740c42f 100644
--- a/commons/src/test/java/org/apache/aurora/common/net/http/handlers/AssetHandlerTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/net/http/handlers/AssetHandlerTest.java
@@ -16,7 +16,6 @@ package org.apache.aurora.common.net.http.handlers;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.zip.GZIPInputStream;
 
@@ -24,8 +23,8 @@ import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.google.common.io.ByteSource;
 import com.google.common.io.ByteStreams;
-import com.google.common.io.InputSupplier;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -34,6 +33,7 @@ import org.apache.aurora.common.testing.easymock.EasyMockTest;
 
 import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED;
 import static javax.servlet.http.HttpServletResponse.SC_OK;
+import static org.easymock.EasyMock.createMockBuilder;
 import static org.easymock.EasyMock.expect;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
@@ -48,11 +48,11 @@ public class AssetHandlerTest extends EasyMockTest {
   private static final String TEST_DATA_CHECKSUM = "ePvVhtAeVRu85KSOLKL0oQ==";
   private static final String CONTENT_TYPE = "text/plain";
 
-  private InputSupplier<InputStream> inputSupplier;
+  private ByteSource byteSource;
 
   @Before
   public void setUp() {
-    inputSupplier = createMock(new Clazz<InputSupplier<InputStream>>() {});
+    byteSource = createMock(ByteSource.class);
   }
 
   private static class Request {
@@ -73,7 +73,7 @@ public class AssetHandlerTest extends EasyMockTest {
     HttpServletResponse resp = createMock(HttpServletResponse.class);
 
     if (expectRead) {
-      expect(inputSupplier.getInput()).andReturn(new ByteArrayInputStream(TEST_DATA.getBytes()));
+      expect(byteSource.openStream()).andReturn(new ByteArrayInputStream(TEST_DATA.getBytes()));
     }
 
     expect(req.getHeader("If-None-Match")).andReturn(suppliedChecksum);
@@ -121,7 +121,7 @@ public class AssetHandlerTest extends EasyMockTest {
 
     control.replay();
 
-    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(inputSupplier, CONTENT_TYPE,
true));
+    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(byteSource, CONTENT_TYPE,
true));
 
     handler.doGet(test1.req, test1.resp);
     assertThat(new String(test1.responseBody.toByteArray()), is(TEST_DATA));
@@ -162,7 +162,7 @@ public class AssetHandlerTest extends EasyMockTest {
 
     control.replay();
 
-    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(inputSupplier, CONTENT_TYPE,
true));
+    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(byteSource, CONTENT_TYPE,
true));
 
     handler.doGet(test1.req, test1.resp);
     assertThat(unzip(test1.responseBody), is(TEST_DATA));
@@ -203,7 +203,7 @@ public class AssetHandlerTest extends EasyMockTest {
 
     control.replay();
 
-    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(inputSupplier, CONTENT_TYPE,
false));
+    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(byteSource, CONTENT_TYPE,
false));
 
     handler.doGet(test1.req, test1.resp);
     assertThat(new String(test1.responseBody.toByteArray()), is(TEST_DATA));
@@ -244,7 +244,7 @@ public class AssetHandlerTest extends EasyMockTest {
 
     control.replay();
 
-    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(inputSupplier, CONTENT_TYPE,
false));
+    AssetHandler handler = new AssetHandler(new AssetHandler.StaticAsset(byteSource, CONTENT_TYPE,
false));
 
     handler.doGet(test1.req, test1.resp);
     assertThat(unzip(test1.responseBody), is(TEST_DATA));

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/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 5056b60..53fd68c 100644
--- a/src/main/java/org/apache/aurora/scheduler/HostOffer.java
+++ b/src/main/java/org/apache/aurora/scheduler/HostOffer.java
@@ -15,6 +15,8 @@ package org.apache.aurora.scheduler;
 
 import java.util.Objects;
 
+import com.google.common.base.MoreObjects;
+
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
 
 import static java.util.Objects.requireNonNull;
@@ -58,7 +60,7 @@ public class HostOffer {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("offer", offer)
         .add("hostAttributes", hostAttributes)
         .toString();

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/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 11d4a08..3112579 100644
--- a/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/TaskStatusHandlerImpl.java
@@ -111,7 +111,7 @@ public class TaskStatusHandlerImpl extends AbstractExecutionThreadService
             driver.abort();
           }
         },
-        MoreExecutors.sameThreadExecutor());
+        MoreExecutors.newDirectExecutorService());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/TierInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TierInfo.java b/src/main/java/org/apache/aurora/scheduler/TierInfo.java
index 61bf30a..72c2f9e 100644
--- a/src/main/java/org/apache/aurora/scheduler/TierInfo.java
+++ b/src/main/java/org/apache/aurora/scheduler/TierInfo.java
@@ -16,6 +16,7 @@ package org.apache.aurora.scheduler;
 import java.util.Objects;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
 
 /**
  * Defines common task tier traits and behaviors.
@@ -54,7 +55,7 @@ public class TierInfo {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("revocable", revocable)
         .toString();
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/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 458530f..7bf0afb 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Query.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Query.java
@@ -16,6 +16,7 @@ package org.apache.aurora.scheduler.base;
 import java.util.EnumSet;
 import java.util.Objects;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.primitives.Ints;
@@ -171,7 +172,7 @@ public final class Query {
 
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("query", query)
           .toString();
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java b/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
index 46e89cd..dd8c9cd 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
@@ -13,10 +13,12 @@
  */
 package org.apache.aurora.scheduler.cron;
 
+import java.util.Objects;
+
 import javax.annotation.Nullable;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Optional;
 import com.google.common.base.Strings;
 
@@ -138,17 +140,17 @@ public final class SanitizedCronJob {
 
     SanitizedCronJob other = (SanitizedCronJob) o;
 
-    return Objects.equal(config, other.config) && Objects.equal(crontabEntry, other.crontabEntry);
+    return Objects.equals(config, other.config) && Objects.equals(crontabEntry, other.crontabEntry);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hashCode(config, crontabEntry);
+    return Objects.hash(config, crontabEntry);
   }
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("config", config)
         .add("crontabEntry", crontabEntry)
         .toString();

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/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 298ac74..2a4c066 100644
--- a/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
+++ b/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
@@ -16,6 +16,7 @@ package org.apache.aurora.scheduler.events;
 import java.util.Objects;
 import java.util.Set;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Optional;
 
 import org.apache.aurora.gen.ScheduleStatus;
@@ -71,7 +72,7 @@ public interface PubsubEvent {
 
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("tasks", Tasks.ids(tasks))
           .toString();
     }
@@ -150,7 +151,7 @@ public interface PubsubEvent {
 
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("task", Tasks.id(task))
           .add("oldState", getOldState())
           .add("newState", getNewState())
@@ -189,7 +190,7 @@ public interface PubsubEvent {
 
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("attributes", getAttributes())
           .toString();
     }
@@ -233,7 +234,7 @@ public interface PubsubEvent {
 
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("groupKey", groupKey)
           .add("vetoes", vetoes)
           .toString();

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
index 260e11e..1e8eb0c 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
@@ -16,6 +16,8 @@ package org.apache.aurora.scheduler.filter;
 import java.util.Objects;
 import java.util.Set;
 
+import com.google.common.base.MoreObjects;
+
 import org.apache.aurora.scheduler.ResourceSlot;
 import org.apache.aurora.scheduler.storage.entities.IConstraint;
 import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
@@ -232,7 +234,7 @@ public interface SchedulingFilter {
 
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("vetoType", vetoType)
           .add("reason", reason)
           .add("score", score)

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionProposal.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionProposal.java b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionProposal.java
index d598b02..fcc8918 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionProposal.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionProposal.java
@@ -16,6 +16,7 @@ package org.apache.aurora.scheduler.preemptor;
 import java.util.Objects;
 import java.util.Set;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableSet;
 
 import static java.util.Objects.requireNonNull;
@@ -58,7 +59,7 @@ class PreemptionProposal {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("victims", getVictims())
         .add("slaveId", getSlaveId())
         .toString();

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictim.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictim.java b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictim.java
index 8f3161a..7d92843 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictim.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictim.java
@@ -15,6 +15,8 @@ package org.apache.aurora.scheduler.preemptor;
 
 import java.util.Objects;
 
+import com.google.common.base.MoreObjects;
+
 import org.apache.aurora.scheduler.ResourceSlot;
 import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
@@ -80,7 +82,7 @@ public final class PreemptionVictim {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("task", task)
         .toString();
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/quota/QuotaInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/quota/QuotaInfo.java b/src/main/java/org/apache/aurora/scheduler/quota/QuotaInfo.java
index 3e25812..b40ecd0 100644
--- a/src/main/java/org/apache/aurora/scheduler/quota/QuotaInfo.java
+++ b/src/main/java/org/apache/aurora/scheduler/quota/QuotaInfo.java
@@ -15,6 +15,8 @@ package org.apache.aurora.scheduler.quota;
 
 import java.util.Objects;
 
+import com.google.common.base.MoreObjects;
+
 import org.apache.aurora.scheduler.storage.entities.IResourceAggregate;
 
 import static java.util.Objects.requireNonNull;
@@ -84,7 +86,7 @@ public class QuotaInfo {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("quota", quota)
         .add("prodConsumption", prodConsumption)
         .add("nonProdConsumption", nonProdConsumption)

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/spi/Permissions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/spi/Permissions.java b/src/main/java/org/apache/aurora/scheduler/spi/Permissions.java
index b9dff44..c2919ab 100644
--- a/src/main/java/org/apache/aurora/scheduler/spi/Permissions.java
+++ b/src/main/java/org/apache/aurora/scheduler/spi/Permissions.java
@@ -21,7 +21,7 @@ import org.apache.shiro.authz.permission.WildcardPermission;
 
 import static java.util.Objects.requireNonNull;
 
-import static com.google.common.base.Objects.toStringHelper;
+import static com.google.common.base.MoreObjects.toStringHelper;
 
 /**
  * Utilities for Aurora-specific Shiro permissions.

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java b/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
index 6928c66..2b6ff7e 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
@@ -15,6 +15,7 @@ package org.apache.aurora.scheduler.state;
 
 import java.util.Objects;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 
@@ -72,7 +73,7 @@ public class TransitionResult {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("result", result)
         .add("sideEffects", sideEffects)
         .toString();

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java b/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
index 0a1a292..a17337f 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/JobDiff.java
@@ -19,6 +19,7 @@ import java.util.Set;
 
 import com.google.common.base.Function;
 import com.google.common.base.Functions;
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Predicates;
 import com.google.common.collect.ContiguousSet;
 import com.google.common.collect.DiscreteDomain;
@@ -120,7 +121,7 @@ public final class JobDiff {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("replacedInstances", getReplacedInstances())
         .add("replacementInstances", getReplacementInstances())
         .add("unchangedInstances", getUnchangedInstances())

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/updater/OneWayJobUpdater.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/OneWayJobUpdater.java b/src/main/java/org/apache/aurora/scheduler/updater/OneWayJobUpdater.java
index 5b1e2b9..4650611 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/OneWayJobUpdater.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/OneWayJobUpdater.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Predicates;
 import com.google.common.collect.ImmutableMap;
@@ -313,7 +314,7 @@ class OneWayJobUpdater<K, T> {
 
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("status", getStatus())
           .add("sideEffects", getSideEffects())
           .toString();

http://git-wip-us.apache.org/repos/asf/aurora/blob/68447b38/src/main/java/org/apache/aurora/scheduler/updater/SideEffect.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/updater/SideEffect.java b/src/main/java/org/apache/aurora/scheduler/updater/SideEffect.java
index 3f49242..61d855e 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/SideEffect.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/SideEffect.java
@@ -16,6 +16,7 @@ package org.apache.aurora.scheduler.updater;
 import java.util.Objects;
 import java.util.Set;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Optional;
 
 import org.apache.aurora.scheduler.updater.StateEvaluator.Failure;
@@ -110,7 +111,7 @@ public class SideEffect {
 
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("action", getAction())
         .add("statusChanges", getStatusChanges())
         .toString();


Mime
View raw message