public abstract class AbstractChangeRecordEmitter<T extends DataCollectionSchema> extends Object implements ChangeRecordEmitter
ChangeRecordEmitter.ChangeRecordEmitter.Receiver| Modifier and Type | Field and Description |
|---|---|
private Clock |
clock |
private OffsetContext |
offsetContext |
| Constructor and Description |
|---|
AbstractChangeRecordEmitter(OffsetContext offsetContext,
Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
void |
emitChangeRecords(DataCollectionSchema schema,
ChangeRecordEmitter.Receiver receiver)
Emits the change record(s) corresponding to data change represented by this emitter.
|
protected abstract void |
emitCreateRecord(ChangeRecordEmitter.Receiver receiver,
T schema)
Emits change record(s) associated with an insert operation.
|
protected abstract void |
emitDeleteRecord(ChangeRecordEmitter.Receiver receiver,
T schema)
Emits change record(s) associated with a delete operation.
|
protected abstract void |
emitReadRecord(ChangeRecordEmitter.Receiver receiver,
T schema)
Emits change record(s) associated with a snapshot.
|
protected abstract void |
emitUpdateRecord(ChangeRecordEmitter.Receiver receiver,
T schema)
Emits change record(s) associated with an update operation.
|
Clock |
getClock()
Returns the clock of the change record(s) emitted.
|
OffsetContext |
getOffset()
Returns the offset of the change record(s) emitted.
|
protected abstract Envelope.Operation |
getOperation()
Returns the operation associated with the change.
|
private final OffsetContext offsetContext
private final Clock clock
public AbstractChangeRecordEmitter(OffsetContext offsetContext, Clock clock)
public void emitChangeRecords(DataCollectionSchema schema, ChangeRecordEmitter.Receiver receiver) throws InterruptedException
ChangeRecordEmitteremitChangeRecords in interface ChangeRecordEmitterInterruptedExceptionpublic OffsetContext getOffset()
ChangeRecordEmittergetOffset in interface ChangeRecordEmitterpublic Clock getClock()
protected abstract Envelope.Operation getOperation()
protected abstract void emitReadRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
receiver - the handler for which the emitted record should be dispatchedschema - the schemaInterruptedExceptionprotected abstract void emitCreateRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
receiver - the handler for which the emitted record should be dispatchedschema - the schemaInterruptedExceptionprotected abstract void emitUpdateRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
receiver - the handler for which the emitted record should be dispatchedschema - the schemaInterruptedExceptionprotected abstract void emitDeleteRecord(ChangeRecordEmitter.Receiver receiver, T schema) throws InterruptedException
receiver - the handler for which the emitted record should be dispatchedschema - the schemaInterruptedExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.