hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen He (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7606) Missing null check in INodeFile#getBlocks()
Date Wed, 14 Jan 2015 21:17:34 GMT

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

Chen He commented on HDFS-7606:
-------------------------------

Do you mean the last element itself returned by diffs.getLast() is "null" ?

> Missing null check in INodeFile#getBlocks()
> -------------------------------------------
>
>                 Key: HDFS-7606
>                 URL: https://issues.apache.org/jira/browse/HDFS-7606
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> {code}
>     BlockInfo[] snapshotBlocks = diff == null ? getBlocks() : diff.getBlocks();
>     if(snapshotBlocks != null)
>       return snapshotBlocks;
>     // Blocks are not in the current snapshot
>     // Find next snapshot with blocks present or return current file blocks
>     snapshotBlocks = getDiffs().findLaterSnapshotBlocks(diff.getSnapshotId());
> {code}
> If diff is null and snapshotBlocks is null, NullPointerException would result from the
call to diff.getSnapshotId().



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message