diff --git a/conf/cassandra.xml b/conf/cassandra.xml
index 64af5bb54c..6f98126e8e 100644
--- a/conf/cassandra.xml
+++ b/conf/cassandra.xml
@@ -46,13 +46,13 @@
false
- org.apache.cassandra.locator.EndPointSnitch
+ org.apache.cassandra.locator.EndPointSnitch
- org.apache.cassandra.locator.EndPointSnitch
+ org.apache.cassandra.locator.EndPointSnitch
diff --git a/contrib/property_snitch/src/java/org/apache/cassandra/locator/PropertyFileEndPointSnitch.java b/contrib/property_snitch/src/java/org/apache/cassandra/locator/PropertyFileEndPointSnitch.java
index 0fbd38dc18..6d7e6d2237 100644
--- a/contrib/property_snitch/src/java/org/apache/cassandra/locator/PropertyFileEndPointSnitch.java
+++ b/contrib/property_snitch/src/java/org/apache/cassandra/locator/PropertyFileEndPointSnitch.java
@@ -80,12 +80,12 @@ public class PropertyFileEndPointSnitch extends EndPointSnitch implements Proper
/**
* Get the raw information about an end point
*
- * @param endPoint endPoint to process
+ * @param endpoint endpoint to process
*
* @return a array of string with the first index being the data center and the second being the rack
*/
- public String[] getEndPointInfo(InetAddress endPoint) {
- String key = endPoint.toString();
+ public String[] getEndpointInfo(InetAddress endpoint) {
+ String key = endpoint.toString();
String value = hostProperties.getProperty(key);
if (value == null)
{
@@ -104,22 +104,22 @@ public class PropertyFileEndPointSnitch extends EndPointSnitch implements Proper
/**
* Return the data center for which an endpoint resides in
*
- * @param endPoint the endPoint to process
+ * @param endpoint the endpoint to process
* @return string of data center
*/
- public String getDataCenterForEndPoint(InetAddress endPoint) {
- return getEndPointInfo(endPoint)[0];
+ public String getDataCenterForEndpoint(InetAddress endpoint) {
+ return getEndpointInfo(endpoint)[0];
}
/**
* Return the rack for which an endpoint resides in
*
- * @param endPoint the endPoint to process
+ * @param endpoint the endpoint to process
*
* @return string of rack
*/
- public String getRackForEndPoint(InetAddress endPoint) {
- return getEndPointInfo(endPoint)[1];
+ public String getRackForEndpoint(InetAddress endpoint) {
+ return getEndpointInfo(endpoint)[1];
}
@Override
@@ -129,7 +129,7 @@ public class PropertyFileEndPointSnitch extends EndPointSnitch implements Proper
{
return super.isInSameDataCenter(host, host2);
}
- return getDataCenterForEndPoint(host).equals(getDataCenterForEndPoint(host2));
+ return getDataCenterForEndpoint(host).equals(getDataCenterForEndpoint(host2));
}
@Override
@@ -143,7 +143,7 @@ public class PropertyFileEndPointSnitch extends EndPointSnitch implements Proper
{
return false;
}
- return getRackForEndPoint(host).equals(getRackForEndPoint(host2));
+ return getRackForEndpoint(host).equals(getRackForEndpoint(host2));
}
public String displayConfiguration() {
diff --git a/contrib/word_count/storage-conf.xml b/contrib/word_count/storage-conf.xml
index 0d591d97e0..62fb4d6a0d 100644
--- a/contrib/word_count/storage-conf.xml
+++ b/contrib/word_count/storage-conf.xml
@@ -127,13 +127,13 @@
1
- org.apache.cassandra.locator.EndPointSnitch
+ org.apache.cassandra.locator.EndPointSnitch
diff --git a/src/java/org/apache/cassandra/client/RingCache.java b/src/java/org/apache/cassandra/client/RingCache.java
index a71744b9db..04e7a0782c 100644
--- a/src/java/org/apache/cassandra/client/RingCache.java
+++ b/src/java/org/apache/cassandra/client/RingCache.java
@@ -65,10 +65,10 @@ public class RingCache
this.keyspace = keyspace;
DatabaseDescriptor.loadSchemas();
- refreshEndPointMap();
+ refreshEndpointMap();
}
- public void refreshEndPointMap()
+ public void refreshEndpointMap()
{
for (String seed : seeds_)
{
@@ -109,7 +109,7 @@ public class RingCache
}
}
- public List getEndPoint(byte[] key)
+ public List getEndpoint(byte[] key)
{
if (tokenMetadata == null)
throw new RuntimeException("Must refresh endpoints before looking up a key.");
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 87ab8425ab..a05227bcca 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -377,12 +377,12 @@ public class DatabaseDescriptor
}
/* end point snitch */
- String endPointSnitchClassName = xmlUtils.getNodeValue("/Storage/EndPointSnitch");
- if (endPointSnitchClassName == null)
+ String endpointSnitchClassName = xmlUtils.getNodeValue("/Storage/EndpointSnitch");
+ if (endpointSnitchClassName == null)
{
throw new ConfigurationException("Missing endpointsnitch directive");
}
- snitch = createEndpointSnitch(endPointSnitchClassName);
+ snitch = createEndpointSnitch(endpointSnitchClassName);
/* snapshot-before-compaction. defaults to false */
String sbc = xmlUtils.getNodeValue("/Storage/SnapshotBeforeCompaction");
@@ -524,17 +524,17 @@ public class DatabaseDescriptor
}
}
- private static IEndPointSnitch createEndpointSnitch(String endPointSnitchClassName) throws ConfigurationException
+ private static IEndPointSnitch createEndpointSnitch(String endpointSnitchClassName) throws ConfigurationException
{
IEndPointSnitch snitch;
Class cls;
try
{
- cls = Class.forName(endPointSnitchClassName);
+ cls = Class.forName(endpointSnitchClassName);
}
catch (ClassNotFoundException e)
{
- throw new ConfigurationException("Unable to load endpointsnitch class " + endPointSnitchClassName);
+ throw new ConfigurationException("Unable to load endpointsnitch class " + endpointSnitchClassName);
}
Constructor ctor;
try
@@ -543,7 +543,7 @@ public class DatabaseDescriptor
}
catch (NoSuchMethodException e)
{
- throw new ConfigurationException("No default constructor found in " + endPointSnitchClassName);
+ throw new ConfigurationException("No default constructor found in " + endpointSnitchClassName);
}
try
{
@@ -551,17 +551,17 @@ public class DatabaseDescriptor
}
catch (InstantiationException e)
{
- throw new ConfigurationException("endpointsnitch class " + endPointSnitchClassName + "is abstract");
+ throw new ConfigurationException("endpointsnitch class " + endpointSnitchClassName + "is abstract");
}
catch (IllegalAccessException e)
{
- throw new ConfigurationException("Access to " + endPointSnitchClassName + " constructor was rejected");
+ throw new ConfigurationException("Access to " + endpointSnitchClassName + " constructor was rejected");
}
catch (InvocationTargetException e)
{
if (e.getCause() instanceof ConfigurationException)
throw (ConfigurationException)e.getCause();
- throw new ConfigurationException("Error instantiating " + endPointSnitchClassName + " " + e.getMessage());
+ throw new ConfigurationException("Error instantiating " + endpointSnitchClassName + " " + e.getMessage());
}
return snitch;
}
@@ -872,7 +872,7 @@ public class DatabaseDescriptor
return partitioner;
}
- public static IEndPointSnitch getEndPointSnitch()
+ public static IEndPointSnitch getEndpointSnitch()
{
return snitch;
}
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
index 922081afff..46ef4275a7 100644
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@ -104,14 +104,14 @@ public class HintedHandOffManager
}, "Hint delivery").start();
}
- private static boolean sendMessage(InetAddress endPoint, String tableName, byte[] key) throws IOException
+ private static boolean sendMessage(InetAddress endpoint, String tableName, byte[] key) throws IOException
{
- if (!Gossiper.instance.isKnownEndpoint(endPoint))
+ if (!Gossiper.instance.isKnownEndpoint(endpoint))
{
- logger_.warn("Hints found for endpoint " + endPoint + " which is not part of the gossip network. discarding.");
+ logger_.warn("Hints found for endpoint " + endpoint + " which is not part of the gossip network. discarding.");
return true;
}
- if (!FailureDetector.instance.isAlive(endPoint))
+ if (!FailureDetector.instance.isAlive(endpoint))
{
return false;
}
@@ -127,7 +127,7 @@ public class HintedHandOffManager
}
Message message = rm.makeRowMutationMessage();
WriteResponseHandler responseHandler = new WriteResponseHandler(1, tableName);
- MessagingService.instance.sendRR(message, new InetAddress[] { endPoint }, responseHandler);
+ MessagingService.instance.sendRR(message, new InetAddress[] { endpoint }, responseHandler);
try
{
@@ -140,7 +140,7 @@ public class HintedHandOffManager
return true;
}
- private static void deleteEndPoint(byte[] endpointAddress, String tableName, byte[] key, long timestamp) throws IOException
+ private static void deleteEndpoint(byte[] endpointAddress, String tableName, byte[] key, long timestamp) throws IOException
{
RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, tableName.getBytes(UTF8));
rm.delete(new QueryPath(HINTS_CF, key, endpointAddress), timestamp);
@@ -189,7 +189,7 @@ public class HintedHandOffManager
{
if (sendMessage(InetAddress.getByAddress(endpoint.name()), tableName, keyBytes))
{
- deleteEndPoint(endpoint.name(), tableName, keyColumn.name(), System.currentTimeMillis());
+ deleteEndpoint(endpoint.name(), tableName, keyColumn.name(), System.currentTimeMillis());
deleted++;
}
}
@@ -223,12 +223,12 @@ public class HintedHandOffManager
|| (hintColumnFamily.getSortedColumns().size() == 1 && hintColumnFamily.getColumn(startColumn) != null);
}
- private static void deliverHintsToEndpoint(InetAddress endPoint) throws IOException, DigestMismatchException, InvalidRequestException, TimeoutException
+ private static void deliverHintsToEndpoint(InetAddress endpoint) throws IOException, DigestMismatchException, InvalidRequestException, TimeoutException
{
if (logger_.isDebugEnabled())
- logger_.debug("Started hinted handoff for endPoint " + endPoint);
+ logger_.debug("Started hinted handoff for endpoint " + endpoint);
- byte[] targetEPBytes = endPoint.getAddress();
+ byte[] targetEPBytes = endpoint.getAddress();
// 1. Scan through all the keys that we need to handoff
// 2. For each key read the list of recipients if the endpoint matches send
// 3. Delete that recipient from the key if write was successful
@@ -249,14 +249,14 @@ public class HintedHandOffManager
{
byte[] keyBytes = keyColumn.name();
Collection endpoints = keyColumn.getSubColumns();
- for (IColumn hintEndPoint : endpoints)
+ for (IColumn hintEndpoint : endpoints)
{
- if (Arrays.equals(hintEndPoint.name(), targetEPBytes) && sendMessage(endPoint, tableName, keyBytes))
+ if (Arrays.equals(hintEndpoint.name(), targetEPBytes) && sendMessage(endpoint, tableName, keyBytes))
{
if (endpoints.size() == 1)
deleteHintKey(tableName, keyColumn.name());
else
- deleteEndPoint(hintEndPoint.name(), tableName, keyColumn.name(), System.currentTimeMillis());
+ deleteEndpoint(hintEndpoint.name(), tableName, keyColumn.name(), System.currentTimeMillis());
break;
}
}
@@ -267,7 +267,7 @@ public class HintedHandOffManager
}
if (logger_.isDebugEnabled())
- logger_.debug("Finished hinted handoff for endpoint " + endPoint);
+ logger_.debug("Finished hinted handoff for endpoint " + endpoint);
}
/** called when a keyspace is dropped or rename. newTable==null in the case of a drop. */
diff --git a/src/java/org/apache/cassandra/dht/BootStrapper.java b/src/java/org/apache/cassandra/dht/BootStrapper.java
index 6135c34670..62fae70fea 100644
--- a/src/java/org/apache/cassandra/dht/BootStrapper.java
+++ b/src/java/org/apache/cassandra/dht/BootStrapper.java
@@ -156,7 +156,7 @@ public class BootStrapper
{
if (range.contains(myRange))
{
- List preferred = DatabaseDescriptor.getEndPointSnitch().getSortedListByProximity(address, rangeAddresses.get(range));
+ List preferred = DatabaseDescriptor.getEndpointSnitch().getSortedListByProximity(address, rangeAddresses.get(range));
myRangeAddresses.putAll(myRange, preferred);
break;
}
diff --git a/src/java/org/apache/cassandra/gms/FailureDetector.java b/src/java/org/apache/cassandra/gms/FailureDetector.java
index c4498011ea..e5f5af5a15 100644
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@ -120,7 +120,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
return true;
/* Incoming port is assumed to be the Storage port. We need to change it to the control port */
- EndPointState epState = Gossiper.instance.getEndPointStateForEndPoint(ep);
+ EndPointState epState = Gossiper.instance.getEndpointStateForEndpoint(ep);
return epState.isAlive();
}
diff --git a/src/java/org/apache/cassandra/gms/GossipDigest.java b/src/java/org/apache/cassandra/gms/GossipDigest.java
index c97e50e675..490877dd32 100644
--- a/src/java/org/apache/cassandra/gms/GossipDigest.java
+++ b/src/java/org/apache/cassandra/gms/GossipDigest.java
@@ -40,7 +40,7 @@ public class GossipDigest implements Comparable
serializer_ = new GossipDigestSerializer();
}
- InetAddress endPoint_;
+ InetAddress endpoint_;
int generation_;
int maxVersion_;
@@ -49,16 +49,16 @@ public class GossipDigest implements Comparable
return serializer_;
}
- GossipDigest(InetAddress endPoint, int generation, int maxVersion)
+ GossipDigest(InetAddress endpoint, int generation, int maxVersion)
{
- endPoint_ = endPoint;
+ endpoint_ = endpoint;
generation_ = generation;
maxVersion_ = maxVersion;
}
- InetAddress getEndPoint()
+ InetAddress getEndpoint()
{
- return endPoint_;
+ return endpoint_;
}
int getGeneration()
@@ -81,7 +81,7 @@ public class GossipDigest implements Comparable
public String toString()
{
StringBuilder sb = new StringBuilder();
- sb.append(endPoint_);
+ sb.append(endpoint_);
sb.append(":");
sb.append(generation_);
sb.append(":");
@@ -94,16 +94,16 @@ class GossipDigestSerializer implements ICompactSerializer
{
public void serialize(GossipDigest gDigest, DataOutputStream dos) throws IOException
{
- CompactEndPointSerializationHelper.serialize(gDigest.endPoint_, dos);
+ CompactEndPointSerializationHelper.serialize(gDigest.endpoint_, dos);
dos.writeInt(gDigest.generation_);
dos.writeInt(gDigest.maxVersion_);
}
public GossipDigest deserialize(DataInputStream dis) throws IOException
{
- InetAddress endPoint = CompactEndPointSerializationHelper.deserialize(dis);
+ InetAddress endpoint = CompactEndPointSerializationHelper.deserialize(dis);
int generation = dis.readInt();
int version = dis.readInt();
- return new GossipDigest(endPoint, generation, version);
+ return new GossipDigest(endpoint, generation, version);
}
}
diff --git a/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java b/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java
index ffaa374fc5..992d2ddc1c 100644
--- a/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java
+++ b/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java
@@ -52,7 +52,7 @@ class GossipDigestAck2Message
epStateMap_ = epStateMap;
}
- Map getEndPointStateMap()
+ Map getEndpointStateMap()
{
return epStateMap_;
}
diff --git a/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java b/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
index e70973c19b..fc300678d0 100644
--- a/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
+++ b/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
@@ -60,7 +60,7 @@ class GossipDigestAckMessage
return gDigestList_;
}
- Map getEndPointStateMap()
+ Map getEndpointStateMap()
{
return epStateMap_;
}
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index ce339bf804..64f10455db 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -55,7 +55,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
synchronized( Gossiper.instance )
{
/* Update the local heartbeat counter. */
- endPointStateMap_.get(localEndPoint_).getHeartBeatState().updateHeartBeat();
+ endpointStateMap_.get(localEndpoint_).getHeartBeatState().updateHeartBeat();
List gDigests = new ArrayList();
Gossiper.instance.makeRandomGossipDigest(gDigests);
@@ -106,7 +106,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
public static final Gossiper instance = new Gossiper();
private Timer gossipTimer_;
- private InetAddress localEndPoint_;
+ private InetAddress localEndpoint_;
private long aVeryLongTime_;
private long FatClientTimeout_;
private Random random_ = new Random();
@@ -124,13 +124,13 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
private Set seeds_ = new HashSet();
/* map where key is the endpoint and value is the state associated with the endpoint */
- Map endPointStateMap_ = new Hashtable();
+ Map endpointStateMap_ = new Hashtable();
/* map where key is endpoint and value is timestamp when this endpoint was removed from
* gossip. We will ignore any gossip regarding these endpoints for Streaming.RING_DELAY time
* after removal to prevent nodes from falsely reincarnating during the time when removal
* gossip gets propagated to all nodes */
- Map justRemovedEndPoints_ = new Hashtable();
+ Map justRemovedEndpoints_ = new Hashtable();
private Gossiper()
{
@@ -157,7 +157,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
public Set getLiveMembers()
{
Set liveMbrs = new HashSet(liveEndpoints_);
- liveMbrs.add(localEndPoint_);
+ liveMbrs.add(localEndpoint_);
return liveMbrs;
}
@@ -174,7 +174,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
*/
public void convict(InetAddress endpoint)
{
- EndPointState epState = endPointStateMap_.get(endpoint);
+ EndPointState epState = endpointStateMap_.get(endpoint);
if (epState.isAlive())
{
logger_.info("InetAddress {} is now dead.", endpoint);
@@ -182,7 +182,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
}
}
- int getMaxEndPointStateVersion(EndPointState epState)
+ int getMaxEndpointStateVersion(EndPointState epState)
{
List versions = new ArrayList();
versions.add( epState.getHeartBeatState().getHeartBeatVersion() );
@@ -214,13 +214,13 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
/**
* Removes the endpoint completely from Gossip
*/
- public void removeEndPoint(InetAddress endpoint)
+ public void removeEndpoint(InetAddress endpoint)
{
liveEndpoints_.remove(endpoint);
unreachableEndpoints_.remove(endpoint);
- endPointStateMap_.remove(endpoint);
+ endpointStateMap_.remove(endpoint);
FailureDetector.instance.remove(endpoint);
- justRemovedEndPoints_.put(endpoint, System.currentTimeMillis());
+ justRemovedEndpoints_.put(endpoint, System.currentTimeMillis());
}
/**
@@ -233,25 +233,25 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
void makeRandomGossipDigest(List gDigests)
{
/* Add the local endpoint state */
- EndPointState epState = endPointStateMap_.get(localEndPoint_);
+ EndPointState epState = endpointStateMap_.get(localEndpoint_);
int generation = epState.getHeartBeatState().getGeneration();
- int maxVersion = getMaxEndPointStateVersion(epState);
- gDigests.add( new GossipDigest(localEndPoint_, generation, maxVersion) );
+ int maxVersion = getMaxEndpointStateVersion(epState);
+ gDigests.add( new GossipDigest(localEndpoint_, generation, maxVersion) );
- List endpoints = new ArrayList(endPointStateMap_.keySet());
+ List endpoints = new ArrayList(endpointStateMap_.keySet());
Collections.shuffle(endpoints, random_);
- for (InetAddress endPoint : endpoints)
+ for (InetAddress endpoint : endpoints)
{
- epState = endPointStateMap_.get(endPoint);
+ epState = endpointStateMap_.get(endpoint);
if (epState != null)
{
generation = epState.getHeartBeatState().getGeneration();
- maxVersion = getMaxEndPointStateVersion(epState);
- gDigests.add(new GossipDigest(endPoint, generation, maxVersion));
+ maxVersion = getMaxEndpointStateVersion(epState);
+ gDigests.add(new GossipDigest(endpoint, generation, maxVersion));
}
else
{
- gDigests.add(new GossipDigest(endPoint, 0, 0));
+ gDigests.add(new GossipDigest(endpoint, 0, 0));
}
}
@@ -268,12 +268,12 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
public boolean isKnownEndpoint(InetAddress endpoint)
{
- return endPointStateMap_.containsKey(endpoint);
+ return endpointStateMap_.containsKey(endpoint);
}
public int getCurrentGenerationNumber(InetAddress endpoint)
{
- return endPointStateMap_.get(endpoint).getHeartBeatState().getGeneration();
+ return endpointStateMap_.get(endpoint).getHeartBeatState().getGeneration();
}
Message makeGossipDigestSynMessage(List gDigests) throws IOException
@@ -282,7 +282,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
ByteArrayOutputStream bos = new ByteArrayOutputStream(Gossiper.MAX_GOSSIP_PACKET_SIZE);
DataOutputStream dos = new DataOutputStream( bos );
GossipDigestSynMessage.serializer().serialize(gDigestMessage, dos);
- return new Message(localEndPoint_, StageManager.GOSSIP_STAGE, StorageService.Verb.GOSSIP_DIGEST_SYN, bos.toByteArray());
+ return new Message(localEndpoint_, StageManager.GOSSIP_STAGE, StorageService.Verb.GOSSIP_DIGEST_SYN, bos.toByteArray());
}
Message makeGossipDigestAckMessage(GossipDigestAckMessage gDigestAckMessage) throws IOException
@@ -292,7 +292,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
GossipDigestAckMessage.serializer().serialize(gDigestAckMessage, dos);
if (logger_.isTraceEnabled())
logger_.trace("@@@@ Size of GossipDigestAckMessage is " + bos.toByteArray().length);
- return new Message(localEndPoint_, StageManager.GOSSIP_STAGE, StorageService.Verb.GOSSIP_DIGEST_ACK, bos.toByteArray());
+ return new Message(localEndpoint_, StageManager.GOSSIP_STAGE, StorageService.Verb.GOSSIP_DIGEST_ACK, bos.toByteArray());
}
Message makeGossipDigestAck2Message(GossipDigestAck2Message gDigestAck2Message) throws IOException
@@ -300,7 +300,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
ByteArrayOutputStream bos = new ByteArrayOutputStream(Gossiper.MAX_GOSSIP_PACKET_SIZE);
DataOutputStream dos = new DataOutputStream(bos);
GossipDigestAck2Message.serializer().serialize(gDigestAck2Message, dos);
- return new Message(localEndPoint_, StageManager.GOSSIP_STAGE, StorageService.Verb.GOSSIP_DIGEST_ACK2, bos.toByteArray());
+ return new Message(localEndpoint_, StageManager.GOSSIP_STAGE, StorageService.Verb.GOSSIP_DIGEST_ACK2, bos.toByteArray());
}
/**
@@ -314,9 +314,9 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
{
int size = epSet.size();
/* Generate a random number from 0 -> size */
- List liveEndPoints = new ArrayList(epSet);
+ List liveEndpoints = new ArrayList(epSet);
int index = (size == 1) ? 0 : random_.nextInt(size);
- InetAddress to = liveEndPoints.get(index);
+ InetAddress to = liveEndpoints.get(index);
if (logger_.isTraceEnabled())
logger_.trace("Sending a GossipDigestSynMessage to {} ...", to);
MessagingService.instance.sendOneWay(message, to);
@@ -337,12 +337,12 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
/* Sends a Gossip message to an unreachable member */
void doGossipToUnreachableMember(Message message)
{
- double liveEndPoints = liveEndpoints_.size();
- double unreachableEndPoints = unreachableEndpoints_.size();
- if ( unreachableEndPoints > 0 )
+ double liveEndpoints = liveEndpoints_.size();
+ double unreachableEndpoints = unreachableEndpoints_.size();
+ if ( unreachableEndpoints > 0 )
{
/* based on some probability */
- double prob = unreachableEndPoints / (liveEndPoints + 1);
+ double prob = unreachableEndpoints / (liveEndpoints + 1);
double randDbl = random_.nextDouble();
if ( randDbl < prob )
sendGossip(message, unreachableEndpoints_);
@@ -355,7 +355,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
int size = seeds_.size();
if ( size > 0 )
{
- if ( size == 1 && seeds_.contains(localEndPoint_) )
+ if ( size == 1 && seeds_.contains(localEndpoint_) )
{
return;
}
@@ -379,14 +379,14 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
{
long now = System.currentTimeMillis();
- Set eps = endPointStateMap_.keySet();
+ Set eps = endpointStateMap_.keySet();
for ( InetAddress endpoint : eps )
{
- if ( endpoint.equals(localEndPoint_) )
+ if ( endpoint.equals(localEndpoint_) )
continue;
FailureDetector.instance.interpret(endpoint);
- EndPointState epState = endPointStateMap_.get(endpoint);
+ EndPointState epState = endpointStateMap_.get(endpoint);
if ( epState != null )
{
long duration = now - epState.getUpdateTimestamp();
@@ -400,7 +400,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
else
{
logger_.info("FatClient " + endpoint + " has been silent for " + FatClientTimeout_ + "ms, removing from gossip");
- removeEndPoint(endpoint);
+ removeEndpoint(endpoint);
}
}
@@ -410,33 +410,33 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
}
}
- if (!justRemovedEndPoints_.isEmpty())
+ if (!justRemovedEndpoints_.isEmpty())
{
- Hashtable copy = new Hashtable(justRemovedEndPoints_);
+ Hashtable copy = new Hashtable(justRemovedEndpoints_);
for (Map.Entry entry : copy.entrySet())
{
if ((now - entry.getValue()) > StorageService.RING_DELAY)
{
if (logger_.isDebugEnabled())
logger_.debug(StorageService.RING_DELAY + " elapsed, " + entry.getKey() + " gossip quarantine over");
- justRemovedEndPoints_.remove(entry.getKey());
+ justRemovedEndpoints_.remove(entry.getKey());
}
}
}
}
}
- EndPointState getEndPointStateForEndPoint(InetAddress ep)
+ EndPointState getEndpointStateForEndpoint(InetAddress ep)
{
- return endPointStateMap_.get(ep);
+ return endpointStateMap_.get(ep);
}
synchronized EndPointState getStateForVersionBiggerThan(InetAddress forEndpoint, int version)
{
if (logger_.isTraceEnabled())
logger_.trace("Scanning for state greater than " + version + " for " + forEndpoint);
- EndPointState epState = endPointStateMap_.get(forEndpoint);
- EndPointState reqdEndPointState = null;
+ EndPointState epState = endpointStateMap_.get(forEndpoint);
+ EndPointState reqdEndpointState = null;
if ( epState != null )
{
@@ -451,7 +451,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
int localHbVersion = epState.getHeartBeatState().getHeartBeatVersion();
if ( localHbVersion > version )
{
- reqdEndPointState = new EndPointState(epState.getHeartBeatState());
+ reqdEndpointState = new EndPointState(epState.getHeartBeatState());
}
Map appStateMap = epState.getApplicationStateMap();
/* Accumulate all application states whose versions are greater than "version" variable */
@@ -460,18 +460,18 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
ApplicationState appState = entry.getValue();
if ( appState.getStateVersion() > version )
{
- if ( reqdEndPointState == null )
+ if ( reqdEndpointState == null )
{
- reqdEndPointState = new EndPointState(epState.getHeartBeatState());
+ reqdEndpointState = new EndPointState(epState.getHeartBeatState());
}
final String key = entry.getKey();
if (logger_.isTraceEnabled())
logger_.trace("Adding state " + key + ": " + appState.getValue());
- reqdEndPointState.addApplicationState(key, appState);
+ reqdEndpointState.addApplicationState(key, appState);
}
}
}
- return reqdEndPointState;
+ return reqdEndpointState;
}
void notifyFailureDetector(List gDigests)
@@ -479,29 +479,29 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
IFailureDetector fd = FailureDetector.instance;
for ( GossipDigest gDigest : gDigests )
{
- EndPointState localEndPointState = endPointStateMap_.get(gDigest.endPoint_);
+ EndPointState localEndpointState = endpointStateMap_.get(gDigest.endpoint_);
/*
* If the local endpoint state exists then report to the FD only
* if the versions workout.
*/
- if ( localEndPointState != null )
+ if ( localEndpointState != null )
{
- int localGeneration = endPointStateMap_.get(gDigest.endPoint_).getHeartBeatState().generation_;
+ int localGeneration = endpointStateMap_.get(gDigest.endpoint_).getHeartBeatState().generation_;
int remoteGeneration = gDigest.generation_;
if ( remoteGeneration > localGeneration )
{
- fd.report(gDigest.endPoint_);
+ fd.report(gDigest.endpoint_);
continue;
}
if ( remoteGeneration == localGeneration )
{
- int localVersion = getMaxEndPointStateVersion(localEndPointState);
- //int localVersion = endPointStateMap_.get(gDigest.endPoint_).getHeartBeatState().getHeartBeatVersion();
+ int localVersion = getMaxEndpointStateVersion(localEndpointState);
+ //int localVersion = endpointStateMap_.get(gDigest.endpoint_).getHeartBeatState().getHeartBeatVersion();
int remoteVersion = gDigest.maxVersion_;
if ( remoteVersion > localVersion )
{
- fd.report(gDigest.endPoint_);
+ fd.report(gDigest.endpoint_);
}
}
}
@@ -514,16 +514,16 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
for (Entry entry : remoteEpStateMap.entrySet())
{
InetAddress endpoint = entry.getKey();
- EndPointState remoteEndPointState = entry.getValue();
- EndPointState localEndPointState = endPointStateMap_.get(endpoint);
+ EndPointState remoteEndpointState = entry.getValue();
+ EndPointState localEndpointState = endpointStateMap_.get(endpoint);
/*
* If the local endpoint state exists then report to the FD only
* if the versions workout.
*/
- if ( localEndPointState != null )
+ if ( localEndpointState != null )
{
- int localGeneration = localEndPointState.getHeartBeatState().generation_;
- int remoteGeneration = remoteEndPointState.getHeartBeatState().generation_;
+ int localGeneration = localEndpointState.getHeartBeatState().generation_;
+ int remoteGeneration = remoteEndpointState.getHeartBeatState().generation_;
if ( remoteGeneration > localGeneration )
{
fd.report(endpoint);
@@ -532,9 +532,9 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
if ( remoteGeneration == localGeneration )
{
- int localVersion = getMaxEndPointStateVersion(localEndPointState);
- //int localVersion = localEndPointState.getHeartBeatState().getHeartBeatVersion();
- int remoteVersion = remoteEndPointState.getHeartBeatState().getHeartBeatVersion();
+ int localVersion = getMaxEndpointStateVersion(localEndpointState);
+ //int localVersion = localEndpointState.getHeartBeatState().getHeartBeatVersion();
+ int remoteVersion = remoteEndpointState.getHeartBeatState().getHeartBeatVersion();
if ( remoteVersion > localVersion )
{
fd.report(endpoint);
@@ -557,7 +557,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
private void handleNewJoin(InetAddress ep, EndPointState epState)
{
- if (justRemovedEndPoints_.containsKey(ep))
+ if (justRemovedEndpoints_.containsKey(ep))
return;
logger_.info("Node {} is now part of the cluster", ep);
handleMajorStateChange(ep, epState, false);
@@ -578,11 +578,11 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
*
* @param ep endpoint
* @param epState EndPointState for the endpoint
- * @param isKnownNode is this node familiar to us already (present in endPointStateMap)
+ * @param isKnownNode is this node familiar to us already (present in endpointStateMap)
*/
private void handleMajorStateChange(InetAddress ep, EndPointState epState, boolean isKnownNode)
{
- endPointStateMap_.put(ep, epState);
+ endpointStateMap_.put(ep, epState);
isAlive(ep, epState, isKnownNode);
for (IEndPointStateChangeSubscriber subscriber : subscribers_)
subscriber.onJoin(ep, epState);
@@ -593,10 +593,10 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
for (Entry entry : epStateMap.entrySet())
{
InetAddress ep = entry.getKey();
- if ( ep.equals( localEndPoint_ ) )
+ if ( ep.equals( localEndpoint_ ) )
continue;
- EndPointState localEpStatePtr = endPointStateMap_.get(ep);
+ EndPointState localEpStatePtr = endpointStateMap_.get(ep);
EndPointState remoteState = entry.getValue();
/*
If state does not exist just add it. If it does then add it only if the version
@@ -614,8 +614,8 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
else if ( remoteGeneration == localGeneration )
{
/* manage the membership state */
- int localMaxVersion = getMaxEndPointStateVersion(localEpStatePtr);
- int remoteMaxVersion = getMaxEndPointStateVersion(remoteState);
+ int localMaxVersion = getMaxEndpointStateVersion(localEpStatePtr);
+ int remoteMaxVersion = getMaxEndpointStateVersion(remoteState);
if ( remoteMaxVersion > localMaxVersion )
{
markAlive(ep, localEpStatePtr);
@@ -732,15 +732,15 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
void requestAll(GossipDigest gDigest, List deltaGossipDigestList, int remoteGeneration)
{
/* We are here since we have no data for this endpoint locally so request everthing. */
- deltaGossipDigestList.add( new GossipDigest(gDigest.getEndPoint(), remoteGeneration, 0) );
+ deltaGossipDigestList.add( new GossipDigest(gDigest.getEndpoint(), remoteGeneration, 0) );
}
/* Send all the data with version greater than maxRemoteVersion */
void sendAll(GossipDigest gDigest, Map deltaEpStateMap, int maxRemoteVersion)
{
- EndPointState localEpStatePtr = getStateForVersionBiggerThan(gDigest.getEndPoint(), maxRemoteVersion) ;
+ EndPointState localEpStatePtr = getStateForVersionBiggerThan(gDigest.getEndpoint(), maxRemoteVersion) ;
if ( localEpStatePtr != null )
- deltaEpStateMap.put(gDigest.getEndPoint(), localEpStatePtr);
+ deltaEpStateMap.put(gDigest.getEndpoint(), localEpStatePtr);
}
/*
@@ -754,7 +754,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
int remoteGeneration = gDigest.getGeneration();
int maxRemoteVersion = gDigest.getMaxVersion();
/* Get state associated with the end point in digest */
- EndPointState epStatePtr = endPointStateMap_.get(gDigest.getEndPoint());
+ EndPointState epStatePtr = endpointStateMap_.get(gDigest.getEndpoint());
/*
Here we need to fire a GossipDigestAckMessage. If we have some data associated with this endpoint locally
then we follow the "if" path of the logic. If we have absolutely nothing for this endpoint we need to
@@ -764,7 +764,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
{
int localGeneration = epStatePtr.getHeartBeatState().getGeneration();
/* get the max version of all keys in the state associated with this endpoint */
- int maxLocalVersion = getMaxEndPointStateVersion(epStatePtr);
+ int maxLocalVersion = getMaxEndpointStateVersion(epStatePtr);
if ( remoteGeneration == localGeneration && maxRemoteVersion == maxLocalVersion )
continue;
@@ -789,7 +789,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
*/
if ( maxRemoteVersion > maxLocalVersion )
{
- deltaGossipDigestList.add( new GossipDigest(gDigest.getEndPoint(), remoteGeneration, maxLocalVersion) );
+ deltaGossipDigestList.add( new GossipDigest(gDigest.getEndpoint(), remoteGeneration, maxLocalVersion) );
}
if ( maxRemoteVersion < maxLocalVersion )
{
@@ -810,27 +810,27 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
* Start the gossiper with the generation # retrieved from the System
* table
*/
- public void start(InetAddress localEndPoint, int generationNbr)
+ public void start(InetAddress localEndpoint, int generationNbr)
{
- localEndPoint_ = localEndPoint;
+ localEndpoint_ = localEndpoint;
/* Get the seeds from the config and initialize them. */
Set seedHosts = DatabaseDescriptor.getSeeds();
for (InetAddress seed : seedHosts)
{
- if (seed.equals(localEndPoint))
+ if (seed.equals(localEndpoint))
continue;
seeds_.add(seed);
}
- /* initialize the heartbeat state for this localEndPoint */
- EndPointState localState = endPointStateMap_.get(localEndPoint_);
+ /* initialize the heartbeat state for this localEndpoint */
+ EndPointState localState = endpointStateMap_.get(localEndpoint_);
if ( localState == null )
{
HeartBeatState hbState = new HeartBeatState(generationNbr);
localState = new EndPointState(hbState);
localState.isAlive(true);
localState.isAGossiper(true);
- endPointStateMap_.put(localEndPoint_, localState);
+ endpointStateMap_.put(localEndpoint_, localState);
}
/* starts a timer thread */
@@ -840,7 +840,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
public synchronized void addLocalApplicationState(String key, ApplicationState appState)
{
assert !StorageService.instance.isClientMode();
- EndPointState epState = endPointStateMap_.get(localEndPoint_);
+ EndPointState epState = endpointStateMap_.get(localEndpoint_);
assert epState != null;
epState.addApplicationState(key, appState);
}
@@ -909,7 +909,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
Map epToDigestMap = new HashMap();
for ( GossipDigest gDigest : gDigestList )
{
- epToDigestMap.put(gDigest.getEndPoint(), gDigest);
+ epToDigestMap.put(gDigest.getEndpoint(), gDigest);
}
/*
@@ -919,9 +919,9 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
List diffDigests = new ArrayList();
for ( GossipDigest gDigest : gDigestList )
{
- InetAddress ep = gDigest.getEndPoint();
- EndPointState epState = Gossiper.instance.getEndPointStateForEndPoint(ep);
- int version = (epState != null) ? Gossiper.instance.getMaxEndPointStateVersion( epState ) : 0;
+ InetAddress ep = gDigest.getEndpoint();
+ EndPointState epState = Gossiper.instance.getEndpointStateForEndpoint(ep);
+ int version = (epState != null) ? Gossiper.instance.getMaxEndpointStateVersion( epState ) : 0;
int diffVersion = Math.abs(version - gDigest.getMaxVersion() );
diffDigests.add( new GossipDigest(ep, gDigest.getGeneration(), diffVersion) );
}
@@ -935,7 +935,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
*/
for ( int i = size - 1; i >= 0; --i )
{
- gDigestList.add( epToDigestMap.get(diffDigests.get(i).getEndPoint()) );
+ gDigestList.add( epToDigestMap.get(diffDigests.get(i).getEndpoint()) );
}
}
}
@@ -957,7 +957,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
{
GossipDigestAckMessage gDigestAckMessage = GossipDigestAckMessage.serializer().deserialize(dis);
List gDigestList = gDigestAckMessage.getGossipDigestList();
- Map epStateMap = gDigestAckMessage.getEndPointStateMap();
+ Map epStateMap = gDigestAckMessage.getEndpointStateMap();
if ( epStateMap.size() > 0 )
{
@@ -970,7 +970,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
Map deltaEpStateMap = new HashMap();
for( GossipDigest gDigest : gDigestList )
{
- InetAddress addr = gDigest.getEndPoint();
+ InetAddress addr = gDigest.getEndpoint();
EndPointState localEpStatePtr = Gossiper.instance.getStateForVersionBiggerThan(addr, gDigest.getMaxVersion());
if ( localEpStatePtr != null )
deltaEpStateMap.put(addr, localEpStatePtr);
@@ -1010,7 +1010,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC
{
throw new RuntimeException(e);
}
- Map remoteEpStateMap = gDigestAck2Message.getEndPointStateMap();
+ Map remoteEpStateMap = gDigestAck2Message.getEndpointStateMap();
/* Notify the Failure Detector */
Gossiper.instance.notifyFailureDetector(remoteEpStateMap);
Gossiper.instance.applyStateLocally(remoteEpStateMap);
diff --git a/src/java/org/apache/cassandra/hadoop/ColumnFamilySplit.java b/src/java/org/apache/cassandra/hadoop/ColumnFamilySplit.java
index c52bc194d7..01ec83d2ca 100644
--- a/src/java/org/apache/cassandra/hadoop/ColumnFamilySplit.java
+++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilySplit.java
@@ -84,9 +84,9 @@ public class ColumnFamilySplit extends InputSplit implements Writable
out.writeUTF(endToken);
out.writeInt(dataNodes.length);
- for (String endPoint : dataNodes)
+ for (String endpoint : dataNodes)
{
- out.writeUTF(endPoint);
+ out.writeUTF(endpoint);
}
}
@@ -95,9 +95,9 @@ public class ColumnFamilySplit extends InputSplit implements Writable
startToken = in.readUTF();
endToken = in.readUTF();
- int numOfEndPoints = in.readInt();
- dataNodes = new String[numOfEndPoints];
- for(int i = 0; i < numOfEndPoints; i++)
+ int numOfEndpoints = in.readInt();
+ dataNodes = new String[numOfEndpoints];
+ for(int i = 0; i < numOfEndpoints; i++)
{
dataNodes[i] = in.readUTF();
}
diff --git a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
index 05f0807f8f..27e981131c 100644
--- a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
+++ b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
@@ -79,7 +79,7 @@ public abstract class AbstractReplicationStrategy
{
Multimap map = HashMultimap.create(targets.size(), 1);
- IEndPointSnitch endPointSnitch = DatabaseDescriptor.getEndPointSnitch();
+ IEndPointSnitch endpointSnitch = DatabaseDescriptor.getEndpointSnitch();
// first, add the live endpoints
for (InetAddress ep : targets)
@@ -106,7 +106,7 @@ public abstract class AbstractReplicationStrategy
InetAddress destination = map.isEmpty()
? localAddress
- : endPointSnitch.getSortedListByProximity(localAddress, map.keySet()).get(0);
+ : endpointSnitch.getSortedListByProximity(localAddress, map.keySet()).get(0);
map.put(destination, ep);
}
diff --git a/src/java/org/apache/cassandra/locator/DatacenterEndPointSnitch.java b/src/java/org/apache/cassandra/locator/DatacenterEndPointSnitch.java
index c6af9ee8e8..4c3607b3b5 100644
--- a/src/java/org/apache/cassandra/locator/DatacenterEndPointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DatacenterEndPointSnitch.java
@@ -75,10 +75,10 @@ public class DatacenterEndPointSnitch extends AbstractEndpointSnitch
/**
* Return the rack for which an endpoint resides in
*/
- public String getRackForEndPoint(InetAddress endPoint)
+ public String getRackForEndpoint(InetAddress endpoint)
throws UnknownHostException
{
- byte[] ipQuads = getIPAddress(endPoint.getHostAddress());
+ byte[] ipQuads = getIPAddress(endpoint.getHostAddress());
return ipRAC.get(ipQuads[1]).get(ipQuads[2]);
}
@@ -93,11 +93,11 @@ public class DatacenterEndPointSnitch extends AbstractEndpointSnitch
{
try
{
- String[] dcNames = xmlUtils.getNodeValues("/EndPoints/DataCenter/name");
+ String[] dcNames = xmlUtils.getNodeValues("/Endpoints/DataCenter/name");
for (String dcName : dcNames)
{
// Parse the Datacenter Quaderant.
- String dcXPath = "/EndPoints/DataCenter[name='" + dcName + "']";
+ String dcXPath = "/Endpoints/DataCenter[name='" + dcName + "']";
String dcIPQuad = xmlUtils.getNodeValue(dcXPath + "/ip2ndQuad");
String replicationFactor = xmlUtils.getNodeValue(dcXPath + "/replicationFactor");
byte dcByte = intToByte(Integer.parseInt(dcIPQuad));
diff --git a/src/java/org/apache/cassandra/locator/DatacenterShardStategy.java b/src/java/org/apache/cassandra/locator/DatacenterShardStategy.java
index d078d0cd30..ea86a83231 100644
--- a/src/java/org/apache/cassandra/locator/DatacenterShardStategy.java
+++ b/src/java/org/apache/cassandra/locator/DatacenterShardStategy.java
@@ -50,11 +50,11 @@ public class DatacenterShardStategy extends AbstractReplicationStrategy
private static int locQFactor = 0;
ArrayList tokens;
- private List localEndPoints = new ArrayList();
+ private List localEndpoints = new ArrayList();
- private List getLocalEndPoints()
+ private List getLocalEndpoints()
{
- return new ArrayList(localEndPoints);
+ return new ArrayList(localEndpoints);
}
private Map getQuorumRepFactor()
@@ -66,18 +66,18 @@ public class DatacenterShardStategy extends AbstractReplicationStrategy
* This Method will get the required information of the EndPoint from the
* DataCenterEndPointSnitch and poopulates this singleton class.
*/
- private synchronized void loadEndPoints(TokenMetadata metadata) throws IOException
+ private synchronized void loadEndpoints(TokenMetadata metadata) throws IOException
{
this.tokens = new ArrayList(metadata.sortedTokens());
String localDC = ((DatacenterEndPointSnitch)snitch_).getLocation(InetAddress.getLocalHost());
dcMap = new HashMap>();
for (Token token : this.tokens)
{
- InetAddress endPoint = metadata.getEndPoint(token);
- String dataCenter = ((DatacenterEndPointSnitch)snitch_).getLocation(endPoint);
+ InetAddress endpoint = metadata.getEndpoint(token);
+ String dataCenter = ((DatacenterEndPointSnitch)snitch_).getLocation(endpoint);
if (dataCenter.equals(localDC))
{
- localEndPoints.add(endPoint);
+ localEndpoints.add(endpoint);
}
List lst = dcMap.get(dataCenter);
if (lst == null)
@@ -112,7 +112,7 @@ public class DatacenterShardStategy extends AbstractReplicationStrategy
super(tokenMetadata, snitch);
if ((!(snitch instanceof DatacenterEndPointSnitch)))
{
- throw new IllegalArgumentException("DatacenterShardStrategy requires DatacenterEndpointSnitch");
+ throw new IllegalArgumentException("DatacenterShardStrategy requires DatacenterEndPointSnitch");
}
}
@@ -137,7 +137,7 @@ public class DatacenterShardStategy extends AbstractReplicationStrategy
if (null == tokens || tokens.size() != metadata.sortedTokens().size())
{
- loadEndPoints(metadata);
+ loadEndpoints(metadata);
}
for (String dc : dcMap.keySet())
@@ -149,16 +149,16 @@ public class DatacenterShardStategy extends AbstractReplicationStrategy
boolean doneDataCenterItr;
// Add the node at the index by default
Iterator iter = TokenMetadata.ringIterator(tokens, searchToken);
- InetAddress primaryHost = metadata.getEndPoint(iter.next());
+ InetAddress primaryHost = metadata.getEndpoint(iter.next());
forloopReturn.add(primaryHost);
while (forloopReturn.size() < replicas_ && iter.hasNext())
{
Token t = iter.next();
- InetAddress endPointOfInterest = metadata.getEndPoint(t);
+ InetAddress endpointOfInterest = metadata.getEndpoint(t);
if (forloopReturn.size() < replicas_ - 1)
{
- forloopReturn.add(endPointOfInterest);
+ forloopReturn.add(endpointOfInterest);
continue;
}
else
@@ -169,9 +169,9 @@ public class DatacenterShardStategy extends AbstractReplicationStrategy
// Now try to find one on a different rack
if (!bOtherRack)
{
- if (!((DatacenterEndPointSnitch)snitch_).isOnSameRack(primaryHost, endPointOfInterest))
+ if (!((DatacenterEndPointSnitch)snitch_).isOnSameRack(primaryHost, endpointOfInterest))
{
- forloopReturn.add(metadata.getEndPoint(t));
+ forloopReturn.add(metadata.getEndpoint(t));
bOtherRack = true;
}
}
@@ -193,9 +193,9 @@ public class DatacenterShardStategy extends AbstractReplicationStrategy
while (forloopReturn.size() < replicas_ && iter.hasNext())
{
Token t = iter.next();
- if (!forloopReturn.contains(metadata.getEndPoint(t)))
+ if (!forloopReturn.contains(metadata.getEndpoint(t)))
{
- forloopReturn.add(metadata.getEndPoint(t));
+ forloopReturn.add(metadata.getEndpoint(t));
}
}
}
diff --git a/src/java/org/apache/cassandra/locator/RackAwareStrategy.java b/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
index dae0ee7c8a..8b533d62fa 100644
--- a/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
+++ b/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
@@ -56,7 +56,7 @@ public class RackAwareStrategy extends AbstractReplicationStrategy
Iterator iter = TokenMetadata.ringIterator(tokens, token);
Token primaryToken = iter.next();
- endpoints.add(metadata.getEndPoint(primaryToken));
+ endpoints.add(metadata.getEndpoint(primaryToken));
boolean bDataCenter = false;
boolean bOtherRack = false;
@@ -66,24 +66,24 @@ public class RackAwareStrategy extends AbstractReplicationStrategy
{
// First try to find one in a different data center
Token t = iter.next();
- if (!((EndPointSnitch)snitch_).isInSameDataCenter(metadata.getEndPoint(primaryToken), metadata.getEndPoint(t)))
+ if (!((EndPointSnitch)snitch_).isInSameDataCenter(metadata.getEndpoint(primaryToken), metadata.getEndpoint(t)))
{
// If we have already found something in a diff datacenter no need to find another
if (!bDataCenter)
{
- endpoints.add(metadata.getEndPoint(t));
+ endpoints.add(metadata.getEndpoint(t));
bDataCenter = true;
}
continue;
}
// Now try to find one on a different rack
- if (!((EndPointSnitch)snitch_).isOnSameRack(metadata.getEndPoint(primaryToken), metadata.getEndPoint(t)) &&
- ((EndPointSnitch)snitch_).isInSameDataCenter(metadata.getEndPoint(primaryToken), metadata.getEndPoint(t)))
+ if (!((EndPointSnitch)snitch_).isOnSameRack(metadata.getEndpoint(primaryToken), metadata.getEndpoint(t)) &&
+ ((EndPointSnitch)snitch_).isInSameDataCenter(metadata.getEndpoint(primaryToken), metadata.getEndpoint(t)))
{
// If we have already found something in a diff rack no need to find another
if (!bOtherRack)
{
- endpoints.add(metadata.getEndPoint(t));
+ endpoints.add(metadata.getEndpoint(t));
bOtherRack = true;
}
}
@@ -103,8 +103,8 @@ public class RackAwareStrategy extends AbstractReplicationStrategy
while (endpoints.size() < replicas && iter.hasNext())
{
Token t = iter.next();
- if (!endpoints.contains(metadata.getEndPoint(t)))
- endpoints.add(metadata.getEndPoint(t));
+ if (!endpoints.contains(metadata.getEndpoint(t)))
+ endpoints.add(metadata.getEndpoint(t));
}
}
diff --git a/src/java/org/apache/cassandra/locator/RackUnawareStrategy.java b/src/java/org/apache/cassandra/locator/RackUnawareStrategy.java
index dc100105ce..a0ea5c65b7 100644
--- a/src/java/org/apache/cassandra/locator/RackUnawareStrategy.java
+++ b/src/java/org/apache/cassandra/locator/RackUnawareStrategy.java
@@ -53,7 +53,7 @@ public class RackUnawareStrategy extends AbstractReplicationStrategy
Iterator iter = TokenMetadata.ringIterator(tokens, token);
while (endpoints.size() < replicas && iter.hasNext())
{
- endpoints.add(metadata.getEndPoint(iter.next()));
+ endpoints.add(metadata.getEndpoint(iter.next()));
}
return endpoints;
diff --git a/src/java/org/apache/cassandra/locator/TokenMetadata.java b/src/java/org/apache/cassandra/locator/TokenMetadata.java
index c6c3b7aae6..6537401c59 100644
--- a/src/java/org/apache/cassandra/locator/TokenMetadata.java
+++ b/src/java/org/apache/cassandra/locator/TokenMetadata.java
@@ -35,7 +35,7 @@ import org.apache.commons.lang.StringUtils;
public class TokenMetadata
{
/* Maintains token to endpoint map of every node in the cluster. */
- private BiMap tokenToEndPointMap;
+ private BiMap tokenToEndpointMap;
// Suppose that there is a ring of nodes A, C and E, with replication factor 3.
// Node D bootstraps between C and E, so its pending ranges will be E-A, A-C and C-D.
@@ -51,7 +51,7 @@ public class TokenMetadata
// An anonymous pending ranges list is not enough, as that does not tell which node is leaving
// and/or if the ranges are there because of bootstrap or leave operation.
// (See CASSANDRA-603 for more detail + examples).
- private Set leavingEndPoints;
+ private Set leavingEndpoints;
private ConcurrentMap> pendingRanges;
@@ -64,20 +64,20 @@ public class TokenMetadata
this(null);
}
- public TokenMetadata(BiMap tokenToEndPointMap)
+ public TokenMetadata(BiMap tokenToEndpointMap)
{
- if (tokenToEndPointMap == null)
- tokenToEndPointMap = HashBiMap.create();
- this.tokenToEndPointMap = tokenToEndPointMap;
+ if (tokenToEndpointMap == null)
+ tokenToEndpointMap = HashBiMap.create();
+ this.tokenToEndpointMap = tokenToEndpointMap;
bootstrapTokens = HashBiMap.create();
- leavingEndPoints = new HashSet();
+ leavingEndpoints = new HashSet();
pendingRanges = new ConcurrentHashMap>();
sortedTokens = sortTokens();
}
private List sortTokens()
{
- List tokens = new ArrayList(tokenToEndPointMap.keySet());
+ List tokens = new ArrayList(tokenToEndpointMap.keySet());
Collections.sort(tokens);
return Collections.unmodifiableList(tokens);
}
@@ -102,12 +102,12 @@ public class TokenMetadata
try
{
bootstrapTokens.inverse().remove(endpoint);
- tokenToEndPointMap.inverse().remove(endpoint);
- if (!endpoint.equals(tokenToEndPointMap.put(token, endpoint)))
+ tokenToEndpointMap.inverse().remove(endpoint);
+ if (!endpoint.equals(tokenToEndpointMap.put(token, endpoint)))
{
sortedTokens = sortTokens();
}
- leavingEndPoints.remove(endpoint);
+ leavingEndpoints.remove(endpoint);
}
finally
{
@@ -123,15 +123,15 @@ public class TokenMetadata
lock.writeLock().lock();
try
{
- InetAddress oldEndPoint = null;
+ InetAddress oldEndpoint = null;
- oldEndPoint = bootstrapTokens.get(token);
- if (oldEndPoint != null && !oldEndPoint.equals(endpoint))
- throw new RuntimeException("Bootstrap Token collision between " + oldEndPoint + " and " + endpoint + " (token " + token);
+ oldEndpoint = bootstrapTokens.get(token);
+ if (oldEndpoint != null && !oldEndpoint.equals(endpoint))
+ throw new RuntimeException("Bootstrap Token collision between " + oldEndpoint + " and " + endpoint + " (token " + token);
- oldEndPoint = tokenToEndPointMap.get(token);
- if (oldEndPoint != null && !oldEndPoint.equals(endpoint))
- throw new RuntimeException("Bootstrap Token collision between " + oldEndPoint + " and " + endpoint + " (token " + token);
+ oldEndpoint = tokenToEndpointMap.get(token);
+ if (oldEndpoint != null && !oldEndpoint.equals(endpoint))
+ throw new RuntimeException("Bootstrap Token collision between " + oldEndpoint + " and " + endpoint + " (token " + token);
bootstrapTokens.inverse().remove(endpoint);
bootstrapTokens.put(token, endpoint);
@@ -157,14 +157,14 @@ public class TokenMetadata
}
}
- public void addLeavingEndPoint(InetAddress endpoint)
+ public void addLeavingEndpoint(InetAddress endpoint)
{
assert endpoint != null;
lock.writeLock().lock();
try
{
- leavingEndPoints.add(endpoint);
+ leavingEndpoints.add(endpoint);
}
finally
{
@@ -172,14 +172,14 @@ public class TokenMetadata
}
}
- public void removeLeavingEndPoint(InetAddress endpoint)
+ public void removeLeavingEndpoint(InetAddress endpoint)
{
assert endpoint != null;
lock.writeLock().lock();
try
{
- leavingEndPoints.remove(endpoint);
+ leavingEndpoints.remove(endpoint);
}
finally
{
@@ -189,13 +189,13 @@ public class TokenMetadata
public void removeEndpoint(InetAddress endpoint)
{
- assert tokenToEndPointMap.containsValue(endpoint);
+ assert tokenToEndpointMap.containsValue(endpoint);
lock.writeLock().lock();
try
{
bootstrapTokens.inverse().remove(endpoint);
- tokenToEndPointMap.inverse().remove(endpoint);
- leavingEndPoints.remove(endpoint);
+ tokenToEndpointMap.inverse().remove(endpoint);
+ leavingEndpoints.remove(endpoint);
sortedTokens = sortTokens();
}
finally
@@ -212,7 +212,7 @@ public class TokenMetadata
lock.readLock().lock();
try
{
- return tokenToEndPointMap.inverse().get(endpoint);
+ return tokenToEndpointMap.inverse().get(endpoint);
}
finally
{
@@ -227,7 +227,7 @@ public class TokenMetadata
lock.readLock().lock();
try
{
- return tokenToEndPointMap.inverse().containsKey(endpoint);
+ return tokenToEndpointMap.inverse().containsKey(endpoint);
}
finally
{
@@ -242,7 +242,7 @@ public class TokenMetadata
lock.readLock().lock();
try
{
- return leavingEndPoints.contains(endpoint);
+ return leavingEndpoints.contains(endpoint);
}
finally
{
@@ -252,12 +252,12 @@ public class TokenMetadata
public InetAddress getFirstEndpoint()
{
- assert tokenToEndPointMap.size() > 0;
+ assert tokenToEndpointMap.size() > 0;
lock.readLock().lock();
try
{
- return tokenToEndPointMap.get(sortedTokens.get(0));
+ return tokenToEndpointMap.get(sortedTokens.get(0));
}
finally
{
@@ -266,7 +266,7 @@ public class TokenMetadata
}
/**
- * Create a copy of TokenMetadata with only tokenToEndPointMap. That is, pending ranges,
+ * Create a copy of TokenMetadata with only tokenToEndpointMap. That is, pending ranges,
* bootstrap tokens and leaving endpoints are not included in the copy.
*/
public TokenMetadata cloneOnlyTokenMap()
@@ -274,7 +274,7 @@ public class TokenMetadata
lock.readLock().lock();
try
{
- return new TokenMetadata(HashBiMap.create(tokenToEndPointMap));
+ return new TokenMetadata(HashBiMap.create(tokenToEndpointMap));
}
finally
{
@@ -283,7 +283,7 @@ public class TokenMetadata
}
/**
- * Create a copy of TokenMetadata with tokenToEndPointMap reflecting situation after all
+ * Create a copy of TokenMetadata with tokenToEndpointMap reflecting situation after all
* current leave operations have finished.
*/
public TokenMetadata cloneAfterAllLeft()
@@ -292,8 +292,8 @@ public class TokenMetadata
try
{
TokenMetadata allLeftMetadata = cloneOnlyTokenMap();
- for (InetAddress endPoint : leavingEndPoints)
- allLeftMetadata.removeEndpoint(endPoint);
+ for (InetAddress endpoint : leavingEndpoints)
+ allLeftMetadata.removeEndpoint(endpoint);
return allLeftMetadata;
}
finally
@@ -302,12 +302,12 @@ public class TokenMetadata
}
}
- public InetAddress getEndPoint(Token token)
+ public InetAddress getEndpoint(Token token)
{
lock.readLock().lock();
try
{
- return tokenToEndPointMap.get(token);
+ return tokenToEndpointMap.get(token);
}
finally
{
@@ -372,7 +372,7 @@ public class TokenMetadata
{
List tokens = sortedTokens();
int index = Collections.binarySearch(tokens, token);
- assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndPointMap.keySet(), ", ");
+ assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndpointMap.keySet(), ", ");
return (Token) (index == 0 ? tokens.get(tokens.size() - 1) : tokens.get(index - 1));
}
@@ -380,13 +380,13 @@ public class TokenMetadata
{
List tokens = sortedTokens();
int index = Collections.binarySearch(tokens, token);
- assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndPointMap.keySet(), ", ");
+ assert index >= 0 : token + " not found in " + StringUtils.join(tokenToEndpointMap.keySet(), ", ");
return (Token) ((index == (tokens.size() - 1)) ? tokens.get(0) : tokens.get(index + 1));
}
- public InetAddress getSuccessor(InetAddress endPoint)
+ public InetAddress getSuccessor(InetAddress endpoint)
{
- return getEndPoint(getSuccessor(getToken(endPoint)));
+ return getEndpoint(getSuccessor(getToken(endpoint)));
}
/** caller should not modify bootstrapTokens */
@@ -395,10 +395,10 @@ public class TokenMetadata
return bootstrapTokens;
}
- /** caller should not modify leavigEndPoints */
- public Set getLeavingEndPoints()
+ /** caller should not modify leavigEndpoints */
+ public Set getLeavingEndpoints()
{
- return leavingEndPoints;
+ return leavingEndpoints;
}
/**
@@ -443,8 +443,8 @@ public class TokenMetadata
public void clearUnsafe()
{
bootstrapTokens.clear();
- tokenToEndPointMap.clear();
- leavingEndPoints.clear();
+ tokenToEndpointMap.clear();
+ leavingEndpoints.clear();
pendingRanges.clear();
}
@@ -454,7 +454,7 @@ public class TokenMetadata
lock.readLock().lock();
try
{
- Set eps = tokenToEndPointMap.inverse().keySet();
+ Set eps = tokenToEndpointMap.inverse().keySet();
if (!eps.isEmpty())
{
@@ -464,7 +464,7 @@ public class TokenMetadata
{
sb.append(ep);
sb.append(":");
- sb.append(tokenToEndPointMap.inverse().get(ep));
+ sb.append(tokenToEndpointMap.inverse().get(ep));
sb.append(System.getProperty("line.separator"));
}
}
@@ -480,11 +480,11 @@ public class TokenMetadata
}
}
- if (!leavingEndPoints.isEmpty())
+ if (!leavingEndpoints.isEmpty())
{
- sb.append("Leaving EndPoints:");
+ sb.append("Leaving Endpoints:");
sb.append(System.getProperty("line.separator"));
- for (InetAddress ep : leavingEndPoints)
+ for (InetAddress ep : leavingEndpoints)
{
sb.append(ep);
sb.append(System.getProperty("line.separator"));
diff --git a/src/java/org/apache/cassandra/net/CompactEndPointSerializationHelper.java b/src/java/org/apache/cassandra/net/CompactEndPointSerializationHelper.java
index d9f0cfd26c..971400432e 100644
--- a/src/java/org/apache/cassandra/net/CompactEndPointSerializationHelper.java
+++ b/src/java/org/apache/cassandra/net/CompactEndPointSerializationHelper.java
@@ -23,9 +23,9 @@ import java.net.InetAddress;
public class CompactEndPointSerializationHelper
{
- public static void serialize(InetAddress endPoint, DataOutputStream dos) throws IOException
+ public static void serialize(InetAddress endpoint, DataOutputStream dos) throws IOException
{
- byte[] buf = endPoint.getAddress();
+ byte[] buf = endpoint.getAddress();
dos.writeByte(buf.length);
dos.write(buf);
}
diff --git a/src/java/org/apache/cassandra/service/AntiEntropyService.java b/src/java/org/apache/cassandra/service/AntiEntropyService.java
index f61826445d..dea1ccfcc8 100644
--- a/src/java/org/apache/cassandra/service/AntiEntropyService.java
+++ b/src/java/org/apache/cassandra/service/AntiEntropyService.java
@@ -559,8 +559,8 @@ public class AntiEntropyService
rtree.partitioner(StorageService.getPartitioner());
// determine the ranges where responsibility overlaps
- Set interesting = new HashSet(ss.getRangesForEndPoint(cf.left, local));
- interesting.retainAll(ss.getRangesForEndPoint(cf.left, remote));
+ Set interesting = new HashSet(ss.getRangesForEndpoint(cf.left, local));
+ interesting.retainAll(ss.getRangesForEndpoint(cf.left, remote));
// compare trees, and filter out uninteresting differences
for (MerkleTree.TreeRange diff : MerkleTree.difference(ltree, rtree))
diff --git a/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java b/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
index 6641c7f166..f7db7de279 100644
--- a/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
+++ b/src/java/org/apache/cassandra/service/DatacenterSyncWriteResponseHandler.java
@@ -42,14 +42,14 @@ public class DatacenterSyncWriteResponseHandler extends WriteResponseHandler
{
private final Map dcResponses = new HashMap();
private final Map responseCounts;
- private final DatacenterEndPointSnitch endPointSnitch;
+ private final DatacenterEndPointSnitch endpointSnitch;
public DatacenterSyncWriteResponseHandler(Map responseCounts, String table)
{
// Response is been managed by the map so make it 1 for the superclass.
super(1, table);
this.responseCounts = responseCounts;
- endPointSnitch = (DatacenterEndPointSnitch) DatabaseDescriptor.getEndPointSnitch();
+ endpointSnitch = (DatacenterEndPointSnitch) DatabaseDescriptor.getEndpointSnitch();
}
@Override
@@ -60,7 +60,7 @@ public class DatacenterSyncWriteResponseHandler extends WriteResponseHandler
{
try
{
- String dataCenter = endPointSnitch.getLocation(message.getFrom());
+ String dataCenter = endpointSnitch.getLocation(message.getFrom());
Object blockFor = responseCounts.get(dataCenter);
// If this DC needs to be blocked then do the below.
if (blockFor != null)
diff --git a/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java b/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java
index 19228108e5..fb291cab81 100644
--- a/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java
+++ b/src/java/org/apache/cassandra/service/DatacenterWriteResponseHandler.java
@@ -50,7 +50,7 @@ public class DatacenterWriteResponseHandler extends WriteResponseHandler
// Response is been managed by the map so the waitlist size really doesnt matter.
super(blockFor, table);
this.blockFor = new AtomicInteger(blockFor);
- endpointsnitch = (DatacenterEndPointSnitch) DatabaseDescriptor.getEndPointSnitch();
+ endpointsnitch = (DatacenterEndPointSnitch) DatabaseDescriptor.getEndpointSnitch();
localEndpoint = FBUtilities.getLocalAddress();
}
diff --git a/src/java/org/apache/cassandra/service/MigrationManager.java b/src/java/org/apache/cassandra/service/MigrationManager.java
index e8b3fcdea9..f9ec247e3c 100644
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@ -62,7 +62,7 @@ public class MigrationManager implements IEndPointStateChangeSubscriber
}
/** gets called after a this node joins a cluster */
- public void onAlive(InetAddress endpoint, EndPointState state)
+ public void onAlive(InetAddress endpoint, EndPointState state)
{
ApplicationState appState = state.getApplicationState(MIGRATION_STATE);
if (appState != null)
diff --git a/src/java/org/apache/cassandra/service/ReadResponseResolver.java b/src/java/org/apache/cassandra/service/ReadResponseResolver.java
index 138dd0c3af..08d70b0499 100644
--- a/src/java/org/apache/cassandra/service/ReadResponseResolver.java
+++ b/src/java/org/apache/cassandra/service/ReadResponseResolver.java
@@ -65,7 +65,7 @@ public class ReadResponseResolver implements IResponseResolver
{
long startTime = System.currentTimeMillis();
List versions = new ArrayList();
- List endPoints = new ArrayList();
+ List endpoints = new ArrayList();
DecoratedKey key = null;
byte[] digest = new byte[0];
boolean isDigestQuery = false;
@@ -89,7 +89,7 @@ public class ReadResponseResolver implements IResponseResolver
else
{
versions.add(result.row().cf);
- endPoints.add(response.getFrom());
+ endpoints.add(response.getFrom());
key = result.row().key;
}
}
@@ -109,7 +109,7 @@ public class ReadResponseResolver implements IResponseResolver
}
ColumnFamily resolved = resolveSuperset(versions);
- maybeScheduleRepairs(resolved, table, key, versions, endPoints);
+ maybeScheduleRepairs(resolved, table, key, versions, endpoints);
if (logger_.isDebugEnabled())
logger_.debug("resolve: " + (System.currentTimeMillis() - startTime) + " ms.");
@@ -120,7 +120,7 @@ public class ReadResponseResolver implements IResponseResolver
* For each row version, compare with resolved (the superset of all row versions);
* if it is missing anything, send a mutation to the endpoint it come from.
*/
- public static void maybeScheduleRepairs(ColumnFamily resolved, String table, DecoratedKey key, List versions, List endPoints)
+ public static void maybeScheduleRepairs(ColumnFamily resolved, String table, DecoratedKey key, List versions, List endpoints)
{
for (int i = 0; i < versions.size(); i++)
{
@@ -132,7 +132,7 @@ public class ReadResponseResolver implements IResponseResolver
RowMutation rowMutation = new RowMutation(table, key.key);
rowMutation.add(diffCf);
RowMutationMessage rowMutationMessage = new RowMutationMessage(rowMutation);
- ReadRepairManager.instance.schedule(endPoints.get(i), rowMutationMessage);
+ ReadRepairManager.instance.schedule(endpoints.get(i), rowMutationMessage);
}
}
diff --git a/src/java/org/apache/cassandra/service/StorageLoadBalancer.java b/src/java/org/apache/cassandra/service/StorageLoadBalancer.java
index 813ec75a09..7c2991f89c 100644
--- a/src/java/org/apache/cassandra/service/StorageLoadBalancer.java
+++ b/src/java/org/apache/cassandra/service/StorageLoadBalancer.java
@@ -69,14 +69,14 @@ public class StorageLoadBalancer implements IEndPointStateChangeSubscriber
/*
int threshold = (int)(StorageLoadBalancer.TOPHEAVY_RATIO * averageSystemLoad());
int myLoad = localLoad();
- InetAddress predecessor = StorageService.instance.getPredecessor(StorageService.getLocalStorageEndPoint());
+ InetAddress predecessor = StorageService.instance.getPredecessor(StorageService.getLocalStorageEndpoint());
if (logger_.isDebugEnabled())
logger_.debug("Trying to relocate the predecessor {}", predecessor);
boolean value = tryThisNode(myLoad, threshold, predecessor);
if ( !value )
{
loadInfo2_.remove(predecessor);
- InetAddress successor = StorageService.instance.getSuccessor(StorageService.getLocalStorageEndPoint());
+ InetAddress successor = StorageService.instance.getSuccessor(StorageService.getLocalStorageEndpoint());
if (logger_.isDebugEnabled())
logger_.debug("Trying to relocate the successor {}", successor);
value = tryThisNode(myLoad, threshold, successor);
@@ -136,7 +136,7 @@ public class StorageLoadBalancer implements IEndPointStateChangeSubscriber
BigInteger targetToken = BootstrapAndLbHelper.getTokenBasedOnPrimaryCount(keyCount);
// Send a MoveMessage and see if this node is relocateable
MoveMessage moveMessage = new MoveMessage(targetToken);
- Message message = new Message(StorageService.getLocalStorageEndPoint(), StorageLoadBalancer.lbStage_, StorageLoadBalancer.moveMessageVerbHandler_, new Object[]{moveMessage});
+ Message message = new Message(StorageService.getLocalStorageEndpoint(), StorageLoadBalancer.lbStage_, StorageLoadBalancer.moveMessageVerbHandler_, new Object[]{moveMessage});
if (logger_.isDebugEnabled())
logger_.debug("Sending a move message to {}", target);
IAsyncResult result = MessagingService.getMessagingInstance().sendRR(message, target);
@@ -205,7 +205,7 @@ public class StorageLoadBalancer implements IEndPointStateChangeSubscriber
if ( isHeavyNode() )
{
if (logger_.isDebugEnabled())
- logger_.debug(StorageService.getLocalStorageEndPoint() + " is a heavy node with load " + localLoad());
+ logger_.debug(StorageService.getLocalStorageEndpoint() + " is a heavy node with load " + localLoad());
// lb_.schedule( new LoadBalancer(), StorageLoadBalancer.delay_, TimeUnit.MINUTES );
}
*/
@@ -230,7 +230,7 @@ public class StorageLoadBalancer implements IEndPointStateChangeSubscriber
if ( !isMoveable_.get() )
return false;
int myload = localLoad();
- InetAddress successor = StorageService.instance.getSuccessor(StorageService.getLocalStorageEndPoint());
+ InetAddress successor = StorageService.instance.getSuccessor(StorageService.getLocalStorageEndpoint());
LoadInfo li = loadInfo2_.get(successor);
// "load" is NULL means that the successor node has not
// yet gossiped its load information. We should return
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index 91aaa40e95..55bad98d87 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -345,14 +345,14 @@ public class StorageProxy implements StorageProxyMBean
for (ReadCommand command: commands)
{
- InetAddress endPoint = StorageService.instance.findSuitableEndPoint(command.table, command.key);
+ InetAddress endpoint = StorageService.instance.findSuitableEndpoint(command.table, command.key);
Message message = command.makeReadMessage();
if (logger.isDebugEnabled())
- logger.debug("weakreadremote reading " + command + " from " + message.getMessageId() + "@" + endPoint);
+ logger.debug("weakreadremote reading " + command + " from " + message.getMessageId() + "@" + endpoint);
if (randomlyReadRepair(command))
message.setHeader(ReadCommand.DO_REPAIR, ReadCommand.DO_REPAIR.getBytes());
- iars.add(MessagingService.instance.sendRR(message, endPoint));
+ iars.add(MessagingService.instance.sendRR(message, endpoint));
}
for (IAsyncResult iar: iars)
@@ -429,7 +429,7 @@ public class StorageProxy implements StorageProxyMBean
private static List strongRead(List commands, ConsistencyLevel consistency_level) throws IOException, UnavailableException, TimeoutException
{
List> quorumResponseHandlers = new ArrayList>();
- List commandEndPoints = new ArrayList();
+ List commandEndpoints = new ArrayList();
List rows = new ArrayList();
int commandIndex = 0;
@@ -442,14 +442,14 @@ public class StorageProxy implements StorageProxyMBean
Message message = command.makeReadMessage();
Message messageDigestOnly = readMessageDigestOnly.makeReadMessage();
- InetAddress dataPoint = StorageService.instance.findSuitableEndPoint(command.table, command.key);
+ InetAddress dataPoint = StorageService.instance.findSuitableEndpoint(command.table, command.key);
List endpointList = StorageService.instance.getLiveNaturalEndpoints(command.table, command.key);
final String table = command.table;
int responseCount = determineBlockFor(DatabaseDescriptor.getReplicationFactor(table), consistency_level);
if (endpointList.size() < responseCount)
throw new UnavailableException();
- InetAddress[] endPoints = new InetAddress[endpointList.size()];
+ InetAddress[] endpoints = new InetAddress[endpointList.size()];
Message messages[] = new Message[endpointList.size()];
// data-request message is sent to dataPoint, the node that will actually get
// the data for us. The other replicas are only sent a digest query.
@@ -457,15 +457,15 @@ public class StorageProxy implements StorageProxyMBean
for (InetAddress endpoint : endpointList)
{
Message m = endpoint.equals(dataPoint) ? message : messageDigestOnly;
- endPoints[n] = endpoint;
+ endpoints[n] = endpoint;
messages[n++] = m;
if (logger.isDebugEnabled())
logger.debug("strongread reading " + (m == message ? "data" : "digest") + " for " + command + " from " + m.getMessageId() + "@" + endpoint);
}
QuorumResponseHandler quorumResponseHandler = new QuorumResponseHandler(DatabaseDescriptor.getQuorum(command.table), new ReadResponseResolver(command.table, responseCount));
- MessagingService.instance.sendRR(messages, endPoints, quorumResponseHandler);
+ MessagingService.instance.sendRR(messages, endpoints, quorumResponseHandler);
quorumResponseHandlers.add(quorumResponseHandler);
- commandEndPoints.add(endPoints);
+ commandEndpoints.add(endpoints);
}
for (QuorumResponseHandler quorumResponseHandler: quorumResponseHandlers)
@@ -492,7 +492,7 @@ public class StorageProxy implements StorageProxyMBean
readResponseResolverRepair);
logger.info("DigestMismatchException: " + ex.getMessage());
Message messageRepair = command.makeReadMessage();
- MessagingService.instance.sendRR(messageRepair, commandEndPoints.get(commandIndex), quorumResponseHandlerRepair);
+ MessagingService.instance.sendRR(messageRepair, commandEndpoints.get(commandIndex), quorumResponseHandlerRepair);
try
{
row = quorumResponseHandlerRepair.get();
@@ -675,7 +675,7 @@ public class StorageProxy implements StorageProxyMBean
if (endpoints.size() < responseCount)
throw new UnavailableException();
- DatabaseDescriptor.getEndPointSnitch().sortByProximity(FBUtilities.getLocalAddress(), endpoints);
+ DatabaseDescriptor.getEndpointSnitch().sortByProximity(FBUtilities.getLocalAddress(), endpoints);
List endpointsForCL = endpoints.subList(0, responseCount);
Set restrictedRanges = queryRange.restrictTo(nodeRange);
for (AbstractBounds range : restrictedRanges)
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 8aedb8cf49..8f15dab2a5 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -125,12 +125,12 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
public Collection getLocalRanges(String table)
{
- return getRangesForEndPoint(table, FBUtilities.getLocalAddress());
+ return getRangesForEndpoint(table, FBUtilities.getLocalAddress());
}
public Range getLocalPrimaryRange()
{
- return getPrimaryRangeForEndPoint(FBUtilities.getLocalAddress());
+ return getPrimaryRangeForEndpoint(FBUtilities.getLocalAddress());
}
/* This abstraction maintains the token/endpoint metadata information */
@@ -274,7 +274,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
try
{
Constructor extends AbstractReplicationStrategy> constructor = cls.getConstructor(parameterTypes);
- replicationStrategy = constructor.newInstance(tokenMetadata, DatabaseDescriptor.getEndPointSnitch());
+ replicationStrategy = constructor.newInstance(tokenMetadata, DatabaseDescriptor.getEndpointSnitch());
}
catch (Exception e)
{
@@ -451,7 +451,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
* @param keyspace
* @return
*/
- public Map> getRangeToEndPointMap(String keyspace)
+ public Map> getRangeToEndpointMap(String keyspace)
{
// some people just want to get a visual representation of things. Allow null and set it to the first
// non-system table.
@@ -470,7 +470,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
public Map> getRangeToAddressMap(String keyspace)
{
List ranges = getAllRanges(tokenMetadata_.sortedTokens());
- return constructRangeToEndPointMap(keyspace, ranges);
+ return constructRangeToEndpointMap(keyspace, ranges);
}
/**
@@ -479,14 +479,14 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
* @param ranges
* @return mapping of ranges to the replicas responsible for them.
*/
- private Map> constructRangeToEndPointMap(String keyspace, List ranges)
+ private Map> constructRangeToEndpointMap(String keyspace, List ranges)
{
- Map> rangeToEndPointMap = new HashMap>();
+ Map> rangeToEndpointMap = new HashMap>();
for (Range range : ranges)
{
- rangeToEndPointMap.put(range, getReplicationStrategy(keyspace).getNaturalEndpoints(range.right, keyspace));
+ rangeToEndpointMap.put(range, getReplicationStrategy(keyspace).getNaturalEndpoints(range.right, keyspace));
}
- return rangeToEndPointMap;
+ return rangeToEndpointMap;
}
/*
@@ -521,32 +521,32 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
/**
* Handle node bootstrap
*
- * @param endPoint bootstrapping node
+ * @param endpoint bootstrapping node
* @param moveValue bootstrap token as string
*/
- private void handleStateBootstrap(InetAddress endPoint, String moveValue)
+ private void handleStateBootstrap(InetAddress endpoint, String moveValue)
{
Token token = getPartitioner().getTokenFactory().fromString(moveValue);
if (logger_.isDebugEnabled())
- logger_.debug("Node " + endPoint + " state bootstrapping, token " + token);
+ logger_.debug("Node " + endpoint + " state bootstrapping, token " + token);
// if this node is present in token metadata, either we have missed intermediate states
// or the node had crashed. Print warning if needed, clear obsolete stuff and
// continue.
- if (tokenMetadata_.isMember(endPoint))
+ if (tokenMetadata_.isMember(endpoint))
{
// If isLeaving is false, we have missed both LEAVING and LEFT. However, if
// isLeaving is true, we have only missed LEFT. Waiting time between completing
// leave operation and rebootstrapping is relatively short, so the latter is quite
// common (not enough time for gossip to spread). Therefore we report only the
// former in the log.
- if (!tokenMetadata_.isLeaving(endPoint))
- logger_.info("Node " + endPoint + " state jump to bootstrap");
- tokenMetadata_.removeEndpoint(endPoint);
+ if (!tokenMetadata_.isLeaving(endpoint))
+ logger_.info("Node " + endpoint + " state jump to bootstrap");
+ tokenMetadata_.removeEndpoint(endpoint);
}
- tokenMetadata_.addBootstrapToken(token, endPoint);
+ tokenMetadata_.addBootstrapToken(token, endpoint);
calculatePendingRanges();
}
@@ -554,55 +554,55 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
* Handle node move to normal state. That is, node is entering token ring and participating
* in reads.
*
- * @param endPoint node
+ * @param endpoint node
* @param moveValue token as string
*/
- private void handleStateNormal(InetAddress endPoint, String moveValue)
+ private void handleStateNormal(InetAddress endpoint, String moveValue)
{
Token token = getPartitioner().getTokenFactory().fromString(moveValue);
if (logger_.isDebugEnabled())
- logger_.debug("Node " + endPoint + " state normal, token " + token);
+ logger_.debug("Node " + endpoint + " state normal, token " + token);
- if (tokenMetadata_.isMember(endPoint))
- logger_.info("Node " + endPoint + " state jump to normal");
+ if (tokenMetadata_.isMember(endpoint))
+ logger_.info("Node " + endpoint + " state jump to normal");
- tokenMetadata_.updateNormalToken(token, endPoint);
+ tokenMetadata_.updateNormalToken(token, endpoint);
calculatePendingRanges();
if (!isClientMode)
- SystemTable.updateToken(endPoint, token);
+ SystemTable.updateToken(endpoint, token);
}
/**
* Handle node preparing to leave the ring
*
- * @param endPoint node
+ * @param endpoint node
* @param moveValue token as string
*/
- private void handleStateLeaving(InetAddress endPoint, String moveValue)
+ private void handleStateLeaving(InetAddress endpoint, String moveValue)
{
Token token = getPartitioner().getTokenFactory().fromString(moveValue);
if (logger_.isDebugEnabled())
- logger_.debug("Node " + endPoint + " state leaving, token " + token);
+ logger_.debug("Node " + endpoint + " state leaving, token " + token);
// If the node is previously unknown or tokens do not match, update tokenmetadata to
// have this node as 'normal' (it must have been using this token before the
// leave). This way we'll get pending ranges right.
- if (!tokenMetadata_.isMember(endPoint))
+ if (!tokenMetadata_.isMember(endpoint))
{
- logger_.info("Node " + endPoint + " state jump to leaving");
- tokenMetadata_.updateNormalToken(token, endPoint);
+ logger_.info("Node " + endpoint + " state jump to leaving");
+ tokenMetadata_.updateNormalToken(token, endpoint);
}
- else if (!tokenMetadata_.getToken(endPoint).equals(token))
+ else if (!tokenMetadata_.getToken(endpoint).equals(token))
{
- logger_.warn("Node " + endPoint + " 'leaving' token mismatch. Long network partition?");
- tokenMetadata_.updateNormalToken(token, endPoint);
+ logger_.warn("Node " + endpoint + " 'leaving' token mismatch. Long network partition?");
+ tokenMetadata_.updateNormalToken(token, endpoint);
}
// at this point the endpoint is certainly a member with this token, so let's proceed
// normally
- tokenMetadata_.addLeavingEndPoint(endPoint);
+ tokenMetadata_.addLeavingEndpoint(endpoint);
calculatePendingRanges();
}
@@ -610,51 +610,51 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
* Handle node leaving the ring. This can be either because the node was removed manually by
* removetoken command or because of decommission or loadbalance
*
- * @param endPoint If reason for leaving is decommission or loadbalance (LEFT_NORMALLY),
- * endPoint is the leaving node. If reason manual removetoken (REMOVE_TOKEN), endPoint
+ * @param endpoint If reason for leaving is decommission or loadbalance (LEFT_NORMALLY),
+ * endpoint is the leaving node. If reason manual removetoken (REMOVE_TOKEN), endpoint
* parameter is ignored and the operation is based on the token inside moveValue.
* @param moveValue (REMOVE_TOKEN|LEFT_NORMALLY)
*/
- private void handleStateLeft(InetAddress endPoint, String moveValue)
+ private void handleStateLeft(InetAddress endpoint, String moveValue)
{
int index = moveValue.indexOf(Delimiter);
assert (index != -1);
String typeOfState = moveValue.substring(0, index);
Token token = getPartitioner().getTokenFactory().fromString(moveValue.substring(index + 1));
- // endPoint itself is leaving
+ // endpoint itself is leaving
if (typeOfState.equals(LEFT_NORMALLY))
{
if (logger_.isDebugEnabled())
- logger_.debug("Node " + endPoint + " state left, token " + token);
+ logger_.debug("Node " + endpoint + " state left, token " + token);
// If the node is member, remove all references to it. If not, call
// removeBootstrapToken just in case it is there (very unlikely chain of events)
- if (tokenMetadata_.isMember(endPoint))
+ if (tokenMetadata_.isMember(endpoint))
{
- if (!tokenMetadata_.getToken(endPoint).equals(token))
- logger_.warn("Node " + endPoint + " 'left' token mismatch. Long network partition?");
- tokenMetadata_.removeEndpoint(endPoint);
+ if (!tokenMetadata_.getToken(endpoint).equals(token))
+ logger_.warn("Node " + endpoint + " 'left' token mismatch. Long network partition?");
+ tokenMetadata_.removeEndpoint(endpoint);
}
}
else
{
- // if we're here, endPoint is not leaving but broadcasting remove token command
+ // if we're here, endpoint is not leaving but broadcasting remove token command
assert (typeOfState.equals(REMOVE_TOKEN));
- InetAddress endPointThatLeft = tokenMetadata_.getEndPoint(token);
+ InetAddress endpointThatLeft = tokenMetadata_.getEndpoint(token);
// let's make sure that we're not removing ourselves. This can happen when a node
// enters ring as a replacement for a removed node. removeToken for the old node is
// still in gossip, so we will see it.
- if (FBUtilities.getLocalAddress().equals(endPointThatLeft))
+ if (FBUtilities.getLocalAddress().equals(endpointThatLeft))
{
logger_.info("Received removeToken gossip about myself. Is this node a replacement for a removed one?");
return;
}
if (logger_.isDebugEnabled())
- logger_.debug("Token " + token + " removed manually (endpoint was " + ((endPointThatLeft == null) ? "unknown" : endPointThatLeft) + ")");
- if (endPointThatLeft != null)
+ logger_.debug("Token " + token + " removed manually (endpoint was " + ((endpointThatLeft == null) ? "unknown" : endpointThatLeft) + ")");
+ if (endpointThatLeft != null)
{
- removeEndPointLocally(endPointThatLeft);
+ removeEndpointLocally(endpointThatLeft);
}
}
@@ -664,14 +664,14 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
}
/**
- * endPoint was completely removed from ring (as a result of removetoken command). Remove it
+ * endpoint was completely removed from ring (as a result of removetoken command). Remove it
* from token metadata and gossip and restore replica count.
*/
- private void removeEndPointLocally(InetAddress endPoint)
+ private void removeEndpointLocally(InetAddress endpoint)
{
- restoreReplicaCount(endPoint);
- Gossiper.instance.removeEndPoint(endPoint);
- tokenMetadata_.removeEndpoint(endPoint);
+ restoreReplicaCount(endpoint);
+ Gossiper.instance.removeEndpoint(endpoint);
+ tokenMetadata_.removeEndpoint(endpoint);
}
/**
@@ -709,9 +709,9 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
TokenMetadata tm = StorageService.instance.getTokenMetadata();
Multimap pendingRanges = HashMultimap.create();
Map bootstrapTokens = tm.getBootstrapTokens();
- Set leavingEndPoints = tm.getLeavingEndPoints();
+ Set leavingEndpoints = tm.getLeavingEndpoints();
- if (bootstrapTokens.isEmpty() && leavingEndPoints.isEmpty())
+ if (bootstrapTokens.isEmpty() && leavingEndpoints.isEmpty())
{
if (logger_.isDebugEnabled())
logger_.debug("No bootstrapping or leaving nodes -> empty pending ranges for {}", table);
@@ -726,17 +726,17 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
// get all ranges that will be affected by leaving nodes
Set affectedRanges = new HashSet();
- for (InetAddress endPoint : leavingEndPoints)
- affectedRanges.addAll(addressRanges.get(endPoint));
+ for (InetAddress endpoint : leavingEndpoints)
+ affectedRanges.addAll(addressRanges.get(endpoint));
// for each of those ranges, find what new nodes will be responsible for the range when
// all leaving nodes are gone.
for (Range range : affectedRanges)
{
- List currentEndPoints = strategy.getNaturalEndpoints(range.right, tm, table);
- List newEndPoints = strategy.getNaturalEndpoints(range.right, allLeftMetadata, table);
- newEndPoints.removeAll(currentEndPoints);
- pendingRanges.putAll(range, newEndPoints);
+ List currentEndpoints = strategy.getNaturalEndpoints(range.right, tm, table);
+ List newEndpoints = strategy.getNaturalEndpoints(range.right, allLeftMetadata, table);
+ newEndpoints.removeAll(currentEndpoints);
+ pendingRanges.putAll(range, newEndpoints);
}
// At this stage pendingRanges has been updated according to leave operations. We can
@@ -746,12 +746,12 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
// allLeftMetadata and check in between what their ranges would be.
for (Map.Entry entry : bootstrapTokens.entrySet())
{
- InetAddress endPoint = entry.getValue();
+ InetAddress endpoint = entry.getValue();
- allLeftMetadata.updateNormalToken(entry.getKey(), endPoint);
- for (Range range : strategy.getAddressRanges(allLeftMetadata, table).get(endPoint))
- pendingRanges.put(range, endPoint);
- allLeftMetadata.removeEndpoint(endPoint);
+ allLeftMetadata.updateNormalToken(entry.getKey(), endpoint);
+ for (Range range : strategy.getAddressRanges(allLeftMetadata, table).get(endpoint))
+ pendingRanges.put(range, endpoint);
+ allLeftMetadata.removeEndpoint(endpoint);
}
tm.setPendingRanges(table, pendingRanges);
@@ -761,7 +761,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
}
/**
- * Called when an endPoint is removed from the ring without proper
+ * Called when an endpoint is removed from the ring without proper
* STATE_LEAVING -> STATE_LEFT sequence. This function checks
* whether this node becomes responsible for new ranges as a
* consequence and streams data if needed.
@@ -769,9 +769,9 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
* This is rather ineffective, but it does not matter so much
* since this is called very seldom
*
- * @param endPoint node that has left
+ * @param endpoint node that has left
*/
- private void restoreReplicaCount(InetAddress endPoint)
+ private void restoreReplicaCount(InetAddress endpoint)
{
InetAddress myAddress = FBUtilities.getLocalAddress();
@@ -779,7 +779,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
{
// get all ranges that change ownership (that is, a node needs
// to take responsibility for new range)
- Multimap changedRanges = getChangedRangesForLeaving(table, endPoint);
+ Multimap changedRanges = getChangedRangesForLeaving(table, endpoint);
// check if any of these ranges are coming our way
Set myNewRanges = new HashSet();
@@ -792,7 +792,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
if (!myNewRanges.isEmpty())
{
if (logger_.isDebugEnabled())
- logger_.debug(endPoint + " was removed, my added ranges: " + StringUtils.join(myNewRanges, ", "));
+ logger_.debug(endpoint + " was removed, my added ranges: " + StringUtils.join(myNewRanges, ", "));
Multimap rangeAddresses = getReplicationStrategy(table).getRangeAddresses(tokenMetadata_, table);
Multimap sourceRanges = HashMultimap.create();
@@ -801,13 +801,13 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
// find alive sources for our new ranges
for (Range myNewRange : myNewRanges)
{
- List sources = DatabaseDescriptor.getEndPointSnitch().getSortedListByProximity(myAddress, rangeAddresses.get(myNewRange));
+ List sources = DatabaseDescriptor.getEndpointSnitch().getSortedListByProximity(myAddress, rangeAddresses.get(myNewRange));
assert (!sources.contains(myAddress));
for (InetAddress source : sources)
{
- if (source.equals(endPoint))
+ if (source.equals(endpoint))
continue;
if (failureDetector.isAlive(source))
@@ -834,7 +834,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
private Multimap getChangedRangesForLeaving(String table, InetAddress endpoint)
{
// First get all ranges the leaving endpoint is responsible for
- Collection ranges = getRangesForEndPoint(table, endpoint);
+ Collection ranges = getRangesForEndpoint(table, endpoint);
if (logger_.isDebugEnabled())
logger_.debug("Node " + endpoint + " ranges [" + StringUtils.join(ranges, ", ") + "]");
@@ -954,24 +954,24 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
return stringify(Gossiper.instance.getUnreachableMembers());
}
- private Set stringify(Set endPoints)
+ private Set stringify(Set endpoints)
{
- Set stringEndPoints = new HashSet();
- for (InetAddress ep : endPoints)
+ Set stringEndpoints = new HashSet();
+ for (InetAddress ep : endpoints)
{
- stringEndPoints.add(ep.getHostAddress());
+ stringEndpoints.add(ep.getHostAddress());
}
- return stringEndPoints;
+ return stringEndpoints;
}
- private List stringify(List endPoints)
+ private List stringify(List endpoints)
{
- List stringEndPoints = new ArrayList();
- for (InetAddress ep : endPoints)
+ List stringEndpoints = new ArrayList();
+ for (InetAddress ep : endpoints)
{
- stringEndPoints.add(ep.getHostAddress());
+ stringEndpoints.add(ep.getHostAddress());
}
- return stringEndPoints;
+ return stringEndpoints;
}
public int getCurrentGenerationNumber()
@@ -1104,7 +1104,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
InetAddress getPredecessor(InetAddress ep)
{
Token token = tokenMetadata_.getToken(ep);
- return tokenMetadata_.getEndPoint(tokenMetadata_.getPredecessor(token));
+ return tokenMetadata_.getEndpoint(tokenMetadata_.getPredecessor(token));
}
/*
@@ -1114,7 +1114,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
public InetAddress getSuccessor(InetAddress ep)
{
Token token = tokenMetadata_.getToken(ep);
- return tokenMetadata_.getEndPoint(tokenMetadata_.getSuccessor(token));
+ return tokenMetadata_.getEndpoint(tokenMetadata_.getSuccessor(token));
}
/**
@@ -1122,7 +1122,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
* @param ep endpoint we are interested in.
* @return range for the specified endpoint.
*/
- public Range getPrimaryRangeForEndPoint(InetAddress ep)
+ public Range getPrimaryRangeForEndpoint(InetAddress ep)
{
return tokenMetadata_.getPrimaryRangeFor(tokenMetadata_.getToken(ep));
}
@@ -1132,7 +1132,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
* @param ep endpoint we are interested in.
* @return ranges for the specified endpoint.
*/
- Collection getRangesForEndPoint(String table, InetAddress ep)
+ Collection getRangesForEndpoint(String table, InetAddress ep)
{
return getReplicationStrategy(table).getAddressRanges(table).get(ep);
}
@@ -1216,10 +1216,10 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
/**
* This function finds the closest live endpoint that contains a given key.
*/
- public InetAddress findSuitableEndPoint(String table, byte[] key) throws IOException, UnavailableException
+ public InetAddress findSuitableEndpoint(String table, byte[] key) throws IOException, UnavailableException
{
List endpoints = getNaturalEndpoints(table, key);
- DatabaseDescriptor.getEndPointSnitch().sortByProximity(FBUtilities.getLocalAddress(), endpoints);
+ DatabaseDescriptor.getEndpointSnitch().sortByProximity(FBUtilities.getLocalAddress(), endpoints);
for (InetAddress endpoint : endpoints)
{
if (FailureDetector.instance.isAlive(endpoint))
@@ -1233,7 +1233,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
HashMap map = new HashMap();
for (Token t : tokenMetadata_.sortedTokens())
{
- map.put(t.toString(), tokenMetadata_.getEndPoint(t).getHostAddress());
+ map.put(t.toString(), tokenMetadata_.getEndpoint(t).getHostAddress());
}
return map;
}
@@ -1306,7 +1306,7 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
private void startLeaving()
{
Gossiper.instance.addLocalApplicationState(MOVE_STATE, new ApplicationState(STATE_LEAVING + Delimiter + getLocalToken().toString()));
- tokenMetadata_.addLeavingEndPoint(FBUtilities.getLocalAddress());
+ tokenMetadata_.addLeavingEndpoint(FBUtilities.getLocalAddress());
calculatePendingRanges();
}
@@ -1470,18 +1470,18 @@ public class StorageService implements IEndPointStateChangeSubscriber, StorageSe
// cannot find the endpoint for this token from metadata, but
// that would prevent this command from being issued by a node
// that has never seen the failed node.
- InetAddress endPoint = tokenMetadata_.getEndPoint(token);
- if (endPoint != null)
+ InetAddress endpoint = tokenMetadata_.getEndpoint(token);
+ if (endpoint != null)
{
- if (endPoint.equals(FBUtilities.getLocalAddress()))
+ if (endpoint.equals(FBUtilities.getLocalAddress()))
throw new UnsupportedOperationException("Cannot remove node's own token");
// Let's make sure however that we're not removing a live
// token (member)
- if (Gossiper.instance.getLiveMembers().contains(endPoint))
- throw new UnsupportedOperationException("Node " + endPoint + " is alive and owns this token. Use decommission command to remove it from the ring");
+ if (Gossiper.instance.getLiveMembers().contains(endpoint))
+ throw new UnsupportedOperationException("Node " + endpoint + " is alive and owns this token. Use decommission command to remove it from the ring");
- removeEndPointLocally(endPoint);
+ removeEndpointLocally(endpoint);
calculatePendingRanges();
}
diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
index f189dd1c73..a3a3ce5d53 100644
--- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
@@ -62,7 +62,7 @@ public interface StorageServiceMBean
*
* @return mapping of ranges to end points
*/
- public Map> getRangeToEndPointMap(String keyspace);
+ public Map> getRangeToEndpointMap(String keyspace);
/**
* Numeric load value.
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index 4b6061dfb5..746764539f 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -607,7 +607,7 @@ public class CassandraServer implements Cassandra.Iface
public List describe_ring(String keyspace)
{
List ranges = new ArrayList();
- for (Map.Entry> entry : StorageService.instance.getRangeToEndPointMap(keyspace).entrySet())
+ for (Map.Entry> entry : StorageService.instance.getRangeToEndpointMap(keyspace).entrySet())
{
Range range = entry.getKey();
List endpoints = entry.getValue();
diff --git a/src/java/org/apache/cassandra/tools/ClusterCmd.java b/src/java/org/apache/cassandra/tools/ClusterCmd.java
index 9d5dceb319..0bcb46f833 100644
--- a/src/java/org/apache/cassandra/tools/ClusterCmd.java
+++ b/src/java/org/apache/cassandra/tools/ClusterCmd.java
@@ -144,9 +144,9 @@ public class ClusterCmd {
hf.printHelp(usage, "", options, header);
}
- public void printEndPoints(String keyspace, String key)
+ public void printEndpoints(String keyspace, String key)
{
- List endpoints = probe.getEndPoints(keyspace, key);
+ List endpoints = probe.getEndpoints(keyspace, key);
System.out.println(String.format("%-17s: %s", "Key", key));
System.out.println(String.format("%-17s: %s", "Endpoints", endpoints));
}
@@ -260,7 +260,7 @@ public class ClusterCmd {
ClusterCmd.printUsage();
System.exit(1);
}
- clusterCmd.printEndPoints(arguments[1], arguments[2]);
+ clusterCmd.printEndpoints(arguments[1], arguments[2]);
}
else if (cmdName.equals("global_snapshot"))
{
diff --git a/src/java/org/apache/cassandra/tools/NodeCmd.java b/src/java/org/apache/cassandra/tools/NodeCmd.java
index e5dba82762..bc782aa467 100644
--- a/src/java/org/apache/cassandra/tools/NodeCmd.java
+++ b/src/java/org/apache/cassandra/tools/NodeCmd.java
@@ -92,7 +92,7 @@ public class NodeCmd {
*/
public void printRing(PrintStream outs)
{
- Map> rangeMap = probe.getRangeToEndPointMap(null);
+ Map> rangeMap = probe.getRangeToEndpointMap(null);
List ranges = new ArrayList(rangeMap.keySet());
Collections.sort(ranges);
Set liveNodes = probe.getLiveNodes();
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 52b8e09da1..acd34ec93e 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -152,9 +152,9 @@ public class NodeProbe
ssProxy.drain();
}
- public Map> getRangeToEndPointMap(String tableName)
+ public Map> getRangeToEndpointMap(String tableName)
{
- return ssProxy.getRangeToEndPointMap(tableName);
+ return ssProxy.getRangeToEndpointMap(tableName);
}
public Set getLiveNodes()
@@ -169,7 +169,7 @@ public class NodeProbe
*/
public void printRing(PrintStream outs)
{
- Map> rangeMap = ssProxy.getRangeToEndPointMap(null);
+ Map> rangeMap = ssProxy.getRangeToEndpointMap(null);
List ranges = new ArrayList(rangeMap.keySet());
Collections.sort(ranges);
Set liveNodes = ssProxy.getLiveNodes();
@@ -407,7 +407,7 @@ public class NodeProbe
}
}
- public List getEndPoints(String keyspace, String key)
+ public List getEndpoints(String keyspace, String key)
{
// FIXME: string key
return ssProxy.getNaturalEndpoints(keyspace, key.getBytes(UTF8));
diff --git a/test/conf/cassandra.xml b/test/conf/cassandra.xml
index 6695e552cc..bb1dcdafb0 100644
--- a/test/conf/cassandra.xml
+++ b/test/conf/cassandra.xml
@@ -37,7 +37,7 @@
mmap
1
0.00002
- org.apache.cassandra.locator.EndPointSnitch
+ org.apache.cassandra.locator.EndPointSnitch
@@ -58,13 +58,13 @@
org.apache.cassandra.locator.RackUnawareStrategy
1
- org.apache.cassandra.locator.EndPointSnitch
+ org.apache.cassandra.locator.EndPointSnitch
org.apache.cassandra.locator.RackUnawareStrategy
5
- org.apache.cassandra.locator.EndPointSnitch
+ org.apache.cassandra.locator.EndPointSnitch
@@ -73,7 +73,7 @@
org.apache.cassandra.locator.RackUnawareStrategy
3
- org.apache.cassandra.locator.EndPointSnitch
+ org.apache.cassandra.locator.EndPointSnitch
diff --git a/test/system/__init__.py b/test/system/__init__.py
index 73ec87ffb5..eb1c89ca22 100644
--- a/test/system/__init__.py
+++ b/test/system/__init__.py
@@ -142,7 +142,7 @@ class ThriftTester(BaseTester):
self.client.transport.close()
def define_schema(self):
- keyspace1 = Cassandra.KsDef('Keyspace1', 'org.apache.cassandra.locator.RackUnawareStrategy', 1, 'org.apache.cassandra.locator.EndPointSnitch',
+ keyspace1 = Cassandra.KsDef('Keyspace1', 'org.apache.cassandra.locator.RackUnawareStrategy', 1, 'org.apache.cassandra.locator.EndPointSnitch',
[
Cassandra.CfDef('Keyspace1', 'Standard1'),
Cassandra.CfDef('Keyspace1', 'Standard2'),
diff --git a/test/unit/org/apache/cassandra/client/TestRingCache.java b/test/unit/org/apache/cassandra/client/TestRingCache.java
index a456a2ca43..10f1d794d4 100644
--- a/test/unit/org/apache/cassandra/client/TestRingCache.java
+++ b/test/unit/org/apache/cassandra/client/TestRingCache.java
@@ -92,14 +92,14 @@ public class TestRingCache
ColumnPath col = new ColumnPath("Standard1").setSuper_column(null).setColumn("col1".getBytes());
ColumnParent parent = new ColumnParent("Standard1").setSuper_column(null);
- List endPoints = tester.ringCache.getEndPoint(row);
+ List endpoints = tester.ringCache.getEndpoint(row);
String hosts="";
- for (int i = 0; i < endPoints.size(); i++)
- hosts = hosts + ((i > 0) ? "," : "") + endPoints.get(i);
- System.out.println("hosts with key " + new String(row) + " : " + hosts + "; choose " + endPoints.get(0));
+ for (int i = 0; i < endpoints.size(); i++)
+ hosts = hosts + ((i > 0) ? "," : "") + endpoints.get(i);
+ System.out.println("hosts with key " + new String(row) + " : " + hosts + "; choose " + endpoints.get(0));
// now, read the row back directly from the host owning the row locally
- tester.setup(endPoints.get(0).getHostAddress(), DatabaseDescriptor.getRpcPort());
+ tester.setup(endpoints.get(0).getHostAddress(), DatabaseDescriptor.getRpcPort());
tester.thriftClient.insert(keyspace, row, parent, new Column("col1".getBytes(), "val1".getBytes(), 1), ConsistencyLevel.ONE);
Column column = tester.thriftClient.get(keyspace, row, col, ConsistencyLevel.ONE).column;
System.out.println("read row " + new String(row) + " " + new String(column.name) + ":" + new String(column.value) + ":" + column.timestamp);
diff --git a/test/unit/org/apache/cassandra/dht/BootStrapperTest.java b/test/unit/org/apache/cassandra/dht/BootStrapperTest.java
index 5639f241e0..46b84d1be6 100644
--- a/test/unit/org/apache/cassandra/dht/BootStrapperTest.java
+++ b/test/unit/org/apache/cassandra/dht/BootStrapperTest.java
@@ -59,7 +59,7 @@ public class BootStrapperTest
assert three.equals(source);
InetAddress myEndpoint = InetAddress.getByName("127.0.0.1");
- Range range3 = ss.getPrimaryRangeForEndPoint(three);
+ Range range3 = ss.getPrimaryRangeForEndpoint(three);
Token fakeToken = ((IPartitioner)StorageService.getPartitioner()).midpoint(range3.left, range3.right);
assert range3.contains(fakeToken);
ss.onChange(myEndpoint, StorageService.MOVE_STATE, new ApplicationState(StorageService.STATE_BOOTSTRAPPING + StorageService.Delimiter + ss.getPartitioner().getTokenFactory().toString(fakeToken)));
diff --git a/test/unit/org/apache/cassandra/gms/GossipDigestTest.java b/test/unit/org/apache/cassandra/gms/GossipDigestTest.java
index f4bc1bdf12..1353ac9a54 100644
--- a/test/unit/org/apache/cassandra/gms/GossipDigestTest.java
+++ b/test/unit/org/apache/cassandra/gms/GossipDigestTest.java
@@ -37,12 +37,12 @@ public class GossipDigestTest
@Test
public void test() throws IOException
{
- InetAddress endPoint = InetAddress.getByName("127.0.0.1");
+ InetAddress endpoint = InetAddress.getByName("127.0.0.1");
int generation = 0;
int maxVersion = 123;
- GossipDigest expected = new GossipDigest(endPoint, generation, maxVersion);
+ GossipDigest expected = new GossipDigest(endpoint, generation, maxVersion);
//make sure we get the same values out
- assertEquals(endPoint, expected.getEndPoint());
+ assertEquals(endpoint, expected.getEndpoint());
assertEquals(generation, expected.getGeneration());
assertEquals(maxVersion, expected.getMaxVersion());
diff --git a/test/unit/org/apache/cassandra/locator/RackAwareStrategyTest.java b/test/unit/org/apache/cassandra/locator/RackAwareStrategyTest.java
index 36872d3721..4ec4a72734 100644
--- a/test/unit/org/apache/cassandra/locator/RackAwareStrategyTest.java
+++ b/test/unit/org/apache/cassandra/locator/RackAwareStrategyTest.java
@@ -36,7 +36,7 @@ import org.junit.Test;
public class RackAwareStrategyTest
{
- private List endPointTokens;
+ private List endpointTokens;
private List keyTokens;
private TokenMetadata tmd;
private Map> expectedResults;
@@ -44,7 +44,7 @@ public class RackAwareStrategyTest
@Before
public void init()
{
- endPointTokens = new ArrayList();
+ endpointTokens = new ArrayList();
keyTokens = new ArrayList();
tmd = new TokenMetadata();
expectedResults = new HashMap>();
@@ -58,13 +58,13 @@ public class RackAwareStrategyTest
@Test
public void testBigIntegerEndpointsA() throws UnknownHostException
{
- EndPointSnitch endPointSnitch = new EndPointSnitch();
+ EndPointSnitch endpointSnitch = new EndPointSnitch();
- AbstractReplicationStrategy strategy = new RackAwareStrategy(tmd, endPointSnitch);
- addEndPoint("0", "5", "254.0.0.1");
- addEndPoint("10", "15", "254.0.0.2");
- addEndPoint("20", "25", "254.0.0.3");
- addEndPoint("30", "35", "254.0.0.4");
+ AbstractReplicationStrategy strategy = new RackAwareStrategy(tmd, endpointSnitch);
+ addEndpoint("0", "5", "254.0.0.1");
+ addEndpoint("10", "15", "254.0.0.2");
+ addEndpoint("20", "25", "254.0.0.3");
+ addEndpoint("30", "35", "254.0.0.4");
expectedResults.put("5", buildResult("254.0.0.2", "254.0.0.3", "254.0.0.4"));
expectedResults.put("15", buildResult("254.0.0.3", "254.0.0.4", "254.0.0.1"));
@@ -83,13 +83,13 @@ public class RackAwareStrategyTest
@Test
public void testBigIntegerEndpointsB() throws UnknownHostException
{
- EndPointSnitch endPointSnitch = new EndPointSnitch();
+ EndPointSnitch endpointSnitch = new EndPointSnitch();
- AbstractReplicationStrategy strategy = new RackAwareStrategy(tmd, endPointSnitch);
- addEndPoint("0", "5", "254.0.0.1");
- addEndPoint("10", "15", "254.0.0.2");
- addEndPoint("20", "25", "254.1.0.3");
- addEndPoint("30", "35", "254.0.0.4");
+ AbstractReplicationStrategy strategy = new RackAwareStrategy(tmd, endpointSnitch);
+ addEndpoint("0", "5", "254.0.0.1");
+ addEndpoint("10", "15", "254.0.0.2");
+ addEndpoint("20", "25", "254.1.0.3");
+ addEndpoint("30", "35", "254.0.0.4");
expectedResults.put("5", buildResult("254.0.0.2", "254.1.0.3", "254.0.0.4"));
expectedResults.put("15", buildResult("254.1.0.3", "254.0.0.4", "254.0.0.1"));
@@ -109,13 +109,13 @@ public class RackAwareStrategyTest
@Test
public void testBigIntegerEndpointsC() throws UnknownHostException
{
- EndPointSnitch endPointSnitch = new EndPointSnitch();
+ EndPointSnitch endpointSnitch = new EndPointSnitch();
- AbstractReplicationStrategy strategy = new RackAwareStrategy(tmd, endPointSnitch);
- addEndPoint("0", "5", "254.0.0.1");
- addEndPoint("10", "15", "254.0.0.2");
- addEndPoint("20", "25", "254.0.1.3");
- addEndPoint("30", "35", "254.1.0.4");
+ AbstractReplicationStrategy strategy = new RackAwareStrategy(tmd, endpointSnitch);
+ addEndpoint("0", "5", "254.0.0.1");
+ addEndpoint("10", "15", "254.0.0.2");
+ addEndpoint("20", "25", "254.0.1.3");
+ addEndpoint("30", "35", "254.1.0.4");
expectedResults.put("5", buildResult("254.0.0.2", "254.0.1.3", "254.1.0.4"));
expectedResults.put("15", buildResult("254.0.1.3", "254.1.0.4", "254.0.0.1"));
@@ -144,27 +144,27 @@ public class RackAwareStrategyTest
return result;
}
- private void addEndPoint(String endPointTokenID, String keyTokenID, String endPointAddress) throws UnknownHostException
+ private void addEndpoint(String endpointTokenID, String keyTokenID, String endpointAddress) throws UnknownHostException
{
- BigIntegerToken endPointToken = new BigIntegerToken(endPointTokenID);
- endPointTokens.add(endPointToken);
+ BigIntegerToken endpointToken = new BigIntegerToken(endpointTokenID);
+ endpointTokens.add(endpointToken);
BigIntegerToken keyToken = new BigIntegerToken(keyTokenID);
keyTokens.add(keyToken);
- InetAddress ep = InetAddress.getByName(endPointAddress);
- tmd.updateNormalToken(endPointToken, ep);
+ InetAddress ep = InetAddress.getByName(endpointAddress);
+ tmd.updateNormalToken(endpointToken, ep);
}
private void testGetEndpoints(AbstractReplicationStrategy strategy, Token[] keyTokens, String table) throws UnknownHostException
{
for (Token keyToken : keyTokens)
{
- List endPoints = strategy.getNaturalEndpoints(keyToken, tmd, table);
- for (int j = 0; j < endPoints.size(); j++)
+ List endpoints = strategy.getNaturalEndpoints(keyToken, tmd, table);
+ for (int j = 0; j < endpoints.size(); j++)
{
ArrayList hostsExpected = expectedResults.get(keyToken.toString());
- assertEquals(endPoints.get(j), hostsExpected.get(j));
+ assertEquals(endpoints.get(j), hostsExpected.get(j));
}
}
}
diff --git a/test/unit/org/apache/cassandra/locator/RackUnawareStrategyTest.java b/test/unit/org/apache/cassandra/locator/RackUnawareStrategyTest.java
index d2bfdbab33..a7c22d74d3 100644
--- a/test/unit/org/apache/cassandra/locator/RackUnawareStrategyTest.java
+++ b/test/unit/org/apache/cassandra/locator/RackUnawareStrategyTest.java
@@ -65,14 +65,14 @@ public class RackUnawareStrategyTest extends SchemaLoader
TokenMetadata tmd = new TokenMetadata();
AbstractReplicationStrategy strategy = new RackUnawareStrategy(tmd, null);
- List endPointTokens = new ArrayList();
+ List endpointTokens = new ArrayList();
List keyTokens = new ArrayList();
for (int i = 0; i < 5; i++) {
- endPointTokens.add(new BigIntegerToken(String.valueOf(10 * i)));
+ endpointTokens.add(new BigIntegerToken(String.valueOf(10 * i)));
keyTokens.add(new BigIntegerToken(String.valueOf(10 * i + 5)));
}
for (String table : DatabaseDescriptor.getNonSystemTables())
- testGetEndpoints(tmd, strategy, endPointTokens.toArray(new Token[0]), keyTokens.toArray(new Token[0]), table);
+ testGetEndpoints(tmd, strategy, endpointTokens.toArray(new Token[0]), keyTokens.toArray(new Token[0]), table);
}
@Test
@@ -82,35 +82,35 @@ public class RackUnawareStrategyTest extends SchemaLoader
IPartitioner partitioner = new OrderPreservingPartitioner();
AbstractReplicationStrategy strategy = new RackUnawareStrategy(tmd, null);
- List endPointTokens = new ArrayList();
+ List endpointTokens = new ArrayList();
List keyTokens = new ArrayList();
for (int i = 0; i < 5; i++) {
- endPointTokens.add(new StringToken(String.valueOf((char)('a' + i * 2))));
+ endpointTokens.add(new StringToken(String.valueOf((char)('a' + i * 2))));
keyTokens.add(partitioner.getToken(String.valueOf((char)('a' + i * 2 + 1)).getBytes()));
}
for (String table : DatabaseDescriptor.getNonSystemTables())
- testGetEndpoints(tmd, strategy, endPointTokens.toArray(new Token[0]), keyTokens.toArray(new Token[0]), table);
+ testGetEndpoints(tmd, strategy, endpointTokens.toArray(new Token[0]), keyTokens.toArray(new Token[0]), table);
}
// given a list of endpoint tokens, and a set of key tokens falling between the endpoint tokens,
// make sure that the Strategy picks the right endpoints for the keys.
- private void testGetEndpoints(TokenMetadata tmd, AbstractReplicationStrategy strategy, Token[] endPointTokens, Token[] keyTokens, String table) throws UnknownHostException
+ private void testGetEndpoints(TokenMetadata tmd, AbstractReplicationStrategy strategy, Token[] endpointTokens, Token[] keyTokens, String table) throws UnknownHostException
{
List hosts = new ArrayList();
- for (int i = 0; i < endPointTokens.length; i++)
+ for (int i = 0; i < endpointTokens.length; i++)
{
InetAddress ep = InetAddress.getByName("127.0.0." + String.valueOf(i + 1));
- tmd.updateNormalToken(endPointTokens[i], ep);
+ tmd.updateNormalToken(endpointTokens[i], ep);
hosts.add(ep);
}
for (int i = 0; i < keyTokens.length; i++)
{
- List endPoints = strategy.getNaturalEndpoints(keyTokens[i], table);
- assertEquals(DatabaseDescriptor.getReplicationFactor(table), endPoints.size());
- for (int j = 0; j < endPoints.size(); j++)
+ List endpoints = strategy.getNaturalEndpoints(keyTokens[i], table);
+ assertEquals(DatabaseDescriptor.getReplicationFactor(table), endpoints.size());
+ for (int j = 0; j < endpoints.size(); j++)
{
- assertEquals(endPoints.get(j), hosts.get((i + j + 1) % hosts.size()));
+ assertEquals(endpoints.get(j), hosts.get((i + j + 1) % hosts.size()));
}
}
}
@@ -124,27 +124,27 @@ public class RackUnawareStrategyTest extends SchemaLoader
TokenMetadata oldTmd = StorageServiceAccessor.setTokenMetadata(tmd);
AbstractReplicationStrategy strategy = new RackUnawareStrategy(tmd, null);
- Token[] endPointTokens = new Token[RING_SIZE];
+ Token[] endpointTokens = new Token[RING_SIZE];
Token[] keyTokens = new Token[RING_SIZE];
for (int i = 0; i < RING_SIZE; i++)
{
- endPointTokens[i] = new BigIntegerToken(String.valueOf(RING_SIZE * 2 * i));
+ endpointTokens[i] = new BigIntegerToken(String.valueOf(RING_SIZE * 2 * i));
keyTokens[i] = new BigIntegerToken(String.valueOf(RING_SIZE * 2 * i + RING_SIZE));
}
List hosts = new ArrayList();
- for (int i = 0; i < endPointTokens.length; i++)
+ for (int i = 0; i < endpointTokens.length; i++)
{
InetAddress ep = InetAddress.getByName("127.0.0." + String.valueOf(i + 1));
- tmd.updateNormalToken(endPointTokens[i], ep);
+ tmd.updateNormalToken(endpointTokens[i], ep);
hosts.add(ep);
}
// bootstrap at the end of the ring
Token bsToken = new BigIntegerToken(String.valueOf(210));
- InetAddress bootstrapEndPoint = InetAddress.getByName("127.0.0.11");
- tmd.addBootstrapToken(bsToken, bootstrapEndPoint);
+ InetAddress bootstrapEndpoint = InetAddress.getByName("127.0.0.11");
+ tmd.addBootstrapToken(bsToken, bootstrapEndpoint);
for (String table : DatabaseDescriptor.getNonSystemTables())
{
@@ -153,20 +153,20 @@ public class RackUnawareStrategyTest extends SchemaLoader
for (int i = 0; i < keyTokens.length; i++)
{
- Collection endPoints = strategy.getWriteEndpoints(keyTokens[i], table, strategy.getNaturalEndpoints(keyTokens[i], table));
- assertTrue(endPoints.size() >= replicationFactor);
+ Collection