Return-Path: Delivered-To: apmail-incubator-cassandra-commits-archive@minotaur.apache.org Received: (qmail 97723 invoked from network); 27 Jan 2010 21:19:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2010 21:19:10 -0000 Received: (qmail 98530 invoked by uid 500); 27 Jan 2010 21:19:09 -0000 Delivered-To: apmail-incubator-cassandra-commits-archive@incubator.apache.org Received: (qmail 98507 invoked by uid 500); 27 Jan 2010 21:19:09 -0000 Mailing-List: contact cassandra-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-commits@incubator.apache.org Received: (qmail 98497 invoked by uid 99); 27 Jan 2010 21:19:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 21:19:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 21:19:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 439562388906; Wed, 27 Jan 2010 21:18:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r903845 - in /incubator/cassandra/trunk: conf/storage-conf.xml src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java src/java/org/apache/cassandra/locator/EndPointSnitch.java Date: Wed, 27 Jan 2010 21:18:33 -0000 To: cassandra-commits@incubator.apache.org From: jbellis@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100127211833.439562388906@eris.apache.org> Author: jbellis Date: Wed Jan 27 21:18:32 2010 New Revision: 903845 URL: http://svn.apache.org/viewvc?rev=903845&view=rev Log: update endpoint snitch comments. patch by jbellis Modified: incubator/cassandra/trunk/conf/storage-conf.xml incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/EndPointSnitch.java Modified: incubator/cassandra/trunk/conf/storage-conf.xml URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/conf/storage-conf.xml?rev=903845&r1=903844&r2=903845&view=diff ============================================================================== --- incubator/cassandra/trunk/conf/storage-conf.xml (original) +++ incubator/cassandra/trunk/conf/storage-conf.xml Wed Jan 27 21:18:32 2010 @@ -158,9 +158,10 @@ org.apache.cassandra.locator.EndPointSnitch Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java?rev=903845&r1=903844&r2=903845&view=diff ============================================================================== --- incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java (original) +++ incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java Wed Jan 27 21:18:32 2010 @@ -25,10 +25,15 @@ import java.net.UnknownHostException; import java.util.*; +/** + * An endpoint snitch tells Cassandra information about network topology that it can use to route + * requests more efficiently (with "sortByProximity"). Of the abstract methods, isOnSameRack + * and isInSameDataCenter are always required; getLocation is only used by DatacenterShardStrategy. + */ public abstract class AbstractEndpointSnitch implements IEndPointSnitch { /** - * Helps determine if 2 nodes are in the same rack in the data center. + * Determines if 2 nodes are in the same rack in the data center. * @param host a specified endpoint * @param host2 another specified endpoint * @return true if on the same rack false otherwise @@ -37,7 +42,7 @@ abstract public boolean isOnSameRack(InetAddress host, InetAddress host2) throws UnknownHostException; /** - * Helps determine if 2 nodes are in the same data center. + * Determines if 2 nodes are in the same data center. * @param host a specified endpoint * @param host2 another specified endpoint * @return true if in the same data center false otherwise @@ -46,7 +51,9 @@ abstract public boolean isInSameDataCenter(InetAddress host, InetAddress host2) throws UnknownHostException; /** - * Given endpoints this method will help us know the datacenter name where the node is located at. + * Determines the name of the datacenter this endpoint lives in. + * @param endpoint + * @return the name of the datacenter the endpoint lives in */ abstract public String getLocation(InetAddress endpoint) throws UnknownHostException; Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/EndPointSnitch.java URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/EndPointSnitch.java?rev=903845&r1=903844&r2=903845&view=diff ============================================================================== --- incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/EndPointSnitch.java (original) +++ incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/EndPointSnitch.java Wed Jan 27 21:18:32 2010 @@ -22,6 +22,10 @@ import java.net.UnknownHostException; import java.util.*; +/** + * A simple endpoint snitch implementation that assumes rack and dc information is encoded + * in the ip address. + */ public class EndPointSnitch extends AbstractEndpointSnitch { public boolean isOnSameRack(InetAddress host, InetAddress host2) throws UnknownHostException