[ 
https://issues.apache.org/jira/browse/HADOOP-7856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18116653#comment-18116653
 ] 

ASF GitHub Bot commented on HADOOP-7856:
----------------------------------------

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

   Fixes [HADOOP-7856](https://issues.apache.org/jira/browse/HADOOP-7856)
   
   ### Description of PR
   
   `DiskChecker#checkDir(File)` javadocs were incomplete (the original summary 
trailed off, and later checkstyle-only `@param`/`@throws` text did not describe 
the method). Switching between `checkDir(File)` and `checkDir(LocalFileSystem, 
Path, FsPermission)` can also surprise callers: File-based access checks 
reflect OS/filesystem writability, while Hadoop `FsPermission` / 
`FsAction#implies` only inspect permission bits and can pass on a read-only 
filesystem.
   
   This change completes the `checkDir` javadocs and calls that distinction out 
explicitly. After HADOOP-8973 both overloads also use `File` methods for 
access; the FsPermission overload still additionally applies `expected` 
permission, so the two APIs remain not equivalent.
   
   Javadoc-only. No code behavior change.
   
   ### How was this patch tested?
   
   Checks in progress (will update this PR with results):
   - `TestDiskChecker` / `TestDiskCheckerWithDiskIo`
   - checkstyle on the touched file if feasible
   
   ### For code changes:
   
   - [x] Does the title of this PR start with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: N/A
   - [ ] New dependencies: none
   - [ ] LICENSE/NOTICE: N/A
   
   ### AI Tooling
   
   - [x] The PR includes the phrase "Contains content generated by Cursor Grok 
4.6"
   - [x] My use of AI contributions follows the ASF legal policy 
https://www.apache.org/legal/generative-tooling.html
   
   Contains content generated by Cursor Grok 4.6.
   
   ### Contributor notes
   
   - Apache ICLA may be required for this contribution. I am **not** claiming 
that an ICLA has been signed.
   - Please do not merge until a committer has confirmed CLA status and 
reviewed the change.




> Improve DiskChecker javadocs
> ----------------------------
>
>                 Key: HADOOP-7856
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7856
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>            Reporter: Eli Collins
>            Priority: Major
>              Labels: newbie
>
> The javadocs for DiskChecker#checkDir(File dir) trail off, look like they 
> weren't completed, should be. 
> While checkDir(File) uses java File to check if a dir actually is writable, 
> the version of checkDir that takes an FsPermission uses FsAction#implies 
> which doesn't actually check if a dir is writable (eg it passes on a 
> read-only file system). So switching from one version to the other can cause 
> unexpected bugs. Let's call this out explicitly in the javadocs.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to