cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [06/18] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Date Fri, 13 Nov 2015 14:50:48 GMT
Merge branch 'cassandra-2.1' into cassandra-2.2

Conflicts:
	test/unit/org/apache/cassandra/db/HintedHandOffTest.java


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

Branch: refs/heads/cassandra-3.0
Commit: 9f021823fe0403dd0e34280a08a84389ec981a85
Parents: bfbcca1 e291382
Author: Joshua McKenzie <jmckenzie@apache.org>
Authored: Fri Nov 13 09:48:03 2015 -0500
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Fri Nov 13 09:48:03 2015 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/db/HintedHandOffManager.java   | 12 +++++-------
 src/java/org/apache/cassandra/service/StorageProxy.java | 11 ++++++-----
 .../unit/org/apache/cassandra/db/HintedHandOffTest.java |  5 +++--
 3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9f021823/src/java/org/apache/cassandra/db/HintedHandOffManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9f021823/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/StorageProxy.java
index 3a62640,b701015..5e4d912
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@@ -1012,19 -983,18 +1012,20 @@@ public class StorageProxy implements St
      public static void writeHintForMutation(Mutation mutation, long now, int ttl, InetAddress
target)
      {
          assert ttl > 0;
+ 
          UUID hostId = StorageService.instance.getTokenMetadata().getHostId(target);
-         if (hostId == null)
+         if (hostId != null)
          {
-             logger.warn("Missing host Id for {}", target.getHostAddress());
-             throw new AssertionError("Missing host Id for " + target.getHostAddress());
+             HintedHandOffManager.instance.hintFor(mutation, now, ttl, Pair.create(target,
hostId)).apply();
+             StorageMetrics.totalHints.inc();
          }
-         HintedHandOffManager.instance.hintFor(mutation, now, ttl, hostId).apply();
-         StorageMetrics.totalHints.inc();
+         else
+             logger.debug("Discarding hint for endpoint not part of ring: {}", target);
      }
  
 -    private static void sendMessagesToNonlocalDC(MessageOut<? extends IMutation> message,
Collection<InetAddress> targets, AbstractWriteResponseHandler handler)
 +    private static void sendMessagesToNonlocalDC(MessageOut<? extends IMutation> message,
 +                                                 Collection<InetAddress> targets,
 +                                                 AbstractWriteResponseHandler<IMutation>
handler)
      {
          Iterator<InetAddress> iter = targets.iterator();
          InetAddress target = iter.next();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9f021823/test/unit/org/apache/cassandra/db/HintedHandOffTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/HintedHandOffTest.java
index ce14c37,ad1e6cf..6bb6be2
--- a/test/unit/org/apache/cassandra/db/HintedHandOffTest.java
+++ b/test/unit/org/apache/cassandra/db/HintedHandOffTest.java
@@@ -36,9 -34,8 +36,10 @@@ import org.apache.cassandra.cql3.Untype
  import org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy;
  import org.apache.cassandra.db.marshal.Int32Type;
  import org.apache.cassandra.db.marshal.UUIDType;
 +import org.apache.cassandra.exceptions.ConfigurationException;
 +import org.apache.cassandra.locator.SimpleStrategy;
  import org.apache.cassandra.utils.ByteBufferUtil;
+ import org.apache.cassandra.utils.Pair;
  
  import static org.junit.Assert.assertEquals;
  import static org.apache.cassandra.cql3.QueryProcessor.executeInternal;
@@@ -79,8 -66,8 +80,8 @@@ public class HintedHandOffTes
          HintedHandOffManager.instance.hintFor(rm,
                                                System.currentTimeMillis(),
                                                HintedHandOffManager.calculateHintTTL(rm),
-                                               UUID.randomUUID())
+                                               Pair.create(InetAddress.getByName("127.0.0.1"),
UUID.randomUUID()))
 -                                     .apply();
 +                                     .applyUnsafe();
  
          // flush data to disk
          hintStore.forceBlockingFlush();
@@@ -120,8 -107,8 +121,8 @@@
          HintedHandOffManager.instance.hintFor(rm,
                                                System.currentTimeMillis(),
                                                HintedHandOffManager.calculateHintTTL(rm),
-                                               UUID.randomUUID())
+                                               Pair.create(InetAddress.getByName("127.0.0.1"),
UUID.randomUUID()))
 -                                     .apply();
 +                                     .applyUnsafe();
  
          assert getNoOfHints() == 1;
  


Mime
View raw message