lukecwik commented on a change in pull request #17103:
URL: https://github.com/apache/beam/pull/17103#discussion_r830322682



##########
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:
       Wouldn't your new SDF be the same as changing this one line here to be 
`Instant.now().minus(watermarkDelay());`?
   
   It would be best to re-use Watch if possible.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to