Class MailboxExecutorImpl

    • Method Detail

      • isIdle

        public boolean isIdle()
      • execute

        public void execute​(MailboxExecutor.MailOptions mailOptions,
                            ThrowingRunnable<? extends Exception> command,
                            String descriptionFormat,
                            Object... descriptionArgs)
        Description copied from interface: MailboxExecutor
        Executes the given command at some time in the future in the mailbox thread.

        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.

        Specified by:
        execute in interface MailboxExecutor
        Parameters:
        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.
      • yield

        public void yield()
                   throws InterruptedException
        Description copied from interface: MailboxExecutor
        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. The method blocks until another command to run is available in the mailbox and must only be called from the mailbox thread. Must only be called from the mailbox thread to not violate the single-threaded execution model.
        Specified by:
        yield in interface MailboxExecutor
        Throws:
        InterruptedException - on interruption.
      • tryYield

        public boolean tryYield()
        Description copied from interface: MailboxExecutor
        This method attempts to run the command at the head of the mailbox. This is intended to be used by the mailbox thread to yield from a currently ongoing action to another command. The method returns true if a command was found and executed or false if the mailbox was empty. Must only be called from the mailbox thread to not violate the single-threaded execution model.
        Specified by:
        tryYield in interface MailboxExecutor
        Returns:
        true on successful yielding to another command, false if there was no command to yield to.
      • shouldInterrupt

        public boolean shouldInterrupt()
        Description copied from interface: MailboxExecutor
        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.
        Specified by:
        shouldInterrupt in interface MailboxExecutor
        Returns:
        whether operator/function should interrupt its computation.