cassandra-server
Version:
A thin Javascript wrapper around Apache Cassandra to provide out of the box server support
456 lines (449 loc) • 17.6 kB
HTML
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Sun Sep 07 15:29:29 CEST 2014 -->
<title>UUIDGen (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="UUIDGen (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/UUIDGen.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/utils/StreamingHistogram.StreamingHistogramSerializer.html" title="class in org.apache.cassandra.utils"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/utils/UUIDSerializer.html" title="class in org.apache.cassandra.utils"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/utils/UUIDGen.html" target="_top">Frames</a></li>
<li><a href="UUIDGen.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>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </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.utils</div>
<h2 title="Class UUIDGen" class="title">Class UUIDGen</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.utils.UUIDGen</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">UUIDGen</span>
extends java.lang.Object</pre>
<div class="block">The goods are here: www.ietf.org/rfc/rfc4122.txt.</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"> </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 byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#decompose(java.util.UUID)">decompose</a></strong>(java.util.UUID uuid)</code>
<div class="block">decomposes a uuid into raw bytes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getAdjustedTimestamp(java.util.UUID)">getAdjustedTimestamp</a></strong>(java.util.UUID uuid)</code>
<div class="block">Returns a milliseconds-since-epoch value for a type-1 UUID.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.util.UUID</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getTimeUUID()">getTimeUUID</a></strong>()</code>
<div class="block">Creates a type 1 UUID (time-based UUID).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.util.UUID</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getTimeUUID(long)">getTimeUUID</a></strong>(long when)</code>
<div class="block">Creates a type 1 UUID (time-based UUID) with the timestamp of @param when, in milliseconds.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.util.UUID</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getTimeUUID(long,%20long)">getTimeUUID</a></strong>(long when,
long clockSeqAndNode)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getTimeUUIDBytes()">getTimeUUIDBytes</a></strong>()</code>
<div class="block">Returns a 16 byte representation of a type 1 UUID (a time-based UUID),
based on the current system time.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getTimeUUIDBytes(long)">getTimeUUIDBytes</a></strong>(long timeMillis)</code>
<div class="block">Converts a milliseconds-since-epoch timestamp into the 16 byte representation
of a type 1 UUID (a time-based UUID).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getTimeUUIDBytes(long,%20int)">getTimeUUIDBytes</a></strong>(long timeMillis,
int nanos)</code>
<div class="block">Converts a 100-nanoseconds precision timestamp into the 16 byte representation
of a type 1 UUID (a time-based UUID).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.util.UUID</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#getUUID(java.nio.ByteBuffer)">getUUID</a></strong>(java.nio.ByteBuffer raw)</code>
<div class="block">creates a type 1 uuid from raw bytes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.util.UUID</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#maxTimeUUID(long)">maxTimeUUID</a></strong>(long timestamp)</code>
<div class="block">Returns the biggest possible type 1 UUID having the provided timestamp.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#microsTimestamp(java.util.UUID)">microsTimestamp</a></strong>(java.util.UUID uuid)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.util.UUID</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#minTimeUUID(long)">minTimeUUID</a></strong>(long timestamp)</code>
<div class="block">Returns the smaller possible type 1 UUID having the provided timestamp.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/utils/UUIDGen.html#unixTimestamp(java.util.UUID)">unixTimestamp</a></strong>(java.util.UUID uuid)</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">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getTimeUUID()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeUUID</h4>
<pre>public static java.util.UUID getTimeUUID()</pre>
<div class="block">Creates a type 1 UUID (time-based UUID).</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a UUID instance</dd></dl>
</li>
</ul>
<a name="getTimeUUID(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeUUID</h4>
<pre>public static java.util.UUID getTimeUUID(long when)</pre>
<div class="block">Creates a type 1 UUID (time-based UUID) with the timestamp of @param when, in milliseconds.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a UUID instance</dd></dl>
</li>
</ul>
<a name="getTimeUUID(long, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeUUID</h4>
<pre>public static java.util.UUID getTimeUUID(long when,
long clockSeqAndNode)</pre>
</li>
</ul>
<a name="getUUID(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUUID</h4>
<pre>public static java.util.UUID getUUID(java.nio.ByteBuffer raw)</pre>
<div class="block">creates a type 1 uuid from raw bytes.</div>
</li>
</ul>
<a name="decompose(java.util.UUID)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompose</h4>
<pre>public static byte[] decompose(java.util.UUID uuid)</pre>
<div class="block">decomposes a uuid into raw bytes.</div>
</li>
</ul>
<a name="getTimeUUIDBytes()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeUUIDBytes</h4>
<pre>public static byte[] getTimeUUIDBytes()</pre>
<div class="block">Returns a 16 byte representation of a type 1 UUID (a time-based UUID),
based on the current system time.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a type 1 UUID represented as a byte[]</dd></dl>
</li>
</ul>
<a name="minTimeUUID(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minTimeUUID</h4>
<pre>public static java.util.UUID minTimeUUID(long timestamp)</pre>
<div class="block">Returns the smaller possible type 1 UUID having the provided timestamp.
<b>Warning:</b> this method should only be used for querying as this
doesn't at all guarantee the uniqueness of the resulting UUID.</div>
</li>
</ul>
<a name="maxTimeUUID(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxTimeUUID</h4>
<pre>public static java.util.UUID maxTimeUUID(long timestamp)</pre>
<div class="block">Returns the biggest possible type 1 UUID having the provided timestamp.
<b>Warning:</b> this method should only be used for querying as this
doesn't at all guarantee the uniqueness of the resulting UUID.</div>
</li>
</ul>
<a name="unixTimestamp(java.util.UUID)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unixTimestamp</h4>
<pre>public static long unixTimestamp(java.util.UUID uuid)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>uuid</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>milliseconds since Unix epoch</dd></dl>
</li>
</ul>
<a name="microsTimestamp(java.util.UUID)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>microsTimestamp</h4>
<pre>public static long microsTimestamp(java.util.UUID uuid)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>uuid</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>microseconds since Unix epoch</dd></dl>
</li>
</ul>
<a name="getTimeUUIDBytes(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeUUIDBytes</h4>
<pre>public static byte[] getTimeUUIDBytes(long timeMillis)</pre>
<div class="block">Converts a milliseconds-since-epoch timestamp into the 16 byte representation
of a type 1 UUID (a time-based UUID).
<p><i><b>Deprecated:</b> This method goes again the principle of a time
UUID and should not be used. For queries based on timestamp, minTimeUUID() and
maxTimeUUID() can be used but this method has questionable usefulness. This is
only kept because CQL2 uses it (see TimeUUID.fromStringCQL2) and we
don't want to break compatibility.</i></p>
<p><i><b>Warning:</b> This method is not guaranteed to return unique UUIDs; Multiple
invocations using identical timestamps will result in identical UUIDs.</i></p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>timeMillis</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>a type 1 UUID represented as a byte[]</dd></dl>
</li>
</ul>
<a name="getTimeUUIDBytes(long, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeUUIDBytes</h4>
<pre>public static byte[] getTimeUUIDBytes(long timeMillis,
int nanos)</pre>
<div class="block">Converts a 100-nanoseconds precision timestamp into the 16 byte representation
of a type 1 UUID (a time-based UUID).
To specify a 100-nanoseconds precision timestamp, one should provide a milliseconds timestamp and
a number 0 <= n < 10000 such that n*100 is the number of nanoseconds within that millisecond.
<p><i><b>Warning:</b> This method is not guaranteed to return unique UUIDs; Multiple
invocations using identical timestamps will result in identical UUIDs.</i></p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a type 1 UUID represented as a byte[]</dd></dl>
</li>
</ul>
<a name="getAdjustedTimestamp(java.util.UUID)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getAdjustedTimestamp</h4>
<pre>public static long getAdjustedTimestamp(java.util.UUID uuid)</pre>
<div class="block">Returns a milliseconds-since-epoch value for a type-1 UUID.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>uuid</code> - a type-1 (time-based) UUID</dd>
<dt><span class="strong">Returns:</span></dt><dd>the number of milliseconds since the unix epoch</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the UUID is not version 1</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/UUIDGen.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/utils/StreamingHistogram.StreamingHistogramSerializer.html" title="class in org.apache.cassandra.utils"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/utils/UUIDSerializer.html" title="class in org.apache.cassandra.utils"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/utils/UUIDGen.html" target="_top">Frames</a></li>
<li><a href="UUIDGen.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>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </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>