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>
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, OracleConnection jdbcConnection, OracleDatabaseSchema schema, EventDispatcher<OraclePartition, TableId> dispatcher, Clock clock, SnapshotProgressListener<OraclePartition> snapshotProgressListener) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcomplete(AbstractSnapshotChangeEventSource.SnapshotContext<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) getSnapshotSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, TableId tableId, List<String> columns) Generate a valid Oracle query string for the specified table and columnsgetSnapshottingTask(OraclePartition partition, OracleOffsetContext previousOffset) protected voidlockTablesForSchemaSnapshot(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) prepare(OraclePartition partition) private static 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, getColumnValue, getPreparedColumnNames, lastSnapshotRecord, postSnapshot, readTableStatement, releaseDataSnapshotLocks, rowCountForTable, schema, tryStartingSnapshotMethods inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
delaySnapshotIfNeeded, determineDataCollectionsToBeSnapshotted, execute
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
connectorConfig
-
jdbcConnection
-
databaseSchema
-
-
Constructor Details
-
OracleSnapshotChangeEventSource
public OracleSnapshotChangeEventSource(OracleConnectorConfig connectorConfig, OracleConnection jdbcConnection, 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
-
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>
-
getCreateTableEvent
protected SchemaChangeEvent getCreateTableEvent(RelationalSnapshotChangeEventSource.RelationalSnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext, Table table) throws SQLException- Specified by:
getCreateTableEventin classRelationalSnapshotChangeEventSource<OraclePartition,OracleOffsetContext> - Throws:
SQLException
-
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
-
complete
protected void complete(AbstractSnapshotChangeEventSource.SnapshotContext<OraclePartition, OracleOffsetContext> snapshotContext) - Overrides:
completein classAbstractSnapshotChangeEventSource<OraclePartition,OracleOffsetContext>
-
quote
-