UNPKG

cassandra-server

Version:

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

511 lines (508 loc) 21.9 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:28 CEST 2014 --> <title>CounterMutation (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="CounterMutation (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/CounterMutation.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/db/CounterCell.html" title="interface in org.apache.cassandra.db"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/db/CounterMutation.CounterMutationSerializer.html" title="class in org.apache.cassandra.db"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/db/CounterMutation.html" target="_top">Frames</a></li> <li><a href="CounterMutation.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><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&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.db</div> <h2 title="Class CounterMutation" class="title">Class CounterMutation</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.apache.cassandra.db.CounterMutation</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></dd> </dl> <hr> <br> <pre>public class <span class="strong">CounterMutation</span> extends java.lang.Object implements <a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></pre> </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">&nbsp;</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&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.CounterMutationSerializer.html" title="class in org.apache.cassandra.db">CounterMutation.CounterMutationSerializer</a></strong></code>&nbsp;</td> </tr> </table> </li> </ul> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/db/CounterMutation.CounterMutationSerializer.html" title="class in org.apache.cassandra.db">CounterMutation.CounterMutationSerializer</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#serializer">serializer</a></strong></code>&nbsp;</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">&nbsp;</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/CounterMutation.html#CounterMutation(org.apache.cassandra.db.Mutation,%20org.apache.cassandra.db.ConsistencyLevel)">CounterMutation</a></strong>(<a href="../../../../org/apache/cassandra/db/Mutation.html" title="class in org.apache.cassandra.db">Mutation</a>&nbsp;mutation, <a href="../../../../org/apache/cassandra/db/ConsistencyLevel.html" title="enum in org.apache.cassandra.db">ConsistencyLevel</a>&nbsp;consistency)</code>&nbsp;</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">&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>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#addAll(org.apache.cassandra.db.IMutation)">addAll</a></strong>(<a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a>&nbsp;m)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/db/Mutation.html" title="class in org.apache.cassandra.db">Mutation</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#apply()">apply</a></strong>()</code> <div class="block">Applies the counter mutation, returns the result Mutation (for replication to other nodes).</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/db/ConsistencyLevel.html" title="enum in org.apache.cassandra.db">ConsistencyLevel</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#consistency()">consistency</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.util.Collection&lt;<a href="../../../../org/apache/cassandra/db/ColumnFamily.html" title="class in org.apache.cassandra.db">ColumnFamily</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#getColumnFamilies()">getColumnFamilies</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.util.Collection&lt;java.util.UUID&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#getColumnFamilyIds()">getColumnFamilyIds</a></strong>()</code>&nbsp;</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/CounterMutation.html#getKeyspaceName()">getKeyspaceName</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/db/Mutation.html" title="class in org.apache.cassandra.db">Mutation</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#getMutation()">getMutation</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#getTimeout()">getTimeout</a></strong>()</code>&nbsp;</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/CounterMutation.html#key()">key</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/net/MessageOut.html" title="class in org.apache.cassandra.net">MessageOut</a>&lt;<a href="../../../../org/apache/cassandra/db/CounterMutation.html" title="class in org.apache.cassandra.db">CounterMutation</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#makeMutationMessage()">makeMutationMessage</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/CounterMutation.html#toString()">toString</a></strong>()</code>&nbsp;</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/CounterMutation.html#toString(boolean)">toString</a></strong>(boolean&nbsp;shallow)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="serializer"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>serializer</h4> <pre>public static final&nbsp;<a href="../../../../org/apache/cassandra/db/CounterMutation.CounterMutationSerializer.html" title="class in org.apache.cassandra.db">CounterMutation.CounterMutationSerializer</a> serializer</pre> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="CounterMutation(org.apache.cassandra.db.Mutation, org.apache.cassandra.db.ConsistencyLevel)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>CounterMutation</h4> <pre>public&nbsp;CounterMutation(<a href="../../../../org/apache/cassandra/db/Mutation.html" title="class in org.apache.cassandra.db">Mutation</a>&nbsp;mutation, <a href="../../../../org/apache/cassandra/db/ConsistencyLevel.html" title="enum in org.apache.cassandra.db">ConsistencyLevel</a>&nbsp;consistency)</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getKeyspaceName()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getKeyspaceName</h4> <pre>public&nbsp;java.lang.String&nbsp;getKeyspaceName()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/db/IMutation.html#getKeyspaceName()">getKeyspaceName</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></code></dd> </dl> </li> </ul> <a name="getColumnFamilyIds()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getColumnFamilyIds</h4> <pre>public&nbsp;java.util.Collection&lt;java.util.UUID&gt;&nbsp;getColumnFamilyIds()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/db/IMutation.html#getColumnFamilyIds()">getColumnFamilyIds</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></code></dd> </dl> </li> </ul> <a name="getColumnFamilies()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getColumnFamilies</h4> <pre>public&nbsp;java.util.Collection&lt;<a href="../../../../org/apache/cassandra/db/ColumnFamily.html" title="class in org.apache.cassandra.db">ColumnFamily</a>&gt;&nbsp;getColumnFamilies()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/db/IMutation.html#getColumnFamilies()">getColumnFamilies</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></code></dd> </dl> </li> </ul> <a name="getMutation()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getMutation</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/db/Mutation.html" title="class in org.apache.cassandra.db">Mutation</a>&nbsp;getMutation()</pre> </li> </ul> <a name="key()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>key</h4> <pre>public&nbsp;java.nio.ByteBuffer&nbsp;key()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/db/IMutation.html#key()">key</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></code></dd> </dl> </li> </ul> <a name="consistency()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>consistency</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/db/ConsistencyLevel.html" title="enum in org.apache.cassandra.db">ConsistencyLevel</a>&nbsp;consistency()</pre> </li> </ul> <a name="makeMutationMessage()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>makeMutationMessage</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/net/MessageOut.html" title="class in org.apache.cassandra.net">MessageOut</a>&lt;<a href="../../../../org/apache/cassandra/db/CounterMutation.html" title="class in org.apache.cassandra.db">CounterMutation</a>&gt;&nbsp;makeMutationMessage()</pre> </li> </ul> <a name="apply()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>apply</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/db/Mutation.html" title="class in org.apache.cassandra.db">Mutation</a>&nbsp;apply() throws <a href="../../../../org/apache/cassandra/exceptions/WriteTimeoutException.html" title="class in org.apache.cassandra.exceptions">WriteTimeoutException</a></pre> <div class="block">Applies the counter mutation, returns the result Mutation (for replication to other nodes). 1. Grabs the striped cell-level locks in the proper order 2. Gets the current values of the counters-to-be-modified from the counter cache 3. Reads the rest of the current values (cache misses) from the CF 4. Writes the updated counter values 5. Updates the counter cache 6. Releases the lock(s) See CASSANDRA-4775 and CASSANDRA-6504 for further details.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the applied resulting Mutation</dd> <dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../../org/apache/cassandra/exceptions/WriteTimeoutException.html" title="class in org.apache.cassandra.exceptions">WriteTimeoutException</a></code></dd></dl> </li> </ul> <a name="addAll(org.apache.cassandra.db.IMutation)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addAll</h4> <pre>public&nbsp;void&nbsp;addAll(<a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a>&nbsp;m)</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/db/IMutation.html#addAll(org.apache.cassandra.db.IMutation)">addAll</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></code></dd> </dl> </li> </ul> <a name="getTimeout()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTimeout</h4> <pre>public&nbsp;long&nbsp;getTimeout()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/db/IMutation.html#getTimeout()">getTimeout</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></code></dd> </dl> </li> </ul> <a name="toString()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>public&nbsp;java.lang.String&nbsp;toString()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd> </dl> </li> </ul> <a name="toString(boolean)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>toString</h4> <pre>public&nbsp;java.lang.String&nbsp;toString(boolean&nbsp;shallow)</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/apache/cassandra/db/IMutation.html#toString(boolean)">toString</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/apache/cassandra/db/IMutation.html" title="interface in org.apache.cassandra.db">IMutation</a></code></dd> </dl> </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/CounterMutation.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/db/CounterCell.html" title="interface in org.apache.cassandra.db"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/db/CounterMutation.CounterMutationSerializer.html" title="class in org.apache.cassandra.db"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/db/CounterMutation.html" target="_top">Frames</a></li> <li><a href="CounterMutation.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><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&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>