Class DataChangeEvent
- java.lang.Object
-
- org.apache.flink.cdc.common.event.DataChangeEvent
-
- All Implemented Interfaces:
Serializable,ChangeEvent,Event
@PublicEvolving public class DataChangeEvent extends Object implements ChangeEvent, Serializable
ClassDataChangeEventrepresents the data change events of external systems, such as INSERT, UPDATE, DELETE and so on.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordDataafter()RecordDatabefore()static DataChangeEventdeleteEvent(TableId tableId, RecordData before)Creates aDataChangeEventinstance that describes the delete event.static DataChangeEventdeleteEvent(TableId tableId, RecordData before, Map<String,String> meta)Creates aDataChangeEventinstance that describes the delete event with meta info.StringdescribeMeta()Creates a string to describe the information of meta.booleanequals(Object o)inthashCode()static DataChangeEventinsertEvent(TableId tableId, RecordData after)Creates aDataChangeEventinstance that describes the insert event.static DataChangeEventinsertEvent(TableId tableId, RecordData after, Map<String,String> meta)Creates aDataChangeEventinstance that describes the insert event with meta info.Map<String,String>meta()OperationTypeop()StringopTypeString(boolean isAfter)static DataChangeEventprojectAfter(DataChangeEvent dataChangeEvent, RecordData projectedAfter)Updates the after of aDataChangeEventinstance that describes the event with meta info.static DataChangeEventprojectBefore(DataChangeEvent dataChangeEvent, RecordData projectedBefore)Updates the before of aDataChangeEventinstance that describes the event with meta info.static DataChangeEventprojectRecords(DataChangeEvent dataChangeEvent, RecordData projectedBefore, RecordData projectedAfter)Updates the after of aDataChangeEventinstance that describes the event with meta info.static DataChangeEventreplaceEvent(TableId tableId, RecordData after)Creates aDataChangeEventinstance that describes the replace event.static DataChangeEventreplaceEvent(TableId tableId, RecordData after, Map<String,String> meta)Creates aDataChangeEventinstance that describes the replace event with meta info.static DataChangeEventroute(DataChangeEvent dataChangeEvent, TableId tableId)Updates theTableIdinfo of current data change event.TableIdtableId()Describes the database table corresponding to the occurrence of a change event.StringtoReadableString(java.util.function.Function<RecordData,?> extractor)StringtoString()static DataChangeEventupdateEvent(TableId tableId, RecordData before, RecordData after)Creates aDataChangeEventinstance that describes the update event.static DataChangeEventupdateEvent(TableId tableId, RecordData before, RecordData after, Map<String,String> meta)Creates aDataChangeEventinstance that describes the update event with meta info.
-
-
-
Method Detail
-
tableId
public TableId tableId()
Description copied from interface:ChangeEventDescribes the database table corresponding to the occurrence of a change event.- Specified by:
tableIdin interfaceChangeEvent
-
before
public RecordData before()
-
after
public RecordData after()
-
op
public OperationType op()
-
opTypeString
public String opTypeString(boolean isAfter)
-
insertEvent
public static DataChangeEvent insertEvent(TableId tableId, RecordData after)
Creates aDataChangeEventinstance that describes the insert event.
-
insertEvent
public static DataChangeEvent insertEvent(TableId tableId, RecordData after, Map<String,String> meta)
Creates aDataChangeEventinstance that describes the insert event with meta info.
-
deleteEvent
public static DataChangeEvent deleteEvent(TableId tableId, RecordData before)
Creates aDataChangeEventinstance that describes the delete event.
-
deleteEvent
public static DataChangeEvent deleteEvent(TableId tableId, RecordData before, Map<String,String> meta)
Creates aDataChangeEventinstance that describes the delete event with meta info.
-
updateEvent
public static DataChangeEvent updateEvent(TableId tableId, RecordData before, RecordData after)
Creates aDataChangeEventinstance that describes the update event.
-
updateEvent
public static DataChangeEvent updateEvent(TableId tableId, RecordData before, RecordData after, Map<String,String> meta)
Creates aDataChangeEventinstance that describes the update event with meta info.
-
replaceEvent
public static DataChangeEvent replaceEvent(TableId tableId, RecordData after)
Creates aDataChangeEventinstance that describes the replace event.
-
replaceEvent
public static DataChangeEvent replaceEvent(TableId tableId, RecordData after, Map<String,String> meta)
Creates aDataChangeEventinstance that describes the replace event with meta info.
-
projectBefore
public static DataChangeEvent projectBefore(DataChangeEvent dataChangeEvent, RecordData projectedBefore)
Updates the before of aDataChangeEventinstance that describes the event with meta info.
-
projectAfter
public static DataChangeEvent projectAfter(DataChangeEvent dataChangeEvent, RecordData projectedAfter)
Updates the after of aDataChangeEventinstance that describes the event with meta info.
-
projectRecords
public static DataChangeEvent projectRecords(DataChangeEvent dataChangeEvent, RecordData projectedBefore, RecordData projectedAfter)
Updates the after of aDataChangeEventinstance that describes the event with meta info.
-
route
public static DataChangeEvent route(DataChangeEvent dataChangeEvent, TableId tableId)
Updates theTableIdinfo of current data change event.
-
describeMeta
public String describeMeta()
Creates a string to describe the information of meta.
-
toReadableString
public String toReadableString(java.util.function.Function<RecordData,?> extractor)
-
-