Interface SegmentedBytesStore.KeySchema
-
- All Known Implementing Classes:
SessionKeySchema
,WindowKeySchema
- Enclosing interface:
- SegmentedBytesStore
public static interface SegmentedBytesStore.KeySchema
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.kafka.streams.state.internals.HasNextCondition
hasNextCondition(org.apache.kafka.common.utils.Bytes binaryKeyFrom, org.apache.kafka.common.utils.Bytes binaryKeyTo, long from, long to)
Create an implementation ofHasNextCondition
that knows when to stop iterating over the KeyValueSegments.org.apache.kafka.common.utils.Bytes
lowerRange(org.apache.kafka.common.utils.Bytes key, long from)
Given a range of record keys and a time, construct a Segmented key that represents the lower range of keys to search when performing range queries.org.apache.kafka.common.utils.Bytes
lowerRangeFixedSize(org.apache.kafka.common.utils.Bytes key, long from)
Given a range of fixed size record keys and a time, construct a Segmented key that represents the lower range of keys to search when performing range queries.<S extends Segment>
List<S>segmentsToSearch(org.apache.kafka.streams.state.internals.Segments<S> segments, long from, long to)
Used duringSegmentedBytesStore.fetch(Bytes, long, long)
operations to determine which segments should be scanned.long
segmentTimestamp(org.apache.kafka.common.utils.Bytes key)
Extract the timestamp of the segment from the key.org.apache.kafka.common.utils.Bytes
upperRange(org.apache.kafka.common.utils.Bytes key, long to)
Given a range of record keys and a time, construct a Segmented key that represents the upper range of keys to search when performing range queries.org.apache.kafka.common.utils.Bytes
upperRangeFixedSize(org.apache.kafka.common.utils.Bytes key, long to)
Given a range of fixed size record keys and a time, construct a Segmented key that represents the upper range of keys to search when performing range queries.
-
-
-
Method Detail
-
upperRange
org.apache.kafka.common.utils.Bytes upperRange(org.apache.kafka.common.utils.Bytes key, long to)
Given a range of record keys and a time, construct a Segmented key that represents the upper range of keys to search when performing range queries.- Parameters:
key
-to
-- Returns:
- The key that represents the upper range to search for in the store
- See Also:
SessionKeySchema.upperRange(org.apache.kafka.common.utils.Bytes, long)
,WindowKeySchema.upperRange(org.apache.kafka.common.utils.Bytes, long)
-
lowerRange
org.apache.kafka.common.utils.Bytes lowerRange(org.apache.kafka.common.utils.Bytes key, long from)
Given a range of record keys and a time, construct a Segmented key that represents the lower range of keys to search when performing range queries.- Parameters:
key
-from
-- Returns:
- The key that represents the lower range to search for in the store
- See Also:
SessionKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
,WindowKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
-
upperRangeFixedSize
org.apache.kafka.common.utils.Bytes upperRangeFixedSize(org.apache.kafka.common.utils.Bytes key, long to)
Given a range of fixed size record keys and a time, construct a Segmented key that represents the upper range of keys to search when performing range queries.- Parameters:
key
- the last key in the rangeto
- the last timestamp in the range- Returns:
- The key that represents the upper range to search for in the store
- See Also:
SessionKeySchema.upperRange(org.apache.kafka.common.utils.Bytes, long)
,WindowKeySchema.upperRange(org.apache.kafka.common.utils.Bytes, long)
-
lowerRangeFixedSize
org.apache.kafka.common.utils.Bytes lowerRangeFixedSize(org.apache.kafka.common.utils.Bytes key, long from)
Given a range of fixed size record keys and a time, construct a Segmented key that represents the lower range of keys to search when performing range queries.- Parameters:
key
- the first key in the rangefrom
- the first timestamp in the range- Returns:
- The key that represents the lower range to search for in the store
- See Also:
SessionKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
,WindowKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
-
segmentTimestamp
long segmentTimestamp(org.apache.kafka.common.utils.Bytes key)
Extract the timestamp of the segment from the key. The key is a composite of the record-key, any timestamps, plus any additional information.- Parameters:
key
-- Returns:
- See Also:
SessionKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
,WindowKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
-
hasNextCondition
org.apache.kafka.streams.state.internals.HasNextCondition hasNextCondition(org.apache.kafka.common.utils.Bytes binaryKeyFrom, org.apache.kafka.common.utils.Bytes binaryKeyTo, long from, long to)
Create an implementation ofHasNextCondition
that knows when to stop iterating over the KeyValueSegments. Used duringSegmentedBytesStore.fetch(Bytes, Bytes, long, long)
operations- Parameters:
binaryKeyFrom
- the first key in the rangebinaryKeyTo
- the last key in the rangefrom
- starting time rangeto
- ending time range- Returns:
-
segmentsToSearch
<S extends Segment> List<S> segmentsToSearch(org.apache.kafka.streams.state.internals.Segments<S> segments, long from, long to)
Used duringSegmentedBytesStore.fetch(Bytes, long, long)
operations to determine which segments should be scanned.- Parameters:
segments
-from
-to
-- Returns:
- List of segments to search
-
-