Interface StateStoreContext
public interface StateStoreContext
State store context interface.
-
Method Summary
Modifier and TypeMethodDescriptionReturns all the application config properties as key/value pairs.appConfigsWithPrefix(String prefix) Returns all the application config properties with the given key prefix, as key/value pairs stripping the prefix.Returns the application id.Serde<?>keySerde()Returns the default key serde.metrics()Returns Metrics instance.voidregister(StateStore store, StateRestoreCallback stateRestoreCallback) Registers and possibly restores the specified storage engine.stateDir()Returns the state directory for the partition.taskId()Returns the task id.Serde<?>Returns the default value serde.
-
Method Details
-
applicationId
String applicationId()Returns the application id.- Returns:
- the application id
-
taskId
TaskId taskId()Returns the task id.- Returns:
- the task id
-
keySerde
Serde<?> keySerde()Returns the default key serde.- Returns:
- the key serializer
-
valueSerde
Serde<?> valueSerde()Returns the default value serde.- Returns:
- the value serializer
-
stateDir
File stateDir()Returns the state directory for the partition.- Returns:
- the state directory
-
metrics
StreamsMetrics metrics()Returns Metrics instance.- Returns:
- StreamsMetrics
-
register
Registers and possibly restores the specified storage engine.- Parameters:
store- the storage enginestateRestoreCallback- the restoration callback logic for log-backed state stores upon restart- Throws:
IllegalStateException- If store gets registered after initialized is already finishedStreamsException- if the store's change log does not contain the partition
-
appConfigs
Returns all the application config properties as key/value pairs.The config properties are defined in the
StreamsConfigobject and associated to the StateStoreContext.The type of the values is dependent on the
typeof the property (e.g. the value ofDEFAULT_KEY_SERDE_CLASS_CONFIGwill be of typeClass, even if it was specified as a String toStreamsConfig(Map)).- Returns:
- all the key/values from the StreamsConfig properties
-
appConfigsWithPrefix
Returns all the application config properties with the given key prefix, as key/value pairs stripping the prefix.The config properties are defined in the
StreamsConfigobject and associated to the StateStoreContext.- Parameters:
prefix- the properties prefix- Returns:
- the key/values matching the given prefix from the StreamsConfig properties.
-