pnowojski commented on a change in pull request #10252: [FLINK-14857] 
[runtime/task] deprecate StreamTask.getCheckpointLock m…
URL: https://github.com/apache/flink/pull/10252#discussion_r348955562
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
 ##########
 @@ -715,7 +715,18 @@ String getTaskNameWithSubtaskAndId() {
        /**
         * Gets the lock object on which all operations that involve data and 
state mutation have to lock.
         * @return The checkpoint lock object.
+        * @deprecated This method will be removed in future releases. Use 
{@linkplain MailboxExecutor mailbox executor}
+        * to run {@link StreamTask} actions that require synchronization (e.g. 
checkpointing, collecting output).
+        * <p>
+        * For other (non-{@link StreamTask}) actions other synchronization 
means can be used.
+        * </p>
+        * MailboxExecutor {@link MailboxExecutor#yield() yield} or {@link 
MailboxExecutor#tryYield() tryYield} methods can
+        * be used for actions that should give control to other actions 
temporarily.
+        * <p>
+        * Example use of {@linkplain MailboxExecutor mailbox executor} can be 
found in {@link 
org.apache.flink.streaming.api.operators.async.AsyncWaitOperator 
AsyncWaitOperator}.
 
 Review comment:
   nit: Could you add a reference to `YieldingOperatorFactory`?
   +/- ?
   ```
   MailboxExecutor can be accessed by using YieldingOperatorFactory. Example 
usage can be found in AsyncWaitOperator.
   ```

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