Package io.debezium.pipeline
Class AbstractChangeRecordEmitter<T extends DataCollectionSchema>
- java.lang.Object
-
- io.debezium.pipeline.AbstractChangeRecordEmitter<T>
-
- All Implemented Interfaces:
ChangeRecordEmitter
- Direct Known Subclasses:
RelationalChangeRecordEmitter
public abstract class AbstractChangeRecordEmitter<T extends DataCollectionSchema> extends Object implements ChangeRecordEmitter
An abstract implementation ofChangeRecordEmitter.- Author:
- Chris Cranford
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.debezium.pipeline.spi.ChangeRecordEmitter
ChangeRecordEmitter.Receiver
-
-
Field Summary
Fields Modifier and Type Field Description private Clockclockprivate OffsetContextoffsetContext
-
Constructor Summary
Constructors Constructor Description AbstractChangeRecordEmitter(OffsetContext offsetContext, Clock clock)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidemitChangeRecords(DataCollectionSchema schema, ChangeRecordEmitter.Receiver receiver)Emits the change record(s) corresponding to data change represented by this emitter.protected abstract voidemitCreateRecord(ChangeRecordEmitter.Receiver receiver, T schema)Emits change record(s) associated with an insert operation.protected abstract voidemitDeleteRecord(ChangeRecordEmitter.Receiver receiver, T schema)Emits change record(s) associated with a delete operation.protected abstract voidemitReadRecord(ChangeRecordEmitter.Receiver receiver, T schema)Emits change record(s) associated with a snapshot.protected abstract voidemitUpdateRecord(ChangeRecordEmitter.Receiver receiver, T schema)Emits change record(s) associated with an update operation.ClockgetClock()Returns the clock of the change record(s) emitted.OffsetContextgetOffset()Returns the offset of the change record(s) emitted.protected abstract Envelope.OperationgetOperation()Returns the operation associated with the change.
-
-
-
Field Detail
-
offsetContext
private final OffsetContext offsetContext
-
clock
private final Clock clock
-
-
Constructor Detail
-
AbstractChangeRecordEmitter
public AbstractChangeRecordEmitter(OffsetContext offsetContext, Clock clock)
-
-
Method Detail
-
emitChangeRecords
public void emitChangeRecords(DataCollectionSchema schema, ChangeRecordEmitter.Receiver receiver) throws InterruptedException
Description copied from interface:ChangeRecordEmitterEmits the change record(s) corresponding to data change represented by this emitter.- Specified by:
emitChangeRecordsin interfaceChangeRecordEmitter- Throws:
InterruptedException
-
getOffset
public OffsetContext getOffset()
Description copied from interface:ChangeRecordEmitterReturns the offset of the change record(s) emitted.- Specified by:
getOffsetin interfaceChangeRecordEmitter
-
getClock
public Clock getClock()
Returns the clock of the change record(s) emitted.
-
getOperation
protected abstract Envelope.Operation getOperation()
Returns the operation associated with the change.
-
emitReadRecord
protected abstract void emitReadRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
Emits change record(s) associated with a snapshot.- Parameters:
receiver- the handler for which the emitted record should be dispatchedschema- the schema- Throws:
InterruptedException
-
emitCreateRecord
protected abstract void emitCreateRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
Emits change record(s) associated with an insert operation.- Parameters:
receiver- the handler for which the emitted record should be dispatchedschema- the schema- Throws:
InterruptedException
-
emitUpdateRecord
protected abstract void emitUpdateRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
Emits change record(s) associated with an update operation.- Parameters:
receiver- the handler for which the emitted record should be dispatchedschema- the schema- Throws:
InterruptedException
-
emitDeleteRecord
protected abstract void emitDeleteRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
Emits change record(s) associated with a delete operation.- Parameters:
receiver- the handler for which the emitted record should be dispatchedschema- the schema- Throws:
InterruptedException
-
-