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
FieldsModifier and TypeFieldDescriptionprivate final CountDownLatchprivate final EmbeddedEngine.CompletionCallbackprivate Throwableprivate Stringprivate boolean -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidawait()Causes the current thread to wait until thecompletion occursor until the thread is interrupted.booleanCauses 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.voidbooleanDetermine if the connector has completed.booleanhasError()Determine if there is a completion error.message()Get the completion message.booleansuccess()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:
handlein interfaceio.debezium.engine.DebeziumEngine.CompletionCallback
-
await
Causes the current thread to wait until thecompletion occursor 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 thetimeoutargument- Returns:
trueif the completion was received, orfalseif 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:
trueif the connector has completed, orfalseif the connector is still running and this callback has not yet beennotified
-
success
public boolean success()Get whether the connector completed normally.- Returns:
trueif the connector completed normally, orfalseif 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:
trueif there is acompletion error, orfalseif there is no error or the connector has not yetcompleted
-