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-9221) HdfsServerConstants#ReplicaState#getState should avoid calling values() since it creates a temporary array
Date Mon, 12 Oct 2015 08:27:05 GMT

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

Hudson commented on HDFS-9221:
------------------------------

FAILURE: Integrated in Hadoop-Yarn-trunk #1248 (See [https://builds.apache.org/job/Hadoop-Yarn-trunk/1248/])
HDFS-9221. HdfsServerConstants#ReplicaState#getState should avoid (yliu: rev 0ff1216100d16cfa862854a89cd1be8969b0bd7e)
* hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java


> HdfsServerConstants#ReplicaState#getState should avoid calling values() since it creates
a temporary array
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-9221
>                 URL: https://issues.apache.org/jira/browse/HDFS-9221
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: performance
>    Affects Versions: 2.7.1
>            Reporter: Staffan Friberg
>            Assignee: Staffan Friberg
>             Fix For: 2.8.0
>
>         Attachments: HADOOP-9221.001.patch
>
>
> When the BufferDecoder in BlockListAsLongs converts the stored value to a ReplicaState
enum it calls ReplicaState.getState(int) unfortunately this method creates a ReplicaState[]
for each call since it calls ReplicaState.values().
> This patch creates a cached version of the values and thus avoid all allocation when
doing the conversion.



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

Mime
View raw message