/** * 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)); }
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options); if (options.has(newPathArgu)) { newPath = options.valueOf(newPathArgu); log.info("new state storage is " + newPath); } return config; }
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options); if (options.has(newPathArgu)) { newPath = options.valueOf(newPathArgu); log.info("new state storage is " + newPath); } return config; }
/** * 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(); }
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options); if (options.has(newPathArgu)) { newPath = options.valueOf(newPathArgu); log.info("new state storage is " + newPath); } return config; }
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(); } }
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options); if (options.has(newPathArgu)) { newPath = options.valueOf(newPathArgu); log.info("new state storage is " + newPath); } return config; }
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(); } }
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options); if (options.has(newPathArgu)) { newPath = options.valueOf(newPathArgu); log.info("new state storage is " + newPath); } return config; }
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options);
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options);
@Override public MapConfig loadConfig(OptionSet options) { MapConfig config = super.loadConfig(options);