New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SSH and SCP command utility and refactor shell utility #10658
Conversation
Automated checks report:
Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
private static final class Command { | ||
private String[] mCommand; | ||
private static class Command { | ||
protected String[] mCommand; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to protected
to be inherited
@@ -148,7 +149,7 @@ private Command(String[] execString) { | |||
* @return the output | |||
* @throws ExitCodeException if the command returns a non-zero exit code | |||
*/ | |||
private String run() throws ExitCodeException, IOException { | |||
protected String run() throws ExitCodeException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable inheritance
* | ||
* @return {@link CommandReturn} object representation of stdout, stderr and exit code | ||
*/ | ||
protected CommandReturn runTolerateFailure() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is similar to run()
.
The differences are:
- Not redirecting stderr to stdout.
- Keeping exitCode, stderr and stdout separated and wrapped in an object CommandReturn.
- Not throwing exception when exitcode is non-zero. Return all information instead.
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiacheliu3 Thanks! I left a few comments.
Merged build finished. Test FAILed. |
Test FAILed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiacheliu3 Just a minor comment, then looks good.
Merged build finished. Test PASSed. |
Test PASSed. |
Merged build finished. Test PASSed. |
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
alluxio-bot, merge this please |
This change adds a wrapper to SSH executing a command to ShellUtils, together with SCP commands.
ShellUtils
class refactored with inner classed extracted to standalone classes.PR #10596 relies on this utility as it extensively invokes commands over SSH.