blob: 93c5ec476627d1325ff86bc4288068fb683c3bb2 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- GitHub action javadoc-cleanup -->
<link rel="canonical" href="https://beam.apache.org/releases/javadoc/current/org/apache/beam/it/cassandra/CassandraResourceManager.html">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- End javadoc-cleanup block -->
<!-- Generated by javadoc -->
<title>CassandraResourceManager (Apache Beam 2.55.1)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CassandraResourceManager (Apache Beam 2.55.1)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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="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&nbsp;Class</li>
<li><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.Builder.html" title="class in org.apache.beam.it.cassandra"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/it/cassandra/CassandraResourceManager.html" target="_top">Frames</a></li>
<li><a href="CassandraResourceManager.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;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="#fields.inherited.from.class.org.apache.beam.it.testcontainers.TestContainerResourceManager">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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.beam.it.cassandra</div>
<h2 title="Class CassandraResourceManager" class="title">Class CassandraResourceManager</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html" title="class in org.apache.beam.it.testcontainers">org.apache.beam.it.testcontainers.TestContainerResourceManager</a>&lt;<a href="https://static.javadoc.io/org.testcontainers/testcontainers/1.17.3/org/testcontainers/containers/GenericContainer.html?is-external=true" title="class or interface in org.testcontainers.containers">GenericContainer</a>&lt;?&gt;&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.beam.it.cassandra.CassandraResourceManager</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>org.apache.beam.it.common.ResourceManager</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">CassandraResourceManager</span>
extends <a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html" title="class in org.apache.beam.it.testcontainers">TestContainerResourceManager</a>&lt;<a href="https://static.javadoc.io/org.testcontainers/testcontainers/1.17.3/org/testcontainers/containers/GenericContainer.html?is-external=true" title="class or interface in org.testcontainers.containers">GenericContainer</a>&lt;?&gt;&gt;
implements org.apache.beam.it.common.ResourceManager</pre>
<div class="block">Client for managing Cassandra resources.
<p>The class supports one database and multiple collections per database object. A database is
created when the first collection is created if one has not been created already.
<p>The database name is formed using testId. The database name will be "{testId}-{ISO8601 time,
microsecond precision}", with additional formatting.
<p>The class is thread-safe.</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="memberSummary" 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><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.Builder.html" title="class in org.apache.beam.it.cassandra">CassandraResourceManager.Builder</a></span></code>
<div class="block">Builder for <a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html" title="class in org.apache.beam.it.cassandra"><code>CassandraResourceManager</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.beam.it.testcontainers.TestContainerResourceManager">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.beam.it.testcontainers.<a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html" title="class in org.apache.beam.it.testcontainers">TestContainerResourceManager</a></h3>
<code><a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html#HOST_IP">HOST_IP</a>, <a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html#port">port</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.Builder.html" title="class in org.apache.beam.it.cassandra">CassandraResourceManager.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#builder-java.lang.String-">builder</a></span>(java.lang.String&nbsp;testId)</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#cleanupAll--">cleanupAll</a></span>()</code>
<div class="block">Deletes all created resources (VM's, etc.) and stops the container, making the manager object
unusable.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>com.datastax.oss.driver.api.core.cql.ResultSet</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#executeStatement-java.lang.String-">executeStatement</a></span>(java.lang.String&nbsp;statement)</code>
<div class="block">Execute the given statement on the managed keyspace.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#getKeyspaceName--">getKeyspaceName</a></span>()</code>
<div class="block">Returns the name of the Database that this Cassandra manager will operate in.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#getPort--">getPort</a></span>()</code>
<div class="block">Returns the port to connect to the Cassandra Database.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#insertDocument-java.lang.String-java.util.Map-">insertDocument</a></span>(java.lang.String&nbsp;tableName,
java.util.Map&lt;java.lang.String,java.lang.Object&gt;&nbsp;document)</code>
<div class="block">Inserts the given Document into a table.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#insertDocuments-java.lang.String-java.util.List-">insertDocuments</a></span>(java.lang.String&nbsp;tableName,
java.util.List&lt;java.util.Map&lt;java.lang.String,java.lang.Object&gt;&gt;&nbsp;documents)</code>
<div class="block">Inserts the given Documents into a collection.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.lang.Iterable&lt;com.datastax.oss.driver.api.core.cql.Row&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.html#readTable-java.lang.String-">readTable</a></span>(java.lang.String&nbsp;tableName)</code>
<div class="block">Reads all the Documents in a collection.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.it.testcontainers.TestContainerResourceManager">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.beam.it.testcontainers.<a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html" title="class in org.apache.beam.it.testcontainers">TestContainerResourceManager</a></h3>
<code><a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html#getDockerImageName--">getDockerImageName</a>, <a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html#getHost--">getHost</a>, <a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html#getPort-int-">getPort</a></code></li>
</ul>
<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, 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="builder-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>builder</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.Builder.html" title="class in org.apache.beam.it.cassandra">CassandraResourceManager.Builder</a>&nbsp;builder(java.lang.String&nbsp;testId)</pre>
</li>
</ul>
<a name="getPort--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPort</h4>
<pre>public&nbsp;int&nbsp;getPort()</pre>
<div class="block">Returns the port to connect to the Cassandra Database.</div>
</li>
</ul>
<a name="getKeyspaceName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKeyspaceName</h4>
<pre>public&nbsp;java.lang.String&nbsp;getKeyspaceName()</pre>
<div class="block">Returns the name of the Database that this Cassandra manager will operate in.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the name of the Cassandra Database.</dd>
</dl>
</li>
</ul>
<a name="executeStatement-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>executeStatement</h4>
<pre>public&nbsp;com.datastax.oss.driver.api.core.cql.ResultSet&nbsp;executeStatement(java.lang.String&nbsp;statement)</pre>
<div class="block">Execute the given statement on the managed keyspace.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>statement</code> - The statement to execute.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>ResultSet from Cassandra.</dd>
</dl>
</li>
</ul>
<a name="insertDocument-java.lang.String-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>insertDocument</h4>
<pre>public&nbsp;boolean&nbsp;insertDocument(java.lang.String&nbsp;tableName,
java.util.Map&lt;java.lang.String,java.lang.Object&gt;&nbsp;document)</pre>
<div class="block">Inserts the given Document into a table.
<p>A database will be created here, if one does not already exist.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>tableName</code> - The name of the table to insert the document into.</dd>
<dd><code>document</code> - The document to insert into the table.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A boolean indicating whether the Document was inserted successfully.</dd>
</dl>
</li>
</ul>
<a name="insertDocuments-java.lang.String-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>insertDocuments</h4>
<pre>public&nbsp;boolean&nbsp;insertDocuments(java.lang.String&nbsp;tableName,
java.util.List&lt;java.util.Map&lt;java.lang.String,java.lang.Object&gt;&gt;&nbsp;documents)
throws <a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManagerException.html" title="class in org.apache.beam.it.cassandra">CassandraResourceManagerException</a></pre>
<div class="block">Inserts the given Documents into a collection.
<p>Note: Implementations may do collection creation here, if one does not already exist.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>tableName</code> - The name of the collection to insert the documents into.</dd>
<dd><code>documents</code> - A list of documents to insert into the collection.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A boolean indicating whether the Documents were inserted successfully.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManagerException.html" title="class in org.apache.beam.it.cassandra">CassandraResourceManagerException</a></code> - if there is an error inserting the documents.</dd>
</dl>
</li>
</ul>
<a name="readTable-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readTable</h4>
<pre>public&nbsp;java.lang.Iterable&lt;com.datastax.oss.driver.api.core.cql.Row&gt;&nbsp;readTable(java.lang.String&nbsp;tableName)
throws <a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManagerException.html" title="class in org.apache.beam.it.cassandra">CassandraResourceManagerException</a></pre>
<div class="block">Reads all the Documents in a collection.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>tableName</code> - The name of the collection to read from.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>An iterable of all the Documents in the collection.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManagerException.html" title="class in org.apache.beam.it.cassandra">CassandraResourceManagerException</a></code> - if there is an error reading the collection.</dd>
</dl>
</li>
</ul>
<a name="cleanupAll--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>cleanupAll</h4>
<pre>public&nbsp;void&nbsp;cleanupAll()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html#cleanupAll--">TestContainerResourceManager</a></code></span></div>
<div class="block">Deletes all created resources (VM's, etc.) and stops the container, making the manager object
unusable.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>cleanupAll</code>&nbsp;in interface&nbsp;<code>org.apache.beam.it.common.ResourceManager</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html#cleanupAll--">cleanupAll</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/it/testcontainers/TestContainerResourceManager.html" title="class in org.apache.beam.it.testcontainers">TestContainerResourceManager</a>&lt;<a href="https://static.javadoc.io/org.testcontainers/testcontainers/1.17.3/org/testcontainers/containers/GenericContainer.html?is-external=true" title="class or interface in org.testcontainers.containers">GenericContainer</a>&lt;?&gt;&gt;</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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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="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&nbsp;Class</li>
<li><a href="../../../../../org/apache/beam/it/cassandra/CassandraResourceManager.Builder.html" title="class in org.apache.beam.it.cassandra"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/it/cassandra/CassandraResourceManager.html" target="_top">Frames</a></li>
<li><a href="CassandraResourceManager.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;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="#fields.inherited.from.class.org.apache.beam.it.testcontainers.TestContainerResourceManager">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>