예제 #1
0
 @Override
 public PCollectionView<Iterable<T>> apply(PCollection<T> input) {
   return input.apply(
       CreatePCollectionView.<T, Iterable<T>>of(
           PCollectionViews.iterableView(
               input.getPipeline(), input.getWindowingStrategy(), input.getCoder())));
 }
    @Override
    public PDone apply(PCollection<Integer> input) {
      // Apply an operation so that this is a composite transform.
      input.apply(Count.<Integer>perElement());

      return PDone.in(input.getPipeline());
    }
예제 #3
0
 @Override
 public PDone apply(PCollection<T> input) {
   if (topic == null) {
     throw new IllegalStateException("need to set the topic of a PubsubIO.Write transform");
   }
   return PDone.in(input.getPipeline());
 }
    @Override
    public PCollection<Integer> apply(PCollection<Integer> input) {
      // Apply an operation so that this is a composite transform.
      input.apply(Count.<Integer>perElement());

      // Return a value unrelated to the input.
      return input.getPipeline().apply(Create.of(1, 2, 3, 4));
    }
예제 #5
0
 @Override
 public PCollectionView<T> apply(PCollection<T> input) {
   return input.apply(
       CreatePCollectionView.<T, T>of(
           PCollectionViews.singletonView(
               input.getPipeline(),
               input.getWindowingStrategy(),
               hasDefault,
               defaultValue,
               input.getCoder())));
 }
    @Override
    public PCollectionTuple apply(PCollection<Integer> input) {
      PCollection<Integer> sum = input.apply(Sum.integersGlobally());

      // Fails here when attempting to construct a tuple with an unbound object.
      return PCollectionTuple.of(sumTag, sum)
          .and(
              doneTag,
              PCollection.<Void>createPrimitiveOutputInternal(
                  input.getPipeline(), WindowingStrategy.globalDefault(), input.isBounded()));
    }
 @Override
 public PCollection<String> apply(PCollection<String> input) {
   return PCollection.createPrimitiveOutputInternal(
       input.getPipeline(), WindowingStrategy.globalDefault(), input.isBounded());
 }