public <K> KeyQueryMetadata queryMetadataForKey(final String storeName,
                                                    final K key,
                                                    final Serializer<K> keySerializer) {
        validateIsRunningOrRebalancing();
        return streamsMetadataState.getKeyQueryMetadataForKey(storeName, key, keySerializer);
    }
Finds the metadata containing the active hosts and standby hosts where the key being queried would reside.

@param storeName     the {@code storeName} to find metadata for
@param key           the key to find metadata for
@param keySerializer serializer for the key
@param <K>           key type
Returns {@link KeyQueryMetadata} containing all metadata about hosting the given key for the given store,
or {@code null} if no matching metadata could be found.
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java