boyuanzz commented on a change in pull request #11922:
URL: https://github.com/apache/beam/pull/11922#discussion_r436116972
##########
File path:
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
##########
@@ -577,26 +586,83 @@ public Instant timestamp(DoFn<InputT, OutputT> doFn) {
switch (pTransform.getSpec().getUrn()) {
case PTransformTranslation.SPLITTABLE_PROCESS_ELEMENTS_URN:
this.convertSplitResultToWindowedSplitResult =
- (splitResult, watermarkEstimatorState) ->
- WindowedSplitResult.forRoots(
- WindowedValue.of(
- KV.of(
- currentElement.getValue(),
- KV.of(splitResult.getPrimary(),
currentWatermarkEstimatorState)),
- currentElement.getTimestamp(),
- currentWindow,
- currentElement.getPane()),
- WindowedValue.of(
- KV.of(
- currentElement.getValue(),
- KV.of(splitResult.getResidual(),
watermarkEstimatorState)),
- currentElement.getTimestamp(),
- currentWindow,
- currentElement.getPane()));
+ (splitResult, watermarkEstimatorState) -> {
+ List<BoundedWindow> primaryFullyProcessedWindows =
+ ImmutableList.copyOf(
+ Iterables.limit(
+ currentElement.getWindows(),
currentWindowIterator.previousIndex()));
+ // Advances the iterator consuming the remaining windows.
+ List<BoundedWindow> residualUnprocessedWindows =
+ ImmutableList.copyOf(currentWindowIterator);
Review comment:
Ah I see. It's different from what I know about an `Iterator`. Thanks!
----------------------------------------------------------------
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]