[ https://issues.apache.org/jira/browse/BEAM-5605?focusedWorklogId=369515&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-369515 ]
ASF GitHub Bot logged work on BEAM-5605: ---------------------------------------- Author: ASF GitHub Bot Created on: 10/Jan/20 01:23 Start Date: 10/Jan/20 01:23 Worklog Time Spent: 10m Work Description: youngoli commented on pull request #10535: [BEAM-5605] Add support for executing pair with restriction, split restriction, split and size restriction, process element and restriction and process sized element and restriction within the Java SDK harness. URL: https://github.com/apache/beam/pull/10535#discussion_r365025326 ########## File path: sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java ########## @@ -162,9 +475,127 @@ public void output(OutputT output, Instant timestamp, BoundedWindow window) { outputTo(consumers, WindowedValue.of(output, timestamp, window, PaneInfo.NO_FIRING)); } }; + switch (context.pTransform.getSpec().getUrn()) { + case PTransformTranslation.SPLITTABLE_SPLIT_RESTRICTION_URN: + this.outputSplitRestrictionReceiver = + new OutputReceiver<RestrictionT>() { + + @Override + public void output(RestrictionT output) { + outputTo( + mainOutputConsumers, + (WindowedValue<OutputT>) + currentElement.withValue(KV.of(currentElement.getValue(), output))); + } + + @Override + public void outputWithTimestamp(RestrictionT output, Instant timestamp) { + outputTo( + mainOutputConsumers, + (WindowedValue<OutputT>) + WindowedValue.of( + KV.of(currentElement.getValue(), output), + timestamp, + currentWindow, + currentElement.getPane())); + } + }; + break; + case PTransformTranslation.SPLITTABLE_SPLIT_AND_SIZE_RESTRICTIONS_URN: + this.outputSplitRestrictionReceiver = + new OutputReceiver<RestrictionT>() { + + @Override + public void output(RestrictionT output) { + RestrictionTracker<RestrictionT, PositionT> outputTracker = + doFnInvoker.invokeNewTracker(output); + outputTo( + mainOutputConsumers, + (WindowedValue<OutputT>) + currentElement.withValue( + KV.of( + KV.of(currentElement.getValue(), output), + outputTracker instanceof HasSize + ? ((HasSize) outputTracker).getSize() + : 1.0))); + } + + @Override + public void outputWithTimestamp(RestrictionT output, Instant timestamp) { + outputTo( + mainOutputConsumers, + (WindowedValue<OutputT>) + WindowedValue.of( + KV.of(currentElement.getValue(), output), Review comment: Shouldn't this method also produce sizes, like the `output` method above? ---------------------------------------------------------------- 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 Issue Time Tracking ------------------- Worklog Id: (was: 369515) Time Spent: 4h 40m (was: 4.5h) > Support Portable SplittableDoFn for batch > ----------------------------------------- > > Key: BEAM-5605 > URL: https://issues.apache.org/jira/browse/BEAM-5605 > Project: Beam > Issue Type: New Feature > Components: sdk-java-core > Reporter: Scott Wegner > Assignee: Luke Cwik > Priority: Major > Labels: portability > Time Spent: 4h 40m > Remaining Estimate: 0h > > Roll-up item tracking work towards supporting portable SplittableDoFn for > batch -- This message was sent by Atlassian Jira (v8.3.4#803005)