public abstract class RelationalChangeRecordEmitter extends Object implements ChangeRecordEmitter
ChangeRecordEmitter implementations based on a relational database.ChangeRecordEmitter.Receiver| Modifier and Type | Field and Description |
|---|---|
private Clock |
clock |
private OffsetContext |
offsetContext |
| Constructor and Description |
|---|
RelationalChangeRecordEmitter(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.
|
private void |
emitCreateRecord(ChangeRecordEmitter.Receiver receiver,
TableSchema tableSchema) |
private void |
emitDeleteRecord(ChangeRecordEmitter.Receiver receiver,
TableSchema tableSchema) |
private void |
emitReadRecord(ChangeRecordEmitter.Receiver receiver,
TableSchema tableSchema) |
private void |
emitUpdateRecord(ChangeRecordEmitter.Receiver receiver,
TableSchema tableSchema) |
protected abstract Object[] |
getNewColumnValues()
Returns the new row state in case of a CREATE or READ.
|
OffsetContext |
getOffset()
Returns the offset of the change record(s) emitted.
|
protected abstract Object[] |
getOldColumnValues()
Returns the old row state in case of an UPDATE or DELETE.
|
protected abstract Envelope.Operation |
getOperation()
Returns the operation done by the represented change.
|
private final OffsetContext offsetContext
private final Clock clock
public RelationalChangeRecordEmitter(OffsetContext offsetContext, Clock clock)
public void emitChangeRecords(DataCollectionSchema schema, ChangeRecordEmitter.Receiver receiver) throws InterruptedException
ChangeRecordEmitteremitChangeRecords in interface ChangeRecordEmitterInterruptedExceptionpublic OffsetContext getOffset()
ChangeRecordEmittergetOffset in interface ChangeRecordEmitterprivate void emitCreateRecord(ChangeRecordEmitter.Receiver receiver, TableSchema tableSchema) throws InterruptedException
InterruptedExceptionprivate void emitReadRecord(ChangeRecordEmitter.Receiver receiver, TableSchema tableSchema) throws InterruptedException
InterruptedExceptionprivate void emitUpdateRecord(ChangeRecordEmitter.Receiver receiver, TableSchema tableSchema) throws InterruptedException
InterruptedExceptionprivate void emitDeleteRecord(ChangeRecordEmitter.Receiver receiver, TableSchema tableSchema) throws InterruptedException
InterruptedExceptionprotected abstract Envelope.Operation getOperation()
protected abstract Object[] getOldColumnValues()
protected abstract Object[] getNewColumnValues()
Copyright © 2018 JBoss by Red Hat. All rights reserved.