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/03/18 21:53:50 UTC

[GitHub] [beam] dpcollins-google commented on a change in pull request #17103: [BEAM-14129] Restructure SubscriptionPartitionLoader to use a manual SDF so its watermarks are reasonable given the polling semantics

dpcollins-google commented on a change in pull request #17103:
URL: https://github.com/apache/beam/pull/17103#discussion_r830371879



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/internal/SubscriptionPartitionLoader.java
##########
@@ -74,28 +156,8 @@
 
   @Override
   public PCollection<SubscriptionPartition> expand(PBegin input) {
-    PCollection<TopicPath> start = input.apply(Create.of(ImmutableList.of(topic)));
-    PCollection<KV<TopicPath, Partition>> partitions =
-        start.apply(
-            Watch.growthOf(
-                    new PollFn<TopicPath, Partition>() {
-                      @Override
-                      public PollResult<Partition> apply(TopicPath element, Context c) {
-                        checkArgument(element.equals(topic));
-                        int partitionCount = getPartitionCount.apply(element);
-                        List<Partition> partitions =
-                            IntStream.range(0, partitionCount)
-                                .mapToObj(Partition::of)
-                                .collect(Collectors.toList());
-                        return PollResult.incomplete(Instant.now(), partitions)
-                            .withWatermark(Instant.now());

Review comment:
       No, since it exports the first successful poll at EPOCH. This is important because it prevents data which exists on the partition before the pipeline starts from being late.




-- 
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