hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r960816 - in /hadoop/common/branches/branch-0.20-append: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
Date Tue, 06 Jul 2010 06:52:20 GMT
Author: dhruba
Date: Tue Jul  6 06:52:20 2010
New Revision: 960816

URL: http://svn.apache.org/viewvc?rev=960816&view=rev
Log:
HDFS-1202.  DataBlockScanner throws NPE when updated before 
initialized. (Todd Lipcon via dhruba)


Modified:
    hadoop/common/branches/branch-0.20-append/CHANGES.txt
    hadoop/common/branches/branch-0.20-append/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java

Modified: hadoop/common/branches/branch-0.20-append/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-append/CHANGES.txt?rev=960816&r1=960815&r2=960816&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-append/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-append/CHANGES.txt Tue Jul  6 06:52:20 2010
@@ -22,6 +22,9 @@ Release 0.20-append - Unreleased
     HDFS-1057.  Concurrent readers hit ChecksumExceptions if following 
     a writer to very end of file (Sam Rash via dhruba)
 
+    HDFS-1202.  DataBlockScanner throws NPE when updated before 
+    initialized. (Todd Lipcon via dhruba)
+
   IMPROVEMENTS
 
   BUG FIXES

Modified: hadoop/common/branches/branch-0.20-append/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-append/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java?rev=960816&r1=960815&r2=960816&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-append/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
(original)
+++ hadoop/common/branches/branch-0.20-append/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
Tue Jul  6 06:52:20 2010
@@ -145,7 +145,7 @@ class DataBlockScanner implements Runnab
     // initialized when the scanner thread is started.
   }
   
-  private synchronized boolean isInitiliazed() {
+  private synchronized boolean isInitialized() {
     return throttler != null;
   }
   
@@ -254,7 +254,7 @@ class DataBlockScanner implements Runnab
 
   /** Adds block to list of blocks */
   synchronized void addBlock(Block block) {
-    if (!isInitiliazed()) {
+    if (!isInitialized()) {
       return;
     }
     
@@ -273,7 +273,7 @@ class DataBlockScanner implements Runnab
   
   /** Deletes the block from internal structures */
   synchronized void deleteBlock(Block block) {
-    if (!isInitiliazed()) {
+    if (!isInitialized()) {
       return;
     }
     BlockScanInfo info = blockMap.get(block);
@@ -284,7 +284,7 @@ class DataBlockScanner implements Runnab
 
   /** @return the last scan time */
   synchronized long getLastScanTime(Block block) {
-    if (!isInitiliazed()) {
+    if (!isInitialized()) {
       return 0;
     }
     BlockScanInfo info = blockMap.get(block);
@@ -305,6 +305,9 @@ class DataBlockScanner implements Runnab
   private synchronized void updateScanStatus(Block block, 
                                              ScanType type,
                                              boolean scanOk) {
+    if (!isInitialized()) {
+      return;
+    }
     BlockScanInfo info = blockMap.get(block);
     
     if ( info != null ) {
@@ -955,7 +958,7 @@ class DataBlockScanner implements Runnab
       if (blockScanner == null) {
         buffer.append("Periodic block scanner is not running. " +
                       "Please check the datanode log if this is unexpected.");
-      } else if (blockScanner.isInitiliazed()) {
+      } else if (blockScanner.isInitialized()) {
         blockScanner.printBlockReport(buffer, summary);
       } else {
         buffer.append("Periodic block scanner is not yet initialized. " +



Mime
View raw message