Bladeren bron

HDFS-326 innerStart() can throw InterruptedException

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/branches/HDFS-326@808528 13f79535-47bb-0310-9956-ffa450edef68
Steve Loughran 15 jaren geleden
bovenliggende
commit
c47b8b4c09

+ 3 - 2
src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java

@@ -246,9 +246,10 @@ public class DataNode extends Service
    * Start any work (in separate threads)
    *
    * @throws IOException for any startup failure
+   * @throws InterruptedException if the thread was interrupted on startup
    */
   @Override
-  public void innerStart() throws IOException {
+  public void innerStart() throws IOException, InterruptedException {
     startDataNode(getConf(), dataDirs);
   }
 
@@ -265,7 +266,7 @@ public class DataNode extends Service
    */
   void startDataNode(Configuration conf, 
                      AbstractList<File> dataDirs
-                     ) throws IOException {
+                     ) throws IOException, InterruptedException {
     // use configured nameserver & interface to get local hostname
     if (conf.get("slave.host.name") != null) {
       machineName = conf.get("slave.host.name");   

+ 3 - 2
src/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java

@@ -453,10 +453,11 @@ public class NameNode extends Service implements ClientProtocol, DatanodeProtoco
    * Any subclasses that do not consider themsevles to be live once 
    * any subclassed initialize method has returned should override the method
    * {@link #goLiveAtTheEndOfStart()} to change that behavior.
-   * @throws IOException for any problem.
+   * @throws IOException for any problem that prevented startup.
+   * @throws InterruptedException if the thread was interrupted on startup
    */
   @Override
-  protected void innerStart() throws IOException {
+  protected void innerStart() throws IOException, InterruptedException {
     initialize(getConf());
     if(goLiveAtTheEndOfStart()) {
       setServiceState(ServiceState.LIVE);