HDFS-8795. Improve InvalidateBlocks#node2blocks. (yliu)

This commit is contained in:
yliu 2015-07-22 15:15:08 +08:00
parent 03d68b5575
commit 930e344d78
2 changed files with 5 additions and 2 deletions

View File

@ -397,6 +397,8 @@ Release 2.8.0 - UNRELEASED
HDFS-8495. Consolidate append() related implementation into a single class. HDFS-8495. Consolidate append() related implementation into a single class.
(Rakesh R via wheat9) (Rakesh R via wheat9)
HDFS-8795. Improve InvalidateBlocks#node2blocks. (yliu)
OPTIMIZATIONS OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

View File

@ -22,9 +22,9 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DFSConfigKeys;
@ -36,6 +36,7 @@ import org.apache.hadoop.util.Time;
import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.hdfs.DFSUtil;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger; import org.slf4j.Logger;
/** /**
@ -47,7 +48,7 @@ import org.slf4j.Logger;
class InvalidateBlocks { class InvalidateBlocks {
/** Mapping: DatanodeInfo -> Collection of Blocks */ /** Mapping: DatanodeInfo -> Collection of Blocks */
private final Map<DatanodeInfo, LightWeightHashSet<Block>> node2blocks = private final Map<DatanodeInfo, LightWeightHashSet<Block>> node2blocks =
new TreeMap<DatanodeInfo, LightWeightHashSet<Block>>(); new HashMap<DatanodeInfo, LightWeightHashSet<Block>>();
/** The total number of blocks in the map. */ /** The total number of blocks in the map. */
private long numBlocks = 0L; private long numBlocks = 0L;