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 T
fetch(String key)
Fetches the most recent state value stored under the provided key in this repository.void
insert(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:AppendOnlyStateRepository
Fetches the most recent state value stored under the provided key in this repository.- Specified by:
fetch
in 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:AppendOnlyStateRepository
Appends the provided state value, with the provided key, to this repository.- Specified by:
insert
in interfaceAppendOnlyStateRepository<T>
- Parameters:
key
- key associated with the state valuevalue
- state value
-
-