Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.transforms
Class Count
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.Count
-
public class Count extends Object
PTransorm
s to count the elements in aPCollection
.perElement()
can be used to count the number of occurrences of each distinct element in the PCollection,perKey()
can be used to count the number of values per key, andglobally()
can be used to count the total number of elements in a PCollection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
Count.PerElement<T>
Count.PerElement<T>
takes aPCollection<T>
and returns aPCollection<KV<T, Long>>
representing a map from each distinct element of the inputPCollection
to the number of times that element occurs in the input.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static <T> Combine.Globally<T,Long>
globally()
static <T> Count.PerElement<T>
perElement()
Returns aCount.PerElement
PTransform
that counts the number of occurrences of each element in its inputPCollection
.static <K,V> Combine.PerKey<K,V,Long>
perKey()
Returns aCombine.PerKey
PTransform
that counts the number of elements associated with each key of its inputPCollection
.
-
-
-
Method Detail
-
globally
public static <T> Combine.Globally<T,Long> globally()
-
perKey
public static <K,V> Combine.PerKey<K,V,Long> perKey()
Returns aCombine.PerKey
PTransform
that counts the number of elements associated with each key of its inputPCollection
.
-
perElement
public static <T> Count.PerElement<T> perElement()
Returns aCount.PerElement
PTransform
that counts the number of occurrences of each element in its inputPCollection
.See
Count.PerElement
for more details.
-
-