Interface IExtractionStateStore
Represents a general extractor state store, for storing first/last timestamps.
Inherited Members
Namespace: Cognite.Extractor.StateStorage
Assembly: Cognite.StateStorage.dll
Syntax
public interface IExtractionStateStore : IDisposable
Methods
| Edit this page View SourceDeleteExtractionState(IEnumerable<IExtractionState>, string, CancellationToken)
Deletes states from state store table given by tableName
Declaration
Task DeleteExtractionState(IEnumerable<IExtractionState> extractionStates, string tableName, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IExtractionState> | extractionStates | States to delete |
| string | tableName | Collection to delete from |
| CancellationToken | token |
Returns
| Type | Description |
|---|---|
| Task |
GetAllExtractionStates<T>(string, CancellationToken)
Find all extraction states in the table.
Declaration
Task<IEnumerable<T>> GetAllExtractionStates<T>(string tableName, CancellationToken token) where T : BaseStorableState
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableName | Name of table to restore from |
| CancellationToken | token |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<T>> |
Type Parameters
| Name | Description |
|---|---|
| T | Type of state to obtain |
RestoreExtractionState<K>(IDictionary<string, K>, string, bool, CancellationToken)
Restores state from state store table given by tableName
Declaration
Task RestoreExtractionState<K>(IDictionary<string, K> extractionStates, string tableName, bool initializeMissing, CancellationToken token) where K : BaseExtractionState
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, K> | extractionStates | States to restore |
| string | tableName | Collection to restore from |
| bool | initializeMissing | If true, initialize states missing from store to empty. |
| CancellationToken | token |
Returns
| Type | Description |
|---|---|
| Task |
Type Parameters
| Name | Description |
|---|---|
| K | Subtype of BaseExtractionState used as state |
RestoreExtractionState<T, K>(IDictionary<string, K>, string, Action<K, T>, CancellationToken)
Generic method to restore state with a custom type.
Declaration
Task RestoreExtractionState<T, K>(IDictionary<string, K> extractionStates, string tableName, Action<K, T> restoreStorableState, CancellationToken token) where T : BaseStorableState where K : IExtractionState
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, K> | extractionStates | States to store |
| string | tableName | Collection to store into |
| Action<K, T> | restoreStorableState | Action for pair of stored object and state, to restore the state with information from the poco |
| CancellationToken | token |
Returns
| Type | Description |
|---|---|
| Task |
Type Parameters
| Name | Description |
|---|---|
| T | Subtype of BaseStorableState inserted into state store |
| K | Implementation of IExtractionState used as state |
StoreExtractionState<K>(IEnumerable<K>, string, CancellationToken)
Store states into state store table given by tableName
Declaration
Task StoreExtractionState<K>(IEnumerable<K> extractionStates, string tableName, CancellationToken token) where K : BaseExtractionState
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<K> | extractionStates | States to store |
| string | tableName | Collection to store to |
| CancellationToken | token |
Returns
| Type | Description |
|---|---|
| Task |
Type Parameters
| Name | Description |
|---|---|
| K |
StoreExtractionState<T, K>(IEnumerable<K>, string, Func<K, T>, CancellationToken)
Store information from states into state store
Declaration
Task StoreExtractionState<T, K>(IEnumerable<K> extractionStates, string tableName, Func<K, T> buildStorableState, CancellationToken token) where T : BaseStorableState where K : IExtractionState
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<K> | extractionStates | States to store |
| string | tableName | Collection to store into |
| Func<K, T> | buildStorableState | Method to create a storable state from extraction state |
| CancellationToken | token |
Returns
| Type | Description |
|---|---|
| Task |
Type Parameters
| Name | Description |
|---|---|
| T | Subtype of BaseStorableState extracted from state store |
| K | Implementation of IExtractionState used as state |