You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by wf...@apache.org on 2014/01/26 01:39:15 UTC

git commit: Avoid using protobuf equals().

Updated Branches:
  refs/heads/master 964a5f355 -> e74290b81


Avoid using protobuf equals().

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


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

Branch: refs/heads/master
Commit: e74290b81de346ff68e286fe3f327e39a9fdb459
Parents: 964a5f3
Author: Bill Farner <wf...@apache.org>
Authored: Sat Jan 25 16:39:00 2014 -0800
Committer: Bill Farner <wf...@apache.org>
Committed: Sat Jan 25 16:39:00 2014 -0800

----------------------------------------------------------------------
 src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e74290b8/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java b/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
index e4a2259..f7a8b0c 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
@@ -168,7 +168,9 @@ public interface OfferQueue extends EventSubscriber {
       List<HostOffer> sameSlave = FluentIterable.from(hostOffers)
           .filter(new Predicate<HostOffer>() {
             @Override public boolean apply(HostOffer hostOffer) {
-              return hostOffer.offer.getSlaveId().equals(offer.getSlaveId());
+              // Intentionally avoid equals() on the SlaveID itself, since protobuf equals
+              // is rather intensive, and we may have thousands of them to do.
+              return hostOffer.offer.getSlaveId().getValue().equals(offer.getSlaveId().getValue());
             }
           })
           .toList();