Class LogMinerEventAdapter
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.LogMinerEventAdapter
-
@ProtoAdapter(LogMinerEvent.class) public class LogMinerEventAdapter extends Object
An Infinispan ProtoStream adapter to marshallLogMinerEventinstances and its subclasses. This class defines a factory for creatingLogMinerEventinstances and its subclasses for when hydrating records from the persisted datastore as well as field handlers to extract instance values to be marshalled to the protocol buffer stream. The underlying protocol buffer record consists of the following structure:message LogMinerEvent { required int32 eventType = 1; required string scn = 2; required string tableId = 3; required string rowId = 4; required object rsId = 5; required string changeTime = 6; LogMinerDmlEntryImpl entry = 7; string columnName = 8; boolean binary = 9; string data = 10; }- Author:
- Chris Cranford
-
-
Constructor Summary
Constructors Constructor Description LogMinerEventAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogMinerEventfactory(int eventType, String scn, String tableId, String rowId, String rsId, String changeTime, LogMinerDmlEntryImpl entry, String columnName, Boolean binary, String data)A ProtoStream factory that createsLogMinerEventinstances or one of its subclasses from field values.BooleangetBinary(LogMinerEvent event)A ProtoStream handler to extract thebinaryfield from aSelectLobLocatorEventtype.StringgetChangeTime(LogMinerEvent event)A ProtoStream handler to extract thechangeTimefield from theLogMinerEvent.StringgetColumnName(LogMinerEvent event)A ProtoStream handler to extract thecolumnNamefield from aSelectLobLocatorEventtype.StringgetData(LogMinerEvent event)A ProtoStream handler to extract thedatafield from aLobWriteEventtype.LogMinerDmlEntryImplgetEntry(LogMinerEvent event)A ProtoStream handler to extract theentryfield from theDmlEventand subclass types.intgetEventType(LogMinerEvent event)A ProtoStream handler to extract theeventTypefield from theLogMinerEvent.StringgetRowId(LogMinerEvent event)A ProtoStream handler to extract therowIdfield from theLogMinerEvent.StringgetRsId(LogMinerEvent event)A ProtoStream handler to extract thersIdfield from theLogMinerEvent.StringgetScn(LogMinerEvent event)A ProtoStream handler to extract thescnfield from theLogMinerEvent.StringgetTableId(LogMinerEvent event)A ProtoStream handler to extract thetableIdfield from theLogMinerEvent.
-
-
-
Method Detail
-
factory
@ProtoFactory public LogMinerEvent factory(int eventType, String scn, String tableId, String rowId, String rsId, String changeTime, LogMinerDmlEntryImpl entry, String columnName, Boolean binary, String data)
A ProtoStream factory that createsLogMinerEventinstances or one of its subclasses from field values.- Parameters:
eventType- the event typescn- the system change number, must not benulltableId- the fully-qualified table namerowId- the Oracle row-id the change is associated withrsId- the Oracle rollback segment identifierchangeTime- the time the change occurredentry- the parsed SQL statement entrycolumnName- the column name for aSEL_LOB_LOCATORevent typebinary- whether the data is binary for aSEL_LOB_LOCATORevent typedata- the data to be written by aLOB_WRITEevent type- Returns:
- the constructed LogMinerEvent or one of its subclasses
-
getEventType
@ProtoField(number=1, required=true) public int getEventType(LogMinerEvent event)A ProtoStream handler to extract theeventTypefield from theLogMinerEvent.- Parameters:
event- the event instance, must not benull- Returns:
- the event type's numerical representation
-
getScn
@ProtoField(number=2, required=true) public String getScn(LogMinerEvent event)A ProtoStream handler to extract thescnfield from theLogMinerEvent.- Parameters:
event- the event instance, must not benull- Returns:
- the event's system change number represented as a string
-
getTableId
@ProtoField(number=3, required=true) public String getTableId(LogMinerEvent event)A ProtoStream handler to extract thetableIdfield from theLogMinerEvent.- Parameters:
event- the event instance, must not benull- Returns:
- the event's table identifier represented as a string
-
getRowId
@ProtoField(number=4, required=true) public String getRowId(LogMinerEvent event)A ProtoStream handler to extract therowIdfield from theLogMinerEvent.- Parameters:
event- the event instance, must not benull- Returns:
- the event's row identifier, never
null
-
getRsId
@ProtoField(number=5, required=true) public String getRsId(LogMinerEvent event)A ProtoStream handler to extract thersIdfield from theLogMinerEvent.- Parameters:
event- the event instance, must not benull- Returns:
- the rollback segment identifier, never
null
-
getChangeTime
@ProtoField(number=6, required=true) public String getChangeTime(LogMinerEvent event)A ProtoStream handler to extract thechangeTimefield from theLogMinerEvent.- Parameters:
event- the event instance, must not benull- Returns:
- the time when the event occurred as a string, never
null
-
getEntry
@ProtoField(number=7) public LogMinerDmlEntryImpl getEntry(LogMinerEvent event)
A ProtoStream handler to extract theentryfield from theDmlEventand subclass types.- Parameters:
event- the event instance, must not benull- Returns:
- the LogMinerDmlEntryImpl instance or
nullif the event type isn't related to DML events
-
getColumnName
@ProtoField(number=8) public String getColumnName(LogMinerEvent event)
A ProtoStream handler to extract thecolumnNamefield from aSelectLobLocatorEventtype.- Parameters:
event- the event instance, must not benull- Returns:
- the column name or
nullif the event is not a SelectLobLocatorEvent type
-
getBinary
@ProtoField(number=9) public Boolean getBinary(LogMinerEvent event)
A ProtoStream handler to extract thebinaryfield from aSelectLobLocatorEventtype.- Parameters:
event- the event instance, must not benull- Returns:
- the binary data flag or
nullif the event is not a SelectLobLocatorEvent type
-
getData
@ProtoField(number=10) public String getData(LogMinerEvent event)
A ProtoStream handler to extract thedatafield from aLobWriteEventtype.- Parameters:
event- the event instance, must not benull- Returns:
- the data to be written for a LOB field or
nullif the event is not a LobWriteEvent type
-
-