@Internal public final class MailboxExecutorImpl extends Object implements MailboxExecutor
MailboxExecutor.MailOptions
EMPTY_ARGS
Constructor and Description |
---|
MailboxExecutorImpl(TaskMailbox mailbox,
int priority,
StreamTaskActionExecutor actionExecutor) |
MailboxExecutorImpl(TaskMailbox mailbox,
int priority,
StreamTaskActionExecutor actionExecutor,
MailboxProcessor mailboxProcessor) |
Modifier and Type | Method and Description |
---|---|
void |
execute(MailboxExecutor.MailOptions mailOptions,
ThrowingRunnable<? extends Exception> command,
String descriptionFormat,
Object... descriptionArgs)
Executes the given command at some time in the future in the mailbox thread.
|
boolean |
isIdle() |
boolean |
shouldInterrupt()
Return if operator/function should interrupt a longer computation and return from the
currently processed elemenent/watermark, for example in order to let Flink perform a
checkpoint.
|
boolean |
tryYield()
This method attempts to run the command at the head of the mailbox.
|
void |
yield()
This method starts running the command at the head of the mailbox and is intended to be used
by the mailbox thread to yield from a currently ongoing action to another command.
|
public MailboxExecutorImpl(@Nonnull TaskMailbox mailbox, int priority, StreamTaskActionExecutor actionExecutor)
public MailboxExecutorImpl(@Nonnull TaskMailbox mailbox, int priority, StreamTaskActionExecutor actionExecutor, MailboxProcessor mailboxProcessor)
public boolean isIdle()
public void execute(MailboxExecutor.MailOptions mailOptions, ThrowingRunnable<? extends Exception> command, String descriptionFormat, Object... descriptionArgs)
MailboxExecutor
An optional description can (and should) be added to ease debugging and error-reporting.
The description may contain placeholder that refer to the provided description arguments
using Formatter
syntax. The actual description is only formatted on demand.
execute
in interface MailboxExecutor
mailOptions
- additional options to configure behaviour of the command
command
- the runnable task to add to the mailbox for execution.descriptionFormat
- the optional description for the command that is used for debugging
and error-reporting.descriptionArgs
- the parameters used to format the final description string.public void yield() throws InterruptedException
MailboxExecutor
yield
in interface MailboxExecutor
InterruptedException
- on interruption.public boolean tryYield()
MailboxExecutor
tryYield
in interface MailboxExecutor
public boolean shouldInterrupt()
MailboxExecutor
shouldInterrupt
in interface MailboxExecutor
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.