hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-13428) RBF: Remove LinkedList From StateStoreFileImpl.java
Date Wed, 11 Apr 2018 18:09:00 GMT

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

Hudson commented on HDFS-13428:
-------------------------------

SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #13972 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/13972/])
HDFS-13428. RBF: Remove LinkedList From StateStoreFileImpl.java. (inigoiri: rev f7d5bace435a8de151b94ccc3599a6c4de8f7daf)
* (edit) hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl/StateStoreFileImpl.java


> RBF: Remove LinkedList From StateStoreFileImpl.java
> ---------------------------------------------------
>
>                 Key: HDFS-13428
>                 URL: https://issues.apache.org/jira/browse/HDFS-13428
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: federation
>    Affects Versions: 3.0.1
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Trivial
>         Attachments: HDFS-13428.1.patch
>
>
> Replace {{LinkedList}} with {{ArrayList}} implementation in the StateStoreFileImpl class. 
This is especially advantageous because we can pre-allocate the internal array before a copy
occurs.  {{ArrayList}} is faster for iterations and requires less memory than {{LinkedList}}.
> {code:java}
>   protected List<String> getChildren(String path) {
>     List<String> ret = new LinkedList<>();
>     File dir = new File(path);
>     File[] files = dir.listFiles();
>     if (files != null) {
>       for (File file : files) {
>         String filename = file.getName();
>         ret.add(filename);
>       }
>     }
>     return ret;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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