cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r830218 - in /incubator/cassandra/trunk: src/java/org/apache/cassandra/service/StorageService.java src/java/org/apache/cassandra/utils/FBUtilities.java test/unit/org/apache/cassandra/dht/BootStrapperTest.java
Date Tue, 27 Oct 2009 14:53:19 GMT
Author: jbellis
Date: Tue Oct 27 14:53:18 2009
New Revision: 830218

URL: http://svn.apache.org/viewvc?rev=830218&view=rev
Log:
make BootStrapperTest use of TokenMetadata match actual BootStrapper use better.  patch by
jbellis for CASSANDRA-502

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
    incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootStrapperTest.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=830218&r1=830217&r2=830218&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Tue
Oct 27 14:53:18 2009
@@ -285,12 +285,6 @@
         return tokenMetadata_;
     }
 
-    /* TODO: used for testing */
-    public void updateTokenMetadataUnsafe(Token token, InetAddress endpoint)
-    {
-        tokenMetadata_.update(token, endpoint);
-    }
-
     public IEndPointSnitch getEndPointSnitch()
     {
         return endPointSnitch_;

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java?rev=830218&r1=830217&r2=830218&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Tue Oct
27 14:53:18 2009
@@ -64,7 +64,7 @@
             }
         return localInetAddress_;
     }
-
+    
     public static byte[] toByteArray(int i)
     {
         byte[] bytes = new byte[4];

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootStrapperTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootStrapperTest.java?rev=830218&r1=830217&r2=830218&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootStrapperTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootStrapperTest.java Tue
Oct 27 14:53:18 2009
@@ -44,16 +44,15 @@
 
     private void testSourceTargetComputation(int numOldNodes) throws UnknownHostException
     {
+        StorageService ss = StorageService.instance();
+
         generateFakeEndpoints(numOldNodes);
         
         Token myToken = StorageService.getPartitioner().getDefaultToken();
         InetAddress myEndpoint = InetAddress.getByName("127.0.0.1");
- 
-        StorageService ss = StorageService.instance();
-        ss.updateTokenMetadataUnsafe(myToken, myEndpoint);
 
         TokenMetadata tmd = ss.getTokenMetadata();
-        assertEquals(numOldNodes + 1, tmd.cloneTokenEndPointMap().size());
+        assertEquals(numOldNodes, tmd.cloneTokenEndPointMap().size());
         BootStrapper b = new BootStrapper(ss.getReplicationStrategy(), myEndpoint, myToken,
tmd);
         Map<Range, Set<InetAddress>> res = b.getRangesWithSources();
         



Mime
View raw message