@Test public void hashIdTest() { final String datasetId = "f349d447-1c92-4637-ab32-8ae559497032"; final List<ExtendedRecord> input = createCollection("0001_1", "0002_2", "0003_3"); final List<ExtendedRecord> expected = createCollection( "20d8ab138ab4c919cbf32f5d9e667812077a0ee4_1", "1122dc31ba32e386e3a36719699fdb5fb1d2912f_2", "f2b1c436ad680263d74bf1498bf7433d9bb4b31a_3"); PCollection<ExtendedRecord> result = p.apply(Create.of(input)).apply(HashIdTransform.create(datasetId)); PAssert.that(result).containsInAnyOrder(expected); p.run(); }
public static SingleOutput<ExtendedRecord, ExtendedRecord> create(String datasetId) { return ParDo.of(new HashIdTransform(datasetId)); }
HashIdTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create(String datasetId) { return ParDo.of(new HashIdTransform(datasetId)); } }
HashIdTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create(String datasetId) { return ParDo.of(new HashIdTransform(datasetId)); }  }
HashIdTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create(String datasetId) { return ParDo.of(new HashIdTransform(datasetId)); }  static SingleOutput<ExtendedRecord, ExtendedRecord> create(String datasetId); @ProcessElement void processElement(@Element ExtendedRecord er, OutputReceiver<ExtendedRecord> out); }
HashIdTransform extends DoFn<ExtendedRecord, ExtendedRecord> { public static SingleOutput<ExtendedRecord, ExtendedRecord> create(String datasetId) { return ParDo.of(new HashIdTransform(datasetId)); }  static SingleOutput<ExtendedRecord, ExtendedRecord> create(String datasetId); @ProcessElement void processElement(@Element ExtendedRecord er, OutputReceiver<ExtendedRecord> out);  }