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

Jack Bearden commented on HDFS-10673:
-------------------------------------

Since the NullPointerException is being thrown from a rather benign function, 
it seems safe to just guard against the null element at position 0. I could 
very well be mistaken, however. The following code change appears to remedy the 
edge case on my dev cluster:

{code}
// FSPermissionChecker#getINodeAttrs
if (i == 0 && pathByNameArr[i] == null) {
    elements[i] = "";
} else {
    elements[i] = DFSUtil.bytes2String(pathByNameArr[i]);
}
{code}


> Optimize FSPermissionChecker's internal path usage
> --------------------------------------------------
>
>                 Key: HDFS-10673
>                 URL: https://issues.apache.org/jira/browse/HDFS-10673
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 2.8.0, 2.7.4, 3.0.0-alpha1
>
>         Attachments: HDFS-10673-branch-2.7.00.patch, HDFS-10673.1.patch, 
> HDFS-10673.2.patch, HDFS-10673.patch
>
>
> The INodeAttributeProvider and AccessControlEnforcer features degrade 
> performance and generate excessive garbage even when neither is used.  Main 
> issues:
> # A byte[][] of components is unnecessarily created.  Each path component 
> lookup converts a subrange of the byte[][] to a new String[] - then not used 
> by default attribute provider.
> # Subaccess checks are insanely expensive.  The full path of every subdir is 
> created by walking up the inode tree, creating a INode[], building a string 
> by converting each inode's byte[] name to a string, etc.  Which will only be 
> used if there's an exception.
> The expensive of #1 should only be incurred when using the provider/enforcer 
> feature.  For #2, paths should be created on-demand for exceptions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to