jlprat commented on a change in pull request #10840: URL: https://github.com/apache/kafka/pull/10840#discussion_r657132064
########## File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java ########## @@ -1558,12 +1607,45 @@ private void processStreamThread(final Consumer<StreamThread> consumer) { for (final StreamThread thread : copy) consumer.accept(thread); } + /** + * Returns runtime information about the local threads of this {@link KafkaStreams} instance. + * + * @return the set of {@link org.apache.kafka.streams.processor.ThreadMetadata}. + * @deprecated since 3.0 use {@link #threadsMetadata()} + */ + @Deprecated + @SuppressWarnings("deprecation") + public Set<org.apache.kafka.streams.processor.ThreadMetadata> localThreadsMetadata() { + return threadsMetadata().stream().map(threadMetadata -> new org.apache.kafka.streams.processor.ThreadMetadata( + threadMetadata.threadName(), + threadMetadata.threadState(), + threadMetadata.consumerClientId(), + threadMetadata.restoreConsumerClientId(), + threadMetadata.producerClientIds(), + threadMetadata.adminClientId(), + threadMetadata.activeTasks().stream().map(taskMetadata -> new org.apache.kafka.streams.processor.TaskMetadata( + taskMetadata.taskId().toString(), + taskMetadata.topicPartitions(), + taskMetadata.committedOffsets(), + taskMetadata.endOffsets(), + taskMetadata.timeCurrentIdlingStarted()) + ).collect(Collectors.toSet()), + threadMetadata.standbyTasks().stream().map(taskMetadata -> new org.apache.kafka.streams.processor.TaskMetadata( + taskMetadata.taskId().toString(), + taskMetadata.topicPartitions(), + taskMetadata.committedOffsets(), + taskMetadata.endOffsets(), + taskMetadata.timeCurrentIdlingStarted()) + ).collect(Collectors.toSet()))) + .collect(Collectors.toSet()); + } + /** * Returns runtime information about the local threads of this {@link KafkaStreams} instance. * * @return the set of {@link ThreadMetadata}. */ - public Set<ThreadMetadata> localThreadsMetadata() { + public Set<ThreadMetadata> threadsMetadata() { Review comment: I decided to for for the pattern xxxForxxx to keep consistency among different changes. It is now `metadataForLocalThreads` 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