本文整理汇总了Java中org.apache.hadoop.cli.util.CommandExecutor.Result类的典型用法代码示例。如果您正苦于以下问题:Java Result类的具体用法?Java Result怎么用?Java Result使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Result类属于org.apache.hadoop.cli.util.CommandExecutor包,在下文中一共展示了Result类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compareTestOutput
import org.apache.hadoop.cli.util.CommandExecutor.Result; //导入依赖的package包/类
/**
* Compare the actual output with the expected output
* @param compdata
* @return
*/
private boolean compareTestOutput(ComparatorData compdata, Result cmdResult) {
// Compare the output based on the comparator
String comparatorType = compdata.getComparatorType();
Class<?> comparatorClass = null;
// If testMode is "test", then run the command and compare the output
// If testMode is "nocompare", then run the command and dump the output.
// Do not compare
boolean compareOutput = false;
if (testMode.equals(TESTMODE_TEST)) {
try {
// Initialize the comparator class and run its compare method
comparatorClass = Class.forName("org.apache.hadoop.cli.util." +
comparatorType);
ComparatorBase comp = (ComparatorBase) comparatorClass.newInstance();
compareOutput = comp.compare(cmdResult.getCommandOutput(),
expandCommand(compdata.getExpectedOutput()));
} catch (Exception e) {
LOG.info("Error in instantiating the comparator" + e);
}
}
return compareOutput;
}
示例2: execute
import org.apache.hadoop.cli.util.CommandExecutor.Result; //导入依赖的package包/类
@Override
protected Result execute(CLICommand cmd) throws Exception {
if (cmd.getType() instanceof CLICommandMRAdmin)
return new TestMRCLI.MRCmdExecutor(jobtracker).executeCommand(cmd.getCmd());
else if (cmd.getType() instanceof CLICommandArchive)
return new TestMRCLI.ArchiveCmdExecutor(namenode, mrConf).executeCommand(cmd.getCmd());
else
return super.execute(cmd);
}
示例3: execute
import org.apache.hadoop.cli.util.CommandExecutor.Result; //导入依赖的package包/类
/**
* this method has to be overridden by an ancestor
*/
protected CommandExecutor.Result execute(CLICommand cmd) throws Exception {
throw new Exception("Unknown type of test command:"+ cmd.getType());
}
示例4: execute
import org.apache.hadoop.cli.util.CommandExecutor.Result; //导入依赖的package包/类
@Override
protected Result execute(CLICommand cmd) throws Exception {
return cmd.getExecutor(namenode).executeCommand(cmd.getCmd());
}
示例5: execute
import org.apache.hadoop.cli.util.CommandExecutor.Result; //导入依赖的package包/类
@Override
protected Result execute(CLICommand cmd) throws Exception {
return cmd.getExecutor("").executeCommand(cmd.getCmd());
}
示例6: execute
import org.apache.hadoop.cli.util.CommandExecutor.Result; //导入依赖的package包/类
@Override
protected Result execute(CLICommand cmd) throws Exception {
return cmd.getExecutor(namenode, conf).executeCommand(cmd.getCmd());
}
示例7: execute
import org.apache.hadoop.cli.util.CommandExecutor.Result; //导入依赖的package包/类
@Override
protected Result execute(CLICommand cmd) throws Exception {
return cmd.getExecutor("", conf).executeCommand(cmd.getCmd());
}