You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/04/07 19:51:02 UTC

[GitHub] [beam] johnjcasey commented on a diff in pull request #17305: [BEAM-14267] Update watchForNewFiles to allow watching updated files

johnjcasey commented on code in PR #17305:
URL: https://github.com/apache/beam/pull/17305#discussion_r845239477


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileIO.java:
##########
@@ -627,16 +677,32 @@ public MatchAll continuously(
                 "Match filepatterns",
                 ParDo.of(new MatchFn(getConfiguration().getEmptyMatchTreatment())));
       } else {
-        res =
-            input
-                .apply(
-                    "Continuously match filepatterns",
-                    Watch.growthOf(
-                            Contextful.of(new MatchPollFn(), Requirements.empty()),
-                            new ExtractFilenameFn())
-                        .withPollInterval(getConfiguration().getWatchInterval())
-                        .withTerminationPerInput(getConfiguration().getWatchTerminationCondition()))
-                .apply(Values.create());
+        if (getConfiguration().getMatchUpdatedFiles()) {
+          res =

Review Comment:
   Because most of this code is duplicated, we should try and inspect .getMatchUpdatedFiles further in, or we should extract the duplicated code into a helper method



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org