Picks up the command line parameters and kicks off the optimization tests

@param args
@throws Exception
351053
public static void main(String[] args) throws Exception {
        SyncOptimizeDriver syncOptDriver = new SyncOptimizeDriver(true);
        SyncOptimizeConfig syncOptConfig =
            syncOptDriver.processCommandLineArgs(args);

        System.out.println("### Running Sync Thread Optimizer with configuration: " +
                           syncOptConfig.getPrintableConfig());

        int optimalThreads = syncOptDriver.getOptimalThreads(syncOptConfig);

        System.out.println("### Sync Thread Optimizer complete. Optimal thread " +
                           "count for running the DuraCloud SyncTool on " +
                           "this machine is: " + optimalThreads);
    }
220691
@SuppressWarnings("squid:S1166")
    public static void main(String[] args) throws IOException {
        opts = new Options();

        // Parse the cmdline arguments
        CmdLineParser cli = new CmdLineParser(opts);
        try {
            cli.getProperties().withUsageWidth(80);
            cli.parseArgument(args);
        } catch (@SuppressWarnings("unused") CmdLineException ex) {
            cli.printUsage(System.err);
            System.exit(1);
        }

        Runtime runtime = Runtime.getRuntime();
        int mb = 1024 * 1024;
        out(1, "Total Memory: %d%n", runtime.totalMemory() / mb);
        out(1, "Max Memory: %d%n", runtime.maxMemory() / mb);

        Parameters ps = opts.parameters();

        Iterator<LabelledInstance> ite = opts.instances().iterator();
        while (ite.hasNext()) {
            LabelledInstance i = ite.next();
            solve(i, ps);
        }
    }
1293717
public static void main(String... args) throws Exception {
    ClientConfiguration.Builder configBuilder = ClientConfiguration.newBuilder(
        ADDRESS, TARGET_QPS, CLIENT_PAYLOAD, SERVER_PAYLOAD, TLS,
        TESTCA, TRANSPORT, DURATION, SAVE_HISTOGRAM, FLOW_CONTROL_WINDOW);
    ClientConfiguration config;
    try {
      config = configBuilder.build(args);
    } catch (Exception e) {
      System.out.println(e.getMessage());
      configBuilder.printUsage();
      return;
    }
    OpenLoopClient client = new OpenLoopClient(config);
    client.run();
  }
131921
public static void main(final String... args) throws Exception {
        try (ConfigurableApplicationContext context = SpringApplication.run(Application.class, args)) {
            log.info("Arguments: {}", Arrays.asList(args));

            try {
                context.getBean(Application.class).run(context);
            } catch (Exception e) {
                log.error("Exception in command execution", e);
            }
        }
    }
