Skip to content

StreamsMetadataState

StreamsMetadataState is used by a KafkaStreams instance to manage global metadata (of all the KafkaStreamss of a Kafka Streams application).

Creating Instance

StreamsMetadataState takes the following to be created:

StreamsMetadataState is created when:

Global Metadata

List<StreamsMetadata> allMetadata

StreamsMetadataState uses a allMetadata internal registry for all StreamsMetadatas.

The allMetadata registry is initially empty and rebuilt every onChange.

The allMetadata registry is available using KafkaStreams.metadataForAllStreamsClients.

Used when:

onChange

void onChange(
  Map<HostInfo, Set<TopicPartition>> activePartitionHostMap,
  Map<HostInfo, Set<TopicPartition>> standbyPartitionHostMap,
  Cluster clusterMetadata)

onChange stores the given Cluster metadata (in the clusterMetadata internal registry) and rebuildMetadata.

onChange is used when:

rebuildMetadata

void rebuildMetadata(
  Map<HostInfo, Set<TopicPartition>> activePartitionHostMap,
  Map<HostInfo, Set<TopicPartition>> standbyPartitionHostMap)

rebuildMetadata...FIXME

getKeyQueryMetadataForKey

KeyQueryMetadata getKeyQueryMetadataForKey(
  String storeName,
  K key,
  Serializer<K> keySerializer) // (1)
KeyQueryMetadata getKeyQueryMetadataForKey(
  String storeName,
  K key,
  StreamPartitioner<? super K, ?> partitioner)
KeyQueryMetadata getKeyQueryMetadataForKey(
  String storeName,
  K key,
  StreamPartitioner<? super K, ?> partitioner,
  SourceTopicsInfo sourceTopicsInfo) // (2)
  1. Uses DefaultStreamPartitioner
  2. A private method

getKeyQueryMetadataForKey...FIXME

getKeyQueryMetadataForKey is used when:

Back to top