public static <W extends BoundedWindow> TriggerTester<Integer, Iterable<Integer>, W> nonCombining( WindowingStrategy<?, W> windowingStrategy) throws Exception { return new TriggerTester<Integer, Iterable<Integer>, W>( windowingStrategy, SystemReduceFn.<String, Integer, W>buffering(VarIntCoder.of()).create(KEY), IterableCoder.of(VarIntCoder.of())); }
@Test(dataProvider = "bases") public void addContextDataTest( List<GATKRead> reads, List<Variant> variantList, List<KV<GATKRead, ReferenceBases>> kvReadRefBases, List<KV<GATKRead, ReadContextData>> kvReadContextData, List<SimpleInterval> intervals, List<KV<GATKRead, Iterable<Variant>>> kvReadiVariant) { Pipeline p = GATKTestPipeline.create(); DataflowUtils.registerGATKCoders(p); PCollection<GATKRead> pReads = DataflowTestUtils.pCollectionCreateAndVerify(p, reads, new GATKReadCoder()); PCollection<KV<GATKRead, ReferenceBases>> pReadRef = DataflowTestUtils.pCollectionCreateAndVerify( p, kvReadRefBases, KvCoder.of(new GATKReadCoder(), SerializableCoder.of(ReferenceBases.class))); PCollection<KV<GATKRead, Iterable<Variant>>> pReadVariants = p.apply( Create.of(kvReadiVariant) .withCoder(KvCoder.of(new GATKReadCoder(), IterableCoder.of(new VariantCoder())))); PCollection<KV<GATKRead, ReadContextData>> joinedResults = AddContextDataToRead.join(pReads, pReadRef, pReadVariants); PCollection<KV<GATKRead, ReadContextData>> pkvReadContextData = p.apply( Create.of(kvReadContextData) .withCoder(KvCoder.of(new GATKReadCoder(), new ReadContextDataCoder()))); DataflowTestUtils.keyReadContextDataMatcher(joinedResults, pkvReadContextData); p.run(); }