org.apache.cassandra.locator
Interface IEndPointSnitch

All Known Implementing Classes:
EndPointSnitch

public interface IEndPointSnitch

This interface helps determine location of node in the data center relative to another node. Give a node A and another node B it can tell if A and B are on the same rack or in the same data center. Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )


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.
 

Method Detail

isOnSameRack

boolean isOnSameRack(EndPoint host,
                     EndPoint host2)
                     throws java.net.UnknownHostException
Helps determine if 2 nodes are in the same rack in the data center.

Parameters:
host - a specified endpoint
host2 - another specified endpoint
Returns:
true if on the same rack false otherwise
Throws:
java.net.UnknownHostException

isInSameDataCenter

boolean isInSameDataCenter(EndPoint host,
                           EndPoint host2)
                           throws java.net.UnknownHostException
Helps determine if 2 nodes are in the same data center.

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