je-ik commented on a change in pull request #8774: [BEAM-8550] Requires time 
sorted input
URL: https://github.com/apache/beam/pull/8774#discussion_r384664775
 
 

 ##########
 File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/ExecutableStageDoFnOperator.java
 ##########
 @@ -938,4 +938,24 @@ private static void initializeUserState(
     @ProcessElement
     public void doNothing(ProcessContext context) {}
   }
+
+  private static class Locker implements AutoCloseable {
+
+    public static Locker locked(Lock lock) {
+      Locker locker = new Locker(lock);
 
 Review comment:
   I agree, that these changes are not directly related to this PR and we can 
revert them, if necessary.
   If I recall correctly, these changes were part of debugging of state related 
to [FLINK-12653](https://jira.apache.org/jira/browse/FLINK-12653). Just to add 
context, why these changes are there.
   Regarding performance, I think that this change cannot have any measurable 
impact on performance, because creating object in eden space is pretty cheap in 
current JVMs.
   I agree that the `try` - `finally` is working just fine, the locker pattern 
is just a safeguard to prevent someone forgetting add the `finally` clause.
   But as I said, if these changes are undesirable, we can revert them. 
   

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


With regards,
Apache Git Services

Reply via email to