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

Feat[bmqstoragetool]: PrintManager #529

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

waldgange
Copy link
Collaborator

In order to make the output of the storagetool more grep-friendly or/and to be able to parse it the following changes have been done:

  • a separate entity responsible for printing has been indroduced - the PrintManager
  • the existing printing logic has been moved to one of the implementations of the PrintManager
  • two new implementations of the PrintManager have been added: JsonLine (each Record is printed as a single-line json) and JsonPretty (each Record is printed as a multi-line json).
  • a new parameter to specify the print mode has been added:
--print-mode           <print mode>
          can be one of the following: [HUMAN, JSON_PRETTY, JSON_LINE]. Defailt value is HUMAN

Left to do:

  • implement various printing modes for message payload and specific results of SearchResultDecorators
  • fix broken unit tests
  • add unit tests for new print implementations

// class PrintManager
// ==================

class PrintManager {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would never call this interface PrintManager because its name is too abstract even for an interface :).
Consider something like MessagePrinter or MessagePrinterStrategy.

{"print-mode",
"print mode",
"can be one of the following: [HUMAN, JSON_PRETTY, JSON_LINE]. "
"Defailt value is HUMAN",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"Defailt value is HUMAN",
"Default value is HUMAN",

@@ -57,6 +57,12 @@ parseArgs(CommandLineArguments& arguments, int argc, const char* argv[])
"path to a .bmq_csl file",
balcl::TypeInfo(&arguments.d_cslFile),
balcl::OccurrenceInfo::e_OPTIONAL},
{"print-mode",
"print mode",
"can be one of the following: [HUMAN, JSON_PRETTY, JSON_LINE]. "
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the tool support lower-case values for this parameter? If not, it would be handy to have.

@pniedzielski pniedzielski self-assigned this Dec 2, 2024
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.

3 participants