Package io.debezium.pipeline.signal
Class Signal
- java.lang.Object
-
- io.debezium.pipeline.signal.Signal
-
@NotThreadSafe public class Signal extends Object
The class responsible for processing of signals delivered to Debezium via a dedicated signaling table. The processor supports a common set of signals that it can process and every connector can register its own additional signals. The signalling table must conform to the structureid STRING
- the unique identifier of the signal sent, usually UUID, can be used for deduplicationtype STRING
- the unique logical name of the code executing the signaldata STRING
- the data in JSON format that are passed to the signal code
- Author:
- Jiri Pechanec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Signal.Action
static class
Signal.Payload
-
Field Summary
Fields Modifier and Type Field Description private CommonConnectorConfig
connectorConfig
private EventDispatcher<? extends DataCollectionId>
dispatcher
private static org.slf4j.Logger
LOGGER
private Map<String,Signal.Action>
signalActions
private String
signalDataCollectionId
-
Constructor Summary
Constructors Constructor Description Signal(CommonConnectorConfig connectorConfig)
Signal(CommonConnectorConfig connectorConfig, EventDispatcher<? extends DataCollectionId> eventDispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isSignal(DataCollectionId dataCollectionId)
boolean
process(String id, String type, String data)
boolean
process(String id, String type, String data, OffsetContext offset, org.apache.kafka.connect.data.Struct source)
boolean
process(org.apache.kafka.connect.data.Struct value, OffsetContext offset)
void
registerSignalAction(String id, Signal.Action signal)
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
connectorConfig
private final CommonConnectorConfig connectorConfig
-
signalDataCollectionId
private final String signalDataCollectionId
-
dispatcher
private final EventDispatcher<? extends DataCollectionId> dispatcher
-
signalActions
private final Map<String,Signal.Action> signalActions
-
-
Constructor Detail
-
Signal
public Signal(CommonConnectorConfig connectorConfig, EventDispatcher<? extends DataCollectionId> eventDispatcher)
-
Signal
Signal(CommonConnectorConfig connectorConfig)
-
-
Method Detail
-
isSignal
public boolean isSignal(DataCollectionId dataCollectionId)
-
registerSignalAction
public void registerSignalAction(String id, Signal.Action signal)
-
process
public boolean process(String id, String type, String data, OffsetContext offset, org.apache.kafka.connect.data.Struct source) throws InterruptedException
- Throws:
InterruptedException
-
process
public boolean process(String id, String type, String data) throws InterruptedException
- Throws:
InterruptedException
-
process
public boolean process(org.apache.kafka.connect.data.Struct value, OffsetContext offset) throws InterruptedException
- Parameters:
value
- Envelope with change from signaling tableoffset
- offset of the incoming signal- Returns:
- true if the signal was processed
- Throws:
InterruptedException
-
-