blob: 887286e734cdcb6cef8e2790a753fa1c27e404bd [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 (1.8.0_161-google-v7) on Thu Oct 18 16:14:33 PDT 2018 -->
<title>GroupByKey (Apache Beam 2.8.0-SNAPSHOT)</title>
<meta name="date" content="2018-10-18">
<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="GroupByKey (Apache Beam 2.8.0-SNAPSHOT)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":10,"i3":10,"i4":9,"i5":9,"i6":9,"i7":10,"i8":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/Flatten.PCollections.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.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/GroupByKey.html" target="_top">Frames</a></li>
<li><a href="GroupByKey.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>Nested&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 GroupByKey" class="title">Class GroupByKey&lt;K,V&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,V&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;V&gt;&gt;&gt;&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.beam.sdk.transforms.GroupByKey&lt;K,V&gt;</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - the type of the keys of the input and output <code>PCollection</code>s</dd>
<dd><code>V</code> - the type of the values of the input <code>PCollection</code> and the elements of the <code>Iterable</code>s in the output <code>PCollection</code></dd>
</dl>
<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">GroupByKey&lt;K,V&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,V&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;V&gt;&gt;&gt;&gt;</pre>
<div class="block"><code>GroupByKey&lt;K, V&gt;</code> takes a <code>PCollection&lt;KV&lt;K, V&gt;&gt;</code>, groups the values by key and
windows, and returns a <code>PCollection&lt;KV&lt;K, Iterable&lt;V&gt;&gt;&gt;</code> representing a map from each
distinct key and window of the input <code>PCollection</code> to an <code>Iterable</code> over all the
values associated with that key in the input per window. Absent repeatedly-firing <a href="../../../../../org/apache/beam/sdk/transforms/windowing/Window.html#triggering-org.apache.beam.sdk.transforms.windowing.Trigger-"><code>triggering</code></a>, each key in the output <code>PCollection</code> is unique within each
window.
<p><code>GroupByKey</code> is analogous to converting a multi-map into a uni-map, and related to
<code>GROUP BY</code> in SQL. It corresponds to the "shuffle" step between the Mapper and the Reducer
in the MapReduce framework.
<p>Two keys of type <code>K</code> are compared for equality <b>not</b> by regular Java <code>Object.equals(java.lang.Object)</code>, but instead by first encoding each of the keys using the <code>Coder</code> of the
keys of the input <code>PCollection</code>, and then comparing the encoded bytes. This admits
efficient parallel evaluation. Note that this requires that the <code>Coder</code> of the keys be
deterministic (see <a href="../../../../../org/apache/beam/sdk/coders/Coder.html#verifyDeterministic--"><code>Coder.verifyDeterministic()</code></a>). If the key <code>Coder</code> is not
deterministic, an exception is thrown at pipeline construction time.
<p>By default, the <code>Coder</code> of the keys of the output <code>PCollection</code> is the same as
that of the keys of the input, and the <code>Coder</code> of the elements of the <code>Iterable</code>
values of the output <code>PCollection</code> is the same as the <code>Coder</code> of the values of the
input.
<p>Example of use:
<pre><code>
PCollection&lt;KV&lt;String, Doc&gt;&gt; urlDocPairs = ...;
PCollection&lt;KV&lt;String, Iterable&lt;Doc&gt;&gt;&gt; urlToDocs =
urlDocPairs.apply(GroupByKey.&lt;String, Doc&gt;create());
PCollection&lt;R&gt; results =
urlToDocs.apply(ParDo.of(new DoFn&lt;KV&lt;String, Iterable&lt;Doc&gt;&gt;, R&gt;() {
{@literal @}ProcessElement
public void processElement(ProcessContext c) {
String url = c.element().getKey();
Iterable&lt;Doc&gt; docsWithThatUrl = c.element().getValue();
... process all docs having that url ...
}}));
</code></pre>
<p><code>GroupByKey</code> is a key primitive in data-parallel processing, since it is the main way to
efficiently bring associated data together into one location. It is also a key determiner of the
performance of a data-parallel pipeline.
<p>See <a href="../../../../../org/apache/beam/sdk/transforms/join/CoGroupByKey.html" title="class in org.apache.beam.sdk.transforms.join"><code>CoGroupByKey</code></a> for a way to group multiple input
PCollections by a common key at once.
<p>See <a href="../../../../../org/apache/beam/sdk/transforms/Combine.PerKey.html" title="class in org.apache.beam.sdk.transforms"><code>Combine.PerKey</code></a> for a common pattern of <code>GroupByKey</code> followed by <a href="../../../../../org/apache/beam/sdk/transforms/Combine.GroupedValues.html" title="class in org.apache.beam.sdk.transforms"><code>Combine.GroupedValues</code></a>.
<p>When grouping, windows that can be merged according to the <a href="../../../../../org/apache/beam/sdk/transforms/windowing/WindowFn.html" title="class in org.apache.beam.sdk.transforms.windowing"><code>WindowFn</code></a> of the input
<code>PCollection</code> will be merged together, and a window pane corresponding to the new, merged
window will be created. The items in this pane will be emitted when a trigger fires. By default
this will be when the input sources estimate there will be no more data for the window. See
<a href="../../../../../org/apache/beam/sdk/transforms/windowing/AfterWatermark.html" title="class in org.apache.beam.sdk.transforms.windowing"><code>AfterWatermark</code></a> for details on the estimation.
<p>The timestamp for each emitted pane is determined by the <a href="../../../../../org/apache/beam/sdk/transforms/windowing/Window.html#withTimestampCombiner-org.apache.beam.sdk.transforms.windowing.TimestampCombiner-"><code>Window.withTimestampCombiner(TimestampCombiner)</code></a> windowing operation}. The output <code>PCollection</code> will have the same <a href="../../../../../org/apache/beam/sdk/transforms/windowing/WindowFn.html" title="class in org.apache.beam.sdk.transforms.windowing"><code>WindowFn</code></a> as the input.
<p>If the input <code>PCollection</code> contains late data or the <a href="../../../../../org/apache/beam/sdk/transforms/windowing/Window.html#triggering-org.apache.beam.sdk.transforms.windowing.Trigger-"><code>requested
TriggerFn</code></a> can fire before the watermark, then there may be multiple elements output by a <code>GroupByKey</code> that correspond to the same key and window.
<p>If the <a href="../../../../../org/apache/beam/sdk/transforms/windowing/WindowFn.html" title="class in org.apache.beam.sdk.transforms.windowing"><code>WindowFn</code></a> of the input requires merging, it is not valid to apply another <code>GroupByKey</code> without first applying a new <a href="../../../../../org/apache/beam/sdk/transforms/windowing/WindowFn.html" title="class in org.apache.beam.sdk.transforms.windowing"><code>WindowFn</code></a> or applying <a href="../../../../../org/apache/beam/sdk/transforms/windowing/Window.html#remerge--"><code>Window.remerge()</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../serialized-form.html#org.apache.beam.sdk.transforms.GroupByKey">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== 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></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 void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#applicableTo-org.apache.beam.sdk.values.PCollection-">applicableTo</a></span>(<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;?&gt;&nbsp;input)</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="class in org.apache.beam.sdk.transforms">GroupByKey</a>&lt;K,V&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#create--">create</a></span>()</code>
<div class="block">Returns a <code>GroupByKey&lt;K, V&gt;</code> <code>PTransform</code>.</div>
</td>
</tr>
<tr id="i2" 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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</a>&gt;&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</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="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#fewKeys--">fewKeys</a></span>()</code>
<div class="block">Returns whether it groups just few keys.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;V&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#getInputValueCoder-org.apache.beam.sdk.coders.Coder-">getInputValueCoder</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V&gt;&gt;&nbsp;inputCoder)</code>
<div class="block">Returns the <code>Coder</code> of the values of the input to this transform.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;K&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#getKeyCoder-org.apache.beam.sdk.coders.Coder-">getKeyCoder</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V&gt;&gt;&nbsp;inputCoder)</code>
<div class="block">Returns the <code>Coder</code> of the keys of the input to this transform, which is also used as the
<code>Coder</code> of the keys of the output of this transform.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/coders/KvCoder.html" title="class in org.apache.beam.sdk.coders">KvCoder</a>&lt;K,java.lang.Iterable&lt;V&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#getOutputKvCoder-org.apache.beam.sdk.coders.Coder-">getOutputKvCoder</a></span>(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V&gt;&gt;&nbsp;inputCoder)</code>
<div class="block">Returns the <code>Coder</code> of the output of this transform.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</a></span>(<a href="../../../../../org/apache/beam/sdk/transforms/display/DisplayData.Builder.html" title="interface in org.apache.beam.sdk.transforms.display">DisplayData.Builder</a>&nbsp;builder)</code>
<div class="block">Register display data for the given transform or component.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/values/WindowingStrategy.html" title="class in org.apache.beam.sdk.values">WindowingStrategy</a>&lt;?,?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html#updateWindowingStrategy-org.apache.beam.sdk.values.WindowingStrategy-">updateWindowingStrategy</a></span>(<a href="../../../../../org/apache/beam/sdk/values/WindowingStrategy.html" title="class in org.apache.beam.sdk.values">WindowingStrategy</a>&lt;?,?&gt;&nbsp;inputStrategy)</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#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#toString--">toString</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#validate-org.apache.beam.sdk.options.PipelineOptions-">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="create--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="class in org.apache.beam.sdk.transforms">GroupByKey</a>&lt;K,V&gt;&nbsp;create()</pre>
<div class="block">Returns a <code>GroupByKey&lt;K, V&gt;</code> <code>PTransform</code>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - the type of the keys of the input and output <code>PCollection</code>s</dd>
<dd><code>V</code> - the type of the values of the input <code>PCollection</code> and the elements of the
<code>Iterable</code>s in the output <code>PCollection</code></dd>
</dl>
</li>
</ul>
<a name="fewKeys--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fewKeys</h4>
<pre>public&nbsp;boolean&nbsp;fewKeys()</pre>
<div class="block">Returns whether it groups just few keys.</div>
</li>
</ul>
<a name="applicableTo-org.apache.beam.sdk.values.PCollection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applicableTo</h4>
<pre>public static&nbsp;void&nbsp;applicableTo(<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;?&gt;&nbsp;input)</pre>
</li>
</ul>
<a name="updateWindowingStrategy-org.apache.beam.sdk.values.WindowingStrategy-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateWindowingStrategy</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/values/WindowingStrategy.html" title="class in org.apache.beam.sdk.values">WindowingStrategy</a>&lt;?,?&gt;&nbsp;updateWindowingStrategy(<a href="../../../../../org/apache/beam/sdk/values/WindowingStrategy.html" title="class in org.apache.beam.sdk.values">WindowingStrategy</a>&lt;?,?&gt;&nbsp;inputStrategy)</pre>
</li>
</ul>
<a name="expand-org.apache.beam.sdk.values.PCollection-">
<!-- -->
</a>
<ul class="blockList">
<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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</a>&gt;&gt;&gt;&gt;</code></dd>
</dl>
</li>
</ul>
<a name="getKeyCoder-org.apache.beam.sdk.coders.Coder-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKeyCoder</h4>
<pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;K&gt;&nbsp;getKeyCoder(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V&gt;&gt;&nbsp;inputCoder)</pre>
<div class="block">Returns the <code>Coder</code> of the keys of the input to this transform, which is also used as the
<code>Coder</code> of the keys of the output of this transform.</div>
</li>
</ul>
<a name="getInputValueCoder-org.apache.beam.sdk.coders.Coder-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInputValueCoder</h4>
<pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;V&gt;&nbsp;getInputValueCoder(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V&gt;&gt;&nbsp;inputCoder)</pre>
<div class="block">Returns the <code>Coder</code> of the values of the input to this transform.</div>
</li>
</ul>
<a name="getOutputKvCoder-org.apache.beam.sdk.coders.Coder-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOutputKvCoder</h4>
<pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/coders/KvCoder.html" title="class in org.apache.beam.sdk.coders">KvCoder</a>&lt;K,java.lang.Iterable&lt;V&gt;&gt;&nbsp;getOutputKvCoder(<a href="../../../../../org/apache/beam/sdk/coders/Coder.html" title="class in org.apache.beam.sdk.coders">Coder</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V&gt;&gt;&nbsp;inputCoder)</pre>
<div class="block">Returns the <code>Coder</code> of the output of this transform.</div>
</li>
</ul>
<a name="populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>populateDisplayData</h4>
<pre>public&nbsp;void&nbsp;populateDisplayData(<a href="../../../../../org/apache/beam/sdk/transforms/display/DisplayData.Builder.html" title="interface in org.apache.beam.sdk.transforms.display">DisplayData.Builder</a>&nbsp;builder)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">PTransform</a></code></span></div>
<div class="block">Register display data for the given transform or component.
<p><code>populateDisplayData(DisplayData.Builder)</code> is invoked by Pipeline runners to collect
display data via <a href="../../../../../org/apache/beam/sdk/transforms/display/DisplayData.html#from-org.apache.beam.sdk.transforms.display.HasDisplayData-"><code>DisplayData.from(HasDisplayData)</code></a>. Implementations may call <code>super.populateDisplayData(builder)</code> in order to register display data in the current namespace,
but should otherwise use <code>subcomponent.populateDisplayData(builder)</code> to use the namespace
of the subcomponent.
<p>By default, does not register any display data. Implementors may override this method to
provide their own display data.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html" title="interface in org.apache.beam.sdk.transforms.display">HasDisplayData</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</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/GroupByKey.html" title="type parameter in GroupByKey">K</a>,java.lang.Iterable&lt;<a href="../../../../../org/apache/beam/sdk/transforms/GroupByKey.html" title="type parameter in GroupByKey">V</a>&gt;&gt;&gt;&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>builder</code> - The builder to populate with display data.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html" title="interface in org.apache.beam.sdk.transforms.display"><code>HasDisplayData</code></a></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/Flatten.PCollections.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.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/GroupByKey.html" target="_top">Frames</a></li>
<li><a href="GroupByKey.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>Nested&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>