Class FakeMailboxExecutor
java.lang.Object
io.github.flink.gcp.connector.testutils.FakeMailboxExecutor
- All Implemented Interfaces:
org.apache.flink.api.common.operators.MailboxExecutor
@Internal
public final class FakeMailboxExecutor
extends Object
implements org.apache.flink.api.common.operators.MailboxExecutor
A queue-backed
MailboxExecutor for tests: execute(org.apache.flink.api.common.operators.MailboxExecutor.MailOptions, org.apache.flink.util.function.ThrowingRunnable<? extends java.lang.Exception>, java.lang.String, java.lang.Object...) enqueues mails, yield() runs the next mail (blocking until one arrives, like the real mailbox), and drain() runs every mail already enqueued.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.api.common.operators.MailboxExecutor
org.apache.flink.api.common.operators.MailboxExecutor.MailOptions -
Field Summary
Fields inherited from interface org.apache.flink.api.common.operators.MailboxExecutor
EMPTY_ARGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrain()Runs every mail already enqueued, mimicking the idle mailbox loop between records.voidexecute(org.apache.flink.api.common.operators.MailboxExecutor.MailOptions options, org.apache.flink.util.function.ThrowingRunnable<? extends Exception> command, String descriptionFormat, Object... descriptionArgs) booleanbooleantryYield()voidyield()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.common.operators.MailboxExecutor
execute, execute, execute, submit, submit, submit, submit
-
Constructor Details
-
FakeMailboxExecutor
public FakeMailboxExecutor()
-
-
Method Details
-
execute
public void execute(org.apache.flink.api.common.operators.MailboxExecutor.MailOptions options, org.apache.flink.util.function.ThrowingRunnable<? extends Exception> command, String descriptionFormat, Object... descriptionArgs) - Specified by:
executein interfaceorg.apache.flink.api.common.operators.MailboxExecutor
-
yield
- Specified by:
yieldin interfaceorg.apache.flink.api.common.operators.MailboxExecutor- Throws:
InterruptedExceptionorg.apache.flink.util.FlinkRuntimeException
-
tryYield
public boolean tryYield() throws org.apache.flink.util.FlinkRuntimeException- Specified by:
tryYieldin interfaceorg.apache.flink.api.common.operators.MailboxExecutor- Throws:
org.apache.flink.util.FlinkRuntimeException
-
shouldInterrupt
public boolean shouldInterrupt()- Specified by:
shouldInterruptin interfaceorg.apache.flink.api.common.operators.MailboxExecutor
-
drain
public void drain()Runs every mail already enqueued, mimicking the idle mailbox loop between records.
-