Преглед изворни кода

HDFS-8578. On upgrade, Datanode should process all storage/data dirs in parallel. Contributed by vinayakumarb and szetszwo
Addendum to fix compilation

Vinayakumar B пре 9 година
родитељ
комит
33b961ee88

+ 5 - 3
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java

@@ -22,6 +22,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.IOException;
+import java.io.InterruptedIOException;
 import java.io.RandomAccessFile;
 import java.io.RandomAccessFile;
 import java.nio.channels.FileLock;
 import java.nio.channels.FileLock;
 import java.util.ArrayList;
 import java.util.ArrayList;
@@ -54,7 +55,6 @@ import org.apache.hadoop.fs.LocalFileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
-import org.apache.hadoop.hdfs.DFSUtilClient;
 import org.apache.hadoop.hdfs.HdfsConfiguration;
 import org.apache.hadoop.hdfs.HdfsConfiguration;
 import org.apache.hadoop.hdfs.protocol.Block;
 import org.apache.hadoop.hdfs.protocol.Block;
 import org.apache.hadoop.hdfs.protocol.HdfsConstants;
 import org.apache.hadoop.hdfs.protocol.HdfsConstants;
@@ -441,7 +441,8 @@ public class DataStorage extends Storage {
         } catch (ExecutionException e) {
         } catch (ExecutionException e) {
           LOG.warn("Failed to upgrade storage directory " + t.dataDir, e);
           LOG.warn("Failed to upgrade storage directory " + t.dataDir, e);
         } catch (InterruptedException e) {
         } catch (InterruptedException e) {
-          throw DFSUtilClient.toInterruptedIOException("Task interrupted", e);
+          throw (InterruptedIOException) new InterruptedIOException(
+              "Task interrupted").initCause(e);
         }
         }
       }
       }
     }
     }
@@ -490,7 +491,8 @@ public class DataStorage extends Storage {
           LOG.warn("Failed to upgrade storage directory " + t.dataDir
           LOG.warn("Failed to upgrade storage directory " + t.dataDir
               + " for block pool " + bpid, e);
               + " for block pool " + bpid, e);
         } catch (InterruptedException e) {
         } catch (InterruptedException e) {
-          throw DFSUtilClient.toInterruptedIOException("Task interrupted", e);
+          throw (InterruptedIOException) new InterruptedIOException(
+              "Task interrupted").initCause(e);
         }
         }
       }
       }
     }
     }