PCollectionList (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1


Class PCollectionList<T>

  • Type Parameters:
    T - the type of the elements of all the PCollections in this list
    All Implemented Interfaces:
    PInput, POutput

    public class PCollectionList<T>
    extends Object
    implements PInput, POutput
    A PCollectionList<T> is an immutable list of homogeneously typed PCollection<T>s. A PCollectionList is used, for instance, as the input to Flatten or the output of Partition.

    PCollectionLists can be created and accessed like follows:

     PCollection<String> pc1 = ...;
     PCollection<String> pc2 = ...;
     PCollection<String> pc3 = ...;
     // Create a PCollectionList with three PCollections:
     PCollectionList<String> pcs = PCollectionList.of(pc1).and(pc2).and(pc3);
     // Create an empty PCollectionList:
     Pipeline p = ...;
     PCollectionList<String> pcs2 = PCollectionList.<String>empty(p);
     // Get PCollections out of a PCollectionList, by index (origin 0):
     PCollection<String> pcX = pcs.get(1);
     PCollection<String> pcY = pcs.get(0);
     PCollection<String> pcZ = pcs.get(2);
     // Get a list of all PCollections in a PCollectionList:
     List<PCollection<String>> allPcs = pcs.getAll();