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



##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.

Review comment:
       ```suggestion
    * Metadata of a Kafka Streams client.
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.
+ */
+public interface StreamsMetadata {
+
+    /**
+     * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} configured 
for the streams
+     * instance, which is typically host/port
+     *
+     * @return {@link HostInfo} corresponding to the streams instance
+     */
+    HostInfo hostInfo();
+
+    /**
+     * State stores owned by the instance as an active replica
+     *
+     * @return set of active state store names
+     */
+    Set<String> stateStoreNames();
+
+    /**
+     * Topic partitions consumed by the instance as an active replica
+     *
+     * @return set of active topic partitions
+     */

Review comment:
       ```suggestion
       /**
        * Source topic partitions of the active tasks of the Streams client.
        *
        * @return source topic partitions of the active tasks
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/TaskMetadata.java
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.processor.TaskId;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+
+/**
+ * Represents the state of a single task running within a {@link KafkaStreams} 
application.
+ */
+public interface TaskMetadata {
+
+    /**
+     * This function will return a {@link TaskId} with basic task metadata
+     *
+     * @return the basic task metadata such as subtopology and partition id
+     */

Review comment:
       ```suggestion
       /**
        * Task ID of the task.
        *
        * @return task ID consisting of subtopology and partition ID
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/TaskMetadata.java
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.processor.TaskId;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+
+/**
+ * Represents the state of a single task running within a {@link KafkaStreams} 
application.
+ */
+public interface TaskMetadata {
+
+    /**
+     * This function will return a {@link TaskId} with basic task metadata
+     *
+     * @return the basic task metadata such as subtopology and partition id
+     */
+    TaskId taskId();
+
+    /**
+     * This function will return a set of the current TopicPartitions
+     *
+     * @return set of topic partitions
+     */
+    Set<TopicPartition> topicPartitions();
+
+    /**
+     * This function will return a map of TopicPartitions and the highest 
committed offset seen so far
+     *
+     * @return map with an entry for all topic partitions with the committed 
offset as a value
+     */

Review comment:
       ```suggestion
       /**
        * Offsets of the source topic partitions committed so far by the task.
        *
        * @return map from source topic partitions to committed offsets
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */
+    String threadState();
+
+    /**
+     * This function will return the name of the Thread
+     *
+     * @return the name of the Thread
+     */
+    String threadName();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current active tasks
+     *
+     * @return a set of metadata for the active tasks
+     */

Review comment:
       ```suggestion
       /**
        * Metadata of the active tasks assigned to the stream thread.
        *
        * @return metadata of the active tasks
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */
+    String threadState();
+
+    /**
+     * This function will return the name of the Thread
+     *
+     * @return the name of the Thread
+     */
+    String threadName();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current active tasks
+     *
+     * @return a set of metadata for the active tasks
+     */
+    Set<TaskMetadata> activeTasks();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current standby tasks
+     *
+     * @return a set of metadata for the standby tasks
+     */
+    Set<TaskMetadata> standbyTasks();
+
+    /**
+     * This function will return the Client Id for the consumer
+     *
+     * @return the consumer Client Id
+     */
+    String consumerClientId();
+
+    /**
+     * This function will return the Client id for the restore consumer
+     *
+     * @return the restore consumer Client Id
+     */
+    String restoreConsumerClientId();
+
+    /**
+     * This function will return the set of Client Ids for the producers
+     *
+     * @return set of producer Client Ids
+     */

Review comment:
       ```suggestion
       /**
        * Client IDs of the Kafka producers used by the stream thread.
        *
        * @return client IDs of the Kafka producers
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.
+ */
+public interface StreamsMetadata {
+
+    /**
+     * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} configured 
for the streams
+     * instance, which is typically host/port
+     *
+     * @return {@link HostInfo} corresponding to the streams instance
+     */
+    HostInfo hostInfo();
+
+    /**
+     * State stores owned by the instance as an active replica
+     *
+     * @return set of active state store names
+     */
+    Set<String> stateStoreNames();
+
+    /**
+     * Topic partitions consumed by the instance as an active replica
+     *
+     * @return set of active topic partitions
+     */
+    Set<TopicPartition> topicPartitions();
+
+    /**
+     * (Source) Topic partitions for which the instance acts as standby.
+     *
+     * @return set of standby topic partitions
+     */
+    Set<TopicPartition> standbyTopicPartitions();
+
+    /**
+     * State stores owned by the instance as a standby replica
+     *
+     * @return set of standby state store names
+     */
+    Set<String> standbyStateStoreNames();
+
+    /**
+     * This method is equivalent to call {@code 
StreamsMetadata.hostInfo().host();}
+     *
+     * @return the host where the given process runs
+     */
+    String host();
+
+    /**
+     * This method is equivalent to call {@code 
StreamsMetadata.hostInfo().port();}
+     *
+     * @return the port number where the given process runs
+     */

Review comment:
       ```suggestion
       /**
        * Port on which the Streams client listens.
        * 
        * This method is equivalent to {@code 
StreamsMetadata.hostInfo().port();}
        *
        * @return the port on which Streams client listens
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.
+ */
+public interface StreamsMetadata {
+
+    /**
+     * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} configured 
for the streams
+     * instance, which is typically host/port
+     *
+     * @return {@link HostInfo} corresponding to the streams instance
+     */
+    HostInfo hostInfo();
+
+    /**
+     * State stores owned by the instance as an active replica
+     *
+     * @return set of active state store names
+     */

Review comment:
       ```suggestion
       /**
        * Names of the state stores assigned to active tasks of the Streams 
client.
        *
        * @return names of the state stores assigned to active tasks
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.
+ */
+public interface StreamsMetadata {
+
+    /**
+     * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} configured 
for the streams
+     * instance, which is typically host/port
+     *
+     * @return {@link HostInfo} corresponding to the streams instance
+     */
+    HostInfo hostInfo();
+
+    /**
+     * State stores owned by the instance as an active replica
+     *
+     * @return set of active state store names
+     */
+    Set<String> stateStoreNames();
+
+    /**
+     * Topic partitions consumed by the instance as an active replica
+     *
+     * @return set of active topic partitions
+     */
+    Set<TopicPartition> topicPartitions();
+
+    /**
+     * (Source) Topic partitions for which the instance acts as standby.
+     *
+     * @return set of standby topic partitions
+     */
+    Set<TopicPartition> standbyTopicPartitions();
+
+    /**
+     * State stores owned by the instance as a standby replica
+     *
+     * @return set of standby state store names
+     */

Review comment:
       ```suggestion
       /**
        * Names of the state stores assigned to standby tasks of the Streams 
client.
        *
        * @return names of the state stores assigned to standby tasks
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.
+ */
+public interface StreamsMetadata {
+
+    /**
+     * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} configured 
for the streams
+     * instance, which is typically host/port
+     *
+     * @return {@link HostInfo} corresponding to the streams instance
+     */

Review comment:
       ```suggestion
       /**
        * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} 
configured for the Streams
        * client.
        *
        * @return {@link HostInfo} corresponding to the Streams client
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.
+ */
+public interface StreamsMetadata {
+
+    /**
+     * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} configured 
for the streams
+     * instance, which is typically host/port
+     *
+     * @return {@link HostInfo} corresponding to the streams instance
+     */
+    HostInfo hostInfo();
+
+    /**
+     * State stores owned by the instance as an active replica
+     *
+     * @return set of active state store names
+     */
+    Set<String> stateStoreNames();
+
+    /**
+     * Topic partitions consumed by the instance as an active replica
+     *
+     * @return set of active topic partitions
+     */
+    Set<TopicPartition> topicPartitions();
+
+    /**
+     * (Source) Topic partitions for which the instance acts as standby.
+     *
+     * @return set of standby topic partitions
+     */
+    Set<TopicPartition> standbyTopicPartitions();
+
+    /**
+     * State stores owned by the instance as a standby replica
+     *
+     * @return set of standby state store names
+     */
+    Set<String> standbyStateStoreNames();
+
+    /**
+     * This method is equivalent to call {@code 
StreamsMetadata.hostInfo().host();}
+     *
+     * @return the host where the given process runs
+     */

Review comment:
       ```suggestion
       /**
        * Host where the Streams client runs. 
        *
        * This method is equivalent to {@code 
StreamsMetadata.hostInfo().host();}
        *
        * @return the host where the Streams client runs
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/StreamsMetadata.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.state.HostInfo;
+
+import java.util.Set;
+
+/**
+ * Represents the state of the different a given Kafka Streams instance 
running within a {@link KafkaStreams} application.
+ */
+public interface StreamsMetadata {
+
+    /**
+     * The value of {@link StreamsConfig#APPLICATION_SERVER_CONFIG} configured 
for the streams
+     * instance, which is typically host/port
+     *
+     * @return {@link HostInfo} corresponding to the streams instance
+     */
+    HostInfo hostInfo();
+
+    /**
+     * State stores owned by the instance as an active replica
+     *
+     * @return set of active state store names
+     */
+    Set<String> stateStoreNames();
+
+    /**
+     * Topic partitions consumed by the instance as an active replica
+     *
+     * @return set of active topic partitions
+     */
+    Set<TopicPartition> topicPartitions();
+
+    /**
+     * (Source) Topic partitions for which the instance acts as standby.
+     *
+     * @return set of standby topic partitions
+     */

Review comment:
       ```suggestion
       /**
        * Changelog topic partitions for the state stores the standby tasks of 
the Streams client replicates.
        *
        * @return set of changelog topic partitions of the standby tasks
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/TaskMetadata.java
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.processor.TaskId;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+
+/**
+ * Represents the state of a single task running within a {@link KafkaStreams} 
application.
+ */
+public interface TaskMetadata {
+
+    /**
+     * This function will return a {@link TaskId} with basic task metadata
+     *
+     * @return the basic task metadata such as subtopology and partition id
+     */
+    TaskId taskId();
+
+    /**
+     * This function will return a set of the current TopicPartitions
+     *
+     * @return set of topic partitions
+     */

Review comment:
       ```suggestion
       /**
        * Source topic partitions of the task.
        *
        * @return source topic partitions
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */
+    String threadState();
+
+    /**
+     * This function will return the name of the Thread
+     *
+     * @return the name of the Thread
+     */
+    String threadName();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current active tasks
+     *
+     * @return a set of metadata for the active tasks
+     */
+    Set<TaskMetadata> activeTasks();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current standby tasks
+     *
+     * @return a set of metadata for the standby tasks
+     */

Review comment:
       ```suggestion
       /**
        * Metadata of the standby tasks assigned to the stream thread.
        *
        * @return metadata of the standby tasks
   
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */

Review comment:
       ```suggestion
       /**
        * State of the stream thread
        *
        * @return the state
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/TaskMetadata.java
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.processor.TaskId;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+
+/**
+ * Represents the state of a single task running within a {@link KafkaStreams} 
application.
+ */
+public interface TaskMetadata {
+
+    /**
+     * This function will return a {@link TaskId} with basic task metadata
+     *
+     * @return the basic task metadata such as subtopology and partition id
+     */
+    TaskId taskId();
+
+    /**
+     * This function will return a set of the current TopicPartitions
+     *
+     * @return set of topic partitions
+     */
+    Set<TopicPartition> topicPartitions();
+
+    /**
+     * This function will return a map of TopicPartitions and the highest 
committed offset seen so far
+     *
+     * @return map with an entry for all topic partitions with the committed 
offset as a value
+     */
+    Map<TopicPartition, Long> committedOffsets();
+
+    /**
+     * This function will return a map of TopicPartitions and the highest 
offset seen so far in the Topic
+     *
+     * @return map with an entry for all topic partitions with the highest 
offset as a value
+     */

Review comment:
       ```suggestion
       /**
        * End offsets of the source topic partitions of the task.
        *
        * @return map source topic partition to end offsets
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */
+    String threadState();
+
+    /**
+     * This function will return the name of the Thread
+     *
+     * @return the name of the Thread
+     */

Review comment:
       ```suggestion
       /**
        * Name of the stream thread
        *
        * @return the name
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/TaskMetadata.java
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.processor.TaskId;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+
+/**
+ * Represents the state of a single task running within a {@link KafkaStreams} 
application.
+ */

Review comment:
       ```suggestion
   /**
    * Metadata of a task.
    */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */
+    String threadState();
+
+    /**
+     * This function will return the name of the Thread
+     *
+     * @return the name of the Thread
+     */
+    String threadName();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current active tasks
+     *
+     * @return a set of metadata for the active tasks
+     */
+    Set<TaskMetadata> activeTasks();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current standby tasks
+     *
+     * @return a set of metadata for the standby tasks
+     */
+    Set<TaskMetadata> standbyTasks();
+
+    /**
+     * This function will return the Client Id for the consumer
+     *
+     * @return the consumer Client Id
+     */
+    String consumerClientId();
+
+    /**
+     * This function will return the Client id for the restore consumer
+     *
+     * @return the restore consumer Client Id
+     */

Review comment:
       ```suggestion
       /**
        * Client ID of the restore Kafka consumer used by the stream thread
        *
        * @return client ID of the restore Kafka consumer
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */
+    String threadState();
+
+    /**
+     * This function will return the name of the Thread
+     *
+     * @return the name of the Thread
+     */
+    String threadName();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current active tasks
+     *
+     * @return a set of metadata for the active tasks
+     */
+    Set<TaskMetadata> activeTasks();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current standby tasks
+     *
+     * @return a set of metadata for the standby tasks
+     */
+    Set<TaskMetadata> standbyTasks();
+
+    /**
+     * This function will return the Client Id for the consumer
+     *
+     * @return the consumer Client Id
+     */
+    String consumerClientId();
+
+    /**
+     * This function will return the Client id for the restore consumer
+     *
+     * @return the restore consumer Client Id
+     */
+    String restoreConsumerClientId();
+
+    /**
+     * This function will return the set of Client Ids for the producers
+     *
+     * @return set of producer Client Ids
+     */
+    Set<String> producerClientIds();
+
+    /**
+     * This function will return the Client Id for the admin client
+     *
+     * @return the admin Client Id
+     */

Review comment:
       ```suggestion
       /**
        * Client ID of the admin client used by the stream thread.
        *
        * @return client ID of the admin client
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/TaskMetadata.java
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.streams.processor.TaskId;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+
+/**
+ * Represents the state of a single task running within a {@link KafkaStreams} 
application.
+ */
+public interface TaskMetadata {
+
+    /**
+     * This function will return a {@link TaskId} with basic task metadata
+     *
+     * @return the basic task metadata such as subtopology and partition id
+     */
+    TaskId taskId();
+
+    /**
+     * This function will return a set of the current TopicPartitions
+     *
+     * @return set of topic partitions
+     */
+    Set<TopicPartition> topicPartitions();
+
+    /**
+     * This function will return a map of TopicPartitions and the highest 
committed offset seen so far
+     *
+     * @return map with an entry for all topic partitions with the committed 
offset as a value
+     */
+    Map<TopicPartition, Long> committedOffsets();
+
+    /**
+     * This function will return a map of TopicPartitions and the highest 
offset seen so far in the Topic
+     *
+     * @return map with an entry for all topic partitions with the highest 
offset as a value
+     */
+    Map<TopicPartition, Long> endOffsets();
+
+    /**
+     * This function will return the time task idling started, if the task is 
not currently idling it will return empty
+     *
+     * @return A filled {@code Optional} with the time where task idling 
started, and empty {@code Optional} otherwise
+     */

Review comment:
       ```suggestion
       /**
        * Time task idling started. If the task is not currently idling it will 
return empty.
        *
        * @return time when task idling started, empty {@code Optional} if the 
task is currently not idling
        */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */

Review comment:
       ```suggestion
   /**
    * Metadata of a stream thread.
    */
   ```

##########
File path: streams/src/main/java/org/apache/kafka/streams/ThreadMetadata.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams;
+
+import java.util.Set;
+
+/**
+ * Represents the state of a single thread running within a {@link 
KafkaStreams} application.
+ */
+public interface ThreadMetadata {
+
+
+    /**
+     * This function will return the state of the Thread
+     * @return the state of the Thread
+     */
+    String threadState();
+
+    /**
+     * This function will return the name of the Thread
+     *
+     * @return the name of the Thread
+     */
+    String threadName();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current active tasks
+     *
+     * @return a set of metadata for the active tasks
+     */
+    Set<TaskMetadata> activeTasks();
+
+    /**
+     * This function will return the set of the {@link TaskMetadata} for the 
current standby tasks
+     *
+     * @return a set of metadata for the standby tasks
+     */
+    Set<TaskMetadata> standbyTasks();
+
+    /**
+     * This function will return the Client Id for the consumer
+     *
+     * @return the consumer Client Id
+     */

Review comment:
       ```suggestion
       /**
        * Client ID of the Kafka consumer used by the stream thread.
        *
        * @return client ID of the Kafka consumer
        */
   ```




-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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


Reply via email to