2626import org .apache .beam .sdk .io .gcp .bigquery .BigQueryIO ;
2727import org .apache .beam .sdk .io .gcp .pubsub .PubsubIO ;
2828import org .apache .beam .sdk .options .PipelineOptionsFactory ;
29+ import org .apache .beam .sdk .transforms .DoFn ;
30+ import org .apache .beam .sdk .transforms .DoFn .ProcessContext ;
31+ import org .apache .beam .sdk .transforms .DoFn .ProcessElement ;
32+ import org .apache .beam .sdk .transforms .ParDo ;
2933import org .apache .beam .sdk .transforms .windowing .AfterProcessingTime ;
3034import org .apache .beam .sdk .transforms .windowing .FixedWindows ;
3135import org .apache .beam .sdk .transforms .windowing .Window ;
@@ -57,22 +61,22 @@ public static PipelineResult run(S3ReaderOptions options) {
5761 .setSubscriber (options .getSubscriber ())
5862 .setDelimeter (options .getDelimeter ())
5963 .setKeyRange (options .getKeyRange ())
60- .build ())
61- .apply (
62- "Fixed Window" ,
63- Window .<KV <String , String >>into (FixedWindows .of (Duration .standardSeconds (1 )))
64- .triggering (
65- AfterProcessingTime .pastFirstElementInPane ().plusDelayOf (Duration .ZERO ))
66- .discardingFiredPanes ()
67- .withAllowedLateness (Duration .ZERO ));
64+ .build ());
65+ // .apply(
66+ // "Fixed Window",
67+ // Window.<KV<String, String>>into(FixedWindows.of(Duration.standardSeconds(10 )))
68+ // .triggering(
69+ // AfterProcessingTime.pastFirstElementInPane().plusDelayOf(Duration.ZERO))
70+ // .discardingFiredPanes()
71+ // .withAllowedLateness(Duration.ZERO));
6872
69- // nonInspectedContents.apply("Print", ParDo.of(new DoFn<KV<String,String>, String>(){
70- //
71- // @ProcessElement
72- // public void processElement(ProcessContext c) {
73- // c.output(c.element().getValue());
74- // }
75- // }));
73+ // nonInspectedContents.apply("Print", ParDo.of(new DoFn<KV<String,String>, String>(){
74+ //
75+ // @ProcessElement
76+ // public void processElement(ProcessContext c) {
77+ // c.output(c.element().getValue());
78+ // }
79+ // }));
7680
7781 PCollectionTuple inspectedData =
7882 nonInspectedContents .apply (
@@ -83,30 +87,30 @@ public static PipelineResult run(S3ReaderOptions options) {
8387 .setBatchSize (options .getBatchSize ())
8488 .build ());
8589
86- PCollection <Row > inspectedContents =
87- inspectedData .get (Util .inspectData ).setRowSchema (Util .bqDataSchema );
88-
89- PCollection <Row > inspectedStats =
90- inspectedData .get (Util .auditData ).setRowSchema (Util .bqAuditSchema );
91-
92- PCollection <Row > auditData =
93- inspectedStats
94- .apply ("FileTrackerTransform" , new AuditInspectDataTransform ())
95- .setRowSchema (Util .bqAuditSchema );
96-
97- auditData .apply (
98- "WriteAuditData" ,
99- BigQueryIO .<Row >write ()
100- .to (options .getAuditTableSpec ())
101- .withMethod (BigQueryIO .Write .Method .STREAMING_INSERTS )
102- .useBeamSchema ()
103- .withoutValidation ()
104- .withWriteDisposition (BigQueryIO .Write .WriteDisposition .WRITE_APPEND )
105- .withCreateDisposition (BigQueryIO .Write .CreateDisposition .CREATE_NEVER ));
106-
107- auditData
108- .apply ("RowToJson" , new RowToJson ())
109- .apply ("WriteToTopic" , PubsubIO .writeStrings ().to (options .getTopic ()));
90+ // PCollection<Row> inspectedContents =
91+ // inspectedData.get(Util.inspectData).setRowSchema(Util.bqDataSchema);
92+ //
93+ // PCollection<Row> inspectedStats =
94+ // inspectedData.get(Util.auditData).setRowSchema(Util.bqAuditSchema);
95+ //
96+ // PCollection<Row> auditData =
97+ // inspectedStats
98+ // .apply("FileTrackerTransform", new AuditInspectDataTransform())
99+ // .setRowSchema(Util.bqAuditSchema);
100+ //
101+ // auditData.apply(
102+ // "WriteAuditData",
103+ // BigQueryIO.<Row>write()
104+ // .to(options.getAuditTableSpec())
105+ // .withMethod(BigQueryIO.Write.Method.STREAMING_INSERTS)
106+ // .useBeamSchema()
107+ // .withoutValidation()
108+ // .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND)
109+ // .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_NEVER));
110+ //
111+ // auditData
112+ // .apply("RowToJson", new RowToJson())
113+ // .apply("WriteToTopic", PubsubIO.writeStrings().to(options.getTopic()));
110114
111115 // inspectedContents.apply(
112116 // "WriteInspectData",
0 commit comments