Class DefaultAppendOnlyStateRepository<T>
- java.lang.Object
-
- com.snowflake.connectors.common.state.DefaultAppendOnlyStateRepository<T>
-
- All Implemented Interfaces:
AppendOnlyStateRepository<T>
public class DefaultAppendOnlyStateRepository<T> extends Object implements AppendOnlyStateRepository<T>
Default implementation ofAppendOnlyStateRepository.
-
-
Constructor Summary
Constructors Constructor Description DefaultAppendOnlyStateRepository(AppendOnlyTable table, Class<T> clazz)Creates a newDefaultAppendOnlyStateRepository, using the provided table for data storage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tfetch(String key)Fetches the most recent state value stored under the provided key in this repository.voidinsert(String key, T value)Appends the provided state value, with the provided key, to this repository.
-
-
-
Constructor Detail
-
DefaultAppendOnlyStateRepository
public DefaultAppendOnlyStateRepository(AppendOnlyTable table, Class<T> clazz)
Creates a newDefaultAppendOnlyStateRepository, using the provided table for data storage.- Parameters:
table- append-only table used for data storageclazz- class representing state values stored in this repository
-
-
Method Detail
-
fetch
public T fetch(String key)
Description copied from interface:AppendOnlyStateRepositoryFetches the most recent state value stored under the provided key in this repository.- Specified by:
fetchin interfaceAppendOnlyStateRepository<T>- Parameters:
key- key associated with the state value- Returns:
- object stored under the provided key in this repository
-
insert
public void insert(String key, T value)
Description copied from interface:AppendOnlyStateRepositoryAppends the provided state value, with the provided key, to this repository.- Specified by:
insertin interfaceAppendOnlyStateRepository<T>- Parameters:
key- key associated with the state valuevalue- state value
-
-