public class Count
extends java.lang.Object
Count.PerElement can be used to count the number of occurrences of each
distinct element in the PCollection. Count.Globally can
be used to count the total number of elements in a PCollection.| Modifier and Type | Class and Description |
|---|---|
static class |
Count.Globally<T>
Count.Globally<T> takes a PCollection<T> and returns a
PCollection<Long> containing a single element that is the total
number of elements in the PCollection. |
static class |
Count.PerElement<T>
Count.PerElement<T> takes a PCollection<T> and returns a
PCollection<KV<T, Long>> representing a map from each
distinct element of the input PCollection to the number of times
that element occurs in the input. |
| Constructor and Description |
|---|
Count() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Count.Globally<T> |
globally()
|
static <T> Count.PerElement<T> |
perElement()
Returns a
Count.PerElement PTransform
that counts the number of occurrences of each element in its
input PCollection. |
public static <T> Count.Globally<T> globally()
Count.Globally PTransform
that counts the number of elements in its input PCollection.
See Count.Globally for more details.
public static <T> Count.PerElement<T> perElement()
Count.PerElement PTransform
that counts the number of occurrences of each element in its
input PCollection.
See Count.PerElement for more details.