5959import org .apache .beam .sdk .transforms .WithKeys ;
6060import org .apache .beam .sdk .transforms .splittabledofn .OffsetRangeTracker ;
6161import org .apache .beam .sdk .transforms .splittabledofn .RestrictionTracker ;
62- import org .apache .beam .sdk .transforms .windowing .AfterPane ;
63- import org .apache .beam .sdk .transforms .windowing .AfterProcessingTime ;
6462import org .apache .beam .sdk .transforms .windowing .AfterWatermark ;
6563import org .apache .beam .sdk .transforms .windowing .FixedWindows ;
6664import org .apache .beam .sdk .transforms .windowing .Window ;
@@ -85,8 +83,8 @@ public class S3Import {
8583 private static Integer BATCH_SIZE = 520000 ;
8684 private static Integer DLP_PAYLOAD_LIMIT = 524288 ;
8785 private static final String BQ_TABLE_NAME = String .valueOf ("S3_DLP_INSPECT_FINDINGS" );
88- private static final Duration DEFAULT_POLL_INTERVAL = Duration .standardSeconds (30 );
89- private static final Duration WINDOW_INTERVAL = Duration .standardSeconds (5 );
86+ private static final Duration DEFAULT_POLL_INTERVAL = Duration .standardSeconds (60 );
87+ private static final Duration WINDOW_INTERVAL = Duration .standardSeconds (10 );
9088 private static final DateTimeFormatter TIMESTAMP_FORMATTER =
9189 DateTimeFormat .forPattern ("yyyy-MM-dd HH:mm:ss.SSSSSS" );
9290
@@ -122,12 +120,7 @@ public static void main(String[] args) {
122120 s3Files .apply (
123121 "Fixed Window" ,
124122 Window .<KV <String , ReadableFile >>into (FixedWindows .of (WINDOW_INTERVAL ))
125- .triggering (
126- AfterWatermark .pastEndOfWindow ()
127- .withEarlyFirings (
128- AfterProcessingTime .pastFirstElementInPane ()
129- .plusDelayOf (Duration .standardSeconds (10 )))
130- .withLateFirings (AfterPane .elementCountAtLeast (1 )))
123+ .triggering (AfterWatermark .pastEndOfWindow ())
131124 .discardingFiredPanes ()
132125 .withAllowedLateness (Duration .ZERO ));
133126
@@ -275,7 +268,6 @@ public void processElement(ProcessContext c) throws IOException {
275268
276269 try (DlpServiceClient dlpServiceClient = DlpServiceClient .create ()) {
277270 if (!c .element ().getValue ().isEmpty ()) {
278-
279271 ContentItem contentItem =
280272 ContentItem .newBuilder ().setValue (c .element ().getValue ()).build ();
281273 this .requestBuilder .setItem (contentItem );
0 commit comments