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



##########
File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
##########
@@ -560,7 +560,6 @@ public Instant timestamp(DoFn<InputT, OutputT> doFn) {
         throw new IllegalStateException(
             String.format("Unknown URN %s", pTransform.getSpec().getUrn()));
     }
-    this.onTimerContext = new OnTimerContext();

Review comment:
       The intent of these context objects was to not create a new one when 
processing each element/timer and instead to reference a member variable as can 
be seen in:
   
https://github.com/apache/beam/blob/591de3473144de54beef0932131025e2a4d8504b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java#L1468
   
https://github.com/apache/beam/blob/591de3473144de54beef0932131025e2a4d8504b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java#L1506
   
   It would have made more sense to have OnTimerContext just return 
`currentTimer.getUserKey()`




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


Reply via email to