Class EmbeddedEngine.CompletionResult

java.lang.Object
io.debezium.embedded.EmbeddedEngine.CompletionResult
All Implemented Interfaces:
EmbeddedEngine.CompletionCallback, io.debezium.engine.DebeziumEngine.CompletionCallback
Enclosing class:
EmbeddedEngine

public static class EmbeddedEngine.CompletionResult extends Object implements EmbeddedEngine.CompletionCallback
A callback function to be notified when the connector completes.
  • Field Details

  • Constructor Details

  • Method Details

    • handle

      public void handle(boolean success, String message, Throwable error)
      Specified by:
      handle in interface io.debezium.engine.DebeziumEngine.CompletionCallback
    • await

      public void await() throws InterruptedException
      Causes the current thread to wait until the completion occurs or until the thread is interrupted.

      This method returns immediately if the connector has completed already.

      Throws:
      InterruptedException - if the current thread is interrupted while waiting
    • await

      public boolean await(long timeout, TimeUnit unit) throws InterruptedException
      Causes the current thread to wait until the completion occurs, unless the thread is interrupted, or the specified waiting time elapses.

      This method returns immediately if the connector has completed already.

      Parameters:
      timeout - the maximum time to wait
      unit - the time unit of the timeout argument
      Returns:
      true if the completion was received, or false if the waiting time elapsed before the completion was received.
      Throws:
      InterruptedException - if the current thread is interrupted while waiting
    • hasCompleted

      public boolean hasCompleted()
      Determine if the connector has completed.
      Returns:
      true if the connector has completed, or false if the connector is still running and this callback has not yet been notified
    • success

      public boolean success()
      Get whether the connector completed normally.
      Returns:
      true if the connector completed normally, or false if the connector produced an error that prevented startup or premature termination (or the connector has not yet completed)
    • message

      public String message()
      Get the completion message.
      Returns:
      the completion message, or null if the connector has not yet completed
    • error

      public Throwable error()
      Get the completion error, if there is one.
      Returns:
      the completion error, or null if there is no error or connector has not yet completed
    • hasError

      public boolean hasError()
      Determine if there is a completion error.
      Returns:
      true if there is a completion error, or false if there is no error or the connector has not yet completed