GauthamBanasandra opened a new pull request, #4145:
URL: https://github.com/apache/hadoop/pull/4145

   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 
'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   The source files for `hdfs_stat` uses `getopt` for parsing the command line 
arguments. getopt is available only on Linux and thus, isn't cross platform. We 
need to replace getopt with `boost::program_options` to make this tool cross 
platform.
   
   ### How was this patch tested?
   
   # hdfs_stat
   This tool was testing locally with the Hadoop cluster setup in 
pseudo-distributed mode.
   I ran the tool by providing the path to a file as the argument.
   
   ```bash
   $ ./hdfs_stat ~/some-dir/some-data.txt
   ```
   
   ![Stat on a 
file](https://user-images.githubusercontent.com/10280768/162121024-9a2d8f96-d34d-4636-8ace-70f00e3152f9.jpg)
   
   I verified the output against the information displayed in the UI.
   
   ![Confirmation from UI - stat on a 
file](https://user-images.githubusercontent.com/10280768/162121126-c4133834-0f45-4b25-be78-ee2c8892eb84.jpg)
   
   
   I then ran the tool by providing the path to a directory as the argument.
   
   ```bash
   $ ./hdfs_stat ~/some-dir
   ```
   
   ![Stat on a 
directory](https://user-images.githubusercontent.com/10280768/162121241-8157480e-8f8e-4fd7-af47-503bd2e9e866.jpg)
   
   I verified the output against the information displayed in the UI.
   
   ![Confirmation from UI - stat on a 
directory](https://user-images.githubusercontent.com/10280768/162121280-d72b72ee-99f0-4167-8cb3-ea3543c60194.jpg)
   
   I then ran the tool by providing a non-existent path as the argument.
   
   ```bash
   $ ./hdfs_stat ~/some-non-existent-path
   ```
   
   ![Stat on a non-existent 
path](https://user-images.githubusercontent.com/10280768/162121415-66ffcd06-1117-43b3-a763-2bdcb9ba460f.jpg)
   
   We note that an appropriate error message is reported in the above output.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [ ] 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)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to