boyuanzz commented on a change in pull request #12016: URL: https://github.com/apache/beam/pull/12016#discussion_r449734236
########## File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java ########## @@ -95,7 +96,8 @@ void invokeOnTimer( void invokeSplitRestriction(ArgumentProvider<InputT, OutputT> arguments); /** Invoke the {@link TruncateRestriction} method on the bound {@link DoFn}. */ - void invokeTruncateRestriction(ArgumentProvider<InputT, OutputT> arguments); + <RestrictionT> Optional<RestrictionT> invokeTruncateRestriction( Review comment: My intent was to use `Optional.empty()` to represent there is no more work. So we could have 2 options: 1. Use `Optional.empty()` as a notion of no more remaining work and use `Optional.of(value)` as a notion of bounded remaining work. 2. Change the function signature to `@Nullable RestrictionT truncateRestriction()`, where `null` means no more work. I don't have a strong preference over these 2 options. But 2 is more consistent with python. ---------------------------------------------------------------- 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: us...@infra.apache.org