Package io.debezium.pipeline
Class AbstractChangeRecordEmitter<P extends Partition,T extends DataCollectionSchema>
- java.lang.Object
-
- io.debezium.pipeline.AbstractChangeRecordEmitter<P,T>
-
- All Implemented Interfaces:
ChangeRecordEmitter<P>
- Direct Known Subclasses:
RelationalChangeRecordEmitter
public abstract class AbstractChangeRecordEmitter<P extends Partition,T extends DataCollectionSchema> extends Object implements ChangeRecordEmitter<P>
An abstract implementation ofChangeRecordEmitter.- Author:
- Chris Cranford
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.debezium.pipeline.spi.ChangeRecordEmitter
ChangeRecordEmitter.Receiver<P extends Partition>
-
-
Field Summary
Fields Modifier and Type Field Description private Clockclockprivate OffsetContextoffsetContextprivate Ppartition
-
Constructor Summary
Constructors Constructor Description AbstractChangeRecordEmitter(P partition, OffsetContext offsetContext, Clock clock)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidemitChangeRecords(DataCollectionSchema schema, ChangeRecordEmitter.Receiver<P> receiver)Emits the change record(s) corresponding to data change represented by this emitter.protected abstract voidemitCreateRecord(ChangeRecordEmitter.Receiver<P> receiver, T schema)Emits change record(s) associated with an insert operation.protected abstract voidemitDeleteRecord(ChangeRecordEmitter.Receiver<P> receiver, T schema)Emits change record(s) associated with a delete operation.protected abstract voidemitReadRecord(ChangeRecordEmitter.Receiver<P> receiver, T schema)Emits change record(s) associated with a snapshot.protected abstract voidemitUpdateRecord(ChangeRecordEmitter.Receiver<P> 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.PgetPartition()Returns the partition of the change record(s) emitted.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.debezium.pipeline.spi.ChangeRecordEmitter
getOperation
-
-
-
-
Field Detail
-
offsetContext
private final OffsetContext offsetContext
-
clock
private final Clock clock
-
-
Constructor Detail
-
AbstractChangeRecordEmitter
public AbstractChangeRecordEmitter(P partition, OffsetContext offsetContext, Clock clock)
-
-
Method Detail
-
emitChangeRecords
public void emitChangeRecords(DataCollectionSchema schema, ChangeRecordEmitter.Receiver<P> receiver) throws InterruptedException
Description copied from interface:ChangeRecordEmitterEmits the change record(s) corresponding to data change represented by this emitter.- Specified by:
emitChangeRecordsin interfaceChangeRecordEmitter<P extends Partition>- Throws:
InterruptedException
-
getPartition
public P getPartition()
Description copied from interface:ChangeRecordEmitterReturns the partition of the change record(s) emitted.- Specified by:
getPartitionin interfaceChangeRecordEmitter<P extends Partition>
-
getOffset
public OffsetContext getOffset()
Description copied from interface:ChangeRecordEmitterReturns the offset of the change record(s) emitted.- Specified by:
getOffsetin interfaceChangeRecordEmitter<P extends Partition>
-
getClock
public Clock getClock()
Returns the clock of the change record(s) emitted.
-
emitReadRecord
protected abstract void emitReadRecord(ChangeRecordEmitter.Receiver<P> 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<P> 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<P> 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<P> 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
-
-