[
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
```

I verified the output against the information displayed in the UI.

I then ran the tool by providing the path to a directory as the argument.
```bash
$ ./hdfs_stat ~/some-dir
```

I verified the output against the information displayed in the UI.

I then ran the tool by providing a non-existent path as the argument.
```bash
$ ./hdfs_stat ~/some-non-existent-path
```

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]