[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16576285#comment-16576285 ] ASF GitHub Bot commented on METRON-1722: Github user merrimanr closed the pull request at: https://github.com/apache/metron/pull/1138 > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16576191#comment-16576191 ] ASF GitHub Bot commented on METRON-1722: Github user justinleet commented on the issue: https://github.com/apache/metron/pull/1138 I'm still +1 > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575470#comment-16575470 ] ASF GitHub Bot commented on METRON-1722: Github user mmiklavc commented on the issue: https://github.com/apache/metron/pull/1138 +1 > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575468#comment-16575468 ] ASF GitHub Bot commented on METRON-1722: Github user mmiklavc commented on a diff in the pull request: https://github.com/apache/metron/pull/1138#discussion_r209095504 --- Diff: metron-platform/metron-pcap-backend/src/test/java/org/apache/metron/pcap/query/PcapCliTest.java --- @@ -166,12 +166,12 @@ public void runs_fixed_pcap_filter_job_with_full_argument_list_and_default_datef 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); --- End diff -- 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. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575406#comment-16575406 ] ASF GitHub Bot commented on METRON-1722: Github user merrimanr commented on a diff in the pull request: https://github.com/apache/metron/pull/1138#discussion_r209083961 --- Diff: metron-platform/metron-pcap-backend/src/test/java/org/apache/metron/pcap/query/PcapCliTest.java --- @@ -166,12 +166,12 @@ public void runs_fixed_pcap_filter_job_with_full_argument_list_and_default_datef 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); --- End diff -- This needs to be there since the print status command line argument is set. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575393#comment-16575393 ] ASF GitHub Bot commented on METRON-1722: Github user mmiklavc commented on a diff in the pull request: https://github.com/apache/metron/pull/1138#discussion_r209080362 --- Diff: metron-platform/metron-pcap-backend/src/test/java/org/apache/metron/pcap/query/PcapCliTest.java --- @@ -166,12 +166,12 @@ public void runs_fixed_pcap_filter_job_with_full_argument_list_and_default_datef 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); --- End diff -- Probably remove these as they're not used anymore by the test. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575378#comment-16575378 ] ASF GitHub Bot commented on METRON-1722: Github user merrimanr commented on the issue: https://github.com/apache/metron/pull/1138 Let me know what you think of the latest commit. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575163#comment-16575163 ] ASF GitHub Bot commented on METRON-1722: Github user mmiklavc commented on the issue: https://github.com/apache/metron/pull/1138 @merrimanr - That's not quite what I suggested - it's still not using the common config we pass in > Can we add a param for the CLI like PcapOptions.PRINT_JOB_STATUS.put(commonConfig, true) If that monitorAndPrintJob() is a blocking call, it probably belongs in the `get()` itself. Rather than creating a one-off custom method invoked by the client, we already have configuration facilities for providing these options that we use for all other options. e.g. this section https://github.com/apache/metron/blob/f17d50fbfed4fd14e5cdd5a718cc973f51d2c4bc/metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/mr/PcapJob.java#L215 And then it's just using that property like we use the others. https://github.com/apache/metron/blob/f17d50fbfed4fd14e5cdd5a718cc973f51d2c4bc/metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/mr/PcapJob.java#L464 ``` public Pageable get() throws JobException, InterruptedException { if (PcapOptions.PRINT_JOB_STATUS.get(configuration, Boolean.class)) { mrJob.monitorAndPrintJob(); } for (; ; ) { JobStatus status = getStatus(); if (status.getState() == State.SUCCEEDED || status.getState() == State.KILLED || status.getState() == State.FAILED) { return getFinalResults(); } Thread.sleep(completeCheckInterval); } } ``` 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. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16574796#comment-16574796 ] ASF GitHub Bot commented on METRON-1722: Github user merrimanr commented on the issue: https://github.com/apache/metron/pull/1138 Are you good @mmiklavc? > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Assignee: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16572181#comment-16572181 ] ASF GitHub Bot commented on METRON-1722: Github user justinleet commented on the issue: https://github.com/apache/metron/pull/1138 +1 by inspection, assuming @mmiklavc is good. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16572123#comment-16572123 ] ASF GitHub Bot commented on METRON-1722: Github user merrimanr commented on the issue: https://github.com/apache/metron/pull/1138 @mmiklavc the latest commit includes the changes you suggested. Let me know what you think. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570804#comment-16570804 ] ASF GitHub Bot commented on METRON-1722: Github user mmiklavc commented on the issue: https://github.com/apache/metron/pull/1138 @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 `PcapOptions.PRINT_JOB_STATUS.put(commonConfig, true)`? > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570700#comment-16570700 ] ASF GitHub Bot commented on METRON-1722: Github user merrimanr commented on the issue: https://github.com/apache/metron/pull/1138 I believe I found the solution. There is a method called `monitorAndPrintJob` on the `org.apache.hadoop.mapreduce.Job` class that blocks and prints status just as if you had submitted the job synchronously. I compared the Pcap CLI output in this PR with the output in master and it is exactly the same as far as I can tell. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570496#comment-16570496 ] ASF GitHub Bot commented on METRON-1722: Github user justinleet commented on the issue: https://github.com/apache/metron/pull/1138 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. > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-1722) PcapCLI should print progress to stdout
[ https://issues.apache.org/jira/browse/METRON-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16568835#comment-16568835 ] ASF GitHub Bot commented on METRON-1722: GitHub user merrimanr opened a pull request: https://github.com/apache/metron/pull/1138 METRON-1722: PcapCLI should print progress to stdout ## 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: - Added a `PrintStream` member variable to PcapJob - Added a `reportStatus` method that configures that variable - Added logic to the `PcapJob.get` method to print status if the printStream variable is set This 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.get` in 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](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [ ] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [ ] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)? ### 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: ``` mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh ``` - [ ] 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](http://www.apache.org/legal/resolved.html#category-a)? - [ ] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/merrimanr/incubator-metron METRON-1722 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/1138.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 #1138 commit 4bc0438d2c59df4753a266764ffed27975c28717 Author: merrimanr Date: 2018-08-03T21:44:04Z initial commit > PcapCLI should print progress to stdout > --- > > Key: METRON-1722 > URL: https://issues.apache.org/jira/browse/METRON-1722 > Project: Metron > Issue Type: Sub-task >Reporter: Ryan Merriman >Priority: Major > > It would be helpful if the Pcap CLI reported job status included state and > percent complete. -- This message was sent by Atlassian JIRA