Interface TableMappingStorage<V>

Type Parameters:
V - the type of values stored
All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractCachedTableMappingStorage, ConcurrentMapTableMappingStorage

@Incubating public interface TableMappingStorage<V> extends AutoCloseable
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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Enum representing the type of storage.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all mappings from this storage.
    void
    Closes this storage and releases any system resources associated with it.
    void
    configure(RelationalDatabaseConnectorConfig config, boolean tableIdCaseInsensitive, TableMappingStorage.Type type)
    Configures this storage instance with connector configuration.
    void
    forEach(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.
    get(TableId tableId)
    Retrieves the value associated with the given table identifier.
    boolean
    Returns true if this storage contains no mappings.
    Returns a set view of the table identifiers contained in this storage.
    put(TableId tableId, V value)
    Associates the specified value with the specified table identifier.
    remove(TableId tableId)
    Removes the mapping for the specified table identifier.
    int
    Returns the number of table identifier-value mappings in this storage.
  • Field Details

  • 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 configuration
      tableIdCaseInsensitive - whether table identifiers should be treated case-insensitively
      type - the type of storage (schemas or tables)
    • get

      V get(TableId tableId)
      Retrieves the value associated with the given table identifier.
      Parameters:
      tableId - the table identifier
      Returns:
      the associated value, or null if not present
    • put

      V put(TableId tableId, V value)
      Associates the specified value with the specified table identifier.
      Parameters:
      tableId - the table identifier
      value - the value to be associated
      Returns:
      the previous value associated with the table identifier, or null if there was no mapping
    • remove

      V remove(TableId tableId)
      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

      Set<TableId> keySet()
      Returns a set view of the table identifiers contained in this storage.
      Returns:
      a set view of the table identifiers
    • forEach

      void forEach(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.
      Parameters:
      action - the action to be performed for each entry
    • close

      void close() throws Exception
      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:
      close in interface AutoCloseable
      Throws:
      Exception - if this resource cannot be closed