You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Colin Patrick McCabe (JIRA)" <ji...@apache.org> on 2015/10/09 21:12:05 UTC

[jira] [Updated] (HDFS-9221) HdfsServerConstants#ReplicaState#getState should avoid calling values() since it creates a temporary array

     [ https://issues.apache.org/jira/browse/HDFS-9221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colin Patrick McCabe updated HDFS-9221:
---------------------------------------
    Summary: HdfsServerConstants#ReplicaState#getState should avoid calling values() since it creates a temporary array  (was: HdfsServerConstants#getState should avoid calling values() since it creates a temporary array)

> 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
>         Attachments: ReplicaState.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)