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 2020/04/23 05:16:53 UTC

[GitHub] [beam] lukecwik commented on a change in pull request #11472: [BEAM-2939] Migrate from HasSize to HasProgress interface for restriction trackers and use the progress value during sizing, splitting and reporting

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



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java
##########
@@ -397,12 +396,14 @@ public WatermarkEstimatorStateT getState() {
   }
 
   public static class DefaultGetSize {
-    /** Uses {@link Sizes.HasSize} to produce the size. */
+    /** Uses {@link HasProgress} to produce the size. */
     @SuppressWarnings("unused")
     public static <InputT, OutputT> double invokeGetSize(
         DoFnInvoker.ArgumentProvider<InputT, OutputT> argumentProvider) {
-      if (argumentProvider.restrictionTracker() instanceof HasSize) {
-        return ((HasSize) argumentProvider.restrictionTracker()).getSize();
+      if (argumentProvider.restrictionTracker() instanceof HasProgress) {

Review comment:
       DoFn can provide a method annotated with `@GetSize` and the fallback is the HasProgress on the RestrictionTracker. This is analogous to RestrictionProvider/RProvider being able to provide the size while the RestrictionTracker/RTracker provide progress in Python/Go.




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

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