cassandra-server
Version:
A thin Javascript wrapper around Apache Cassandra to provide out of the box server support
405 lines (404 loc) • 18.9 kB
HTML
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Sun Sep 07 15:29:31 CEST 2014 -->
<title>CQLSSTableWriter.Builder (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="CQLSSTableWriter.Builder (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/CQLSSTableWriter.Builder.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/io/sstable/CQLSSTableWriter.html" title="class in org.apache.cassandra.io.sstable"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/cassandra/io/sstable/Descriptor.html" title="class in org.apache.cassandra.io.sstable"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" target="_top">Frames</a></li>
<li><a href="CQLSSTableWriter.Builder.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.io.sstable</div>
<h2 title="Class CQLSSTableWriter.Builder" class="title">Class CQLSSTableWriter.Builder</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.io.sstable.CQLSSTableWriter.Builder</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter</a></dd>
</dl>
<hr>
<br>
<pre>public static class <span class="strong">CQLSSTableWriter.Builder</span>
extends java.lang.Object</pre>
<div class="block">A Builder for a CQLSSTableWriter object.</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><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#build()">build</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#forTable(java.lang.String)">forTable</a></strong>(java.lang.String schema)</code>
<div class="block">The schema (CREATE TABLE statement) for the table for which sstable are to be created.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#inDirectory(java.io.File)">inDirectory</a></strong>(java.io.File directory)</code>
<div class="block">The directory where to write the sstables (mandatory option).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#inDirectory(java.lang.String)">inDirectory</a></strong>(java.lang.String directory)</code>
<div class="block">The directory where to write the sstables.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#sorted()">sorted</a></strong>()</code>
<div class="block">Creates a CQLSSTableWriter that expects sorted inputs.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#using(java.lang.String)">using</a></strong>(java.lang.String insertStatement)</code>
<div class="block">The INSERT statement defining the order of the values to add for a given CQL row.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#withBufferSizeInMB(int)">withBufferSizeInMB</a></strong>(int size)</code>
<div class="block">The size of the buffer to use.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html#withPartitioner(org.apache.cassandra.dht.IPartitioner)">withPartitioner</a></strong>(<a href="../../../../../org/apache/cassandra/dht/IPartitioner.html" title="interface in org.apache.cassandra.dht">IPartitioner</a> partitioner)</code>
<div class="block">The partitioner to use.</div>
</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="inDirectory(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>inDirectory</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a> inDirectory(java.lang.String directory)</pre>
<div class="block">The directory where to write the sstables.
<p>
This is a mandatory option.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the directory to use, which should exists and be writable.</dd>
<dt><span class="strong">Returns:</span></dt><dd>this builder.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>directory</code> doesn't exist or is not writable.</dd></dl>
</li>
</ul>
<a name="inDirectory(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>inDirectory</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a> inDirectory(java.io.File directory)</pre>
<div class="block">The directory where to write the sstables (mandatory option).
<p>
This is a mandatory option.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the directory to use, which should exists and be writable.</dd>
<dt><span class="strong">Returns:</span></dt><dd>this builder.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>directory</code> doesn't exist or is not writable.</dd></dl>
</li>
</ul>
<a name="forTable(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>forTable</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a> forTable(java.lang.String schema)</pre>
<div class="block">The schema (CREATE TABLE statement) for the table for which sstable are to be created.
<p>
Please note that the provided CREATE TABLE statement <b>must</b> use a fully-qualified
table name, one that include the keyspace name.
<p>
This is a mandatory option.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>schema</code> - the schema of the table for which sstables are to be created.</dd>
<dt><span class="strong">Returns:</span></dt><dd>this builder.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>schema</code> is not a valid CREATE TABLE statement
or does not have a fully-qualified table name.</dd></dl>
</li>
</ul>
<a name="withPartitioner(org.apache.cassandra.dht.IPartitioner)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withPartitioner</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a> withPartitioner(<a href="../../../../../org/apache/cassandra/dht/IPartitioner.html" title="interface in org.apache.cassandra.dht">IPartitioner</a> partitioner)</pre>
<div class="block">The partitioner to use.
<p>
By default, <code>Murmur3Partitioner</code> will be used. If this is not the partitioner used
by the cluster for which the SSTables are created, you need to use this method to
provide the correct partitioner.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>partitioner</code> - the partitioner to use.</dd>
<dt><span class="strong">Returns:</span></dt><dd>this builder.</dd></dl>
</li>
</ul>
<a name="using(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>using</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a> using(java.lang.String insertStatement)</pre>
<div class="block">The INSERT statement defining the order of the values to add for a given CQL row.
<p>
Please note that the provided INSERT statement <b>must</b> use a fully-qualified
table name, one that include the keyspace name. Morewover, said statement must use
bind variables since it is those bind variables that will be bound to values by the
resulting writer.
<p>
This is a mandatory option, and this needs to be called after foTable().</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>insertStatement</code> - an insertion statement that defines the order
of column values to use.</dd>
<dt><span class="strong">Returns:</span></dt><dd>this builder.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>insertStatement</code> is not a valid insertion
statement, does not have a fully-qualified table name or have no bind variables.</dd></dl>
</li>
</ul>
<a name="withBufferSizeInMB(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withBufferSizeInMB</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a> withBufferSizeInMB(int size)</pre>
<div class="block">The size of the buffer to use.
<p>
This defines how much data will be buffered before being written as
a new SSTable. This correspond roughly to the data size that will have the created
sstable.
<p>
The default is 128MB, which should be reasonable for a 1GB heap. If you experience
OOM while using the writer, you should lower this value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>size</code> - the size to use in MB.</dd>
<dt><span class="strong">Returns:</span></dt><dd>this builder.</dd></dl>
</li>
</ul>
<a name="sorted()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sorted</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter.Builder</a> sorted()</pre>
<div class="block">Creates a CQLSSTableWriter that expects sorted inputs.
<p>
If this option is used, the resulting writer will expect rows to be
added in SSTable sorted order (and an exception will be thrown if that
is not the case during insertion). The SSTable sorted order means that
rows are added such that their partition key respect the partitioner
order and for a given partition, that the rows respect the clustering
columns order.
<p>
You should thus only use this option is you know that you can provide
the rows in order, which is rarely the case. If you can provide the
rows in order however, using this sorted might be more efficient.
<p>
Note that if used, some option like withBufferSizeInMB will be ignored.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>this builder.</dd></dl>
</li>
</ul>
<a name="build()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>build</h4>
<pre>public <a href="../../../../../org/apache/cassandra/io/sstable/CQLSSTableWriter.html" title="class in org.apache.cassandra.io.sstable">CQLSSTableWriter</a> build()</pre>
</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/CQLSSTableWriter.Builder.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/io/sstable/CQLSSTableWriter.html" title="class in org.apache.cassandra.io.sstable"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/cassandra/io/sstable/Descriptor.html" title="class in org.apache.cassandra.io.sstable"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/io/sstable/CQLSSTableWriter.Builder.html" target="_top">Frames</a></li>
<li><a href="CQLSSTableWriter.Builder.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>