METRON-1722: PcapCLI should print progress to stdout#1138
METRON-1722: PcapCLI should print progress to stdout#1138merrimanr wants to merge 6 commits intoapache:feature/METRON-1554-pcap-query-panelfrom
Conversation
|
Given that this is solving a regression, I'd like a quick update on what the previous state was and how this compares. In particular, I'd like to know how it functions in terms of status and error / exception handling? I believe the old version printed out some of the underlying MR progression along with underlying errors. Do we have a sample of the old output at available? I'm not sure how concerned we need to be with it being exactly the same (and I think there is definitely a fairly strong argument towards being consistent with the UI because the MR job isn't the only time consuming item there), but we do need to make sure it's at least as informative. |
|
I believe I found the solution. There is a method called |
|
@merrimanr I think this is closer with your recent change. I think it should still use the get() method because you need to wait for the finalizer to complete. Can we add a param for the CLI like |
|
@mmiklavc the latest commit includes the changes you suggested. Let me know what you think. |
|
+1 by inspection, assuming @mmiklavc is good. |
|
Are you good @mmiklavc? |
|
@merrimanr - That's not quite what I suggested - it's still not using the common config we pass in
If that monitorAndPrintJob() is a blocking call, it probably belongs in the And then it's just using that property like we use the others. The only reservation I have about the monitorAndPrintJob (versus using the pcapjob's TimerTask method) is that users cannot print status in a non-blocking way. Honestly I don't see a circumstance where you would do that with stdout anyhow. It's through pcapcli, where we want the process to return only after fully completing, so I think this is fine. |
…anel' into METRON-1722
|
Let me know what you think of the latest commit. |
mmiklavc
left a comment
There was a problem hiding this comment.
Looks great @merrimanr! One small cleanup for the unused properties in the unit test and I'm +1 via inspection.
| PcapOptions.START_TIME_MS.put(config, 500L); | ||
| PcapOptions.END_TIME_MS.put(config, 1000L); | ||
| PcapOptions.NUM_RECORDS_PER_FILE.put(config, 1000); | ||
| PcapOptions.PRINT_JOB_STATUS.put(config, true); |
There was a problem hiding this comment.
Probably remove these as they're not used anymore by the test.
There was a problem hiding this comment.
This needs to be there since the print status command line argument is set.
There was a problem hiding this comment.
Ah, I see. Missed that with the diff only showing the option line in the latest commit. Full diff shows the extra option in the cli options arg list.
|
+1 |
|
I'm still +1 |
Contributor Comments
This PR updates the Pcap CLI to print the status of a running job. I took a fairly simple approach as a first pass:
PrintStreammember variable to PcapJobreportStatusmethod that configures that variablePcapJob.getmethod to print status if the printStream variable is setThis approach keeps us from having to change the Statusable interface. For those reviewing, what do you think of the message? Should we format it differently or include more information?
I am also considering adding a unit test for
PcapJob.getin this PR since it doesn't exist and the changes in this PR affect that method.Let me know what you think. There are several different ways to solve this.
Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
For all changes:
For code changes:
Have you included steps to reproduce the behavior or problem that is being changed or addressed?
Have you included steps or a guide to how the change may be verified and tested manually?
Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
Have you written or updated unit tests and or integration tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
For documentation related changes:
Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via
site-book/target/site/index.html:Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.