hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Liang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-12315) Use Path instead of String in the TestHdfsAdmin.verifyOpenFiles()
Date Thu, 17 Aug 2017 17:47:00 GMT

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

Chen Liang commented on HDFS-12315:
-----------------------------------

Thanks [~olegd] for the catch! v001 patch LGTM.

> Use Path instead of String in the TestHdfsAdmin.verifyOpenFiles()
> -----------------------------------------------------------------
>
>                 Key: HDFS-12315
>                 URL: https://issues.apache.org/jira/browse/HDFS-12315
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Oleg Danilov
>            Priority: Trivial
>         Attachments: HDFS-12315.patch
>
>
> closedFiles is a set of Path, therefor closedFiles.contains(String) doesn't make sense.
> lines 252-261:
> {code:java}
>   private void verifyOpenFiles(HashSet<Path> closedFiles,
>       HashMap<Path, FSDataOutputStream> openFileMap) throws IOException {
>     HdfsAdmin hdfsAdmin = new HdfsAdmin(FileSystem.getDefaultUri(conf), conf);
>     HashSet<Path> openFiles = new HashSet<>(openFileMap.keySet());
>     RemoteIterator<OpenFileEntry> openFilesRemoteItr =
>         hdfsAdmin.listOpenFiles();
>     while (openFilesRemoteItr.hasNext()) {
>       String filePath = openFilesRemoteItr.next().getFilePath();
>       assertFalse(filePath + " should not be listed under open files!",
>           closedFiles.contains(filePath));
> {code}



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

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


Mime
View raw message