537632
public static void main(String[] args) throws Exception {
    CommandLineParser parser = new DefaultParser();
    Options slaManagerCliOptions = constructCliOptions();

    // parse the help options first.
    Options helpOptions = constructHelpOptions();
    CommandLine cmd = parser.parse(helpOptions, args, true);
    if (cmd.hasOption("h")) {
      usage(slaManagerCliOptions);
      return;
    }

    try {
      cmd = parser.parse(slaManagerCliOptions, args);
    } catch (ParseException e) {
      usage(slaManagerCliOptions);
      throw new RuntimeException("Error parsing command line options: ", e);
    }

    DownloaderMode mode = DownloaderMode.cluster;
    if (cmd.hasOption(CliArgs.MODE.text)) {
      mode = DownloaderMode.valueOf(cmd.getOptionValue(CliArgs.MODE.text, null));
    }

    Config config;
    switch (mode) {
      case cluster:
        config = Config.toClusterMode(Config.newBuilder()
            .putAll(ConfigLoader.loadClusterConfig())
            .build());
        break;

      case local:
        if (!cmd.hasOption(CliArgs.HERON_HOME.text) || !cmd.hasOption(CliArgs.CONFIG_PATH.text)) {
          throw new IllegalArgumentException("Missing heron_home or config_path argument");
        }
        String heronHome = cmd.getOptionValue(CliArgs.HERON_HOME.text, null);
        String configPath = cmd.getOptionValue(CliArgs.CONFIG_PATH.text, null);
        config = Config.toLocalMode(Config.newBuilder()
            .putAll(ConfigLoader.loadConfig(heronHome, configPath, null, null))
            .build());
        break;

      default:
        throw new IllegalArgumentException(
            "Invalid mode: " + cmd.getOptionValue(CliArgs.MODE.text));
    }

    String uri = cmd.getOptionValue(CliArgs.TOPOLOGY_PACKAGE_URI.text, null);
    String destination = cmd.getOptionValue(CliArgs.EXTRACT_DESTINATION.text, null);
    // make it compatible with old param format
    if (uri == null && destination == null) {
      String[] leftOverArgs = cmd.getArgs();
      if (leftOverArgs.length != 2) {
        System.err.println("Usage: downloader <topology-package-uri> <extract-destination>");
        return;
      }
      uri = leftOverArgs[0];
      destination = leftOverArgs[1];
    }

    final URI topologyLocation = new URI(uri);
    final Path topologyDestination = Paths.get(destination);

    final File file = topologyDestination.toFile();
    if (!file.exists()) {
      file.mkdirs();
    }

    Class clazz = Registry.UriToClass(config, topologyLocation);
    final Downloader downloader = Registry.getDownloader(clazz, topologyLocation);
    downloader.download(topologyLocation, topologyDestination);
  }
