[ 
https://issues.apache.org/jira/browse/HDFS-16473?focusedWorklogId=753839&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-753839
 ]

ASF GitHub Bot logged work on HDFS-16473:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Apr/22 04:40
            Start Date: 07/Apr/22 04:40
    Worklog Time Spent: 10m 
      Work Description: 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?
   
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 753839)
    Remaining Estimate: 0h
            Time Spent: 10m

> Make HDFS stat tool cross platform
> ----------------------------------
>
>                 Key: HDFS-16473
>                 URL: https://issues.apache.org/jira/browse/HDFS-16473
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs-client, libhdfs++, tools
>    Affects Versions: 3.4.0
>         Environment: Centos 7, Centos 8, Debian 10, Ubuntu Focal
>            Reporter: Gautham Banasandra
>            Assignee: Gautham Banasandra
>            Priority: Major
>              Labels: libhdfscpp
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to