Author: cos Date: Tue May 25 23:05:09 2010 New Revision: 948245 URL: http://svn.apache.org/viewvc?rev=948245&view=rev Log: HADOOP-6777. svn merge -c 948242 from trunk
Modified: hadoop/common/branches/branch-0.21/ (props changed) hadoop/common/branches/branch-0.21/CHANGES.txt (contents, props changed) hadoop/common/branches/branch-0.21/src/contrib/ec2/ (props changed) hadoop/common/branches/branch-0.21/src/docs/ (props changed) hadoop/common/branches/branch-0.21/src/java/ (props changed) hadoop/common/branches/branch-0.21/src/test/core/ (props changed) hadoop/common/branches/branch-0.21/src/test/system/aop/org/apache/hadoop/test/system/DaemonProtocolAspect.aj hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/DaemonProtocol.java Propchange: hadoop/common/branches/branch-0.21/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 25 23:05:09 2010 @@ -1,2 +1,2 @@ -/hadoop/common/trunk:944521,945941-945953,947218,947222,947882,948174,948237 +/hadoop/common/trunk:944521,945941-945953,947218,947222,947882,948174,948237,948242 /hadoop/core/branches/branch-0.19/core:713112 Modified: hadoop/common/branches/branch-0.21/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/CHANGES.txt?rev=948245&r1=948244&r2=948245&view=diff ============================================================================== --- hadoop/common/branches/branch-0.21/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.21/CHANGES.txt Tue May 25 23:05:09 2010 @@ -294,6 +294,9 @@ Release 0.21.0 - Unreleased IMPROVEMENTS + HADOOP-6777. Implement a functionality for suspend and resume a process. + (Vinay Thota via cos) + HADOOP-6772. Utilities for system tests specific. (Vinay Thota via cos) HADOOP-6771. Herriot's artifact id for Maven deployment should be set to Propchange: hadoop/common/branches/branch-0.21/CHANGES.txt ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 25 23:05:09 2010 @@ -1,4 +1,4 @@ -/hadoop/common/trunk/CHANGES.txt:944521,945941-945953,947218,947222,947882,948174,948237 +/hadoop/common/trunk/CHANGES.txt:944521,945941-945953,947218,947222,947882,948174,948237,948242 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226 /hadoop/core/branches/branch-0.19/CHANGES.txt:713112 /hadoop/core/trunk/CHANGES.txt:776175-785643,785929-786278 Propchange: hadoop/common/branches/branch-0.21/src/contrib/ec2/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 25 23:05:09 2010 @@ -1,3 +1,3 @@ -/hadoop/common/trunk/src/contrib/ec2:944521,945941-945953,947218,947222,947882,948174,948237 +/hadoop/common/trunk/src/contrib/ec2:944521,945941-945953,947218,947222,947882,948174,948237,948242 /hadoop/core/branches/branch-0.19/core/src/contrib/ec2:713112 /hadoop/core/trunk/src/contrib/ec2:776175-784663 Propchange: hadoop/common/branches/branch-0.21/src/docs/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 25 23:05:09 2010 @@ -1,2 +1,2 @@ -/hadoop/common/trunk/src/docs:944521,945941-945953,947218,947222,947882,948174,948237 +/hadoop/common/trunk/src/docs:944521,945941-945953,947218,947222,947882,948174,948237,948242 /hadoop/core/branches/branch-0.19/src/docs:713112 Propchange: hadoop/common/branches/branch-0.21/src/java/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 25 23:05:09 2010 @@ -1,3 +1,3 @@ -/hadoop/common/trunk/src/java:944521,945941-945953,947218,947222,947882,948174,948237 +/hadoop/common/trunk/src/java:944521,945941-945953,947218,947222,947882,948174,948237,948242 /hadoop/core/branches/branch-0.19/core/src/java:713112 /hadoop/core/trunk/src/core:776175-785643,785929-786278 Propchange: hadoop/common/branches/branch-0.21/src/test/core/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 25 23:05:09 2010 @@ -1,3 +1,3 @@ -/hadoop/common/trunk/src/test/core:944521,945941-945953,947218,947222,947882,948174,948237 +/hadoop/common/trunk/src/test/core:944521,945941-945953,947218,947222,947882,948174,948237,948242 /hadoop/core/branches/branch-0.19/core/src/test/core:713112 /hadoop/core/trunk/src/test/core:776175-785643,785929-786278 Modified: hadoop/common/branches/branch-0.21/src/test/system/aop/org/apache/hadoop/test/system/DaemonProtocolAspect.aj URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/src/test/system/aop/org/apache/hadoop/test/system/DaemonProtocolAspect.aj?rev=948245&r1=948244&r2=948245&view=diff ============================================================================== --- hadoop/common/branches/branch-0.21/src/test/system/aop/org/apache/hadoop/test/system/DaemonProtocolAspect.aj (original) +++ hadoop/common/branches/branch-0.21/src/test/system/aop/org/apache/hadoop/test/system/DaemonProtocolAspect.aj Tue May 25 23:05:09 2010 @@ -31,6 +31,7 @@ import org.apache.commons.logging.LogFac import org.apache.hadoop.io.Writable; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.util.Shell.ShellCommandExecutor; +import org.apache.hadoop.util.Shell; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -274,6 +275,56 @@ public aspect DaemonProtocolAspect { return Integer.parseInt(output.replaceAll("\n", "").trim()); } + /** + * This method is used for suspending the process. + * @param pid process id + * @throws IOException if an I/O error occurs. + * @return true if process is suspended otherwise false. + */ + public boolean DaemonProtocol.suspendProcess(String pid) throws IOException { + String suspendCmd = getDaemonConf().get("test.system.hdrc.suspend.cmd", + "kill -SIGSTOP"); + String [] command = {"bash", "-c", suspendCmd + " " + pid}; + ShellCommandExecutor shexec = new ShellCommandExecutor(command); + try { + shexec.execute(); + } catch (Shell.ExitCodeException e) { + LOG.warn("suspended process throws an exitcode " + + "exception for not being suspended the given process id."); + return false; + } + LOG.info("The suspend process command is :" + + shexec.toString() + + " and the output for the command is " + + shexec.getOutput()); + return true; + } + + /** + * This method is used for resuming the process + * @param pid process id of suspended process. + * @throws IOException if an I/O error occurs. + * @return true if suspeneded process is resumed otherwise false. + */ + public boolean DaemonProtocol.resumeProcess(String pid) throws IOException { + String resumeCmd = getDaemonConf().get("test.system.hdrc.resume.cmd", + "kill -SIGCONT"); + String [] command = {"bash", "-c", resumeCmd + " " + pid}; + ShellCommandExecutor shexec = new ShellCommandExecutor(command); + try { + shexec.execute(); + } catch(Shell.ExitCodeException e) { + LOG.warn("Resume process throws an exitcode " + + "exception for not being resumed the given process id."); + return false; + } + LOG.info("The resume process command is :" + + shexec.toString() + + " and the output for the command is " + + shexec.getOutput()); + return true; + } + private String DaemonProtocol.user = null; public String DaemonProtocol.getDaemonUser() { Modified: hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/DaemonProtocol.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/DaemonProtocol.java?rev=948245&r1=948244&r2=948245&view=diff ============================================================================== --- hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/DaemonProtocol.java (original) +++ hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/DaemonProtocol.java Tue May 25 23:05:09 2010 @@ -162,4 +162,20 @@ public interface DaemonProtocol extends * @throws IOException in case of errors */ String getDaemonUser() throws IOException; + + /** + * It uses for suspending the process. + * @param pid process id. + * @return true if the process is suspended otherwise false. + * @throws IOException if an I/O error occurs. + */ + boolean suspendProcess(String pid) throws IOException; + + /** + * It uses for resuming the suspended process. + * @param pid process id + * @return true if suspended process is resumed otherwise false. + * @throws IOException if an I/O error occurs. + */ + boolean resumeProcess(String pid) throws IOException; }