Package io.debezium.relational
Interface TableMappingStorage<V>
- Type Parameters:
V- the type of values stored
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractCachedTableMappingStorage,ConcurrentMapTableMappingStorage
Interface for storing mappings between
TableId and associated data.
This abstraction allows for alternative storage implementations to reduce memory pressure.- Author:
- Debezium Authors
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnum representing the type of storage. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all mappings from this storage.voidclose()Closes this storage and releases any system resources associated with it.voidconfigure(RelationalDatabaseConnectorConfig config, boolean tableIdCaseInsensitive, TableMappingStorage.Type type) Configures this storage instance with connector configuration.voidforEach(BiConsumer<? super TableId, ? super V> action) Performs the given action for each entry in this storage until all entries have been processed or the action throws an exception.Retrieves the value associated with the given table identifier.booleanisEmpty()Returns true if this storage contains no mappings.keySet()Returns a set view of the table identifiers contained in this storage.Associates the specified value with the specified table identifier.Removes the mapping for the specified table identifier.intsize()Returns the number of table identifier-value mappings in this storage.
-
Field Details
-
STORAGE_PREFIX
- See Also:
-
STORAGE_PREFIX_SCHEMAS
- See Also:
-
STORAGE_PREFIX_TABLES
- See Also:
-
-
Method Details
-
configure
void configure(RelationalDatabaseConnectorConfig config, boolean tableIdCaseInsensitive, TableMappingStorage.Type type) Configures this storage instance with connector configuration. This method is called once after instantiation and before any other methods.- Parameters:
config- the connector configurationtableIdCaseInsensitive- whether table identifiers should be treated case-insensitivelytype- the type of storage (schemas or tables)
-
get
Retrieves the value associated with the given table identifier.- Parameters:
tableId- the table identifier- Returns:
- the associated value, or null if not present
-
put
Associates the specified value with the specified table identifier.- Parameters:
tableId- the table identifiervalue- the value to be associated- Returns:
- the previous value associated with the table identifier, or null if there was no mapping
-
remove
Removes the mapping for the specified table identifier.- Parameters:
tableId- the table identifier- Returns:
- the previous value associated with the table identifier, or null if there was no mapping
-
clear
void clear()Removes all mappings from this storage. -
size
int size()Returns the number of table identifier-value mappings in this storage.- Returns:
- the number of mappings
-
isEmpty
boolean isEmpty()Returns true if this storage contains no mappings.- Returns:
- true if this storage contains no mappings
-
keySet
Returns a set view of the table identifiers contained in this storage.- Returns:
- a set view of the table identifiers
-
forEach
Performs the given action for each entry in this storage until all entries have been processed or the action throws an exception.- Parameters:
action- the action to be performed for each entry
-
close
Closes this storage and releases any system resources associated with it. If the storage is already closed then invoking this method has no effect.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception- if this resource cannot be closed
-