本文整理汇总了Java中org.apache.samza.util.CommandLine.loadConfig方法的典型用法代码示例。如果您正苦于以下问题:Java CommandLine.loadConfig方法的具体用法?Java CommandLine.loadConfig怎么用?Java CommandLine.loadConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.samza.util.CommandLine
的用法示例。
在下文中一共展示了CommandLine.loadConfig方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
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 = ClassLoaderHelper.<MetricsValidator>fromClassName(validatorClass);
}
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();
}
示例2: parseConfig
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
/**
* Reads a {@link org.apache.samza.config.Config} from command line parameters.
* @param args the command line parameters supported by {@link org.apache.samza.util.CommandLine}.
* @return the parsed {@link org.apache.samza.config.Config}.
*/
private static SamzaRestConfig parseConfig(String[] args) {
CommandLine cmd = new CommandLine();
OptionSet options = cmd.parser().parse(args);
MapConfig cfg = cmd.loadConfig(options);
return new SamzaRestConfig(new MapConfig(cfg));
}
示例3: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
/**
* Executes the application using the local application runner.
* It takes two required command line arguments
* config-factory: a fully {@link org.apache.samza.config.factories.PropertiesConfigFactory} class name
* config-path: path to application properties
*
* @param args command line arguments
*/
public static void main(String[] args) {
CommandLine cmdLine = new CommandLine();
OptionSet options = cmdLine.parser().parse(args);
Config config = cmdLine.loadConfig(options);
LocalApplicationRunner runner = new LocalApplicationRunner(config);
WikipediaApplication app = new WikipediaApplication();
runner.run(app);
runner.waitForFinish();
}
示例4: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) {
CommandLine cmdLine = new CommandLine();
OptionSet options = cmdLine.parser().parse(args);
Config config = cmdLine.loadConfig(options);
LocalApplicationRunner runner = new LocalApplicationRunner(config);
AzureApplication app = new AzureApplication();
runner.run(app);
runner.waitForFinish();
}
示例5: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
CommandLine cmdLine = new CommandLine();
Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
localRunner.run(new OrderShipmentJoinExample());
}
示例6: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
CommandLine cmdLine = new CommandLine();
Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
localRunner.run(new RepartitionExample());
}
示例7: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
CommandLine cmdLine = new CommandLine();
Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
localRunner.run(new KeyValueStoreExample());
}
示例8: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) {
CommandLine cmdLine = new CommandLine();
Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
localRunner.run(new PageViewCounterExample());
}
示例9: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
CommandLine cmdLine = new CommandLine();
Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
localRunner.run(new MergeExample());
}
示例10: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
CommandLine cmdLine = new CommandLine();
Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
localRunner.run(new WindowExample());
}
示例11: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
CommandLine cmdLine = new CommandLine();
Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
localRunner.run(new BroadcastExample());
}
示例12: main
import org.apache.samza.util.CommandLine; //导入方法依赖的package包/类
/**
* Main function for using the Config Manager. The main function starts a Config Manager, and reacts to all messages thereafter
* In order for this module to run, you have to add the following configurations to the config file:
* yarn.rm.address=localhost //the ip of the resource manager in yarn
* yarn.rm.port=8088 //the port of the resource manager http server
* Additionally, the config manger will periodically poll the coordinator stream to see if there are any new messages.
* This period is set to 100 ms by default. However, it can be configured by adding the following property to the input config file.
* configManager.polling.interval= < polling interval >
* To run the code use the following command:
* {path to samza deployment}/samza/bin/run-config-manager.sh --config-factory={config-factory} --config-path={path to config file of a job}
*
* @param args input arguments for running ConfigManager.
*/
public static void main(String[] args) {
CommandLine cmdline = new CommandLine();
OptionSet options = cmdline.parser().parse(args);
Config config = cmdline.loadConfig(options);
ConfigManager configManager = new ConfigManager(config);
configManager.run();
}