cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r828028 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
Date Wed, 21 Oct 2009 14:18:09 GMT
Author: jbellis
Date: Wed Oct 21 14:18:09 2009
New Revision: 828028

URL: http://svn.apache.org/viewvc?rev=828028&view=rev
Log:
rename nodePicker -> replicationStrategy.
patch by jbellis; reviewed by Sandeep Tata for CASSANDRA-497

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.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=828028&r1=828027&r2=828028&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 Wed
Oct 21 14:18:09 2009
@@ -20,7 +20,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.lang.management.ManagementFactory;
 import java.util.*;
 import java.util.concurrent.ExecutorService;
@@ -154,7 +153,7 @@
                                                                                    new NamedThreadFactory("CONSISTENCY-MANAGER"));
 
     /* We use this interface to determine where replicas need to be placed */
-    private AbstractReplicationStrategy nodePicker_;
+    private AbstractReplicationStrategy replicationStrategy_;
     /* Are we starting this node in bootstrap mode? */
     private boolean isBootstrapMode;
     private Set<EndPoint> bootstrapSet;
@@ -241,7 +240,7 @@
         Class [] parameterTypes = new Class[] { TokenMetadata.class, IPartitioner.class,
int.class, int.class};
         try
         {
-            nodePicker_ = (AbstractReplicationStrategy) cls.getConstructor(parameterTypes).newInstance(tokenMetadata_,
partitioner_, DatabaseDescriptor.getReplicationFactor(), DatabaseDescriptor.getStoragePort());
+            replicationStrategy_ = (AbstractReplicationStrategy) cls.getConstructor(parameterTypes).newInstance(tokenMetadata_,
partitioner_, DatabaseDescriptor.getReplicationFactor(), DatabaseDescriptor.getStoragePort());
         }
         catch (Exception e)
         {
@@ -357,7 +356,7 @@
         Map<Range, List<EndPoint>> rangeToEndPointMap = new HashMap<Range,
List<EndPoint>>();
         for (Range range : ranges)
         {
-            EndPoint[] endpoints = nodePicker_.getReadStorageEndPoints(range.right());
+            EndPoint[] endpoints = replicationStrategy_.getReadStorageEndPoints(range.right());
             // create a new ArrayList since a bunch of methods like to mutate the endpointmap
List
             rangeToEndPointMap.put(range, new ArrayList<EndPoint>(Arrays.asList(endpoints)));
         }
@@ -378,7 +377,7 @@
         Map<Range, List<EndPoint>> rangeToEndPointMap = new HashMap<Range,
List<EndPoint>>();
         for ( Range range : ranges )
         {
-            EndPoint[] endpoints = nodePicker_.getReadStorageEndPoints(range.right(), tokenToEndPointMap);
+            EndPoint[] endpoints = replicationStrategy_.getReadStorageEndPoints(range.right(),
tokenToEndPointMap);
             rangeToEndPointMap.put(range, new ArrayList<EndPoint>( Arrays.asList(endpoints)
) );
         }
         if (logger_.isDebugEnabled())
@@ -910,7 +909,7 @@
      */
     public EndPoint[] getReadStorageEndPoints(String key)
     {
-        return nodePicker_.getReadStorageEndPoints(partitioner_.getToken(key));
+        return replicationStrategy_.getReadStorageEndPoints(partitioner_.getToken(key));
     }    
     
     /**
@@ -943,12 +942,12 @@
      */
     public Map<EndPoint, EndPoint> getHintedStorageEndpointMap(String key)
     {
-        return nodePicker_.getHintedStorageEndPoints(partitioner_.getToken(key));
+        return replicationStrategy_.getHintedStorageEndPoints(partitioner_.getToken(key));
     }
 
     public void retrofitPorts(List<EndPoint> eps)
     {
-        nodePicker_.retrofitPorts(eps);
+        replicationStrategy_.retrofitPorts(eps);
     }
 
     /**



Mime
View raw message