Example usage for org.apache.hadoop.cli.util CLICommand getCmd

List of usage examples for org.apache.hadoop.cli.util CLICommand getCmd

Introduction

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

Prototype

public String getCmd();

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.  j  ava 2s  .c o  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 {//from   w  w  w . j av  a2  s  .c om
        throw new IllegalArgumentException("Unknown type of test command: " + cmd.getType());
    }
}