jlprat commented on a change in pull request #10840:
URL: https://github.com/apache/kafka/pull/10840#discussion_r657132576



##########
File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
##########
@@ -1478,8 +1499,36 @@ public void cleanUp() {
      * @param storeName the {@code storeName} to find metadata for
      * @return {@link StreamsMetadata} for each {@code KafkaStreams} instances 
with the provide {@code storeName} of
      * this application
+     * @deprecated since 3.0.0 use {@link 
KafkaStreams#allMetadataForGivenStore} instead
      */
-    public Collection<StreamsMetadata> allMetadataForStore(final String 
storeName) {
+    @Deprecated
+    public Collection<org.apache.kafka.streams.state.StreamsMetadata> 
allMetadataForStore(final String storeName) {
+        validateIsRunningOrRebalancing();
+        return 
streamsMetadataState.getAllMetadataForStore(storeName).stream().map(streamsMetadata
 ->
+                new 
org.apache.kafka.streams.state.StreamsMetadata(streamsMetadata.hostInfo(),
+                        streamsMetadata.stateStoreNames(),
+                        streamsMetadata.topicPartitions(),
+                        streamsMetadata.standbyStateStoreNames(),
+                        streamsMetadata.standbyTopicPartitions()))
+                .collect(Collectors.toSet());
+    }
+
+    /**
+     * Find all currently running {@code KafkaStreams} instances (potentially 
remotely) that
+     * <ul>
+     *   <li>use the same {@link StreamsConfig#APPLICATION_ID_CONFIG 
application ID} as this instance (i.e., all
+     *       instances that belong to the same Kafka Streams application)</li>
+     *   <li>and that contain a {@link StateStore} with the given {@code 
storeName}</li>
+     * </ul>
+     * and return {@link StreamsMetadata} for each discovered instance.
+     * <p>
+     * Note: this is a point in time view and it may change due to partition 
reassignment.
+     *
+     * @param storeName the {@code storeName} to find metadata for
+     * @return {@link StreamsMetadata} for each {@code KafkaStreams} instances 
with the provide {@code storeName} of
+     * this application
+     */
+    public Collection<StreamsMetadata> allMetadataForGivenStore(final String 
storeName) {

Review comment:
       I decided to for for the pattern xxxForxxx to keep consistency among 
different changes.
   
   It is now `streamsMetadataForStore` but happy to change if anyone has 
reasons against it.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to