Count { public static <T> PTransform<PCollection<T>, PCollection<Long>> globally() { return Combine.globally(new CountFn<T>()); } private  Count(); static CombineFn<T, ?, Long> combineFn(); static PTransform<PCollection<T>, PCollection<Long>> globally(); static PTransform<PCollection<KV<K, V>>, PCollection<KV<K, Long>>> perKey(); static PTransform<PCollection<T>, PCollection<KV<T, Long>>> perElement();  }
@Test @Category(NeedsRunner.class) public void testCountGloballyBasic() { PCollection<String> input = p.apply(Create.of(WORDS)); PCollection<Long> output = input.apply(Count.globally()); PAssert.that(output).containsInAnyOrder(13L); p.run(); }
@Test @Category(NeedsRunner.class) public void testCountGloballyEmpty() { PCollection<String> input = p.apply(Create.of(NO_LINES).withCoder(StringUtf8Coder.of())); PCollection<Long> output = input.apply(Count.globally()); PAssert.that(output).containsInAnyOrder(0L); p.run(); }