You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Dmitry Melanchenko (JIRA)" <ji...@apache.org> on 2015/09/30 10:06:04 UTC

[jira] [Commented] (KAFKA-313) Add JSON/CSV output and looping options to ConsumerGroupCommand

    [ https://issues.apache.org/jira/browse/KAFKA-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14936518#comment-14936518 ] 

Dmitry Melanchenko commented on KAFKA-313:
------------------------------------------

Hi guys,

since this story is incomplete yet - may I suggest my solution for implementation of CSV and JSON outputs?

I developed it for our current Kafka 0.8.2 but I'll be happy to port it to 0.9 branch. Here is a gist: https://gist.github.com/melan/929d6db871fe5edef941, I know that ConsumerOffsetChecker is deprecated and I'm ready to port it to ConsumerGroupCommand.

Idea is simple: I added a Printer trait and implement it as "default" printer, CSV or JSON printers. We also implemented it as a stateful printer: when the tool is called directly in-proc instead of shell call it's better to get results as typed variables instead of string parsing.

Please let me know your opinion about this change and if it make sense - I'll push those changes within the next few days.

Thanks,
Dmitry

> Add JSON/CSV output and looping options to ConsumerGroupCommand
> ---------------------------------------------------------------
>
>                 Key: KAFKA-313
>                 URL: https://issues.apache.org/jira/browse/KAFKA-313
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Dave DeMaagd
>            Assignee: Ashish K Singh
>            Priority: Minor
>              Labels: newbie, patch
>             Fix For: 0.9.0.0
>
>         Attachments: KAFKA-313-2012032200.diff, KAFKA-313.1.patch, KAFKA-313.patch, KAFKA-313_2015-02-23_18:11:32.patch, KAFKA-313_2015-06-24_11:14:24.patch, KAFKA-313_2015-08-05_15:37:32.patch, KAFKA-313_2015-08-05_15:43:00.patch, KAFKA-313_2015-08-10_12:58:38.patch, KAFKA-313_2015-08-12_14:21:32.patch
>
>
> Adds:
> * '--loop N' - causes the program to loop forever, sleeping for up to N seconds between loops (loop time minus collection time, unless that's less than 0, at which point it will just run again immediately)
> * '--asjson' - display as a JSON string instead of the more human readable output format.
> Neither of the above  depend on each other (you can loop in the human readable output, or do a single shot execution with JSON output).  Existing behavior/output maintained if neither of the above are used.  Diff Attached.
> Impacted files:
> core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)