GitHub user fhussonnois opened a pull request:
https://github.com/apache/kafka/pull/2612
KAFKA-4819: Expose states for active tasks to public API
Simple implementation of the feature :
[KAFKA-4819](https://issues.apache.org/jira/browse/KAFKA-4819)
KAFKA-4819
This PR adds a new method `threadStates` to public API of `KafkaStreams`
which returns all currently states of running threads and active tasks.
Below is a example for a simple topology consuming from topics; test-p2 and
test-p4.
[{"name":"StreamThread-1","state":"RUNNING","activeTasks":[{"id":"0_0",
"assignments":["test-p4-0","test-p2-0"],
"consumedOffsetsByPartition":[{"topicPartition":"test-p2-0","offset":"test-p2-0"}]},
{"id":"0_2", "assignments":["test-p4-2"], "consumedOffsetsByPartition":[]}]},
{"name":"StreamThread-2","state":"RUNNING","activeTasks":[{"id":"0_1",
"assignments":["test-p4-1","test-p2-1"],
"consumedOffsetsByPartition":[{"topicPartition":"test-p2-1","offset":"test-p2-1"}]},
{"id":"0_3", "assignments":["test-p4-3"], "consumedOffsetsByPartition":[]}]}]
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/fhussonnois/kafka KAFKA-4819
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/2612.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2612
commit 0f8b8123cabdbfcfb44fe59b9be20e13ac253c95
Author: Florian Hussonnois
Date: 2017-02-23T22:08:01Z
KAFKA-4819: Expose states for active tasks to public API
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---