Package io.debezium.storage.s3.history
Class S3SchemaHistory
java.lang.Object
io.debezium.relational.history.AbstractSchemaHistory
io.debezium.relational.history.AbstractFileBasedSchemaHistory
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. AbstractFileBasedSchemaHistory.start() fetches history log
from S3 and store the HistoryRecord on the main memory. Also AbstractFileBasedSchemaHistory.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 URIstatic final Fieldstatic final Stringprivate static final org.slf4j.Loggerstatic final Stringstatic final Fieldstatic final Stringprivate Stringprivate software.amazon.awssdk.regions.Regionstatic final Fieldstatic final Stringstatic final Fieldstatic final StringFields inherited from class io.debezium.relational.history.AbstractFileBasedSchemaHistory
documentReader, documentWriter, lock, records, runningFields inherited from class io.debezium.relational.history.AbstractSchemaHistory
config, loggerFields inherited from interface io.debezium.relational.history.SchemaHistory
CONFIGURATION_FIELD_PREFIX_STRING, DDL_FILTER, INTERNAL_CONNECTOR_CLASS, INTERNAL_CONNECTOR_ID, INTERNAL_PREFER_DDL, NAME, SKIP_UNPARSEABLE_DDL_STATEMENTS, STORE_ONLY_CAPTURED_DATABASES_DDL, STORE_ONLY_CAPTURED_TABLES_DDL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration config, HistoryRecordComparator comparator, SchemaHistoryListener listener, boolean useCatalogBeforeSchema) protected voidprotected voiddoPreStoreRecord(HistoryRecord record) protected voiddoStart()voiddoStop()protected voiddoStoreRecord(HistoryRecord record) voidbooleantoString()Methods inherited from class io.debezium.relational.history.AbstractFileBasedSchemaHistory
exists, fromHistoryRecord, getRecords, recoverRecords, start, stop, storeRecord, toHistoryRecordMethods inherited from class io.debezium.relational.history.AbstractSchemaHistory
record, record, recoverMethods 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
-
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
-
-
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
-
doPreStart
protected void doPreStart()- Overrides:
doPreStartin classAbstractFileBasedSchemaHistory
-
doStart
protected void doStart()- Overrides:
doStartin classAbstractFileBasedSchemaHistory
-
doStop
public void doStop()- Overrides:
doStopin classAbstractFileBasedSchemaHistory
-
doPreStoreRecord
- Overrides:
doPreStoreRecordin classAbstractFileBasedSchemaHistory
-
doStoreRecord
- Overrides:
doStoreRecordin classAbstractFileBasedSchemaHistory
-
storageExists
public boolean storageExists() -
initializeStorage
public void initializeStorage()- Specified by:
initializeStoragein interfaceSchemaHistory- Overrides:
initializeStoragein classAbstractSchemaHistory
-
toString
-