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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Runs every mail already enqueued, mimicking the idle mailbox loop between records.
    void
    execute(org.apache.flink.api.common.operators.MailboxExecutor.MailOptions options, org.apache.flink.util.function.ThrowingRunnable<? extends Exception> command, String descriptionFormat, Object... descriptionArgs)
     
    boolean
     
    boolean
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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:
      execute in interface org.apache.flink.api.common.operators.MailboxExecutor
    • yield

      public void yield() throws InterruptedException, org.apache.flink.util.FlinkRuntimeException
      Specified by:
      yield in interface org.apache.flink.api.common.operators.MailboxExecutor
      Throws:
      InterruptedException
      org.apache.flink.util.FlinkRuntimeException
    • tryYield

      public boolean tryYield() throws org.apache.flink.util.FlinkRuntimeException
      Specified by:
      tryYield in interface org.apache.flink.api.common.operators.MailboxExecutor
      Throws:
      org.apache.flink.util.FlinkRuntimeException
    • shouldInterrupt

      public boolean shouldInterrupt()
      Specified by:
      shouldInterrupt in interface org.apache.flink.api.common.operators.MailboxExecutor
    • drain

      public void drain()
      Runs every mail already enqueued, mimicking the idle mailbox loop between records.