[ 
https://issues.apache.org/jira/browse/BEAM-14129?focusedWorklogId=745389&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-745389
 ]

ASF GitHub Bot logged work on BEAM-14129:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Mar/22 19:28
            Start Date: 21/Mar/22 19:28
    Worklog Time Spent: 10m 
      Work Description: dpcollins-google commented on a change in pull request 
#17103:
URL: https://github.com/apache/beam/pull/17103#discussion_r831470697



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/internal/SubscriptionPartitionLoader.java
##########
@@ -74,28 +157,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());
-                      }
-                    })
-                .withPollInterval(pollDuration)
-                .withTerminationPerInput(
-                    terminate ? Watch.Growth.afterIterations(10) : 
Watch.Growth.never()));
-    return partitions.apply(
-        MapElements.into(TypeDescriptor.of(SubscriptionPartition.class))
-            .via(kv -> SubscriptionPartition.of(subscription, kv.getValue())));
+    return input
+        .apply(Create.of(Collections.<Void>singletonList(null)))

Review comment:
       Done.

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/internal/SubscriptionPartitionLoader.java
##########
@@ -74,28 +157,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());
-                      }
-                    })
-                .withPollInterval(pollDuration)
-                .withTerminationPerInput(
-                    terminate ? Watch.Growth.afterIterations(10) : 
Watch.Growth.never()));
-    return partitions.apply(
-        MapElements.into(TypeDescriptor.of(SubscriptionPartition.class))
-            .via(kv -> SubscriptionPartition.of(subscription, kv.getValue())));
+    return input
+        .apply(Create.of(Collections.<Void>singletonList(null)))
+        .apply(ParDo.of(new GeneratorFn()));

Review comment:
       Done.




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 745389)
    Time Spent: 10h 10m  (was: 10h)

> Fix issues with Pub/Sub Lite IO at high volumes
> -----------------------------------------------
>
>                 Key: BEAM-14129
>                 URL: https://issues.apache.org/jira/browse/BEAM-14129
>             Project: Beam
>          Issue Type: Task
>          Components: io-java-gcp
>            Reporter: Daniel Collins
>            Assignee: Daniel Collins
>            Priority: P1
>             Fix For: 2.38.0
>
>          Time Spent: 10h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to