Package io.debezium.connector.oracle
Class OracleSnapshotChangeEventSource
- java.lang.Object
-
- io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
-
- io.debezium.relational.RelationalSnapshotChangeEventSource
-
- io.debezium.connector.oracle.OracleSnapshotChangeEventSource
-
- All Implemented Interfaces:
ChangeEventSource,SnapshotChangeEventSource
public class OracleSnapshotChangeEventSource extends RelationalSnapshotChangeEventSource
AStreamingChangeEventSourcefor Oracle.- Author:
- Gunnar Morling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classOracleSnapshotChangeEventSource.OracleSnapshotContextMutable context which is populated in the course of snapshotting.-
Nested classes/interfaces inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
RelationalSnapshotChangeEventSource.RelationalSnapshotContext
-
Nested classes/interfaces inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
AbstractSnapshotChangeEventSource.SnapshotContext, AbstractSnapshotChangeEventSource.SnapshottingTask
-
Nested classes/interfaces inherited from interface io.debezium.pipeline.source.spi.ChangeEventSource
ChangeEventSource.ChangeEventSourceContext
-
-
Field Summary
Fields Modifier and Type Field Description private OracleConnectorConfigconnectorConfigprivate OracleConnectionjdbcConnectionprivate static org.slf4j.LoggerLOGGER-
Fields inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
clock, dispatcher
-
-
Constructor Summary
Constructors Constructor Description OracleSnapshotChangeEventSource(OracleConnectorConfig connectorConfig, OracleOffsetContext previousOffset, OracleConnection jdbcConnection, OracleDatabaseSchema schema, EventDispatcher<TableId> dispatcher, Clock clock, SnapshotProgressListener snapshotProgressListener)
-
Method Summary
-
Methods inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
connectionCreated, createSchemaChangeEventsForTables, createSnapshotConnection, doExecute, getChangeRecordEmitter, getClock, getColumnValue, getColumnValue, lastSnapshotRecord, postSnapshot, readTableStatement, releaseDataSnapshotLocks, rowCountForTable, tryStartingSnapshot
-
Methods inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
delaySnapshotIfNeeded, determineDataCollectionsToBeSnapshotted, execute
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
connectorConfig
private final OracleConnectorConfig connectorConfig
-
jdbcConnection
private final OracleConnection jdbcConnection
-
-
Constructor Detail
-
OracleSnapshotChangeEventSource
public OracleSnapshotChangeEventSource(OracleConnectorConfig connectorConfig, OracleOffsetContext previousOffset, OracleConnection jdbcConnection, OracleDatabaseSchema schema, EventDispatcher<TableId> dispatcher, Clock clock, SnapshotProgressListener snapshotProgressListener)
-
-
Method Detail
-
getSnapshottingTask
protected AbstractSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask(OffsetContext previousOffset)
- Specified by:
getSnapshottingTaskin classAbstractSnapshotChangeEventSource
-
prepare
protected AbstractSnapshotChangeEventSource.SnapshotContext prepare(ChangeEventSource.ChangeEventSourceContext context) throws Exception
- Specified by:
preparein classAbstractSnapshotChangeEventSource- Throws:
Exception
-
getAllTableIds
protected Set<TableId> getAllTableIds(RelationalSnapshotChangeEventSource.RelationalSnapshotContext ctx) throws Exception
- Specified by:
getAllTableIdsin classRelationalSnapshotChangeEventSource- Throws:
Exception
-
lockTablesForSchemaSnapshot
protected void lockTablesForSchemaSnapshot(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext) throws SQLException, InterruptedException
- Specified by:
lockTablesForSchemaSnapshotin classRelationalSnapshotChangeEventSource- Throws:
SQLExceptionInterruptedException
-
releaseSchemaSnapshotLocks
protected void releaseSchemaSnapshotLocks(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext) throws SQLException
- Specified by:
releaseSchemaSnapshotLocksin classRelationalSnapshotChangeEventSource- Throws:
SQLException
-
determineSnapshotOffset
protected void determineSnapshotOffset(RelationalSnapshotChangeEventSource.RelationalSnapshotContext ctx) throws Exception
- Specified by:
determineSnapshotOffsetin classRelationalSnapshotChangeEventSource- Throws:
Exception
-
getCurrentScn
private Scn getCurrentScn(AbstractSnapshotChangeEventSource.SnapshotContext ctx) throws SQLException
- Throws:
SQLException
-
areSameTimestamp
private boolean areSameTimestamp(Scn scn1, Scn scn2) throws SQLException
Whether the two SCNs represent the same timestamp or not (resolution is only 3 seconds).- Throws:
SQLException
-
getLatestTableDdlScn
private Optional<Scn> getLatestTableDdlScn(RelationalSnapshotChangeEventSource.RelationalSnapshotContext ctx) throws SQLException
Returns the SCN of the latest DDL change to the captured tables. The result will be empty if there's no table to capture as per the configuration.- Throws:
SQLException
-
readTableStructure
protected void readTableStructure(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext) throws SQLException, InterruptedException
- Specified by:
readTableStructurein classRelationalSnapshotChangeEventSource- Throws:
SQLExceptionInterruptedException
-
enhanceOverriddenSelect
protected String enhanceOverriddenSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext, String overriddenSelect, TableId tableId)
- Overrides:
enhanceOverriddenSelectin classRelationalSnapshotChangeEventSource
-
getCreateTableEvent
protected SchemaChangeEvent getCreateTableEvent(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext, Table table) throws SQLException
- Specified by:
getCreateTableEventin classRelationalSnapshotChangeEventSource- Throws:
SQLException
-
getSnapshotSelect
protected Optional<String> getSnapshotSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext, TableId tableId)
- Specified by:
getSnapshotSelectin classRelationalSnapshotChangeEventSource
-
complete
protected void complete(AbstractSnapshotChangeEventSource.SnapshotContext snapshotContext)
- Overrides:
completein classAbstractSnapshotChangeEventSource
-
-