[
https://issues.apache.org/jira/browse/BEAM-5605?focusedWorklogId=369941&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-369941
]
ASF GitHub Bot logged work on BEAM-5605:
----------------------------------------
Author: ASF GitHub Bot
Created on: 10/Jan/20 17:38
Start Date: 10/Jan/20 17:38
Worklog Time Spent: 10m
Work Description: lukecwik 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_r365350253
##########
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:
Yes, fixed in the version below.
I'm relying on the migration to using SDF everywhere will catch the edge
cases via the validates runner tests since unit testing the execution of a
single instance is quite verbose.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 369941)
Time Spent: 4h 50m (was: 4h 40m)
> 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 50m
> 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)