Class WindowStoreFacade<K,V>
- java.lang.Object
-
- org.apache.kafka.streams.state.internals.ReadOnlyWindowStoreFacade<K,V>
-
- org.apache.kafka.streams.internals.WindowStoreFacade<K,V>
-
- All Implemented Interfaces:
StateStore
,ReadOnlyWindowStore<K,V>
,WindowStore<K,V>
public class WindowStoreFacade<K,V> extends ReadOnlyWindowStoreFacade<K,V> implements WindowStore<K,V>
-
-
Field Summary
-
Fields inherited from class org.apache.kafka.streams.state.internals.ReadOnlyWindowStoreFacade
inner
-
-
Constructor Summary
Constructors Constructor Description WindowStoreFacade(TimestampedWindowStore<K,V> store)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated 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.boolean
isOpen()
Is this store open for reading and writingString
name()
The name of this store.boolean
persistent()
Return if the storage is persistent or not.void
put(K key, V value)
Deprecated.void
put(K key, V value, long windowStartTimestamp)
Put a key-value pair into the window with given window start timestamp-
Methods inherited from class org.apache.kafka.streams.state.internals.ReadOnlyWindowStoreFacade
all, fetch, fetch, fetch, fetch, fetch, fetchAll, fetchAll
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.kafka.streams.state.ReadOnlyWindowStore
all, fetch
-
-
-
-
Constructor Detail
-
WindowStoreFacade
public WindowStoreFacade(TimestampedWindowStore<K,V> store)
-
-
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
-
put
@Deprecated public void put(K key, V value)
Deprecated.Description copied from interface:WindowStore
Use the current record timestamp as thewindowStartTimestamp
and delegate toWindowStore.put(Object, Object, long)
.It's highly recommended to use
WindowStore.put(Object, Object, long)
instead, as the record timestamp is unlikely to be the correct windowStartTimestamp in general.- Specified by:
put
in interfaceWindowStore<K,V>
- Parameters:
key
- The key to associate the value tovalue
- The value to update, it can be null; if the serialized bytes are also null it is interpreted as delete
-
put
public void put(K key, V value, long windowStartTimestamp)
Description copied from interface:WindowStore
Put a key-value pair into the window with given window start timestampIf serialized value bytes are null it is interpreted as delete. Note that deletes will be ignored in the case of an underlying store that retains duplicates.
- Specified by:
put
in interfaceWindowStore<K,V>
- Parameters:
key
- The key to associate the value tovalue
- The value; can be nullwindowStartTimestamp
- The timestamp of the beginning of the window to put the key/value into
-
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
-
name
public 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
-
-