Package io.debezium.connector.oracle
Class OracleSnapshotChangeEventSource
java.lang.Object
io.debezium.pipeline.source.AbstractSnapshotChangeEventSource<P,O>
io.debezium.relational.RelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
io.debezium.connector.oracle.OracleSnapshotChangeEventSource
- All Implemented Interfaces:
ChangeEventSource,SnapshotChangeEventSource<OraclePartition,,OracleOffsetContext> AutoCloseable
public class OracleSnapshotChangeEventSource
extends RelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
A
StreamingChangeEventSource for Oracle.- Author:
- Gunnar Morling
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classMutable context which is populated in the course of snapshotting.Nested classes/interfaces inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
RelationalSnapshotChangeEventSource.RelationalSnapshotContext<P extends Partition,O extends OffsetContext> Nested classes/interfaces inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
AbstractSnapshotChangeEventSource.SnapshotContext<P extends Partition,O extends OffsetContext>, AbstractSnapshotChangeEventSource.SnapshottingTask Nested classes/interfaces inherited from interface io.debezium.pipeline.source.spi.ChangeEventSource
ChangeEventSource.ChangeEventSourceContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final OracleConnectorConfigprivate final OracleDatabaseSchemaprivate final OracleConnectionprivate static final org.slf4j.LoggerFields inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
clock, dispatcher, SELECT_ALL_PATTERNFields inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
LOG_INTERVAL -
Constructor Summary
ConstructorsConstructorDescriptionOracleSnapshotChangeEventSource(OracleConnectorConfig connectorConfig, MainConnectionProvidingConnectionFactory<OracleConnection> connectionFactory, OracleDatabaseSchema schema, EventDispatcher<OraclePartition, TableId> dispatcher, Clock clock, SnapshotProgressListener<OraclePartition> snapshotProgressListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidconnectionPoolConnectionCreated(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, JdbcConnection connection) protected OracleOffsetContextcopyOffset(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) protected voiddetermineSnapshotOffset(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> ctx, OracleOffsetContext previousOffset) protected StringenhanceOverriddenSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, String overriddenSelect, TableId tableId) getAllTableIds(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> ctx) protected SchemaChangeEventgetCreateTableEvent(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, Table table) getSignalDataCollectionPattern(String signalingDataCollection) getSnapshotSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, TableId tableId, List<String> columns) Generate a valid Oracle query string for the specified table and columnsprotected InstantgetSnapshotSourceTimestamp(JdbcConnection jdbcConnection, OracleOffsetContext offset, TableId tableId) getSnapshottingTask(OraclePartition partition, OracleOffsetContext previousOffset) protected Collection<TableId>getTablesForSchemaChange(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) protected voidlockTablesForSchemaSnapshot(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) prepare(OraclePartition partition) private Stringprotected voidreadTableStructure(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, OracleOffsetContext offsetContext) protected voidreleaseSchemaSnapshotLocks(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) Methods inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
additionalColumnFilter, connectionCreated, createSchemaChangeEventsForTables, createSnapshotConnection, doExecute, getChangeRecordEmitter, getClock, getPreparedColumnNames, getSnapshotConnectionFirstSelect, getSnapshotSelectOverridesByTable, lastSnapshotRecord, postSnapshot, readTableStatement, releaseDataSnapshotLocks, rowCountForTable, tryStartingSnapshotMethods inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
aborted, completed, delaySnapshotIfNeeded, determineDataCollectionsToBeSnapshotted, execute
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
connectorConfig
-
jdbcConnection
-
databaseSchema
-
-
Constructor Details
-
OracleSnapshotChangeEventSource
public OracleSnapshotChangeEventSource(OracleConnectorConfig connectorConfig, MainConnectionProvidingConnectionFactory<OracleConnection> connectionFactory, OracleDatabaseSchema schema, EventDispatcher<OraclePartition, TableId> dispatcher, Clock clock, SnapshotProgressListener<OraclePartition> snapshotProgressListener)
-
-
Method Details
-
getSnapshottingTask
protected AbstractSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask(OraclePartition partition, OracleOffsetContext previousOffset) - Specified by:
getSnapshottingTaskin classAbstractSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
-
prepare
protected AbstractSnapshotChangeEventSource.SnapshotContext<OraclePartition,OracleOffsetContext> prepare(OraclePartition partition) throws Exception - Specified by:
preparein classAbstractSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
Exception
-
connectionPoolConnectionCreated
protected void connectionPoolConnectionCreated(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, JdbcConnection connection) throws SQLException- Overrides:
connectionPoolConnectionCreatedin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
SQLException
-
getAllTableIds
protected Set<TableId> getAllTableIds(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> ctx) throws Exception- Specified by:
getAllTableIdsin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
Exception
-
lockTablesForSchemaSnapshot
protected void lockTablesForSchemaSnapshot(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) throws SQLException, InterruptedException- Specified by:
lockTablesForSchemaSnapshotin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
SQLExceptionInterruptedException
-
releaseSchemaSnapshotLocks
protected void releaseSchemaSnapshotLocks(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) throws SQLException- Specified by:
releaseSchemaSnapshotLocksin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
SQLException
-
determineSnapshotOffset
protected void determineSnapshotOffset(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> ctx, OracleOffsetContext previousOffset) throws Exception- Specified by:
determineSnapshotOffsetin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
Exception
-
readTableStructure
protected void readTableStructure(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, OracleOffsetContext offsetContext) throws SQLException, InterruptedException- Specified by:
readTableStructurein classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
SQLExceptionInterruptedException
-
enhanceOverriddenSelect
protected String enhanceOverriddenSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, String overriddenSelect, TableId tableId) - Overrides:
enhanceOverriddenSelectin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
-
getTablesForSchemaChange
protected Collection<TableId> getTablesForSchemaChange(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) - Overrides:
getTablesForSchemaChangein classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
-
getCreateTableEvent
protected SchemaChangeEvent getCreateTableEvent(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, Table table) throws SQLException- Specified by:
getCreateTableEventin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
SQLException
-
getSnapshotSourceTimestamp
protected Instant getSnapshotSourceTimestamp(JdbcConnection jdbcConnection, OracleOffsetContext offset, TableId tableId) - Overrides:
getSnapshotSourceTimestampin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
-
getSnapshotSelect
protected Optional<String> getSnapshotSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, TableId tableId, List<String> columns) Generate a valid Oracle query string for the specified table and columns- Specified by:
getSnapshotSelectin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Parameters:
tableId- the table to generate a query for- Returns:
- a valid query string
-
getSignalDataCollectionPattern
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
-
quote
-
copyOffset
protected OracleOffsetContext copyOffset(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) - Specified by:
copyOffsetin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
-