本文整理汇总了Java中org.apache.hadoop.util.ToolRunner.run方法的典型用法代码示例。如果您正苦于以下问题:Java ToolRunner.run方法的具体用法?Java ToolRunner.run怎么用?Java ToolRunner.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.util.ToolRunner
的用法示例。
在下文中一共展示了ToolRunner.run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBenchmarkWithProto
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
@Test(timeout=20000)
public void testBenchmarkWithProto() throws Exception {
int rc = ToolRunner.run(new RPCCallBenchmark(),
new String[] {
"--clientThreads", "30",
"--serverThreads", "30",
"--time", "5",
"--serverReaderThreads", "4",
"--messageSize", "1024",
"--engine", "protobuf"});
assertEquals(0, rc);
}
示例2: main
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
if (args.length!=2){
System.out.println("Usage: FriendRecommendation <input dir> <output dir> \n");
System.exit(-1);
}
System.out.println(Arrays.toString(args));
int res = ToolRunner.run(new Configuration(), new FriendRecommendation(), args);
System.exit(res);
}
示例3: runTestFromCommandLine
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
@Override
public int runTestFromCommandLine() throws Exception {
VerifyReplicationLoop tool = new VerifyReplicationLoop();
tool.integrationTestBigLinkedList = this;
return ToolRunner.run(getConf(), tool, null);
}
示例4: main
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Configuration conf = HBaseConfiguration.create();
IntegrationTestingUtility.setUseDistributedCluster(conf);
int ret = ToolRunner.run(conf, new IntegrationTestAcidGuarantees(), args);
System.exit(ret);
}
示例5: exec
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
/**
* Execute the command, return the result or throw an exception,
* as appropriate.
* @param args argument varags.
* @return return code
* @throws Exception failure
*/
public static int exec(String... args) throws Exception {
return ToolRunner.run(new S3ADiag(), args);
}
示例6: main
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Configuration conf = HBaseConfiguration.create();
IntegrationTestingUtility.setUseDistributedCluster(conf);
int ret = ToolRunner.run(conf, new IntegrationTestReplication(), args);
System.exit(ret);
}
示例7: execute
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
/**
* Invoke {@link org.apache.hadoop.fs.FsShell#main} after a
* few cursory checks of the configuration.
*/
public void execute() throws BuildException {
if (null == cmd)
throw new BuildException("Missing command (cmd) argument");
argv.add(0, cmd);
if (null == confloader) {
setConf(getProject().getProperty("hadoop.conf.dir"));
}
int exit_code = 0;
try {
pushContext();
Configuration conf = new HdfsConfiguration();
conf.setClassLoader(confloader);
exit_code = ToolRunner.run(conf, shell,
argv.toArray(new String[argv.size()]));
exit_code = postCmd(exit_code);
if (0 > exit_code) {
StringBuilder msg = new StringBuilder();
for (String s : argv)
msg.append(s + " ");
msg.append("failed: " + exit_code);
throw new Exception(msg.toString());
}
} catch (Exception e) {
if (failonerror)
throw new BuildException(e);
} finally {
popContext();
}
}
示例8: execute
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
@Override
protected void execute(final String cmd) throws Exception {
String[] args = getCommandAsArgs(cmd, "NAMENODE", this.namenode);
ToolRunner.run(admin, args);
}
示例9: testRun
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
public void testRun() throws Exception {
DBCountPageView testDriver = new DBCountPageView();
ToolRunner.run(createJobConf(), testDriver, new String[0]);
}
示例10: main
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Configuration conf = HBaseConfiguration.create();
IntegrationTestingUtility.setUseDistributedCluster(conf);
int ret = ToolRunner.run(conf, new IntegrationTestIngestStripeCompactions(), args);
System.exit(ret);
}
示例11: main
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Configuration conf = HBaseConfiguration.create();
IntegrationTestingUtility.setUseDistributedCluster(conf);
int ret = ToolRunner.run(conf, new IntegrationTestRegionReplicaReplication(), args);
System.exit(ret);
}
示例12: main
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
JobConf conf = new JobConf();
int result = ToolRunner.run(new HSAdmin(conf), args);
System.exit(result);
}
示例13: executeTool
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
private void executeTool(String toolMessage, Tool tool, String[] args, int expectedResult)
throws Exception {
LOG.info("Starting " + toolMessage);
int res = ToolRunner.run(getConf(), tool, new String[] { "--upgrade" });
if (res != expectedResult) {
LOG.error(toolMessage + "returned " + res + ", expected " + expectedResult);
throw new Exception("Unexpected return code from " + toolMessage);
}
LOG.info("Successfully completed " + toolMessage);
}
示例14: main
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
/**
* @param args
*/
public static void main(String[] args) throws Exception {
int res = ToolRunner.run(new TestLoadGenerator(), args);
System.exit(res);
}
示例15: finalizeNamenode
import org.apache.hadoop.util.ToolRunner; //导入方法依赖的package包/类
/**
* Finalize the namenode. Block pools corresponding to the namenode are
* finalized on the datanode.
*/
private void finalizeNamenode(NameNode nn, Configuration conf) throws Exception {
if (nn == null) {
throw new IllegalStateException("Attempting to finalize "
+ "Namenode but it is not running");
}
ToolRunner.run(new DFSAdmin(conf), new String[] {"-finalizeUpgrade"});
}