Browse Source

commit 1fa2f575e06e258e04aa9ddfa9cf7cafd7cf00b4
Author: Konstantin Boudnik <cos@goodenter-lm.local>
Date: Tue May 18 17:04:11 2010 -0700

HADOOP-6752 from https://issues.apache.org/jira/secure/attachment/12443885/hadoop-6572.patch

+++ b/YAHOO-CHANGES.txt
+ HADOOP-6752. Remote cluster control functionality needs JavaDocs
+ improvement. (Balaji Rajagopalan via cos)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077474 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 years ago
parent
commit
059ef329e3

+ 1 - 1
src/test/system/java/org/apache/hadoop/mapred/TestPushConfig.java

@@ -40,7 +40,7 @@ public class TestPushConfig {
    * in local input directory and pushes all the files from the local to the 
    * in local input directory and pushes all the files from the local to the 
    * remote conf directory. This functionality is required is change the config
    * remote conf directory. This functionality is required is change the config
    * on the fly and restart the cluster which will be used by other test cases
    * on the fly and restart the cluster which will be used by other test cases
-   * @throws Exception 
+   * @throws Exception is thrown if pushConfig fails. 
    */
    */
   @Test
   @Test
   public void testPushConfig() throws Exception {
   public void testPushConfig() throws Exception {

+ 15 - 16
src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonClient.java

@@ -47,7 +47,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * @param conf client to be used by proxy to connect to Daemon.
    * @param conf client to be used by proxy to connect to Daemon.
    * @param process the Daemon process to manage the particular daemon.
    * @param process the Daemon process to manage the particular daemon.
    * 
    * 
-   * @throws IOException
+   * @throws IOException on RPC error
    */
    */
   public AbstractDaemonClient(Configuration conf, RemoteProcess process) 
   public AbstractDaemonClient(Configuration conf, RemoteProcess process) 
       throws IOException {
       throws IOException {
@@ -71,7 +71,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
   /**
   /**
    * Create an RPC proxy to the daemon <br/>
    * Create an RPC proxy to the daemon <br/>
    * 
    * 
-   * @throws IOException
+   * @throws IOException on RPC error
    */
    */
   public abstract void connect() throws IOException;
   public abstract void connect() throws IOException;
 
 
@@ -110,7 +110,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * Gets if the Daemon is ready to accept RPC connections. <br/>
    * Gets if the Daemon is ready to accept RPC connections. <br/>
    * 
    * 
    * @return true if daemon is ready.
    * @return true if daemon is ready.
-   * @throws IOException
+   * @throws IOException on RPC error
    */
    */
   public boolean isReady() throws IOException {
   public boolean isReady() throws IOException {
     return getProxy().isReady();
     return getProxy().isReady();
@@ -118,7 +118,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
 
 
   /**
   /**
    * Kills the Daemon process <br/>
    * Kills the Daemon process <br/>
-   * @throws IOException
+   * @throws IOException on RPC error
    */
    */
   public void kill() throws IOException {
   public void kill() throws IOException {
     process.kill();
     process.kill();
@@ -126,8 +126,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
 
 
   /**
   /**
    * Checks if the Daemon process is alive or not <br/>
    * Checks if the Daemon process is alive or not <br/>
-   * 
-   * @throws IOException
+   * @throws IOException on RPC error
    */
    */
   public void ping() throws IOException {
   public void ping() throws IOException {
     getProxy().ping();
     getProxy().ping();
@@ -135,7 +134,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
 
 
   /**
   /**
    * Start up the Daemon process. <br/>
    * Start up the Daemon process. <br/>
-   * @throws IOException
+   * @throws IOException on RPC error
    */
    */
   public void start() throws IOException {
   public void start() throws IOException {
     process.start();
     process.start();
@@ -146,7 +145,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * 
    * 
    * @return returns system level view of the Daemon process.
    * @return returns system level view of the Daemon process.
    * 
    * 
-   * @throws IOException
+   * @throws IOException on RPC error. 
    */
    */
   public ProcessInfo getProcessInfo() throws IOException {
   public ProcessInfo getProcessInfo() throws IOException {
     return getProxy().getProcessInfo();
     return getProxy().getProcessInfo();
@@ -175,7 +174,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * @param local
    * @param local
    *          whether the path is local or not
    *          whether the path is local or not
    * @return the statuses of the files/directories in the given patch
    * @return the statuses of the files/directories in the given patch
-   * @throws IOException
+   * @throws IOException on RPC error. 
    */
    */
   public FileStatus[] listStatus(String path, boolean local) 
   public FileStatus[] listStatus(String path, boolean local) 
     throws IOException {
     throws IOException {
@@ -193,7 +192,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * @param recursive 
    * @param recursive 
    *          whether to recursively get the status
    *          whether to recursively get the status
    * @return the statuses of the files/directories in the given patch
    * @return the statuses of the files/directories in the given patch
-   * @throws IOException
+   * @throws IOException is thrown on RPC error. 
    */
    */
   public FileStatus[] listStatus(String f, boolean local, boolean recursive) 
   public FileStatus[] listStatus(String f, boolean local, boolean recursive) 
     throws IOException {
     throws IOException {
@@ -239,7 +238,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * Pattern used for searching is ERROR. <br/>
    * Pattern used for searching is ERROR. <br/>
    * @param excludeExpList list of exception to exclude 
    * @param excludeExpList list of exception to exclude 
    * @return number of occurrence of error message.
    * @return number of occurrence of error message.
-   * @throws IOException
+   * @throws IOException is thrown on RPC error. 
    */
    */
   public int getNumberOfErrorStatementsInLog(String[] excludeExpList) 
   public int getNumberOfErrorStatementsInLog(String[] excludeExpList) 
       throws IOException {
       throws IOException {
@@ -254,7 +253,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * Pattern used for searching is WARN. <br/>
    * Pattern used for searching is WARN. <br/>
    * @param excludeExpList list of exception to exclude 
    * @param excludeExpList list of exception to exclude 
    * @return number of occurrence of warning message.
    * @return number of occurrence of warning message.
-   * @throws IOException
+   * @throws IOException thrown on RPC error. 
    */
    */
   public int getNumberOfWarnStatementsInLog(String[] excludeExpList) 
   public int getNumberOfWarnStatementsInLog(String[] excludeExpList) 
       throws IOException {
       throws IOException {
@@ -269,7 +268,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * @param e exception class.
    * @param e exception class.
    * @param excludeExpList list of exceptions to exclude. 
    * @param excludeExpList list of exceptions to exclude. 
    * @return number of exceptions in log
    * @return number of exceptions in log
-   * @throws IOException
+   * @throws IOException is thrown on RPC error. 
    */
    */
   public int getNumberOfExceptionsInLog(Exception e,
   public int getNumberOfExceptionsInLog(Exception e,
       String[] excludeExpList) throws IOException {
       String[] excludeExpList) throws IOException {
@@ -283,7 +282,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * <br/>
    * <br/>
    * @param excludeExpList list of exceptions to exclude.
    * @param excludeExpList list of exceptions to exclude.
    * @return number of times exception in log file.
    * @return number of times exception in log file.
-   * @throws IOException
+   * @throws IOException is thrown on RPC error. 
    */
    */
   public int getNumberOfConcurrentModificationExceptionsInLog(
   public int getNumberOfConcurrentModificationExceptionsInLog(
       String[] excludeExpList) throws IOException {
       String[] excludeExpList) throws IOException {
@@ -299,7 +298,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * Populate the initial exception counts to be used to assert once a testcase
    * Populate the initial exception counts to be used to assert once a testcase
    * is done there was no exception in the daemon when testcase was run.
    * is done there was no exception in the daemon when testcase was run.
    * @param excludeExpList list of exceptions to exclude
    * @param excludeExpList list of exceptions to exclude
-   * @throws IOException
+   * @throws IOException is thrown on RPC error. 
    */
    */
   protected void populateExceptionCount(String [] excludeExpList) 
   protected void populateExceptionCount(String [] excludeExpList) 
       throws IOException {
       throws IOException {
@@ -320,7 +319,7 @@ public abstract class AbstractDaemonClient<PROXY extends DaemonProtocol> {
    * Pre-req for the method is that populateExceptionCount() has 
    * Pre-req for the method is that populateExceptionCount() has 
    * to be called before calling this method.</b></i>
    * to be called before calling this method.</b></i>
    * @param excludeExpList list of exceptions to exclude
    * @param excludeExpList list of exceptions to exclude
-   * @throws IOException
+   * @throws IOException is thrown on RPC error. 
    */
    */
   protected void assertNoExceptionsOccurred(String [] excludeExpList) 
   protected void assertNoExceptionsOccurred(String [] excludeExpList) 
       throws IOException {
       throws IOException {

+ 1 - 2
src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java

@@ -232,8 +232,7 @@ public abstract class AbstractDaemonCluster {
    * that will be excluded.
    * that will be excluded.
    * @param excludeExpList list of exceptions to exclude
    * @param excludeExpList list of exceptions to exclude
    */
    */
-  public void setExcludeExpList(String [] excludeExpList)
-  {
+  public void setExcludeExpList(String [] excludeExpList) {
     this.excludeExpList = excludeExpList;
     this.excludeExpList = excludeExpList;
   }
   }
   
   

+ 3 - 3
src/test/system/java/org/apache/hadoop/test/system/DaemonProtocol.java

@@ -147,12 +147,12 @@ public interface DaemonProtocol extends VersionedProtocol{
    * <b><i>Please note that search spans across all previous messages of
    * <b><i>Please note that search spans across all previous messages of
    * Daemon, so better practice is to get previous counts before an operation
    * Daemon, so better practice is to get previous counts before an operation
    * and then re-check if the sequence of action has caused any problems</i></b>
    * and then re-check if the sequence of action has caused any problems</i></b>
-   * @param pattern to look for in the damon's log file
-   * @param List of exceptions to ignore
+   * @param pattern to look for in the daemon's log file
+   * @param list Exceptions that will be ignored from log file. 
    * @return number of times the pattern if found in log file.
    * @return number of times the pattern if found in log file.
    * @throws IOException in case of errors
    * @throws IOException in case of errors
    */
    */
-  int getNumberOfMatchesInLogFile(String pattern,String[] list) 
+  int getNumberOfMatchesInLogFile(String pattern, String[] list) 
       throws IOException;
       throws IOException;
 
 
   /**
   /**

+ 5 - 6
src/test/system/java/org/apache/hadoop/test/system/process/ClusterProcessManager.java

@@ -62,16 +62,15 @@ public interface ClusterProcessManager {
   /**
   /**
    * Starts the daemon from the user specified conf dir.
    * Starts the daemon from the user specified conf dir.
    * @param newConfLocation the dir where the new conf files reside.
    * @param newConfLocation the dir where the new conf files reside.
-   * @throws IOException
+   * @throws IOException if start from new conf fails. 
    */
    */
   void start(String newConfLocation) throws IOException;
   void start(String newConfLocation) throws IOException;
 
 
   /**
   /**
    * Stops the daemon running from user specified conf dir.
    * Stops the daemon running from user specified conf dir.
    * 
    * 
-   * @param newConfLocation
-   *          the dir where ther new conf files reside.
-   * @throws IOException
+   * @param newConfLocation the dir where the new conf files reside.
+   * @throws IOException if stop from new conf fails. 
    */
    */
   void stop(String newConfLocation) throws IOException;
   void stop(String newConfLocation) throws IOException;
 
 
@@ -86,7 +85,7 @@ public interface ClusterProcessManager {
    * Gets if multi-user support is enabled for this cluster. 
    * Gets if multi-user support is enabled for this cluster. 
    * <br/>
    * <br/>
    * @return true if multi-user support is enabled.
    * @return true if multi-user support is enabled.
-   * @throws IOException
+   * @throws IOException if RPC returns error. 
    */
    */
   boolean isMultiUserSupported() throws IOException;
   boolean isMultiUserSupported() throws IOException;
 
 
@@ -94,7 +93,7 @@ public interface ClusterProcessManager {
    * The pushConfig is used to push a new config to the daemons.
    * The pushConfig is used to push a new config to the daemons.
    * @param localDir
    * @param localDir
    * @return is the remoteDir location where config will be pushed
    * @return is the remoteDir location where config will be pushed
-   * @throws IOException
+   * @throws IOException if pushConfig fails.
    */
    */
   String pushConfig(String localDir) throws IOException;
   String pushConfig(String localDir) throws IOException;
 }
 }

+ 5 - 4
src/test/system/java/org/apache/hadoop/test/system/process/RemoteProcess.java

@@ -41,7 +41,7 @@ public interface RemoteProcess {
   /**
   /**
    * Starts a daemon from user specified conf dir. 
    * Starts a daemon from user specified conf dir. 
    * @param newConfLocation is dir where new conf resides. 
    * @param newConfLocation is dir where new conf resides. 
-   * @throws IOException
+   * @throws IOException if start of process fails from new location.
    */
    */
   void start(String newConfLocation) throws IOException;
   void start(String newConfLocation) throws IOException;
   /**
   /**
@@ -54,7 +54,7 @@ public interface RemoteProcess {
   /**
   /**
    * Stops a given daemon running from user specified 
    * Stops a given daemon running from user specified 
    * conf dir. </br>
    * conf dir. </br>
-   * @throws IOException
+   * @throws IOException if kill fails from new conf location.
    * @param newconfLocation dir location where new conf resides. 
    * @param newconfLocation dir location where new conf resides. 
    */
    */
    void kill(String newConfLocation) throws IOException;
    void kill(String newConfLocation) throws IOException;
@@ -67,8 +67,9 @@ public interface RemoteProcess {
   
   
   /**
   /**
    * Pushed the configuration to new configuration directory 
    * Pushed the configuration to new configuration directory 
-   * @param localDir
-   * @throws IOException
+   * @param localDir The local directory which has config files that will be 
+   * pushed to the remote location
+   * @throws IOException is thrown if the pushConfig results in a error. 
    */
    */
   void pushConfig(String localDir) throws IOException;
   void pushConfig(String localDir) throws IOException;
 }
 }