public class InMemoryTimeOrderedKeyValueBuffer extends java.lang.Object implements TimeOrderedKeyValueBuffer
Modifier and Type | Class and Description |
---|---|
static class |
InMemoryTimeOrderedKeyValueBuffer.Builder |
Modifier and Type | Method and Description |
---|---|
long |
bufferSize() |
void |
close()
Close the storage engine.
|
void |
evictWhile(java.util.function.Supplier<java.lang.Boolean> predicate,
java.util.function.Consumer<KeyValue<org.apache.kafka.common.utils.Bytes,ContextualRecord>> callback) |
void |
flush()
Flush any cached data
|
void |
init(ProcessorContext context,
StateStore root)
Initializes this state store.
|
boolean |
isOpen()
Is this store open for reading and writing
|
long |
minTimestamp() |
java.lang.String |
name()
The name of this store.
|
int |
numRecords() |
boolean |
persistent()
Return if the storage is persistent or not.
|
void |
put(long time,
org.apache.kafka.common.utils.Bytes key,
ContextualRecord value) |
public java.lang.String name()
StateStore
name
in interface StateStore
public boolean persistent()
StateStore
persistent
in interface StateStore
true
if the storage is persistent—false
otherwisepublic void init(ProcessorContext context, StateStore root)
StateStore
The implementation of this function must register the root store in the context via the
ProcessorContext.register(StateStore, StateRestoreCallback)
function, where the
first StateStore
parameter should always be the passed-in root
object, and
the second parameter should be an object of user's implementation
of the StateRestoreCallback
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 extends StateRestoreCallback
to
let users implement bulk-load restoration logic instead of restoring one record at a time.
init
in interface StateStore
public boolean isOpen()
StateStore
isOpen
in interface StateStore
true
if the store is openpublic void close()
StateStore
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
close
in interface StateStore
public void flush()
StateStore
flush
in interface StateStore
public void evictWhile(java.util.function.Supplier<java.lang.Boolean> predicate, java.util.function.Consumer<KeyValue<org.apache.kafka.common.utils.Bytes,ContextualRecord>> callback)
evictWhile
in interface TimeOrderedKeyValueBuffer
public void put(long time, org.apache.kafka.common.utils.Bytes key, ContextualRecord value)
put
in interface TimeOrderedKeyValueBuffer
public int numRecords()
numRecords
in interface TimeOrderedKeyValueBuffer
public long bufferSize()
bufferSize
in interface TimeOrderedKeyValueBuffer
public long minTimestamp()
minTimestamp
in interface TimeOrderedKeyValueBuffer