K
- the type of keysV
- the type of valuespublic class DistributedReadOnlyKeyValueStore<K,V> extends DistributedReadOnlyStateStore<K,V,ExtReadOnlyKeyValueStore<K,V>> implements ExtReadOnlyKeyValueStore<K,V>
ReadOnlyKeyValueStore
that is distributed among KafkaStreams processing nodes comprising
the distributed streams application. It dispatches requests to stores on local and remote
KafkaStreams processing nodes that contain parts of the data which is looked up.Constructor and Description |
---|
DistributedReadOnlyKeyValueStore(org.apache.kafka.streams.KafkaStreams streams,
org.apache.kafka.streams.state.HostInfo localApplicationServer,
String storeName,
org.apache.kafka.common.serialization.Serde<K> keySerde,
org.apache.kafka.common.serialization.Serde<V> valSerde,
Function<? super org.apache.kafka.streams.state.HostInfo,? extends io.grpc.Channel> grpcChannelProvider,
boolean parallel,
FilterPredicate<K,V> filterPredicate) |
Modifier and Type | Method and Description |
---|---|
org.apache.kafka.streams.state.KeyValueIterator<K,V> |
all() |
Stream<K> |
allKeys()
All keys, as a stream.
|
long |
approximateNumEntries() |
Stream<org.apache.kafka.streams.KeyValue<K,V>> |
filter(String filter,
String over)
Get filtered stream.
|
V |
get(K key) |
protected ExtReadOnlyKeyValueStore<K,V> |
localService(String storeName,
org.apache.kafka.streams.KafkaStreams streams) |
org.apache.kafka.streams.state.KeyValueIterator<K,V> |
range(K from,
K to) |
protected ExtReadOnlyKeyValueStore<K,V> |
remoteServiceGrpcClient(String storeName,
io.grpc.Channel channel,
org.apache.kafka.common.serialization.Serde<K> keySerde,
org.apache.kafka.common.serialization.Serde<V> valSerde) |
remoteServiceGrpcClient
allServices, allServicesForStore, allServicesForStoreStream, allServicesStream, close, getKeySerde, serviceForKey
public DistributedReadOnlyKeyValueStore(org.apache.kafka.streams.KafkaStreams streams, org.apache.kafka.streams.state.HostInfo localApplicationServer, String storeName, org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V> valSerde, Function<? super org.apache.kafka.streams.state.HostInfo,? extends io.grpc.Channel> grpcChannelProvider, boolean parallel, FilterPredicate<K,V> filterPredicate)
streams
- The KafkaStreams
applicationlocalApplicationServer
- The HostInfo
derived from the
application.server
configuration property of local kafka streams node for the streams application.
This is used to identify requests for local store, bypassing gRPC callsstoreName
- The name of the ReadOnlyKeyValueStore
registered in the streams applicationkeySerde
- The Serde
for keys of the storevalSerde
- The Serde
for values of the storegrpcChannelProvider
- A function that establishes gRPC Channel
to a remote store service
for the given HostInfo
parameterparallel
- true
if lookups that need to query many stores in the cluster are
to be performed in parallelfilterPredicate
- filter predicate to filter out keys and valuesprotected ExtReadOnlyKeyValueStore<K,V> localService(String storeName, org.apache.kafka.streams.KafkaStreams streams)
localService
in class DistributedService<K,ExtReadOnlyKeyValueStore<K,V>>
protected ExtReadOnlyKeyValueStore<K,V> remoteServiceGrpcClient(String storeName, io.grpc.Channel channel, org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V> valSerde)
remoteServiceGrpcClient
in class DistributedReadOnlyStateStore<K,V,ExtReadOnlyKeyValueStore<K,V>>
public Stream<K> allKeys()
ExtReadOnlyKeyValueStore
allKeys
in interface ExtReadOnlyKeyValueStore<K,V>
public Stream<org.apache.kafka.streams.KeyValue<K,V>> filter(String filter, String over)
ExtReadOnlyKeyValueStore
filter
in interface ExtReadOnlyKeyValueStore<K,V>
filter
- the string filterover
- the search over enum nameCopyright © 2020 Red Hat. All rights reserved.