org.apache.cassandra.locator
Class EndPointSnitch

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

public class EndPointSnitch
extends java.lang.Object
implements IEndPointSnitch

Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )


Constructor Summary
EndPointSnitch()
           
 
Method Summary
 boolean isInSameDataCenter(EndPoint host, EndPoint host2)
          Helps determine if 2 nodes are in the same data center.
 boolean isOnSameRack(EndPoint host, EndPoint host2)
          Helps determine if 2 nodes are in the same rack in the data center.
 
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(EndPoint host,
                            EndPoint host2)
                     throws java.net.UnknownHostException
Description copied from interface: IEndPointSnitch
Helps determine if 2 nodes are in the same rack in the data center.

Specified by:
isOnSameRack in interface IEndPointSnitch
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(EndPoint host,
                                  EndPoint host2)
                           throws java.net.UnknownHostException
Description copied from interface: IEndPointSnitch
Helps determine if 2 nodes are in the same data center.

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


Copyright © 2009 The Apache Software Foundation