gpt4 book ai didi

org.apache.samza.validation.YarnJobValidationTool.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 01:51:31 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.samza.validation.YarnJobValidationTool.<init>()方法的一些代码示例,展示了YarnJobValidationTool.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnJobValidationTool.<init>()方法的具体详情如下:
包路径:org.apache.samza.validation.YarnJobValidationTool
类名称:YarnJobValidationTool
方法名:<init>

YarnJobValidationTool.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apache.samza/samza-yarn

public static void main(String [] args) throws Exception {
  CommandLine cmdline = new CommandLine();
  OptionParser parser = cmdline.parser();
  OptionSpec<String> validatorOpt = parser.accepts("metrics-validator", "The metrics validator class.")
                      .withOptionalArg()
                      .ofType(String.class).describedAs("com.foo.bar.ClassName");
  OptionSet options = cmdline.parser().parse(args);
  Config config = cmdline.loadConfig(options);
  MetricsValidator validator = null;
  if (options.has(validatorOpt)) {
   String validatorClass = options.valueOf(validatorOpt);
   validator = Util.getObj(validatorClass, MetricsValidator.class);
  }

  YarnConfiguration hadoopConfig = new YarnConfiguration();
  hadoopConfig.set("fs.http.impl", HttpFileSystem.class.getName());
  hadoopConfig.set("fs.https.impl", HttpFileSystem.class.getName());
  ClientHelper clientHelper = new ClientHelper(hadoopConfig);

  new YarnJobValidationTool(new JobConfig(config), clientHelper.yarnClient(), validator).run();
 }
}

代码示例来源:origin: org.apache.samza/samza-yarn_2.11

public static void main(String [] args) throws Exception {
  CommandLine cmdline = new CommandLine();
  OptionParser parser = cmdline.parser();
  OptionSpec<String> validatorOpt = parser.accepts("metrics-validator", "The metrics validator class.")
                      .withOptionalArg()
                      .ofType(String.class).describedAs("com.foo.bar.ClassName");
  OptionSet options = cmdline.parser().parse(args);
  Config config = cmdline.loadConfig(options);
  MetricsValidator validator = null;
  if (options.has(validatorOpt)) {
   String validatorClass = options.valueOf(validatorOpt);
   validator = Util.getObj(validatorClass, MetricsValidator.class);
  }

  YarnConfiguration hadoopConfig = new YarnConfiguration();
  hadoopConfig.set("fs.http.impl", HttpFileSystem.class.getName());
  hadoopConfig.set("fs.https.impl", HttpFileSystem.class.getName());
  ClientHelper clientHelper = new ClientHelper(hadoopConfig);

  new YarnJobValidationTool(new JobConfig(config), clientHelper.yarnClient(), validator).run();
 }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com