public class SessionKeySchema extends java.lang.Object implements SegmentedBytesStore.KeySchema
Constructor and Description |
---|
SessionKeySchema() |
Modifier and Type | Method and Description |
---|---|
static long |
extractEndTimestamp(byte[] binaryKey) |
static byte[] |
extractKeyBytes(byte[] binaryKey) |
static long |
extractStartTimestamp(byte[] binaryKey) |
static Window |
extractWindow(byte[] binaryKey) |
static <K> Windowed<K> |
from(byte[] binaryKey,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
java.lang.String topic) |
static Windowed<org.apache.kafka.common.utils.Bytes> |
from(org.apache.kafka.common.utils.Bytes bytesKey) |
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 of
HasNextCondition that knows when
to stop iterating over the Segments. |
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.
|
java.util.List<org.apache.kafka.streams.state.internals.Segment> |
segmentsToSearch(org.apache.kafka.streams.state.internals.Segments segments,
long from,
long to)
Used during
SegmentedBytesStore.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.
|
static byte[] |
toBinary(Windowed<org.apache.kafka.common.utils.Bytes> sessionKey) |
static <K> byte[] |
toBinary(Windowed<K> sessionKey,
org.apache.kafka.common.serialization.Serializer<K> serializer,
java.lang.String topic) |
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.
|
public org.apache.kafka.common.utils.Bytes upperRangeFixedSize(org.apache.kafka.common.utils.Bytes key, long to)
SegmentedBytesStore.KeySchema
upperRangeFixedSize
in interface SegmentedBytesStore.KeySchema
key
- the last key in the rangeto
- the last timestamp in the rangeupperRange(org.apache.kafka.common.utils.Bytes, long)
,
WindowKeySchema.upperRange(org.apache.kafka.common.utils.Bytes, long)
public org.apache.kafka.common.utils.Bytes lowerRangeFixedSize(org.apache.kafka.common.utils.Bytes key, long from)
SegmentedBytesStore.KeySchema
lowerRangeFixedSize
in interface SegmentedBytesStore.KeySchema
key
- the first key in the rangefrom
- the first timestamp in the rangelowerRange(org.apache.kafka.common.utils.Bytes, long)
,
WindowKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
public org.apache.kafka.common.utils.Bytes upperRange(org.apache.kafka.common.utils.Bytes key, long to)
SegmentedBytesStore.KeySchema
upperRange
in interface SegmentedBytesStore.KeySchema
upperRange(org.apache.kafka.common.utils.Bytes, long)
,
WindowKeySchema.upperRange(org.apache.kafka.common.utils.Bytes, long)
public org.apache.kafka.common.utils.Bytes lowerRange(org.apache.kafka.common.utils.Bytes key, long from)
SegmentedBytesStore.KeySchema
lowerRange
in interface SegmentedBytesStore.KeySchema
lowerRange(org.apache.kafka.common.utils.Bytes, long)
,
WindowKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
public long segmentTimestamp(org.apache.kafka.common.utils.Bytes key)
SegmentedBytesStore.KeySchema
segmentTimestamp
in interface SegmentedBytesStore.KeySchema
lowerRange(org.apache.kafka.common.utils.Bytes, long)
,
WindowKeySchema.lowerRange(org.apache.kafka.common.utils.Bytes, long)
public 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)
SegmentedBytesStore.KeySchema
HasNextCondition
that knows when
to stop iterating over the Segments. Used during SegmentedBytesStore.fetch(Bytes, Bytes, long, long)
operationshasNextCondition
in interface SegmentedBytesStore.KeySchema
binaryKeyFrom
- the first key in the rangebinaryKeyTo
- the last key in the rangefrom
- starting time rangeto
- ending time rangepublic java.util.List<org.apache.kafka.streams.state.internals.Segment> segmentsToSearch(org.apache.kafka.streams.state.internals.Segments segments, long from, long to)
SegmentedBytesStore.KeySchema
SegmentedBytesStore.fetch(Bytes, long, long)
operations to determine
which segments should be scanned.segmentsToSearch
in interface SegmentedBytesStore.KeySchema
public static byte[] extractKeyBytes(byte[] binaryKey)
public static long extractEndTimestamp(byte[] binaryKey)
public static long extractStartTimestamp(byte[] binaryKey)
public static Window extractWindow(byte[] binaryKey)
public static <K> Windowed<K> from(byte[] binaryKey, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, java.lang.String topic)
public static Windowed<org.apache.kafka.common.utils.Bytes> from(org.apache.kafka.common.utils.Bytes bytesKey)
public static <K> byte[] toBinary(Windowed<K> sessionKey, org.apache.kafka.common.serialization.Serializer<K> serializer, java.lang.String topic)
public static byte[] toBinary(Windowed<org.apache.kafka.common.utils.Bytes> sessionKey)