Package io.debezium.embedded
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 Summary
Modifier and TypeFieldDescriptionprivate final CountDownLatch
private final EmbeddedEngine.CompletionCallback
private Throwable
private String
private boolean
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
await()
Causes the current thread to wait until thecompletion occurs
or until the thread is interrupted.boolean
Causes the current thread to wait until thecompletion occurs
, unless the thread is interrupted, or the specified waiting time elapses.error()
Get the completion error, if there is one.void
boolean
Determine if the connector has completed.boolean
hasError()
Determine if there is a completion error.message()
Get the completion message.boolean
success()
Get whether the connector completed normally.
-
Field Details
-
delegate
-
completed
-
success
private boolean success -
message
-
error
-
-
Constructor Details
-
CompletionResult
public CompletionResult() -
CompletionResult
-
-
Method Details
-
handle
- Specified by:
handle
in interfaceio.debezium.engine.DebeziumEngine.CompletionCallback
-
await
Causes the current thread to wait until thecompletion 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
Causes the current thread to wait until thecompletion 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 waitunit
- the time unit of thetimeout
argument- Returns:
true
if the completion was received, orfalse
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, orfalse
if the connector is still running and this callback has not yet beennotified
-
success
public boolean success()Get whether the connector completed normally.- Returns:
true
if the connector completed normally, orfalse
if the connector produced an error that prevented startup or premature termination (or the connector has not yetcompleted
)
-
message
Get the completion message.- Returns:
- the completion message, or null if the connector has not yet
completed
-
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 acompletion error
, orfalse
if there is no error or the connector has not yetcompleted
-