当前位置: 首页>>代码示例>>Java>>正文


Java ToolRunner.run方法代码示例

本文整理汇总了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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestRPCCallBenchmark.java

示例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);
}
 
开发者ID:dhruvmalik007,项目名称:Deep_learning_using_Java,代码行数:11,代码来源:Recommendation_program.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:IntegrationTestReplication.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:IntegrationTestAcidGuarantees.java

示例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);
}
 
开发者ID:steveloughran,项目名称:cloudup,代码行数:11,代码来源:S3ADiag.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:IntegrationTestReplication.java

示例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();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:38,代码来源:DfsTask.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:CryptoAdminCmdExecutor.java

示例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]);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:TestDBJob.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:IntegrationTestIngestStripeCompactions.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:IntegrationTestRegionReplicaReplication.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:HSAdmin.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:UpgradeTo96.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestLoadGenerator.java

示例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"});
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:MiniDFSCluster.java


注:本文中的org.apache.hadoop.util.ToolRunner.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。