cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r769014 - in /incubator/cassandra/trunk/src/org/apache/cassandra: locator/RackUnawareStrategy.java service/StorageService.java
Date Mon, 27 Apr 2009 15:01:14 GMT
Author: jbellis
Date: Mon Apr 27 15:01:13 2009
New Revision: 769014

URL: http://svn.apache.org/viewvc?rev=769014&view=rev
Log:
r/m unused code
patch by jbellis; reviewed by Jun Rao for CASSANDRA-65

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/locator/RackUnawareStrategy.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/locator/RackUnawareStrategy.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/locator/RackUnawareStrategy.java?rev=769014&r1=769013&r2=769014&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/locator/RackUnawareStrategy.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/locator/RackUnawareStrategy.java Mon
Apr 27 15:01:13 2009
@@ -71,40 +71,7 @@
         retrofitPorts(list);
         return list.toArray(new EndPoint[0]);
     }
-    
-    private void doInitialization()
-    {
-        if ( !initialized_.get() )
-        {
-            /* construct the mapping from the ranges to the replicas responsible for them
*/
-            rangeToEndPointMap_ = StorageService.instance().getRangeToEndPointMap();    
       
-            initialized_.set(true);
-        }
-    }
-    
-    /**
-     * This method determines which range in the array actually contains
-     * the hash of the key
-     * @param ranges
-     * @param key
-     * @return
-     */
-    private int findRangeIndexForKey(Range[] ranges, String key)
-    {
-        int index = 0;
-        BigInteger hash = StorageService.hash(key);
-        for ( int i = 0; i < ranges.length; ++i )
-        {
-            if ( ranges[i].contains(hash) )
-            {
-                index = i;
-                break;
-            }
-        }
-        
-        return index;
-    }
-    
+            
     public Map<String, EndPoint[]> getStorageEndPoints(String[] keys)
     {              
         Arrays.sort(keys);

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java?rev=769014&r1=769013&r2=769014&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java Mon Apr
27 15:01:13 2009
@@ -52,6 +52,7 @@
 import org.apache.cassandra.db.SystemTable;
 import org.apache.cassandra.db.Table;
 import org.apache.cassandra.db.TouchVerbHandler;
+import org.apache.cassandra.db.ReadCommand;
 import org.apache.cassandra.dht.BootStrapper;
 import org.apache.cassandra.dht.BootstrapInitiateMessage;
 import org.apache.cassandra.dht.BootstrapMetadataVerbHandler;
@@ -564,42 +565,6 @@
         consistencyManager_.submit(consistencySentinel);
     }
 
-    /*
-     * This method displays all the ranges and the replicas
-     * that are responsible for the individual ranges. The
-     * format of this string is the following:
-     *
-     *  R1 : A B C
-     *  R2 : D E F
-     *  R3 : G H I
-    */
-    public String showTheRing()
-    {
-        StringBuilder sb = new StringBuilder();
-        /* Get the token to endpoint map. */
-        Map<BigInteger, EndPoint> tokenToEndPointMap = tokenMetadata_.cloneTokenEndPointMap();
-        Set<BigInteger> tokens = tokenToEndPointMap.keySet();
-        /* All the ranges for the tokens */
-        Range[] ranges = getAllRanges(tokens);
-        Map<Range, List<EndPoint>> oldRangeToEndPointMap = constructRangeToEndPointMap(ranges);
-
-        Set<Range> rangeSet = oldRangeToEndPointMap.keySet();
-        for ( Range range : rangeSet )
-        {
-            sb.append(range);
-            sb.append(" : ");
-
-            List<EndPoint> replicas = oldRangeToEndPointMap.get(range);
-            for ( EndPoint replica : replicas )
-            {
-                sb.append(replica);
-                sb.append(" ");
-            }
-            sb.append(System.getProperty("line.separator"));
-        }
-        return sb.toString();
-    }
-
     public Map<Range, List<EndPoint>> getRangeToEndPointMap()
     {
         /* Get the token to endpoint map. */



Mime
View raw message