瀏覽代碼

HDFS-326 SFOS-1270 strip the ping operation from the service lifecycle proposal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/branches/HDFS-326@808125 13f79535-47bb-0310-9956-ffa450edef68
Steve Loughran 15 年之前
父節點
當前提交
5bac93c3a1

+ 1 - 21
src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java

@@ -251,27 +251,7 @@ public class DataNode extends Service
   public void innerStart() throws IOException {
     startDataNode(getConf(), dataDirs);
   }
-    
-  /**
-   * {@inheritDoc}.
-   *
-   * This implementation checks for the IPC server running and the
-   * DataNode being registered to a namenode.
-   *
-   * @param status the initial status
-   * @throws IOException       for any ping failure
-   * @throws LivenessException if the IPC server is not defined 
-   */
-  @Override
-  public void innerPing(ServiceStatus status) throws IOException {
-    if (ipcServer == null) {
-      status.addThrowable(new LivenessException("No IPC Server running"));
-    }
-    if (dnRegistration == null) {
-      status.addThrowable(
-              new LivenessException("Not registered to a namenode"));
-    }
-  }
+
   
   /**
    * This method starts the data node with the specified conf.

+ 1 - 27
src/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java

@@ -473,33 +473,7 @@ public class NameNode extends Service implements ClientProtocol, DatanodeProtoco
     return true;
   }
 
-  /**
-   * {@inheritDoc}.
-   *
-   * This implementation checks for the name system being non-null and live
-   *
-   * @param status status response to build up
-   * @throws IOException       for IO failure; this will be caught and included
-   * in the status message
-   */
-  @Override
-  public void innerPing(ServiceStatus status) throws IOException {
-    if (namesystem == null) {
-      status.addThrowable(new LivenessException("No name system"));
-    } else {
-      try {
-        namesystem.ping();
-      } catch (IOException e) {
-        status.addThrowable(e);
-      }
-    }
-    if (httpServer == null || !httpServer.isAlive()) {
-      status.addThrowable(
-              new LivenessException("NameNode HttpServer is not running"));
-    }
-  }
-
-  /**
+    /**
    * Wait for service to finish.
    * (Normally, it runs forever.)
    */