Package io.debezium.connector.oracle
Class OracleSnapshotChangeEventSource
- java.lang.Object
-
- io.debezium.pipeline.source.AbstractSnapshotChangeEventSource<O>
-
- io.debezium.relational.RelationalSnapshotChangeEventSource<OracleOffsetContext>
-
- io.debezium.connector.oracle.OracleSnapshotChangeEventSource
-
- All Implemented Interfaces:
ChangeEventSource,SnapshotChangeEventSource<OracleOffsetContext>
public class OracleSnapshotChangeEventSource extends RelationalSnapshotChangeEventSource<OracleOffsetContext>
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<O extends OffsetContext>
-
Nested classes/interfaces inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
AbstractSnapshotChangeEventSource.SnapshotContext<O extends OffsetContext>, 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, LOG_INTERVAL
-
-
Constructor Summary
Constructors Constructor Description OracleSnapshotChangeEventSource(OracleConnectorConfig connectorConfig, 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, lastSnapshotRecord, postSnapshot, readTableStatement, releaseDataSnapshotLocks, rowCountForTable, schema, 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, OracleConnection jdbcConnection, OracleDatabaseSchema schema, EventDispatcher<TableId> dispatcher, Clock clock, SnapshotProgressListener snapshotProgressListener)
-
-
Method Detail
-
getSnapshottingTask
protected AbstractSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask(OracleOffsetContext previousOffset)
- Specified by:
getSnapshottingTaskin classAbstractSnapshotChangeEventSource<OracleOffsetContext>
-
prepare
protected AbstractSnapshotChangeEventSource.SnapshotContext<OracleOffsetContext> prepare(ChangeEventSource.ChangeEventSourceContext context) throws Exception
- Specified by:
preparein classAbstractSnapshotChangeEventSource<OracleOffsetContext>- Throws:
Exception
-
getAllTableIds
protected Set<TableId> getAllTableIds(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OracleOffsetContext> ctx) throws Exception
- Specified by:
getAllTableIdsin classRelationalSnapshotChangeEventSource<OracleOffsetContext>- Throws:
Exception
-
lockTablesForSchemaSnapshot
protected void lockTablesForSchemaSnapshot(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OracleOffsetContext> snapshotContext) throws SQLException, InterruptedException
- Specified by:
lockTablesForSchemaSnapshotin classRelationalSnapshotChangeEventSource<OracleOffsetContext>- Throws:
SQLExceptionInterruptedException
-
releaseSchemaSnapshotLocks
protected void releaseSchemaSnapshotLocks(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OracleOffsetContext> snapshotContext) throws SQLException
- Specified by:
releaseSchemaSnapshotLocksin classRelationalSnapshotChangeEventSource<OracleOffsetContext>- Throws:
SQLException
-
determineSnapshotOffset
protected void determineSnapshotOffset(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OracleOffsetContext> ctx, OracleOffsetContext previousOffset) throws Exception
- Specified by:
determineSnapshotOffsetin classRelationalSnapshotChangeEventSource<OracleOffsetContext>- Throws:
Exception
-
getCurrentScn
private Scn getCurrentScn(AbstractSnapshotChangeEventSource.SnapshotContext<OracleOffsetContext> 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<OracleOffsetContext> 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<OracleOffsetContext> snapshotContext, OracleOffsetContext offsetContext) throws SQLException, InterruptedException
- Specified by:
readTableStructurein classRelationalSnapshotChangeEventSource<OracleOffsetContext>- Throws:
SQLExceptionInterruptedException
-
enhanceOverriddenSelect
protected String enhanceOverriddenSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OracleOffsetContext> snapshotContext, String overriddenSelect, TableId tableId)
- Overrides:
enhanceOverriddenSelectin classRelationalSnapshotChangeEventSource<OracleOffsetContext>
-
getCreateTableEvent
protected SchemaChangeEvent getCreateTableEvent(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OracleOffsetContext> snapshotContext, Table table) throws SQLException
- Specified by:
getCreateTableEventin classRelationalSnapshotChangeEventSource<OracleOffsetContext>- Throws:
SQLException
-
getSnapshotSelect
protected Optional<String> getSnapshotSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OracleOffsetContext> snapshotContext, TableId tableId)
- Specified by:
getSnapshotSelectin classRelationalSnapshotChangeEventSource<OracleOffsetContext>
-
complete
protected void complete(AbstractSnapshotChangeEventSource.SnapshotContext<OracleOffsetContext> snapshotContext)
- Overrides:
completein classAbstractSnapshotChangeEventSource<OracleOffsetContext>
-
-