cassandra-server
Version:
A thin Javascript wrapper around Apache Cassandra to provide out of the box server support
619 lines (608 loc) • 27.9 kB
HTML
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Sun Sep 07 15:29:32 CEST 2014 -->
<title>CounterContext (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="CounterContext (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/CounterContext.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>Prev Class</li>
<li><a href="../../../../../org/apache/cassandra/db/context/CounterContext.ContextState.html" title="class in org.apache.cassandra.db.context"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/db/context/CounterContext.html" target="_top">Frames</a></li>
<li><a href="CounterContext.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: </li>
<li><a href="#nested_class_summary">Nested</a> | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </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.db.context</div>
<h2 title="Class CounterContext" class="title">Class CounterContext</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.db.context.CounterContext</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">CounterContext</span>
extends java.lang.Object</pre>
<div class="block">An implementation of a partitioned counter context.
A context is primarily a list of tuples (counter id, clock, count) -- called
shards, with some shards flagged as global or local (with
special resolution rules in merge()).
The data structure has two parts:
a) a header containing the lists of global and local shard indexes in the body
b) a list of shards -- (counter id, logical clock, count) tuples -- (the so-called 'body' below)
The exact layout is:
| header | body |
context : |--|------|----------|
^ ^
| list of indices in the body list (2*#elt bytes)
#elt in rest of header (2 bytes)
Non-negative indices refer to local shards. Global shard indices are encoded as [idx + Short.MIN_VALUE],
and are thus always negative.
The body layout being:
body: |----|----|----|----|----|----|....
^ ^ ^ ^ ^ ^
| | count_1 | | count_2
| clock_1 | clock_2
counterid_1 counterid_2
The rules when merging two shard with the same counter id are:
- global + global = keep the shard with the highest logical clock
- global + local = keep the global one
- global + remote = keep the global one
- local + local = sum counts (and logical clocks)
- local + remote = keep the local one
- remote + remote = keep the shard with the highest logical clock
For a detailed description of the meaning of a local and why the merging
rules work this way, see CASSANDRA-1938 - specifically the 1938_discussion
attachment (doesn't cover global shards, see CASSANDRA-4775 for that).</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.ContextState.html" title="class in org.apache.cassandra.db.context">CounterContext.ContextState</a></strong></code>
<div class="block">Helper class to work on contexts (works by iterating over them).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.Relationship.html" title="enum in org.apache.cassandra.db.context">CounterContext.Relationship</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#CounterContext()">CounterContext</a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== 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"> </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>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#clearAllLocal(java.nio.ByteBuffer)">clearAllLocal</a></strong>(java.nio.ByteBuffer context)</code>
<div class="block">Remove all the local of a context (but keep global).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#createGlobal(org.apache.cassandra.utils.CounterId,%20long,%20long)">createGlobal</a></strong>(<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id,
long clock,
long count)</code>
<div class="block">Creates a counter context with a single global, 2.1+ shard (a result of increment).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#createLocal(long)">createLocal</a></strong>(long count)</code>
<div class="block">Creates a counter context with a single local shard.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#createRemote(org.apache.cassandra.utils.CounterId,%20long,%20long)">createRemote</a></strong>(<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id,
long clock,
long count)</code>
<div class="block">Creates a counter context with a single remote shard.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/db/context/CounterContext.Relationship.html" title="enum in org.apache.cassandra.db.context">CounterContext.Relationship</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#diff(java.nio.ByteBuffer,%20java.nio.ByteBuffer)">diff</a></strong>(java.nio.ByteBuffer left,
java.nio.ByteBuffer right)</code>
<div class="block">Determine the count relationship between two contexts.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#findPositionOf(java.nio.ByteBuffer,%20org.apache.cassandra.utils.CounterId)">findPositionOf</a></strong>(java.nio.ByteBuffer context,
<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id)</code>
<div class="block">Finds the position of a shard with the given id within the context (via binary search).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/db/ClockAndCount.html" title="class in org.apache.cassandra.db">ClockAndCount</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#getClockAndCountOf(java.nio.ByteBuffer,%20org.apache.cassandra.utils.CounterId)">getClockAndCountOf</a></strong>(java.nio.ByteBuffer context,
<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id)</code>
<div class="block">Returns the clock and the count associated with the given counter id, or (0, 0) if no such shard is present.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/db/ClockAndCount.html" title="class in org.apache.cassandra.db">ClockAndCount</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#getLocalClockAndCount(java.nio.ByteBuffer)">getLocalClockAndCount</a></strong>(java.nio.ByteBuffer context)</code>
<div class="block">Returns the clock and the count associated with the local counter id, or (0, 0) if no such shard is present.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#hasLegacyShards(java.nio.ByteBuffer)">hasLegacyShards</a></strong>(java.nio.ByteBuffer context)</code>
<div class="block">Detects whether or not the context has any legacy (local or remote) shards in it.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/cassandra/db/context/CounterContext.html" title="class in org.apache.cassandra.db.context">CounterContext</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#instance()">instance</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#markLocalToBeCleared(java.nio.ByteBuffer)">markLocalToBeCleared</a></strong>(java.nio.ByteBuffer context)</code>
<div class="block">Mark context to delete local references afterward.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#merge(java.nio.ByteBuffer,%20java.nio.ByteBuffer)">merge</a></strong>(java.nio.ByteBuffer left,
java.nio.ByteBuffer right)</code>
<div class="block">Return a context w/ an aggregated count for each counter id.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#shouldClearLocal(java.nio.ByteBuffer)">shouldClearLocal</a></strong>(java.nio.ByteBuffer context)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#toString(java.nio.ByteBuffer)">toString</a></strong>(java.nio.ByteBuffer context)</code>
<div class="block">Human-readable String from context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#total(java.nio.ByteBuffer)">total</a></strong>(java.nio.ByteBuffer context)</code>
<div class="block">Returns the aggregated count across all counter ids.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#updateDigest(java.security.MessageDigest,%20java.nio.ByteBuffer)">updateDigest</a></strong>(java.security.MessageDigest message,
java.nio.ByteBuffer context)</code>
<div class="block">Update a MessageDigest with the content of a context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/db/context/CounterContext.html#validateContext(java.nio.ByteBuffer)">validateContext</a></strong>(java.nio.ByteBuffer context)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="CounterContext()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CounterContext</h4>
<pre>public CounterContext()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="instance()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>instance</h4>
<pre>public static <a href="../../../../../org/apache/cassandra/db/context/CounterContext.html" title="class in org.apache.cassandra.db.context">CounterContext</a> instance()</pre>
</li>
</ul>
<a name="createGlobal(org.apache.cassandra.utils.CounterId, long, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createGlobal</h4>
<pre>public java.nio.ByteBuffer createGlobal(<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id,
long clock,
long count)</pre>
<div class="block">Creates a counter context with a single global, 2.1+ shard (a result of increment).</div>
</li>
</ul>
<a name="createLocal(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createLocal</h4>
<pre>public java.nio.ByteBuffer createLocal(long count)</pre>
<div class="block">Creates a counter context with a single local shard.
For use by tests of compatibility with pre-2.1 counters only.</div>
</li>
</ul>
<a name="createRemote(org.apache.cassandra.utils.CounterId, long, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createRemote</h4>
<pre>public java.nio.ByteBuffer createRemote(<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id,
long clock,
long count)</pre>
<div class="block">Creates a counter context with a single remote shard.
For use by tests of compatibility with pre-2.1 counters only.</div>
</li>
</ul>
<a name="diff(java.nio.ByteBuffer, java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>diff</h4>
<pre>public <a href="../../../../../org/apache/cassandra/db/context/CounterContext.Relationship.html" title="enum in org.apache.cassandra.db.context">CounterContext.Relationship</a> diff(java.nio.ByteBuffer left,
java.nio.ByteBuffer right)</pre>
<div class="block">Determine the count relationship between two contexts.
EQUAL: Equal set of nodes and every count is equal.
GREATER_THAN: Superset of nodes and every count is equal or greater than its corollary.
LESS_THAN: Subset of nodes and every count is equal or less than its corollary.
DISJOINT: Node sets are not equal and/or counts are not all greater or less than.
Strategy: compare node logical clocks (like a version vector).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>left</code> - counter context.</dd><dd><code>right</code> - counter context.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the Relationship between the contexts.</dd></dl>
</li>
</ul>
<a name="merge(java.nio.ByteBuffer, java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>merge</h4>
<pre>public java.nio.ByteBuffer merge(java.nio.ByteBuffer left,
java.nio.ByteBuffer right)</pre>
<div class="block">Return a context w/ an aggregated count for each counter id.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>left</code> - counter context.</dd><dd><code>right</code> - counter context.</dd></dl>
</li>
</ul>
<a name="toString(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString(java.nio.ByteBuffer context)</pre>
<div class="block">Human-readable String from context.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>context</code> - counter context.</dd>
<dt><span class="strong">Returns:</span></dt><dd>a human-readable String of the context.</dd></dl>
</li>
</ul>
<a name="total(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>total</h4>
<pre>public long total(java.nio.ByteBuffer context)</pre>
<div class="block">Returns the aggregated count across all counter ids.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>context</code> - a counter context</dd>
<dt><span class="strong">Returns:</span></dt><dd>the aggregated count represented by <code>context</code></dd></dl>
</li>
</ul>
<a name="shouldClearLocal(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shouldClearLocal</h4>
<pre>public boolean shouldClearLocal(java.nio.ByteBuffer context)</pre>
</li>
</ul>
<a name="hasLegacyShards(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasLegacyShards</h4>
<pre>public boolean hasLegacyShards(java.nio.ByteBuffer context)</pre>
<div class="block">Detects whether or not the context has any legacy (local or remote) shards in it.</div>
</li>
</ul>
<a name="markLocalToBeCleared(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>markLocalToBeCleared</h4>
<pre>public java.nio.ByteBuffer markLocalToBeCleared(java.nio.ByteBuffer context)</pre>
<div class="block">Mark context to delete local references afterward.
Marking is done by multiply #elt by -1 to preserve header length
and #elt count in order to clear all local refs later.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>context</code> - a counter context</dd>
<dt><span class="strong">Returns:</span></dt><dd>context that marked to delete local refs</dd></dl>
</li>
</ul>
<a name="clearAllLocal(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearAllLocal</h4>
<pre>public java.nio.ByteBuffer clearAllLocal(java.nio.ByteBuffer context)</pre>
<div class="block">Remove all the local of a context (but keep global).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>context</code> - a counter context</dd>
<dt><span class="strong">Returns:</span></dt><dd>a version of <code>context</code> where no shards are local.</dd></dl>
</li>
</ul>
<a name="validateContext(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validateContext</h4>
<pre>public void validateContext(java.nio.ByteBuffer context)
throws <a href="../../../../../org/apache/cassandra/serializers/MarshalException.html" title="class in org.apache.cassandra.serializers">MarshalException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/cassandra/serializers/MarshalException.html" title="class in org.apache.cassandra.serializers">MarshalException</a></code></dd></dl>
</li>
</ul>
<a name="updateDigest(java.security.MessageDigest, java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateDigest</h4>
<pre>public void updateDigest(java.security.MessageDigest message,
java.nio.ByteBuffer context)</pre>
<div class="block">Update a MessageDigest with the content of a context.
Note that this skips the header entirely since the header information
has local meaning only, while digests are meant for comparison across
nodes. This means in particular that we always have:
updateDigest(ctx) == updateDigest(clearAllLocal(ctx))</div>
</li>
</ul>
<a name="getLocalClockAndCount(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocalClockAndCount</h4>
<pre>public <a href="../../../../../org/apache/cassandra/db/ClockAndCount.html" title="class in org.apache.cassandra.db">ClockAndCount</a> getLocalClockAndCount(java.nio.ByteBuffer context)</pre>
<div class="block">Returns the clock and the count associated with the local counter id, or (0, 0) if no such shard is present.</div>
</li>
</ul>
<a name="getClockAndCountOf(java.nio.ByteBuffer, org.apache.cassandra.utils.CounterId)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getClockAndCountOf</h4>
<pre>public <a href="../../../../../org/apache/cassandra/db/ClockAndCount.html" title="class in org.apache.cassandra.db">ClockAndCount</a> getClockAndCountOf(java.nio.ByteBuffer context,
<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id)</pre>
<div class="block">Returns the clock and the count associated with the given counter id, or (0, 0) if no such shard is present.</div>
</li>
</ul>
<a name="findPositionOf(java.nio.ByteBuffer, org.apache.cassandra.utils.CounterId)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>findPositionOf</h4>
<pre>public int findPositionOf(java.nio.ByteBuffer context,
<a href="../../../../../org/apache/cassandra/utils/CounterId.html" title="class in org.apache.cassandra.utils">CounterId</a> id)</pre>
<div class="block">Finds the position of a shard with the given id within the context (via binary search).</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/CounterContext.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>Prev Class</li>
<li><a href="../../../../../org/apache/cassandra/db/context/CounterContext.ContextState.html" title="class in org.apache.cassandra.db.context"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/db/context/CounterContext.html" target="_top">Frames</a></li>
<li><a href="CounterContext.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: </li>
<li><a href="#nested_class_summary">Nested</a> | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </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 © 2014 The Apache Software Foundation</small></p>
</body>
</html>