UNPKG

cassandra-server

Version:

A thin Javascript wrapper around Apache Cassandra to provide out of the box server support

328 lines (327 loc) 15 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_67) on Sun Sep 07 15:29:31 CEST 2014 --> <title>IEndpointSnitch (apache-cassandra API)</title> <meta name="date" content="2014-09-07"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="IEndpointSnitch (apache-cassandra API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/IEndpointSnitch.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/locator/GossipingPropertyFileSnitch.html" title="class in org.apache.cassandra.locator"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/locator/ILatencySubscriber.html" title="interface in org.apache.cassandra.locator"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/locator/IEndpointSnitch.html" target="_top">Frames</a></li> <li><a href="IEndpointSnitch.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.cassandra.locator</div> <h2 title="Interface IEndpointSnitch" class="title">Interface IEndpointSnitch</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../org/apache/cassandra/locator/AbstractEndpointSnitch.html" title="class in org.apache.cassandra.locator">AbstractEndpointSnitch</a>, <a href="../../../../org/apache/cassandra/locator/AbstractNetworkTopologySnitch.html" title="class in org.apache.cassandra.locator">AbstractNetworkTopologySnitch</a>, <a href="../../../../org/apache/cassandra/locator/CloudstackSnitch.html" title="class in org.apache.cassandra.locator">CloudstackSnitch</a>, <a href="../../../../org/apache/cassandra/locator/DynamicEndpointSnitch.html" title="class in org.apache.cassandra.locator">DynamicEndpointSnitch</a>, <a href="../../../../org/apache/cassandra/locator/Ec2MultiRegionSnitch.html" title="class in org.apache.cassandra.locator">Ec2MultiRegionSnitch</a>, <a href="../../../../org/apache/cassandra/locator/Ec2Snitch.html" title="class in org.apache.cassandra.locator">Ec2Snitch</a>, <a href="../../../../org/apache/cassandra/locator/GoogleCloudSnitch.html" title="class in org.apache.cassandra.locator">GoogleCloudSnitch</a>, <a href="../../../../org/apache/cassandra/locator/GossipingPropertyFileSnitch.html" title="class in org.apache.cassandra.locator">GossipingPropertyFileSnitch</a>, <a href="../../../../org/apache/cassandra/locator/PropertyFileSnitch.html" title="class in org.apache.cassandra.locator">PropertyFileSnitch</a>, <a href="../../../../org/apache/cassandra/locator/RackInferringSnitch.html" title="class in org.apache.cassandra.locator">RackInferringSnitch</a>, <a href="../../../../org/apache/cassandra/locator/SimpleSnitch.html" title="class in org.apache.cassandra.locator">SimpleSnitch</a>, <a href="../../../../org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.html" title="class in org.apache.cassandra.locator">YamlFileNetworkTopologySnitch</a></dd> </dl> <hr> <br> <pre>public interface <span class="strong">IEndpointSnitch</span></pre> <div class="block">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.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/locator/IEndpointSnitch.html#compareEndpoints(java.net.InetAddress,%20java.net.InetAddress,%20java.net.InetAddress)">compareEndpoints</a></strong>(java.net.InetAddress&nbsp;target, java.net.InetAddress&nbsp;a1, java.net.InetAddress&nbsp;a2)</code> <div class="block">compares two endpoints in relation to the target endpoint, returning as Comparator.compare would</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/locator/IEndpointSnitch.html#getDatacenter(java.net.InetAddress)">getDatacenter</a></strong>(java.net.InetAddress&nbsp;endpoint)</code> <div class="block">returns a String representing the datacenter this endpoint belongs to</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/locator/IEndpointSnitch.html#getRack(java.net.InetAddress)">getRack</a></strong>(java.net.InetAddress&nbsp;endpoint)</code> <div class="block">returns a String repesenting the rack this endpoint belongs to</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.util.List&lt;java.net.InetAddress&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/locator/IEndpointSnitch.html#getSortedListByProximity(java.net.InetAddress,%20java.util.Collection)">getSortedListByProximity</a></strong>(java.net.InetAddress&nbsp;address, java.util.Collection&lt;java.net.InetAddress&gt;&nbsp;unsortedAddress)</code> <div class="block">returns a new <tt>List</tt> sorted by proximity to the given endpoint</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/locator/IEndpointSnitch.html#gossiperStarting()">gossiperStarting</a></strong>()</code> <div class="block">called after Gossiper instance exists immediately before it starts gossiping</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/locator/IEndpointSnitch.html#isWorthMergingForRangeQuery(java.util.List,%20java.util.List,%20java.util.List)">isWorthMergingForRangeQuery</a></strong>(java.util.List&lt;java.net.InetAddress&gt;&nbsp;merged, java.util.List&lt;java.net.InetAddress&gt;&nbsp;l1, java.util.List&lt;java.net.InetAddress&gt;&nbsp;l2)</code> <div class="block">Returns whether for a range query doing a query against merged is likely to be faster than 2 sequential queries, one against l1 followed by one against l2.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/locator/IEndpointSnitch.html#sortByProximity(java.net.InetAddress,%20java.util.List)">sortByProximity</a></strong>(java.net.InetAddress&nbsp;address, java.util.List&lt;java.net.InetAddress&gt;&nbsp;addresses)</code> <div class="block">This method will sort the <tt>List</tt> by proximity to the given address.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getRack(java.net.InetAddress)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getRack</h4> <pre>java.lang.String&nbsp;getRack(java.net.InetAddress&nbsp;endpoint)</pre> <div class="block">returns a String repesenting the rack this endpoint belongs to</div> </li> </ul> <a name="getDatacenter(java.net.InetAddress)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDatacenter</h4> <pre>java.lang.String&nbsp;getDatacenter(java.net.InetAddress&nbsp;endpoint)</pre> <div class="block">returns a String representing the datacenter this endpoint belongs to</div> </li> </ul> <a name="getSortedListByProximity(java.net.InetAddress, java.util.Collection)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSortedListByProximity</h4> <pre>java.util.List&lt;java.net.InetAddress&gt;&nbsp;getSortedListByProximity(java.net.InetAddress&nbsp;address, java.util.Collection&lt;java.net.InetAddress&gt;&nbsp;unsortedAddress)</pre> <div class="block">returns a new <tt>List</tt> sorted by proximity to the given endpoint</div> </li> </ul> <a name="sortByProximity(java.net.InetAddress, java.util.List)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>sortByProximity</h4> <pre>void&nbsp;sortByProximity(java.net.InetAddress&nbsp;address, java.util.List&lt;java.net.InetAddress&gt;&nbsp;addresses)</pre> <div class="block">This method will sort the <tt>List</tt> by proximity to the given address.</div> </li> </ul> <a name="compareEndpoints(java.net.InetAddress, java.net.InetAddress, java.net.InetAddress)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>compareEndpoints</h4> <pre>int&nbsp;compareEndpoints(java.net.InetAddress&nbsp;target, java.net.InetAddress&nbsp;a1, java.net.InetAddress&nbsp;a2)</pre> <div class="block">compares two endpoints in relation to the target endpoint, returning as Comparator.compare would</div> </li> </ul> <a name="gossiperStarting()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>gossiperStarting</h4> <pre>void&nbsp;gossiperStarting()</pre> <div class="block">called after Gossiper instance exists immediately before it starts gossiping</div> </li> </ul> <a name="isWorthMergingForRangeQuery(java.util.List, java.util.List, java.util.List)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>isWorthMergingForRangeQuery</h4> <pre>boolean&nbsp;isWorthMergingForRangeQuery(java.util.List&lt;java.net.InetAddress&gt;&nbsp;merged, java.util.List&lt;java.net.InetAddress&gt;&nbsp;l1, java.util.List&lt;java.net.InetAddress&gt;&nbsp;l2)</pre> <div class="block">Returns whether for a range query doing a query against merged is likely to be faster than 2 sequential queries, one against l1 followed by one against l2.</div> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/IEndpointSnitch.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/locator/GossipingPropertyFileSnitch.html" title="class in org.apache.cassandra.locator"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/locator/ILatencySubscriber.html" title="interface in org.apache.cassandra.locator"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/locator/IEndpointSnitch.html" target="_top">Frames</a></li> <li><a href="IEndpointSnitch.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2014 The Apache Software Foundation</small></p> </body> </html>