Example usage for org.apache.hadoop.cli.util CommandExecutor executeCommand

List of usage examples for org.apache.hadoop.cli.util CommandExecutor executeCommand

Introduction

In this page you can find the example usage for org.apache.hadoop.cli.util CommandExecutor executeCommand.

Prototype

public Result executeCommand(final String cmd) throws Exception 

Source Link

Usage

From source file:org.apache.bigtop.itest.hadoop.hcfs.TestCLI.java

License:Apache License

/**
 * Execute given hadoop FsShell command (via Toolrunner).
 *///  w  w w  .ja  v  a2s  .  co m
@Override
protected CommandExecutor.Result execute(CLICommand cmd) throws Exception {
    if (cmd.getType() instanceof CLICommandFS) {
        CommandExecutor cmdExecutor = new FSCmdExecutor(namenode, new FsShell(conf));
        return cmdExecutor.executeCommand(cmd.getCmd());
    } else {
        throw new IllegalArgumentException("Unknown type of test command: " + cmd.getType());
    }
}

From source file:org.apache.bigtop.itest.hadoop.hdfs.TestCLI.java

License:Apache License

@Override
protected CommandExecutor.Result execute(CLICommand cmd) throws Exception {
    if (cmd.getType() instanceof CLICommandFS) {
        CommandExecutor cmdExecutor = new FSCmdExecutor(nn, new FsShell(conf));
        return cmdExecutor.executeCommand(cmd.getCmd());
    } else {//  ww w . j  av  a  2s  . com
        throw new IllegalArgumentException("Unknown type of test command: " + cmd.getType());
    }
}