title: How to reshuffle a PCollection<T>?
body: <p>I am trying to implement a <code>Reshuffle</code> transform to prevent <a href="https://cloud.google.com/dataflow/service/dataflow-service-desc#preventing-fusion" rel="nofollow noreferrer">excessive fusion</a>, but I don't know how to alter the version for <code>&lt;KV&lt;String,String&gt;&gt;</code> to deal with simple PCollections. (How to reshuffle  <code>PCollection &lt;KV&lt;String,String&gt;&gt;</code> is described <a href="https://stackoverflow.com/questions/39578932/reading-multiple-gz-file-and-identifying-which-row-belongs-to-which-file">here</a>.)</p>
  
  <p>How would I expand the official Avro I/O <a href="https://cloud.google.com/dataflow/model/avro-io#reading-with-avroio" rel="nofollow noreferrer">example code</a> to reshuffle before adding more steps in my pipeline?</p>
  
  <pre><code>PipelineOptions options = PipelineOptionsFactory.create();
  Pipeline p = Pipeline.create(options);
  
  Schema schema = new Schema.Parser().parse(new File("schema.avsc"));
  
  PCollection&lt;GenericRecord&gt; records =
      p.apply(AvroIO.Read.named("ReadFromAvro")
          .from("gs://my_bucket/path/records-*.avro")
          .withSchema(schema));
  </code></pre>