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

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

                Author: ASF GitHub Bot
            Created on: 21/Jul/21 22:05
            Start Date: 21/Jul/21 22:05
    Worklog Time Spent: 10m 
      Work Description: shvachko commented on a change in pull request #3205:
URL: https://github.com/apache/hadoop/pull/3205#discussion_r674367980



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirMkdirOp.java
##########
@@ -69,25 +69,34 @@ static FileStatus mkdirs(FSNamesystem fsn, 
FSPermissionChecker pc, String src,
         // create multiple inodes.
         fsn.checkFsObjectLimit();
 
-        // create all missing directories along the path,
-        // but don't add them to the INodeMap yet
-        permissions = addImplicitUwx(permissions, permissions); // SHV !!!
-        INode[] missing = createPathDirectories(fsd, iip, permissions);
-        iip = iip.getExistingINodes();
-        // switch the locks
-        fsd.getINodeMap().latchWriteLock(iip, missing);
-        // Add missing inodes to the INodeMap
-        for(INode dir : missing) {
-          iip = addSingleDirectory(fsd, iip, dir, permissions);
-          assert iip != null : "iip should not be null";
-        }
+        iip = createMissingDirs(fsd, iip, permissions);
       }
       return fsd.getAuditFileInfo(iip);
     } finally {
       fsd.writeUnlock();
     }
   }
 
+  public static INodesInPath createMissingDirs(FSDirectory fsd,

Review comment:
       You don't really need it public, right? You should use most restrictive 
modifiers. One can always change them later when needed.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirWriteFileOp.java
##########
@@ -393,7 +400,7 @@ static HdfsFileStatus startFile(
     fsn.checkFsObjectLimit();
     INodeFile newNode = null;
     INodesInPath parent =
-        FSDirMkdirOp.createAncestorDirectories(fsd, iip, permissions);
+        FSDirMkdirOp.createMissingDirs(fsd, iip.getParentINodesInPath(), 
permissions);

Review comment:
       Could you please check for a long lines. They should not exceed 80 
symbols per Hadoop code style.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirMkdirOp.java
##########
@@ -251,7 +260,10 @@ private static INode createDirectoryINode(FSDirectory fsd,
     return dir;
   }
 
-  private static INode[] createPathDirectories(FSDirectory fsd,
+  /**
+   * Find-out missing iNodes for the current mkdir OP
+   */
+  public static INode[] createPathDirectories(FSDirectory fsd,

Review comment:
       Don't really need this to be public.




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


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

    Worklog Id:     (was: 626350)
    Time Spent: 0.5h  (was: 20m)

> [FGL] Implement Create File with FGL
> ------------------------------------
>
>                 Key: HDFS-16130
>                 URL: https://issues.apache.org/jira/browse/HDFS-16130
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>    Affects Versions: Fine-Grained Locking
>            Reporter: Renukaprasad C
>            Assignee: Renukaprasad C
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Implement FGL for Create File.
> Create API acquire global lock at mulitiple stages. Acquire the respective 
> partitioned lock and continue the create operation.



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

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

Reply via email to