cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [6/6] cassandra git commit: Merge branch 'cassandra-3.0' into trunk
Date Fri, 12 Feb 2016 17:33:44 GMT
Merge branch 'cassandra-3.0' into trunk


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

Branch: refs/heads/trunk
Commit: 1944bf507d66b5c103c136319caeb4a9e3767a69
Parents: a800ca8 efbcd15
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Fri Feb 12 17:31:35 2016 +0000
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Fri Feb 12 17:33:14 2016 +0000

----------------------------------------------------------------------
 CHANGES.txt                                                 | 5 ++++-
 src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java | 6 ++++--
 src/java/org/apache/cassandra/locator/TokenMetadata.java    | 7 +++----
 3 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1944bf50/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1944bf50/src/java/org/apache/cassandra/locator/TokenMetadata.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/locator/TokenMetadata.java
index d47b681,97c5f10..caa7661
--- a/src/java/org/apache/cassandra/locator/TokenMetadata.java
+++ b/src/java/org/apache/cassandra/locator/TokenMetadata.java
@@@ -868,20 -869,18 +869,18 @@@ public class TokenMetadat
  
      public Token getPredecessor(Token token)
      {
 -        List tokens = sortedTokens();
 +        List<Token> tokens = sortedTokens();
          int index = Collections.binarySearch(tokens, token);
- //        assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndpointMap.keySet(),
", ");
-         if (index < 0) index = -index-1;
+         assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndpointMap.keySet(),
", ");
 -        return (Token) (index == 0 ? tokens.get(tokens.size() - 1) : tokens.get(index -
1));
 +        return index == 0 ? tokens.get(tokens.size() - 1) : tokens.get(index - 1);
      }
  
      public Token getSuccessor(Token token)
      {
 -        List tokens = sortedTokens();
 +        List<Token> tokens = sortedTokens();
          int index = Collections.binarySearch(tokens, token);
- //        assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndpointMap.keySet(),
", ");
-         if (index < 0) return (Token) tokens.get(-index-1);
+         assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndpointMap.keySet(),
", ");
 -        return (Token) ((index == (tokens.size() - 1)) ? tokens.get(0) : tokens.get(index
+ 1));
 +        return (index == (tokens.size() - 1)) ? tokens.get(0) : tokens.get(index + 1);
      }
  
      /** @return a copy of the bootstrapping tokens map */


Mime
View raw message