pnowojski commented on a change in pull request #16531:
URL: https://github.com/apache/flink/pull/16531#discussion_r673387750
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/mailbox/FutureTaskWithException.java
##########
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package org.apache.flink.runtime.concurrent;
+package org.apache.flink.runtime.mailbox;
Review comment:
Why did you move this one? As long as it stays in `flink-runtime` I
think it makes more sense to have it in the same package as for example
`FutureTask`.
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/execution/Environment.java
##########
@@ -37,6 +37,7 @@
import org.apache.flink.runtime.jobgraph.JobVertexID;
Review comment:
nit: can you copy paste PR description into the commit message?
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/RuntimeEnvironment.java
##########
@@ -92,6 +94,10 @@
private final Task containingTask;
+ private MailboxExecutor mainMailboxExecutor;
Review comment:
`@Nullable` and ditto for `asyncOperationsThreadPool` an
`MockEnvironment`
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/execution/Environment.java
##########
@@ -232,4 +234,20 @@ void acknowledgeCheckpoint(
IndexedInputGate[] getAllInputGates();
TaskEventDispatcher getTaskEventDispatcher();
+
+ //
--------------------------------------------------------------------------------------------
+ // Fields set in the StreamTask to provide access to mailbox and other
runtime resources
+ //
--------------------------------------------------------------------------------------------
+
+ default void setMainMailboxExecutor(MailboxExecutor mainMailboxExecutor) {}
+
+ default MailboxExecutor getMainMailboxExecutor() {
Review comment:
```
Optional<MailboxExecutor> getMainMailboxExecutor() { return
Optional.empty(); };
```
? and ditto for `getAsyncOperationsThreadPool()`?
Currently this is unchecked `@Nullable`, and `Optional` would solve compile
time checks plus solve the problem with `UnsupportedOperationException()`;
Or maybe keep it `MailboxExecutor getMainMailboxExecutor()` but internally
inside the implementation do :
```
public MailboxExecutor getMainMailboxExecutor() {
checkState(mailboxExecutor != null, "Trying to access not yet initialized
mailbox");
return mailboxExecutor;
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]