r/m unused code

patch by jbellis; reviewed by Jun Rao for CASSANDRA-65

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@769014 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-04-27 15:01:13 +00:00
parent 91afe8b6e9
commit 63a748ccf9
2 changed files with 2 additions and 70 deletions

View File

@ -71,40 +71,7 @@ public class RackUnawareStrategy extends AbstractStrategy
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);

View File

@ -52,6 +52,7 @@ import org.apache.cassandra.db.RowMutationVerbHandler;
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 @@ public final class StorageService implements IEndPointStateChangeSubscriber, Sto
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. */