Interface SegmentedBytesStore
-
- All Superinterfaces:
StateStore
- All Known Implementing Classes:
AbstractRocksDBSegmentedBytesStore,RocksDBSegmentedBytesStore,RocksDBTimestampedSegmentedBytesStore
public interface SegmentedBytesStore extends StateStore
The interface representing a StateStore that has 1 or more segments that are based on time.- See Also:
RocksDBSegmentedBytesStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSegmentedBytesStore.KeySchema
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]>all()Gets all the key-value pairs in the existing windows.KeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]>fetch(org.apache.kafka.common.utils.Bytes key, long from, long to)Fetch all records from the segmented store with the provided key and time range from all existing segmentsKeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]>fetch(org.apache.kafka.common.utils.Bytes keyFrom, org.apache.kafka.common.utils.Bytes keyTo, long from, long to)Fetch all records from the segmented store in the provided key range and time range from all existing segmentsKeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]>fetchAll(long from, long to)Gets all the key-value pairs that belong to the windows within in the given time range.byte[]get(org.apache.kafka.common.utils.Bytes key)Get the record from the store with the given key.voidput(org.apache.kafka.common.utils.Bytes key, byte[] value)Write a new value to the store with the provided key.voidremove(org.apache.kafka.common.utils.Bytes key)Remove the record with the provided key.-
Methods inherited from interface org.apache.kafka.streams.processor.StateStore
close, flush, init, isOpen, name, persistent
-
-
-
-
Method Detail
-
fetch
KeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]> fetch(org.apache.kafka.common.utils.Bytes key, long from, long to)
Fetch all records from the segmented store with the provided key and time range from all existing segments- Parameters:
key- the key to matchfrom- earliest time to matchto- latest time to match- Returns:
- an iterator over key-value pairs
-
fetch
KeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]> fetch(org.apache.kafka.common.utils.Bytes keyFrom, org.apache.kafka.common.utils.Bytes keyTo, long from, long to)
Fetch all records from the segmented store in the provided key range and time range from all existing segments- Parameters:
keyFrom- The first key that could be in the rangekeyTo- The last key that could be in the rangefrom- earliest time to matchto- latest time to match- Returns:
- an iterator over key-value pairs
-
all
KeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]> all()
Gets all the key-value pairs in the existing windows.- Returns:
- an iterator over windowed key-value pairs
<Windowed<K>, value> - Throws:
InvalidStateStoreException- if the store is not initialized
-
fetchAll
KeyValueIterator<org.apache.kafka.common.utils.Bytes,byte[]> fetchAll(long from, long to)
Gets all the key-value pairs that belong to the windows within in the given time range.- Parameters:
from- the beginning of the time slot from which to searchto- the end of the time slot from which to search- Returns:
- an iterator over windowed key-value pairs
<Windowed<K>, value> - Throws:
InvalidStateStoreException- if the store is not initializedjava.lang.NullPointerException- if null is used for any key
-
remove
void remove(org.apache.kafka.common.utils.Bytes key)
Remove the record with the provided key. The key should be a composite of the record key, and the timestamp information etc as described by theSegmentedBytesStore.KeySchema- Parameters:
key- the segmented key to remove
-
put
void put(org.apache.kafka.common.utils.Bytes key, byte[] value)Write a new value to the store with the provided key. The key should be a composite of the record key, and the timestamp information etc as described by theSegmentedBytesStore.KeySchema- Parameters:
key-value-
-
get
byte[] get(org.apache.kafka.common.utils.Bytes key)
Get the record from the store with the given key. The key should be a composite of the record key, and the timestamp information etc as described by theSegmentedBytesStore.KeySchema- Parameters:
key-- Returns:
-
-