92048
public static void main(String[] args) {

		ListRepo listRepo = new ListRepo();
		try {
			listRepo.run(args);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
542138
public static void main(final String[] args) throws Exception {
        final AclTool tool = new AclTool(new DefaultCLIToolLogger());
        tool.setShouldExit(true);
        int exitCode = 1; //pessimistic initial value

        try {
            tool.run(args);
            exitCode = 0;
        } catch (OptionsPrompt e) {
            exitCode = 2;
            tool.error(e.getMessage());
            tool.error(e.getPrompt());
            if (tool.argVerbose) {
                e.printStackTrace();
            }
        } catch (CLIToolOptionsException e) {
            exitCode = 2;
            tool.error(e.getMessage());
            if (tool.argVerbose) {
                e.printStackTrace();
            }
        } catch (Throwable e) {
            if (e.getMessage() == null || tool.argVerbose) {
                e.printStackTrace();
            }
            tool.error("Error: " + e.getMessage());
        }
        tool.exit(exitCode);
    }
372883
public static void main(String[] args) throws Exception {
    // Begin constructing a pipeline configured by commandline flags.
    Options options = PipelineOptionsFactory.fromArgs(args).withValidation().as(Options.class);
    Pipeline pipeline = Pipeline.create(options);

    // Read events from a text file and parse them.
    pipeline
        .apply(TextIO.read().from(options.getInput()))
        .apply("ParseGameEvent", ParDo.of(new ParseEventFn()))
        // Extract and sum username/score pairs from the event data.
        .apply("ExtractUserScore", new ExtractAndSumScore("user"))
        .apply(
            "WriteUserScoreSums", new WriteToText<>(options.getOutput(), configureOutput(), false));

    // Run the batch pipeline.
    pipeline.run().waitUntilFinish();
  }
493826
public static void main(final String[] args) {
    LOG.log(Level.INFO, "Entering Launch at :::" + new Date());
    try {
      if (args == null || args.length == 0) {
        throw new IllegalArgumentException("No arguments provided, at least a clrFolder should be supplied.");
      }
      final File dotNetFolder = new File(args[0]).getAbsoluteFile();
      final String[] removedArgs = Arrays.copyOfRange(args, 1, args.length);

      final Configuration config = getClientConfiguration(removedArgs);
      final Injector commandLineInjector = Tang.Factory.getTang().newInjector(parseCommandLine(removedArgs));
      final int waitTime = commandLineInjector.getNamedInstance(WaitTimeForDriver.class);
      final int driverMemory = commandLineInjector.getNamedInstance(DriverMemoryInMb.class);
      final boolean isLocal = commandLineInjector.getNamedInstance(Local.class);
      final String driverIdentifier = commandLineInjector.getNamedInstance(DriverIdentifier.class);
      final String jobSubmissionDirectory = commandLineInjector.getNamedInstance(DriverJobSubmissionDirectory.class);
      final boolean submit = commandLineInjector.getNamedInstance(Submit.class);
      final Injector injector = Tang.Factory.getTang().newInjector(config);
      final JobClient client = injector.getInstance(JobClient.class);
      client.setDriverInfo(driverIdentifier, driverMemory, jobSubmissionDirectory);

      if (submit) {
        client.submit(dotNetFolder, true, isLocal, null);
        client.waitForCompletion(waitTime);
      } else {
        client.submit(dotNetFolder, false, isLocal, config);
        client.waitForCompletion(0);
      }


      LOG.info("Done!");
    } catch (final BindException | InjectionException | IOException ex) {
      LOG.log(Level.SEVERE, "Job configuration error", ex);
    }
  }
9497
public static void main(String... args) throws Exception {
        Options options = createOptions();

        try {
            Parser parser = new PosixParser();
            CommandLine cmd = parser.parse(options, args);

            if (cmd.hasOption("version")) {
                System.out.println("Version: " + Launcher.class.getPackage().getImplementationVersion());
            }

            String scriptPathEntries = cmd.getOptionValue("scriptpath", "src/test/scripts");
            String[] scriptPathEntryArray = scriptPathEntries.split(";");
            List<URL> scriptUrls = new ArrayList<>();

            for (String scriptPathEntry : scriptPathEntryArray) {
                File scriptEntryFilePath = new File(scriptPathEntry);
                scriptUrls.add(scriptEntryFilePath.toURI().toURL());
            }

            String controlURI = cmd.getOptionValue("control");
            if (controlURI == null) {
                controlURI = "tcp://localhost:11642";
            }

            boolean verbose = cmd.hasOption("verbose");

            URLClassLoader scriptLoader = new URLClassLoader(scriptUrls.toArray(new URL[0]));
            RobotServer server = new RobotServer(URI.create(controlURI), verbose, scriptLoader);
            server.start();
            server.join();
        } catch (ParseException ex) {
            HelpFormatter helpFormatter = new HelpFormatter();
            helpFormatter.printHelp(Launcher.class.getSimpleName(), options, true);
        }

    }
1197445
public static void main(String[] args) throws Exception {
    // Parse the command line arguments.
    final List<String> unknown = new ArrayList<>();
    final Namespace namespace = parseArgs(args, unknown);
    final Namespace extraArgs = parseUnknown(unknown);
    extraArgs.getAttrs().forEach((key, value) -> System.setProperty(key, value.toString()));

    final Logger logger = createLogger(namespace);

    final Atomix atomix = buildAtomix(namespace);
    atomix.start().join();
    logger.info("Atomix listening at {}", atomix.getMembershipService().getLocalMember().address());

    final ManagedRestService rest = buildRestService(atomix, namespace);
    rest.start().join();
    logger.warn("The Atomix HTTP API is BETA and is intended for development and debugging purposes only!");
    logger.info("HTTP server listening at {}", rest.address());

    synchronized (Atomix.class) {
      while (atomix.isRunning()) {
        Atomix.class.wait();
      }
    }
  }
1182273
protected void launch(String[] args) throws Exception {
		JarFile.registerUrlProtocolHandler();
		ClassLoader classLoader = createClassLoader(getClassPathArchives());
		launch(args, getMainClass(), classLoader);
	}
722494
public static void main(String[] args) throws Exception {
        setCustomErrStream();

        CommandLine cmdLine = null;
        try {
            cmdLine = new CommandLine(args != null ? Arrays.copyOf(args, args.length) : null);

        } catch (final Exception e) {
        	// Cant use the CommandLine help here as the 
        	// i18n messages wont have been loaded
            System.out.println("Failed due to invalid parameters: " + Arrays.toString(args));
            System.out.println(e.getMessage());
            System.out.println("Use '-h' for more details.");
            System.exit(1);
        }

        ZapBootstrap bootstrap = createZapBootstrap(cmdLine);
        try {
            int rc = bootstrap.start();
            if (rc != 0) {
                System.exit(rc);
            }

        } catch (final Exception e) {
            logger.fatal(e.getMessage(), e);
            System.exit(1);
        }

    }
769905
public static void main(String[] args) throws Exception {
        if (args.length < 1 || args.length > 2) {
            throw new IOException("One or two arguments expected.");
        }
        ServerConfiguration config =
                new ServerConfigurationParser(new FileInputStream(new File(args[0])))
                        .parse();
        if (args.length == 2) {
            Properties props = new Properties();
            props.load(new FileInputStream(new File(args[1])));
            config.applyProperties(props);
        }
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        config.serialize(out);
        String content = new String(out.toByteArray(), "UTF-8");
        System.out.println(content);
    }
902909
public static void mainInternal(String[] args) throws Exception {

        Options options = new Options();
        CmdLineParser parser = new CmdLineParser(options);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            helpScreen(parser);
            return;
        }

        try {
            List<String> configs = new ArrayList<>();
            if (options.configs != null) {
                configs.addAll(Arrays.asList(options.configs.split(",")));
            }
            ConfigSupport.applyConfigChange(ConfigSupport.getJBossHome(), configs, options.enable);
        } catch (ConfigException ex) {
            ConfigLogger.error(ex);
            throw ex;
        } catch (Throwable th) {
            ConfigLogger.error(th);
            throw th;
        }
    }
316853
public static void main(String... args) {
        CommandLineRunner runner = new CommandLineRunner();

        try {
            runner.run(args);
        } catch (Exception t) {
            System.err.println(t.getMessage());
            System.err.println("Try '--help' for more information.");

            t.printStackTrace(System.err);

            System.exit(1);
        }

        System.exit(0);
    }
1303033
public static void main(String[] args) throws Exception {
		
		if(!parseParameters(args)) {
			return;
		}
		
		// set up execution environment
		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
		
		// get input data
		DataSet<Tuple1<Long>> pagesInput = getPagesDataSet(env);
		DataSet<Tuple2<Long, Long>> linksInput = getLinksDataSet(env);
		
		// assign initial rank to pages
		DataSet<Tuple2<Long, Double>> pagesWithRanks = pagesInput.
				map(new RankAssigner((1.0d / numPages)));
		
		// build adjecency list from link input
		DataSet<Tuple2<Long, Long[]>> adjacencyListInput = 
				linksInput.groupBy(0).reduceGroup(new BuildOutgoingEdgeList());
		
		// set iterative data set
		IterativeDataSet<Tuple2<Long, Double>> iteration = pagesWithRanks.iterate(maxIterations);
		
		DataSet<Tuple2<Long, Double>> newRanks = iteration
				// join pages with outgoing edges and distribute rank
				.join(adjacencyListInput).where(0).equalTo(0).flatMap(new JoinVertexWithEdgesMatch())
				// collect and sum ranks
				.groupBy(0).aggregate(SUM, 1)
				// apply dampening factor
				.map(new Dampener(DAMPENING_FACTOR, numPages));
		
		DataSet<Tuple2<Long, Double>> finalPageRanks = iteration.closeWith(
				newRanks, 
				newRanks.join(iteration).where(0).equalTo(0)
				// termination condition
				.filter(new EpsilonFilter()));

		// emit result
		if(fileOutput) {
			finalPageRanks.writeAsCsv(outputPath, "\n", " ");
		} else {
			finalPageRanks.print();
		}

		// execute program
		env.execute("Basic Page Rank Example");
		
	}