cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [4/4] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0
Date Wed, 16 Sep 2015 11:05:09 GMT
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/cassandra-3.0
Commit: 8134f09c2bdf2d859135a187a9de91f4cfb7620d
Parents: c694cd6 5b05b68
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Wed Sep 16 12:04:53 2015 +0100
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed Sep 16 12:04:53 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../locator/GossipingPropertyFileSnitch.java    |   1 +
 .../cassandra/locator/PropertyFileSnitch.java   |   1 +
 .../apache/cassandra/locator/TokenMetadata.java | 142 ++++++++++---
 .../cassandra/service/StorageService.java       |  16 ++
 .../cassandra/locator/TokenMetadataTest.java    | 213 ++++++++++++++++++-
 6 files changed, 335 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8134f09c/src/java/org/apache/cassandra/locator/TokenMetadata.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/locator/TokenMetadata.java
index c3ec353,8d54ead..75448a8
--- a/src/java/org/apache/cassandra/locator/TokenMetadata.java
+++ b/src/java/org/apache/cassandra/locator/TokenMetadata.java
@@@ -124,18 -119,9 +124,18 @@@ public class TokenMetadat
          sortedTokens = sortTokens();
      }
  
 +    /**
 +     * To be used by tests only (via {@link StorageService.setPartitionerUnsafe}).
 +     */
 +    @VisibleForTesting
 +    public TokenMetadata cloneWithNewPartitioner(IPartitioner newPartitioner)
 +    {
 +        return new TokenMetadata(tokenToEndpointMap, endpointToHostIdMap, topology, newPartitioner);
 +    }
 +
      private ArrayList<Token> sortTokens()
      {
-         return new ArrayList<Token>(tokenToEndpointMap.keySet());
+         return new ArrayList<>(tokenToEndpointMap.keySet());
      }
  
      /** @return the number of nodes bootstrapping into source's primary range */
@@@ -533,10 -551,9 +565,10 @@@
          lock.readLock().lock();
          try
          {
-             return new TokenMetadata(SortedBiMultiValMap.<Token, InetAddress>create(tokenToEndpointMap,
null, inetaddressCmp),
+             return new TokenMetadata(SortedBiMultiValMap.create(tokenToEndpointMap, null,
inetaddressCmp),
                                       HashBiMap.create(endpointToHostIdMap),
 -                                     new Topology(topology));
 +                                     new Topology(topology),
 +                                     partitioner);
          }
          finally
          {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8134f09c/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8134f09c/test/unit/org/apache/cassandra/locator/TokenMetadataTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/locator/TokenMetadataTest.java
index 68d0dfa,fc8095d..e7bb70a
--- a/test/unit/org/apache/cassandra/locator/TokenMetadataTest.java
+++ b/test/unit/org/apache/cassandra/locator/TokenMetadataTest.java
@@@ -29,9 -42,6 +41,7 @@@ import org.apache.cassandra.config.Data
  import org.apache.cassandra.dht.Token;
  import org.apache.cassandra.service.StorageService;
  
- import static org.apache.cassandra.Util.token;
- import static org.junit.Assert.assertEquals;
 +
  @RunWith(OrderedJUnit4ClassRunner.class)
  public class TokenMetadataTest
  {


Mime
View raw message