blob: 1dce239066f871b930315a7ef91db6795d75caeb [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>
<!-- Generated by javadoc -->
<title>GroupIntoBatches (Apache Beam 2.47.0)</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="GroupIntoBatches (Apache Beam 2.47.0)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":9,"i3":9,"i4":9,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":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><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="class in org.apache.beam.sdk.transforms"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.BatchingParams.html" title="class in org.apache.beam.sdk.transforms"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/transforms/GroupIntoBatches.html" target="_top">Frames</a></li>
<li><a href="GroupIntoBatches.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.sdk.transforms.PTransform">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.sdk.transforms</div>
<h2 title="Class GroupIntoBatches" class="title">Class GroupIntoBatches&lt;K,InputT&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">org.apache.beam.sdk.transforms.PTransform</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,InputT&gt;&gt;,<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,java.lang.Iterable&lt;InputT&gt;&gt;&gt;&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.beam.sdk.transforms.GroupIntoBatches&lt;K,InputT&gt;</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, <a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html" title="interface in org.apache.beam.sdk.transforms.display">HasDisplayData</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">GroupIntoBatches&lt;K,InputT&gt;</span>
extends <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,InputT&gt;&gt;,<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,java.lang.Iterable&lt;InputT&gt;&gt;&gt;&gt;</pre>
<div class="block">A <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms"><code>PTransform</code></a> that batches inputs to a desired batch size. Batches will contain only
elements of a single key.
<p>Elements are buffered until there are enough elements for a batch, at which point they are
emitted to the output <a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values"><code>PCollection</code></a>. A <code>maxBufferingDuration</code> can be set to emit
output early and avoid waiting for a full batch forever.
<p>Batches can be triggered either based on element count or byte size. <a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofSize-long-"><code>ofSize(long)</code></a> is used
to specify a maximum element count while <a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-"><code>ofByteSize(long)</code></a> is used to specify a maximum byte
size. The single-argument <a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-"><code>ofByteSize(long)</code></a> uses the input coder to determine the encoded byte
size of each element. However, this may not always be what is desired. A user may want to control
batching based on a different byte size (e.g. the memory usage of the decoded Java object) or the
input coder may not be able to efficiently determine the elements' byte size. For these cases, we
also provide the two-argument <a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-"><code>ofByteSize(long)</code></a> allowing the user to pass in a function to be
used to determine the byte size of an element.
<p>Windows are preserved (batches contain elements from the same window). Batches may contain
elements from more than one bundle.
<p>Example 1 (batch call a webservice and get return codes):
<pre><code>
PCollection&lt;KV&lt;String, String&gt;&gt; input = ...;
long batchSize = 100L;
PCollection&lt;KV&lt;String, Iterable&lt;String&gt;&gt;&gt; batched = input
.apply(GroupIntoBatches.&lt;String, String&gt;ofSize(batchSize))
.setCoder(KvCoder.of(StringUtf8Coder.of(), IterableCoder.of(StringUtf8Coder.of())))
.apply(ParDo.of(new DoFn&lt;KV&lt;String, Iterable&lt;String&gt;&gt;, KV&lt;String, String&gt;&gt;() </code>{
<code> @ProcessElement
public void processElement(@Element KV&lt;String, Iterable&lt;String&gt;&gt; element,
OutputReceiver&lt;KV&lt;String, String&gt;&gt; r) {
r.output(KV.of(element.getKey(), callWebService(element.getValue())));
}
</code>}));
</pre>
<p>Example 2 (batch unbounded input in a global window):
<pre><code>
PCollection&lt;KV&lt;String, String&gt;&gt; unboundedInput = ...;
long batchSize = 100L;
Duration maxBufferingDuration = Duration.standardSeconds(10);
PCollection&lt;KV&lt;String, Iterable&lt;String&gt;&gt;&gt; batched = unboundedInput
.apply(Window.&lt;KV&lt;String, String&gt;&gt;into(new GlobalWindows())
.triggering(Repeatedly.forever(AfterPane.elementCountAtLeast(1)))
.discardingFiredPanes())
.apply(GroupIntoBatches.&lt;String, String&gt;ofSize(batchSize)
.withMaxBufferingDuration(maxBufferingDuration));
</code></pre></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../serialized-form.html#org.apache.beam.sdk.transforms.GroupIntoBatches">Serialized Form</a></dd>
</dl>
</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/sdk/transforms/GroupIntoBatches.BatchingParams.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches.BatchingParams</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.BatchingParams.html" title="type parameter in GroupIntoBatches.BatchingParams">InputT</a>&gt;</span></code>
<div class="block">Wrapper class for batching parameters supplied by users.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.WithShardedKey.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches.WithShardedKey</a></span></code>&nbsp;</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.sdk.transforms.PTransform">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.beam.sdk.transforms.<a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#name">name</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#resourceHints">resourceHints</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><a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#expand-org.apache.beam.sdk.values.PCollection-">expand</a></span>(<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;&nbsp;input)</code>
<div class="block">Override this method to specify how this <code>PTransform</code> should be expanded on the given
<code>InputT</code>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.BatchingParams.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches.BatchingParams</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#getBatchingParams--">getBatchingParams</a></span>()</code>
<div class="block">Returns user supplied parameters for batching.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static &lt;K,InputT&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;K,InputT&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-">ofByteSize</a></span>(long&nbsp;batchSizeBytes)</code>
<div class="block">Aim to create batches each with the specified byte size.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static &lt;K,InputT&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;K,InputT&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-org.apache.beam.sdk.transforms.SerializableFunction-">ofByteSize</a></span>(long&nbsp;batchSizeBytes,
<a href="../../../../../org/apache/beam/sdk/transforms/SerializableFunction.html" title="interface in org.apache.beam.sdk.transforms">SerializableFunction</a>&lt;InputT,java.lang.Long&gt;&nbsp;getElementByteSize)</code>
<div class="block">Aim to create batches each with the specified byte size.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static &lt;K,InputT&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;K,InputT&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofSize-long-">ofSize</a></span>(long&nbsp;batchSize)</code>
<div class="block">Aim to create batches each with the specified element count.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#withByteSize-long-">withByteSize</a></span>(long&nbsp;batchSizeBytes)</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#withByteSize-long-org.apache.beam.sdk.transforms.SerializableFunction-">withByteSize</a></span>(long&nbsp;batchSizeBytes,
<a href="../../../../../org/apache/beam/sdk/transforms/SerializableFunction.html" title="interface in org.apache.beam.sdk.transforms">SerializableFunction</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>,java.lang.Long&gt;&nbsp;getElementByteSize)</code>&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#withMaxBufferingDuration-org.joda.time.Duration-">withMaxBufferingDuration</a></span>(<a href="https://static.javadoc.io/joda-time/joda-time/2.10.10/org/joda/time/Duration.html?is-external=true" title="class or interface in org.joda.time">Duration</a>&nbsp;duration)</code>
<div class="block">Sets a time limit (in processing time) on how long an incomplete batch of elements is allowed
to be buffered.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.WithShardedKey.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches.WithShardedKey</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#withShardedKey--">withShardedKey</a></span>()</code>
<div class="block">Outputs batched elements associated with sharded input keys.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#withSize-long-">withSize</a></span>(long&nbsp;batchSize)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.sdk.transforms.PTransform">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.beam.sdk.transforms.<a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#compose-org.apache.beam.sdk.transforms.SerializableFunction-">compose</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#compose-java.lang.String-org.apache.beam.sdk.transforms.SerializableFunction-">compose</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getAdditionalInputs--">getAdditionalInputs</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getDefaultOutputCoder--">getDefaultOutputCoder</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getDefaultOutputCoder-InputT-">getDefaultOutputCoder</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getDefaultOutputCoder-InputT-org.apache.beam.sdk.values.PCollection-">getDefaultOutputCoder</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getKindString--">getKindString</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getName--">getName</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getResourceHints--">getResourceHints</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#setResourceHints-org.apache.beam.sdk.transforms.resourcehints.ResourceHints-">setResourceHints</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#validate-org.apache.beam.sdk.options.PipelineOptions-">validate</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#validate-org.apache.beam.sdk.options.PipelineOptions-java.util.Map-java.util.Map-">validate</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, 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="ofSize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofSize</h4>
<pre>public static&nbsp;&lt;K,InputT&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;K,InputT&gt;&nbsp;ofSize(long&nbsp;batchSize)</pre>
<div class="block">Aim to create batches each with the specified element count.</div>
</li>
</ul>
<a name="ofByteSize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofByteSize</h4>
<pre>public static&nbsp;&lt;K,InputT&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;K,InputT&gt;&nbsp;ofByteSize(long&nbsp;batchSizeBytes)</pre>
<div class="block">Aim to create batches each with the specified byte size.
<p>This option uses the PCollection's coder to determine the byte size of each element. This
may not always be what is desired (e.g. the encoded size is not the same as the memory usage of
the Java object). This is also only recommended if the coder returns true for
isRegisterByteSizeObserverCheap, otherwise the transform will perform a possibly-expensive
encoding of each element in order to measure its byte size. An alternate approach is to use
<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-org.apache.beam.sdk.transforms.SerializableFunction-"><code>ofByteSize(long, SerializableFunction)</code></a> to specify code to calculate the byte size.</div>
</li>
</ul>
<a name="ofByteSize-long-org.apache.beam.sdk.transforms.SerializableFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofByteSize</h4>
<pre>public static&nbsp;&lt;K,InputT&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;K,InputT&gt;&nbsp;ofByteSize(long&nbsp;batchSizeBytes,
<a href="../../../../../org/apache/beam/sdk/transforms/SerializableFunction.html" title="interface in org.apache.beam.sdk.transforms">SerializableFunction</a>&lt;InputT,java.lang.Long&gt;&nbsp;getElementByteSize)</pre>
<div class="block">Aim to create batches each with the specified byte size. The provided function is used to
determine the byte size of each element.</div>
</li>
</ul>
<a name="getBatchingParams--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBatchingParams</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.BatchingParams.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches.BatchingParams</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&nbsp;getBatchingParams()</pre>
<div class="block">Returns user supplied parameters for batching.</div>
</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><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#toString--">toString</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;,<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;&gt;&gt;</code></dd>
</dl>
</li>
</ul>
<a name="withSize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withSize</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&nbsp;withSize(long&nbsp;batchSize)</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofSize-long-"><code>ofSize(long)</code></a></dd>
</dl>
</li>
</ul>
<a name="withByteSize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withByteSize</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&nbsp;withByteSize(long&nbsp;batchSizeBytes)</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-"><code>ofByteSize(long)</code></a></dd>
</dl>
</li>
</ul>
<a name="withByteSize-long-org.apache.beam.sdk.transforms.SerializableFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withByteSize</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&nbsp;withByteSize(long&nbsp;batchSizeBytes,
<a href="../../../../../org/apache/beam/sdk/transforms/SerializableFunction.html" title="interface in org.apache.beam.sdk.transforms">SerializableFunction</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>,java.lang.Long&gt;&nbsp;getElementByteSize)</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html#ofByteSize-long-org.apache.beam.sdk.transforms.SerializableFunction-"><code>ofByteSize(long, SerializableFunction)</code></a></dd>
</dl>
</li>
</ul>
<a name="withMaxBufferingDuration-org.joda.time.Duration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withMaxBufferingDuration</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&nbsp;withMaxBufferingDuration(<a href="https://static.javadoc.io/joda-time/joda-time/2.10.10/org/joda/time/Duration.html?is-external=true" title="class or interface in org.joda.time">Duration</a>&nbsp;duration)</pre>
<div class="block">Sets a time limit (in processing time) on how long an incomplete batch of elements is allowed
to be buffered. Once a batch is flushed to output, the timer is reset. The provided limit must
be a positive duration or zero; a zero buffering duration effectively means no limit.</div>
</li>
</ul>
<a name="withShardedKey--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withShardedKey</h4>
<pre><a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html" title="annotation in org.apache.beam.sdk.annotations">@Experimental</a>
public&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.WithShardedKey.html" title="class in org.apache.beam.sdk.transforms">GroupIntoBatches.WithShardedKey</a>&nbsp;withShardedKey()</pre>
<div class="block">Outputs batched elements associated with sharded input keys. By default, keys are sharded to
such that the input elements with the same key are spread to all available threads executing
the transform. Runners may override the default sharding to do a better load balancing during
the execution time.</div>
</li>
</ul>
<a name="expand-org.apache.beam.sdk.values.PCollection-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>expand</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;&gt;&nbsp;expand(<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;&nbsp;input)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#expand-InputT-">PTransform</a></code></span></div>
<div class="block">Override this method to specify how this <code>PTransform</code> should be expanded on the given
<code>InputT</code>.
<p>NOTE: This method should not be called directly. Instead apply the <code>PTransform</code> should
be applied to the <code>InputT</code> using the <code>apply</code> method.
<p>Composite transforms, which are defined in terms of other transforms, should return the
output of one of the composed transforms. Non-composite transforms, which do not apply any
transforms internally, should return a new unbound output and register evaluators (via
backend-specific registration methods).</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#expand-InputT-">expand</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;,<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.html" title="type parameter in GroupIntoBatches">InputT</a>&gt;&gt;&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><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="class in org.apache.beam.sdk.transforms"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/transforms/GroupIntoBatches.BatchingParams.html" title="class in org.apache.beam.sdk.transforms"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/transforms/GroupIntoBatches.html" target="_top">Frames</a></li>
<li><a href="GroupIntoBatches.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.sdk.transforms.PTransform">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>