Class WrappedStateStore.AbstractStateStore
- java.lang.Object
-
- org.apache.kafka.streams.state.internals.WrappedStateStore.AbstractStateStore
-
- All Implemented Interfaces:
StateStore
,WrappedStateStore
- Direct Known Subclasses:
ChangeLoggingKeyValueBytesStore
,InMemoryKeyValueLoggedStore
,MeteredKeyValueStore
,MeteredSessionStore
,MeteredWindowStore
,RocksDBSessionStore
,RocksDBWindowStore
- Enclosing interface:
- WrappedStateStore
public abstract static class WrappedStateStore.AbstractStateStore extends java.lang.Object implements WrappedStateStore
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.kafka.streams.state.internals.WrappedStateStore
WrappedStateStore.AbstractStateStore
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the storage engine.void
flush()
Flush any cached datavoid
init(ProcessorContext context, StateStore root)
Initializes this state store.StateStore
inner()
Return the inner most storage engineboolean
isOpen()
Is this store open for reading and writingjava.lang.String
name()
The name of this store.boolean
persistent()
Return if the storage is persistent or not.StateStore
wrappedStore()
Return the state store this store directly wraps
-
-
-
Method Detail
-
init
public void init(ProcessorContext context, StateStore root)
Description copied from interface:StateStore
Initializes this state store.The implementation of this function must register the root store in the context via the
ProcessorContext.register(StateStore, StateRestoreCallback)
function, where the firstStateStore
parameter should always be the passed-inroot
object, and the second parameter should be an object of user's implementation of theStateRestoreCallback
interface used for restoring the state store from the changelog.Note that if the state store engine itself supports bulk writes, users can implement another interface
BatchingStateRestoreCallback
which extendsStateRestoreCallback
to let users implement bulk-load restoration logic instead of restoring one record at a time.- Specified by:
init
in interfaceStateStore
-
name
public java.lang.String name()
Description copied from interface:StateStore
The name of this store.- Specified by:
name
in interfaceStateStore
- Returns:
- the storage name
-
persistent
public boolean persistent()
Description copied from interface:StateStore
Return if the storage is persistent or not.- Specified by:
persistent
in interfaceStateStore
- Returns:
true
if the storage is persistent—false
otherwise
-
isOpen
public boolean isOpen()
Description copied from interface:StateStore
Is this store open for reading and writing- Specified by:
isOpen
in interfaceStateStore
- Returns:
true
if the store is open
-
inner
public StateStore inner()
Description copied from interface:WrappedStateStore
Return the inner most storage engine- Specified by:
inner
in interfaceWrappedStateStore
- Returns:
- wrapped inner storage engine
-
flush
public void flush()
Description copied from interface:StateStore
Flush any cached data- Specified by:
flush
in interfaceStateStore
-
close
public void close()
Description copied from interface:StateStore
Close the storage engine. Note that this function needs to be idempotent since it may be called several times on the same state store.Users only need to implement this function but should NEVER need to call this api explicitly as it will be called by the library automatically when necessary
- Specified by:
close
in interfaceStateStore
-
wrappedStore
public StateStore wrappedStore()
Description copied from interface:WrappedStateStore
Return the state store this store directly wraps- Specified by:
wrappedStore
in interfaceWrappedStateStore
- Returns:
- the state store this store directly wraps
-
-