cassandra-server
Version:
A thin Javascript wrapper around Apache Cassandra to provide out of the box server support
509 lines (504 loc) • 21.7 kB
HTML
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Sun Sep 07 15:29:35 CEST 2014 -->
<title>ConsistencyLevel (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="ConsistencyLevel (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/ConsistencyLevel.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/thrift/Compression.html" title="enum in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/CounterColumn.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/ConsistencyLevel.html" target="_top">Frames</a></li>
<li><a href="ConsistencyLevel.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>Nested | </li>
<li><a href="#enum_constant_summary">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#enum_constant_detail">Enum Constants</a> | </li>
<li>Field | </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.thrift</div>
<h2 title="Enum ConsistencyLevel" class="title">Enum ConsistencyLevel</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>java.lang.Enum<<a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a>></li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.thrift.ConsistencyLevel</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, java.lang.Comparable<<a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a>>, org.apache.thrift.TEnum</dd>
</dl>
<hr>
<br>
<pre>public enum <span class="strong">ConsistencyLevel</span>
extends java.lang.Enum<<a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a>>
implements org.apache.thrift.TEnum</pre>
<div class="block">The ConsistencyLevel is an enum that controls both read and write
behavior based on the ReplicationFactor of the keyspace. The
different consistency levels have different meanings, depending on
if you're doing a write or read operation.
If W + R > ReplicationFactor, where W is the number of nodes to
block for on write, and R the number to block for on reads, you
will have strongly consistent behavior; that is, readers will
always see the most recent write. Of these, the most interesting is
to do QUORUM reads and writes, which gives you consistency while
still allowing availability in the face of node failures up to half
of <ReplicationFactor>. Of course if latency is more important than
consistency then you can use lower values for either or both.
Some ConsistencyLevels (ONE, TWO, THREE) refer to a specific number
of replicas rather than a logical concept that adjusts
automatically with the replication factor. Of these, only ONE is
commonly used; TWO and (even more rarely) THREE are only useful
when you care more about guaranteeing a certain level of
durability, than consistency.
Write consistency levels make the following guarantees before reporting success to the client:
ANY Ensure that the write has been written once somewhere, including possibly being hinted in a non-target node.
ONE Ensure that the write has been written to at least 1 node's commit log and memory table
TWO Ensure that the write has been written to at least 2 node's commit log and memory table
THREE Ensure that the write has been written to at least 3 node's commit log and memory table
QUORUM Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes
LOCAL_ONE Ensure that the write has been written to 1 node within the local datacenter (requires NetworkTopologyStrategy)
LOCAL_QUORUM Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
EACH_QUORUM Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
ALL Ensure that the write is written to <code><ReplicationFactor></code> nodes before responding to the client.
Read consistency levels make the following guarantees before returning successful results to the client:
ANY Not supported. You probably want ONE instead.
ONE Returns the record obtained from a single replica.
TWO Returns the record with the most recent timestamp once two replicas have replied.
THREE Returns the record with the most recent timestamp once three replicas have replied.
QUORUM Returns the record with the most recent timestamp once a majority of replicas have replied.
LOCAL_ONE Returns the record with the most recent timestamp once a single replica within the local datacenter have replied.
LOCAL_QUORUM Returns the record with the most recent timestamp once a majority of replicas within the local datacenter have replied.
EACH_QUORUM Returns the record with the most recent timestamp once a majority of replicas within each datacenter have replied.
ALL Returns the record with the most recent timestamp once all replicas have replied (implies no replica may be down)..</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum_constant_summary">
<!-- -->
</a>
<h3>Enum Constant Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation">
<caption><span>Enum Constants</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Enum Constant and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#ALL">ALL</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#ANY">ANY</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#EACH_QUORUM">EACH_QUORUM</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#LOCAL_ONE">LOCAL_ONE</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#LOCAL_QUORUM">LOCAL_QUORUM</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#LOCAL_SERIAL">LOCAL_SERIAL</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#ONE">ONE</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#QUORUM">QUORUM</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#SERIAL">SERIAL</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#THREE">THREE</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#TWO">TWO</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>static <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#findByValue(int)">findByValue</a></strong>(int value)</code>
<div class="block">Find a the enum type by its integer value, as defined in the Thrift IDL.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#getValue()">getValue</a></strong>()</code>
<div class="block">Get the integer value of this enum value, as defined in the Thrift IDL.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html#values()">values</a></strong>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Enum">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Enum</h3>
<code>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</code></li>
</ul>
<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>getClass, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ENUM CONSTANT DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum_constant_detail">
<!-- -->
</a>
<h3>Enum Constant Detail</h3>
<a name="ONE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ONE</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> ONE</pre>
</li>
</ul>
<a name="QUORUM">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>QUORUM</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> QUORUM</pre>
</li>
</ul>
<a name="LOCAL_QUORUM">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LOCAL_QUORUM</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> LOCAL_QUORUM</pre>
</li>
</ul>
<a name="EACH_QUORUM">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EACH_QUORUM</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> EACH_QUORUM</pre>
</li>
</ul>
<a name="ALL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ALL</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> ALL</pre>
</li>
</ul>
<a name="ANY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ANY</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> ANY</pre>
</li>
</ul>
<a name="TWO">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TWO</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> TWO</pre>
</li>
</ul>
<a name="THREE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>THREE</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> THREE</pre>
</li>
</ul>
<a name="SERIAL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SERIAL</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> SERIAL</pre>
</li>
</ul>
<a name="LOCAL_SERIAL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LOCAL_SERIAL</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> LOCAL_SERIAL</pre>
</li>
</ul>
<a name="LOCAL_ONE">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LOCAL_ONE</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> LOCAL_ONE</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="values()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>values</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a>[] values()</pre>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
<pre>
for (ConsistencyLevel c : ConsistencyLevel.values())
System.out.println(c);
</pre></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in the order they are declared</dd></dl>
</li>
</ul>
<a name="valueOf(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>valueOf</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> valueOf(java.lang.String name)</pre>
<div class="block">Returns the enum constant of this type with the specified name.
The string must match <i>exactly</i> an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd>
<dd><code>java.lang.NullPointerException</code> - if the argument is null</dd></dl>
</li>
</ul>
<a name="getValue()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>public int getValue()</pre>
<div class="block">Get the integer value of this enum value, as defined in the Thrift IDL.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>getValue</code> in interface <code>org.apache.thrift.TEnum</code></dd>
</dl>
</li>
</ul>
<a name="findByValue(int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>findByValue</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/ConsistencyLevel.html" title="enum in org.apache.cassandra.thrift">ConsistencyLevel</a> findByValue(int value)</pre>
<div class="block">Find a the enum type by its integer value, as defined in the Thrift IDL.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>null if the value is not found.</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/ConsistencyLevel.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/thrift/Compression.html" title="enum in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/CounterColumn.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/ConsistencyLevel.html" target="_top">Frames</a></li>
<li><a href="ConsistencyLevel.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>Nested | </li>
<li><a href="#enum_constant_summary">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#enum_constant_detail">Enum Constants</a> | </li>
<li>Field | </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>