|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cassandra.locator.AbstractEndpointSnitch
org.apache.cassandra.locator.DatacenterEndPointSnitch
public class DatacenterEndPointSnitch
DataCenterEndPointSnitch
This class basically reads the configuration and sets the IP Ranges to a hashMap which can be read later. this class also provides a way to compare 2 EndPoints and also get details from the same.
| Constructor Summary | |
|---|---|
DatacenterEndPointSnitch()
Constructor, intialize XML config and read the config in... |
|
| Method Summary | |
|---|---|
java.lang.String |
getLocation(java.net.InetAddress endpoint)
Determines the name of the datacenter this endpoint lives in. |
java.util.HashMap<java.lang.String,java.lang.Integer> |
getMapQuorumFactor()
Returns a DC replication map, the key will be the dc name and the value will be the replication factor of that Datacenter. |
java.util.HashMap<java.lang.String,java.lang.Integer> |
getMapReplicationFactor()
Returns a DC replication map, the key will be the dc name and the value will be the replication factor of that Datacenter. |
java.lang.String |
getRackForEndPoint(java.net.InetAddress endPoint)
Return the rack for which an endpoint resides in |
static byte |
intToByte(int n)
|
boolean |
isInSameDataCenter(java.net.InetAddress host,
java.net.InetAddress host2)
This methood will return ture if the hosts are in the same DC else false. |
boolean |
isOnSameRack(java.net.InetAddress host,
java.net.InetAddress host2)
This methood will return ture if the hosts are in the same RAC else false. |
void |
reloadConfiguration()
This method will load the configuration from the xml file. |
| Methods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch |
|---|
getSortedListByProximity, sortByProximity |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatacenterEndPointSnitch()
throws java.io.IOException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException| Method Detail |
|---|
public java.lang.String getRackForEndPoint(java.net.InetAddress endPoint)
throws java.net.UnknownHostException
java.net.UnknownHostException
public void reloadConfiguration()
throws java.io.IOException
java.io.IOException
public boolean isOnSameRack(java.net.InetAddress host,
java.net.InetAddress host2)
throws java.net.UnknownHostException
isOnSameRack in class AbstractEndpointSnitchhost - a specified endpointhost2 - another specified endpoint
java.net.UnknownHostException
public boolean isInSameDataCenter(java.net.InetAddress host,
java.net.InetAddress host2)
throws java.net.UnknownHostException
isInSameDataCenter in class AbstractEndpointSnitchhost - a specified endpointhost2 - another specified endpoint
java.net.UnknownHostExceptionpublic java.util.HashMap<java.lang.String,java.lang.Integer> getMapReplicationFactor()
public java.util.HashMap<java.lang.String,java.lang.Integer> getMapQuorumFactor()
public static byte intToByte(int n)
public java.lang.String getLocation(java.net.InetAddress endpoint)
throws java.net.UnknownHostException
AbstractEndpointSnitch
getLocation in class AbstractEndpointSnitchjava.net.UnknownHostException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||