Package io.debezium.storage.s3.history
Class S3SchemaHistory
java.lang.Object
io.debezium.relational.history.AbstractSchemaHistory
io.debezium.storage.s3.history.S3SchemaHistory
- All Implemented Interfaces:
SchemaHistory
A
SchemaHistory implementation that records schema changes as normal SourceRecords on the specified topic,
and that recovers the history by establishing a Kafka Consumer re-processing all messages on that topic.
This implementation provides caching HistoryRecord on the main memory in the case of recovering records.
Since S3 does not support Append operation on the object level. start() fetches history log
from S3 and store the HistoryRecord on the main memory. Also storeRecord(HistoryRecord)
creates new history object everytime invokes on S3- Author:
- hossein.torabi
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Fieldstatic final Stringstatic final Field.Setprivate Stringstatic final Fieldstatic final Stringprivate software.amazon.awssdk.services.s3.S3Clientprivate software.amazon.awssdk.auth.credentials.AwsCredentialsProviderprivate final DocumentWriterprivate URIstatic final Fieldstatic final Stringprivate final FunctionalReadWriteLockprivate static final org.slf4j.Loggerstatic final Stringstatic final Fieldstatic final Stringprivate Stringprivate final DocumentReaderprivate List<HistoryRecord>private software.amazon.awssdk.regions.Regionstatic final Fieldstatic final Stringprivate final AtomicBooleanstatic final Fieldstatic final StringFields inherited from class io.debezium.relational.history.AbstractSchemaHistory
config, INTERNAL_CONNECTOR_CLASS, INTERNAL_CONNECTOR_ID, INTERNAL_PREFER_DDL, loggerFields inherited from interface io.debezium.relational.history.SchemaHistory
CONFIGURATION_FIELD_PREFIX_STRING, DDL_FILTER, NAME, SKIP_UNPARSEABLE_DDL_STATEMENTS, STORE_ONLY_CAPTURED_TABLES_DDL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration config, HistoryRecordComparator comparator, SchemaHistoryListener listener, boolean useCatalogBeforeSchema) booleanexists()voidprotected voidrecoverRecords(Consumer<HistoryRecord> records) voidstart()voidstop()booleanprotected voidstoreRecord(HistoryRecord record) toString()Methods inherited from class io.debezium.relational.history.AbstractSchemaHistory
record, record, recover, skipUnparseableDdlStatements, storeOnlyCapturedTablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.debezium.relational.history.SchemaHistory
recover, recover
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ACCESS_KEY_ID_CONFIG
- See Also:
-
SECRET_ACCESS_KEY_CONFIG
- See Also:
-
REGION_CONFIG
- See Also:
-
BUCKET_CONFIG
- See Also:
-
OBJECT_NAME_CONFIG
- See Also:
-
ENDPOINT_CONFIG
- See Also:
-
OBJECT_CONTENT_TYPE
- See Also:
-
ACCESS_KEY_ID
-
SECRET_ACCESS_KEY
-
REGION
-
BUCKET
-
OBJECT_NAME
-
ENDPOINT
-
ALL_FIELDS
-
running
-
lock
-
documentWriter
-
reader
-
bucket
-
objectName
-
region
private software.amazon.awssdk.regions.Region region -
endpoint
-
credentialsProvider
private software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider -
client
private volatile software.amazon.awssdk.services.s3.S3Client client -
records
-
-
Constructor Details
-
S3SchemaHistory
public S3SchemaHistory()
-
-
Method Details
-
configure
public void configure(Configuration config, HistoryRecordComparator comparator, SchemaHistoryListener listener, boolean useCatalogBeforeSchema) - Specified by:
configurein interfaceSchemaHistory- Overrides:
configurein classAbstractSchemaHistory
-
start
public void start()- Specified by:
startin interfaceSchemaHistory- Overrides:
startin classAbstractSchemaHistory
-
stop
public void stop()- Specified by:
stopin interfaceSchemaHistory- Overrides:
stopin classAbstractSchemaHistory
-
storeRecord
- Specified by:
storeRecordin classAbstractSchemaHistory- Throws:
SchemaHistoryException
-
recoverRecords
- Specified by:
recoverRecordsin classAbstractSchemaHistory
-
exists
public boolean exists() -
storageExists
public boolean storageExists() -
initializeStorage
public void initializeStorage()- Specified by:
initializeStoragein interfaceSchemaHistory- Overrides:
initializeStoragein classAbstractSchemaHistory
-
toString
-