Package io.debezium.connector.cassandra
Class SchemaHolder
- java.lang.Object
-
- io.debezium.connector.cassandra.SchemaHolder
-
public class SchemaHolder extends Object
Listening to schema changes in Cassandra DB and caches the key and value schema for all CDC-enabled tables. This cache gets updated whenever there's a schema change in Cassandra DB
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classSchemaHolder.CassandraSchemaChangeListener
-
Field Summary
Fields Modifier and Type Field Description private CassandraClientcassandraClientprivate StringkafkaTopicPrefixprivate static org.slf4j.LoggerLOGGERprivate com.datastax.driver.core.SchemaChangeListenerschemaChangeListenerprivate io.debezium.connector.SourceInfoStructMaker<SourceInfo>sourceInfoStructMakerprivate ConcurrentMap<KeyspaceTable,KeyValueSchema>tableToKVSchemaMap
-
Constructor Summary
Constructors Constructor Description SchemaHolder(CassandraClient cassandraClient, String kafkaTopicPrefix, io.debezium.connector.SourceInfoStructMaker<SourceInfo> sourceInfoStructMaker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddOrUpdateTableSchema(KeyspaceTable kst, KeyValueSchema kvs)voidclose()Set<com.datastax.driver.core.TableMetadata>getCdcEnabledTableMetadataSet()KeyValueSchemagetKeyValueSchema(KeyspaceTable kst)private voidinitialize()private voidremoveTableSchema(KeyspaceTable kst)
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
tableToKVSchemaMap
private final ConcurrentMap<KeyspaceTable,KeyValueSchema> tableToKVSchemaMap
-
kafkaTopicPrefix
private final String kafkaTopicPrefix
-
sourceInfoStructMaker
private final io.debezium.connector.SourceInfoStructMaker<SourceInfo> sourceInfoStructMaker
-
cassandraClient
private final CassandraClient cassandraClient
-
schemaChangeListener
private final com.datastax.driver.core.SchemaChangeListener schemaChangeListener
-
-
Constructor Detail
-
SchemaHolder
public SchemaHolder(CassandraClient cassandraClient, String kafkaTopicPrefix, io.debezium.connector.SourceInfoStructMaker<SourceInfo> sourceInfoStructMaker)
-
-
Method Detail
-
initialize
private void initialize()
-
close
public void close()
-
getKeyValueSchema
public KeyValueSchema getKeyValueSchema(KeyspaceTable kst)
-
getCdcEnabledTableMetadataSet
public Set<com.datastax.driver.core.TableMetadata> getCdcEnabledTableMetadataSet()
-
removeTableSchema
private void removeTableSchema(KeyspaceTable kst)
-
addOrUpdateTableSchema
private void addOrUpdateTableSchema(KeyspaceTable kst, KeyValueSchema kvs)
-
-