brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grkvlt <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Feature/async ssh
Date Mon, 01 Dec 2014 15:59:29 GMT
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/358#discussion_r21097323
  
    --- Diff: core/src/main/java/brooklyn/util/internal/ssh/ShellAbstractTool.java ---
    @@ -262,7 +264,112 @@ public ToolAbstractExecScript(Map<String,?> props) {
                 return cmds.build();
             }
     
    +        protected String getSummary() {
    +            String summary = getOptionalVal(props, PROP_SUMMARY);
    +            return (summary != null) ? summary : scriptPath; 
    +        }
    +
             public abstract int run();
         }
         
    +    protected abstract class ToolAbstractAsyncExecScript extends ToolAbstractExecScript
{
    +        protected final String stdoutPath;
    +        protected final String stderrPath;
    +        protected final String exitStatusPath;
    +        protected final String pidPath;
    +
    +        public ToolAbstractAsyncExecScript(Map<String,?> props) {
    +            super(props);
    +
    +            stdoutPath = Os.mergePathsUnix(scriptDir, scriptNameWithoutExtension + ".stdout");
    +            stderrPath = Os.mergePathsUnix(scriptDir, scriptNameWithoutExtension + ".stderr");
    +            exitStatusPath = Os.mergePathsUnix(scriptDir, scriptNameWithoutExtension
+ ".exitstatus");
    +            pidPath = Os.mergePathsUnix(scriptDir, scriptNameWithoutExtension + ".pid");
    +        }
    +
    +        /**
    +         * Builds the command to run the given script, asynchronously.
    +         * The executed command will return immediately, but the output from the script
    +         * will continue to be written 
    +         * note that some modes require \$RESULT passed in order to access a variable,
whereas most just need $ */
    +        protected List<String> buildRunScriptCommand() {
    +            // TODO 
    +            String touchCmd = String.format("touch %s; touch %s; touch %s; touch %s",
stdoutPath, stderrPath, exitStatusPath, pidPath);
    --- End diff --
    
    Can do `touch %s %s %s %s` as a single command.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message