You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/08/29 18:29:00 UTC

[jira] [Work logged] (HADOOP-11452) Make FileSystem.rename(path, path, options) public, specified, tested

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

ASF GitHub Bot logged work on HADOOP-11452:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Aug/20 18:28
            Start Date: 29/Aug/20 18:28
    Worklog Time Spent: 10m 
      Work Description: steveloughran commented on a change in pull request #743:
URL: https://github.com/apache/hadoop/pull/743#discussion_r479676808



##########
File path: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FSMainOperationsBaseTest.java
##########
@@ -623,26 +625,25 @@ public void testGlobStatusFilterWithMultiplePathWildcardsAndNonTrivialFilter()
     FileStatus[] filteredPaths = fSys.globStatus(
         getTestRootPath(fSys, "test/hadoop/a??"),
         TEST_X_FILTER);
-    Assert.assertEquals(2, filteredPaths.length);
-    Assert.assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXA),
+    assertEquals(2, filteredPaths.length);
+    assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXA),
         filteredPaths));
-    Assert.assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXX),
+    assertTrue(containsTestRootPath(getTestRootPath(fSys, TEST_DIR_AXX),
         filteredPaths));
   }
 
   @Test
   public void testGlobStatusThrowsExceptionForUnreadableDir()
       throws Exception {
+    assumePermissionsSupported();
     Path testRootDir = getTestRootPath(fSys, "test/hadoop/dir");
     Path obscuredDir = new Path(testRootDir, "foo");
     Path subDir = new Path(obscuredDir, "bar"); //so foo is non-empty
     fSys.mkdirs(subDir);
     fSys.setPermission(obscuredDir, new FsPermission((short)0)); //no access
     try {
-      fSys.globStatus(getTestRootPath(fSys, "test/hadoop/dir/foo/*"));
-      Assert.fail("Should throw IOException");
-    } catch (IOException ioe) {
-      // expected
+      intercept(IOException.class, () ->

Review comment:
       I'm going to revert all changes to this test suite other than those which go near rename, so whatever is tested for today is going to be exactly what is continued to be tested for. I Don't know what the nuances of HDFS permissions are. 
   I'd assume that the getFileStatus call only needs metadata/list permissions, rather than read access. That HDFS doc states that client needs execute permission on all parent directories, so that it can get from / to the file. Therefore the "has permissions to call getFileXXX" is implicit if you can get to the dir, right?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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

> Make FileSystem.rename(path, path, options) public, specified, tested
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-11452
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11452
>             Project: Hadoop Common
>          Issue Type: Task
>          Components: fs
>    Affects Versions: 2.7.3
>            Reporter: Yi Liu
>            Assignee: Steve Loughran
>            Priority: Major
>         Attachments: HADOOP-11452-001.patch, HADOOP-11452-002.patch, HADOOP-14452-004.patch, HADOOP-14452-branch-2-003.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently in {{FileSystem}}, {{rename}} with _Rename options_ is protected and with _deprecated_ annotation. And the default implementation is not atomic.
> So this method is not able to be used outside. On the other hand, HDFS has a good and atomic implementation. (Also an interesting thing in {{DFSClient}}, the _deprecated_ annotations for these two methods are opposite).
> It makes sense to make public for {{rename}} with _Rename options_, since it's atomic for rename+overwrite, also it saves RPC calls if user desires rename+overwrite.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org