You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2018/11/27 20:59:00 UTC
[jira] [Created] (HDFS-14108) BlockManager Data Structures
BELUGA BEHR created HDFS-14108:
----------------------------------
Summary: BlockManager Data Structures
Key: HDFS-14108
URL: https://issues.apache.org/jira/browse/HDFS-14108
Project: Hadoop HDFS
Issue Type: Improvement
Components: hdfs
Affects Versions: 3.2.0
Reporter: BELUGA BEHR
Assignee: BELUGA BEHR
Attachments: HDFS-14108.1.patch
# Prefer {{ArrayList}} to {{LinkedList}} when simply adding/iterating
# Prefer {{HashSet}} to {{TreeSet}} when no ordering is required
# Other performance improvements
# Check style fixes
https://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist-in-java
{code:java}
final Set<Node> excludedNodes = new HashSet<>();
for(BlockReconstructionWork rw : reconWork){
// Do no bother wasting time clearing out the collection, let GC do that work later
excludedNodes.clear();
// use {{addAll}} here
for (DatanodeDescriptor dn : rw.getContainingNodes()) {
excludedNodes.add(dn);
}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org