hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1220316 - in /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceScanner.java
Date Sun, 18 Dec 2011 01:12:45 GMT
Author: todd
Date: Sun Dec 18 01:12:45 2011
New Revision: 1220316

URL: http://svn.apache.org/viewvc?rev=1220316&view=rev
Log:
HDFS-2553. Fix BlockPoolSliceScanner spinning in a tight loop. Contributed by Uma Maheswara
Rao G.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceScanner.java

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1220316&r1=1220315&r2=1220316&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Sun Dec
18 01:12:45 2011
@@ -104,6 +104,9 @@ Release 0.23.1 - UNRELEASED
 
     HDFS-2640. Javadoc generation hangs. (tomwhite)
 
+    HDFS-2553. Fix BlockPoolSliceScanner spinning in a tight loop (Uma
+    Maheswara Rao G via todd)
+
 Release 0.23.0 - 2011-11-01 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceScanner.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceScanner.java?rev=1220316&r1=1220315&r2=1220316&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceScanner.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceScanner.java
Sun Dec 18 01:12:45 2011
@@ -450,14 +450,14 @@ class BlockPoolSliceScanner {
   }
   
   private synchronized long getEarliestScanTime() {
-    if ( blockInfoSet.size() > 0 ) {
+    if (!blockInfoSet.isEmpty()) {
       return blockInfoSet.first().lastScanTime;
     }
     return Long.MAX_VALUE; 
   }
   
   private synchronized boolean isFirstBlockProcessed() {
-    if (blockInfoSet.size() > 0 ) {
+    if (!blockInfoSet.isEmpty()) {
       long blockId = blockInfoSet.first().block.getBlockId();
       if ((processedBlocks.get(blockId) != null)
           && (processedBlocks.get(blockId) == 1)) {
@@ -471,7 +471,7 @@ class BlockPoolSliceScanner {
   private void verifyFirstBlock() {
     Block block = null;
     synchronized (this) {
-      if ( blockInfoSet.size() > 0 ) {
+      if (!blockInfoSet.isEmpty()) {
         block = blockInfoSet.first().block;
       }
     }
@@ -560,7 +560,7 @@ class BlockPoolSliceScanner {
      * lastModificationTime > 0.
      */    
     synchronized (this) {
-      if (blockInfoSet.size() > 0 ) {
+      if (!blockInfoSet.isEmpty()) {
         BlockScanInfo info;
         while ((info =  blockInfoSet.first()).lastScanTime < 0) {
           delBlockInfo(info);        
@@ -630,7 +630,7 @@ class BlockPoolSliceScanner {
           }
         }
         if (((now - getEarliestScanTime()) >= scanPeriod)
-            || (!(this.isFirstBlockProcessed()))) {
+            || ((!blockInfoSet.isEmpty()) && !(this.isFirstBlockProcessed()))) {
           verifyFirstBlock();
         } else {
           if (LOG.isDebugEnabled()) {



Mime
View raw message