Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Key/Value interface #830

Merged
merged 19 commits into from
Mar 9, 2021
Merged

Conversation

nicholastmosher
Copy link
Contributor

Adds a key/value interface for the producer and consumer CLI. Should not be merged before #828.

The first draft of the documentation for these CLI changes is here: infinyon/fluvio-website#58

@nicholastmosher nicholastmosher force-pushed the key-value-cli branch 2 times, most recently from ec2dc5c to d4858b5 Compare March 4, 2021 20:36
@nicholastmosher nicholastmosher linked an issue Mar 4, 2021 that may be closed by this pull request
4 tasks
@nicholastmosher nicholastmosher force-pushed the key-value-cli branch 3 times, most recently from 6397136 to 30315e1 Compare March 5, 2021 14:40
@nicholastmosher nicholastmosher force-pushed the key-value-cli branch 2 times, most recently from cc91b01 to fb5a707 Compare March 8, 2021 12:45
@@ -34,6 +48,10 @@ pub struct ConsumeLogOpt {
#[structopt(short = "d", long)]
pub disable_continuous: bool,

/// Print records in "[key] value" format, with "[null]" for no key
#[structopt(short, long)]
pub key_value: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest kv for shorthand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has the structopt(short), which means we can use --key-value or -k

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, this flag is confusing. it sounds like it is about consuming. it should be more like: --print-kv-header. Also printing key should be default so in this case, it should be -disable-print-kv-header

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I had made the consumer print keys by default, but @ajhunyady said he preferred otherwise. I don't have a preference one way or the other. Let me know what you guys decide.

src/extension-consumer/src/consume/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/consume/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/consume/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/consume/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/produce/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/produce/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/produce/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/produce/mod.rs Outdated Show resolved Hide resolved
src/extension-consumer/src/produce/mod.rs Show resolved Hide resolved
src/extension-consumer/src/produce/mod.rs Outdated Show resolved Hide resolved
@nicholastmosher
Copy link
Contributor Author

@sehz I think all of the changes have been added. I'm ready to merge this if you are 👍

Copy link
Contributor

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@sehz sehz merged commit b7b3d2c into infinyon:master Mar 9, 2021
@nicholastmosher nicholastmosher deleted the key-value-cli branch March 9, 2021 21:50
simlay pushed a commit that referenced this pull request Mar 16, 2021
* Producer CLI with --lines

Update documentation of CLI producer

Print status for each record produced, unless -q

* Add initial Key/Value support to CLI producer and consumer

* Apply cargo clippy

* Add support for JSON Key/Value with jsonpath

* Update producer printout

* Update consumer key/value printout formatting

* Update interactive printout for producer and consumer

* Remove --partition from producer

* Add --key-value to consumer CLI

* Update help menu for consumer CLI

* Condense producer CLI code

* Remove --json-path from producer CLI

* Review: update tracing and error printout in consumer

* Remove multi-file support for producer

* Remove 'Reading one record per line from stdin' prompt

* Default producer behavior to always be line-by-line

* Update producer help

* Fix double-printing produced lines

* Fixed printout for producer interactive mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking: Support Key/value in produce and consumer
2 participants