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

Mingliang Liu commented on HDFS-11455:
--------------------------------------

The patch looks good to me overall.

One comment is that, for calls to exists and then isDirectory, we can combine 
them together with one getFileStatus call. This is not heavily needed though, 
as we deliberately left the exists not deprecated.
One possible fix is that,
{code}
try {
  FileStatus status = fs.getFileStatus(path);
  if (status != null && status.isDirectory) {
    ..
  }
catch (FileNotFoundException e) {
  fail("File does not exist in test");
}
{code}

[[email protected]] do you have comments on this? Thanks.

> Fix javadoc warnings in HDFS that caused by deprecated FileSystem APIs
> ----------------------------------------------------------------------
>
>                 Key: HDFS-11455
>                 URL: https://issues.apache.org/jira/browse/HDFS-11455
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>            Priority: Minor
>         Attachments: HDFS-11455.001.patch
>
>
> There are many javadoc warnings coming out after FileSystem APIs which 
> promote inefficient call patterns being deprecated in HADOOP-13321. The 
> relevant warnings:
> {code}
> [WARNING] 
> /testptch/hadoop/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java:[320,18]
>  [deprecation] isFile(Path) in FileSystem has been deprecated
> [WARNING] 
> /testptch/hadoop/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java:[1409,18]
>  [deprecation] isFile(Path) in FileSystem has been deprecated
> [WARNING] 
> /testptch/hadoop/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestINodeFile.java:[778,19]
>  [deprecation] isDirectory(Path) in FileSystem has been deprecated
> [WARNING] 
> /testptch/hadoop/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestINodeFile.java:[787,20]
>  [deprecation] isDirectory(Path) in FileSystem has been deprecated
> [WARNING] 
> /testptch/hadoop/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestQuotaByStorageType.java:[834,18]
>  [deprecation] isFile(Path) in FileSystem has been 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to