org.apache.cassandra.locator
Class EndPointSnitch

java.lang.Object
  extended by org.apache.cassandra.locator.AbstractEndpointSnitch
      extended by org.apache.cassandra.locator.EndPointSnitch
All Implemented Interfaces:
IEndPointSnitch

public class EndPointSnitch
extends AbstractEndpointSnitch


Constructor Summary
EndPointSnitch()
           
 
Method Summary
 java.lang.String getLocation(java.net.InetAddress endpoint)
          Given endpoints this method will help us know the datacenter name where the node is located at.
 boolean isInSameDataCenter(java.net.InetAddress host, java.net.InetAddress host2)
          Helps determine if 2 nodes are in the same data center.
 boolean isOnSameRack(java.net.InetAddress host, java.net.InetAddress host2)
          Helps determine if 2 nodes are in the same rack in the data center.
 
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

EndPointSnitch

public EndPointSnitch()
Method Detail

isOnSameRack

public boolean isOnSameRack(java.net.InetAddress host,
                            java.net.InetAddress host2)
                     throws java.net.UnknownHostException
Description copied from class: AbstractEndpointSnitch
Helps determine if 2 nodes are in the same rack in the data center.

Specified by:
isOnSameRack in class AbstractEndpointSnitch
Parameters:
host - a specified endpoint
host2 - another specified endpoint
Returns:
true if on the same rack false otherwise
Throws:
java.net.UnknownHostException

isInSameDataCenter

public boolean isInSameDataCenter(java.net.InetAddress host,
                                  java.net.InetAddress host2)
                           throws java.net.UnknownHostException
Description copied from class: AbstractEndpointSnitch
Helps determine if 2 nodes are in the same data center.

Specified by:
isInSameDataCenter in class AbstractEndpointSnitch
Parameters:
host - a specified endpoint
host2 - another specified endpoint
Returns:
true if in the same data center false otherwise
Throws:
java.net.UnknownHostException

getLocation

public java.lang.String getLocation(java.net.InetAddress endpoint)
                             throws java.net.UnknownHostException
Description copied from class: AbstractEndpointSnitch
Given endpoints this method will help us know the datacenter name where the node is located at.

Specified by:
getLocation in class AbstractEndpointSnitch
Throws:
java.net.UnknownHostException


Copyright © 2010 The Apache Software Foundation