HDFS-3194. DataNode block scanner is running too frequently. Contributed by Andy Isaacson

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1373932 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2012-08-16 17:16:52 +00:00
parent a6091a6a82
commit ac63450f02
2 changed files with 4 additions and 4 deletions

View File

@ -458,6 +458,9 @@ Release 2.0.1-alpha - UNRELEASED
HDFS-3048. Small race in BlockManager#close. (Andy Isaacson via eli) HDFS-3048. Small race in BlockManager#close. (Andy Isaacson via eli)
HDFS-3194. DataNode block scanner is running too frequently.
(Andy Isaacson via eli)
BREAKDOWN OF HDFS-3042 SUBTASKS BREAKDOWN OF HDFS-3042 SUBTASKS
HDFS-2185. HDFS portion of ZK-based FailoverController (todd) HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

View File

@ -554,11 +554,9 @@ class BlockPoolSliceScanner {
} }
private synchronized void startNewPeriod() { private synchronized void startNewPeriod() {
if (LOG.isDebugEnabled()) { LOG.info("Starting a new period : work left in prev period : "
LOG.debug("Starting a new period : work left in prev period : "
+ String.format("%.2f%%", totalBytesToScan == 0 ? 0 + String.format("%.2f%%", totalBytesToScan == 0 ? 0
: (bytesLeft * 100.0) / totalBytesToScan)); : (bytesLeft * 100.0) / totalBytesToScan));
}
// reset the byte counts : // reset the byte counts :
bytesLeft = totalBytesToScan; bytesLeft = totalBytesToScan;
@ -566,7 +564,6 @@ class BlockPoolSliceScanner {
} }
void scanBlockPoolSlice() { void scanBlockPoolSlice() {
startNewPeriod();
// Create a new processedBlocks structure // Create a new processedBlocks structure
processedBlocks = new HashMap<Long, Integer>(); processedBlocks = new HashMap<Long, Integer>();
if (!assignInitialVerificationTimes()) { if (!assignInitialVerificationTimes()) {