You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Gera Shegalov (JIRA)" <ji...@apache.org> on 2015/03/02 10:38:04 UTC
[jira] [Created] (HADOOP-11659) o.a.h.fs.FileSystem.Cache#remove
should use a single hash map lookup
Gera Shegalov created HADOOP-11659:
--------------------------------------
Summary: o.a.h.fs.FileSystem.Cache#remove should use a single hash map lookup
Key: HADOOP-11659
URL: https://issues.apache.org/jira/browse/HADOOP-11659
Project: Hadoop Common
Issue Type: Improvement
Components: fs
Affects Versions: 2.6.0
Reporter: Gera Shegalov
Priority: Trivial
The method looks up the same key in the same hash map potentially 3 times
{code}
if (map.containsKey(key) && fs == map.get(key)) {
map.remove(key)
{code}
Instead it could do a single lookup
{code}
FileSystem cachedFs = map.remove(key);
{code}
and then test cachedFs == fs or something else.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)