public static Command create()

in src/main/java/com/google/cloud/dfmetrics/commands/CommandFactory.java [37:52]


  public static Command create(CommandLineArgs args) throws IOException, IllegalAccessException {
    IOutputStore outputStore = OutputStoreFactory.create(args.outputType, args.outputLocation);
    Dataflow dataflowClient = DataflowClient.builder().build();

    switch (args.command.toUpperCase()) {
      case COLLECT_METRICS:
        LOG.info("Executing Metrics Fetcher command");
        return new MetricsFetcherCommand(args, dataflowClient, outputStore);
      case LAUNCH_AND_COLLECT:
        LOG.info("Executing Template launcher command");
        return new TemplateLauncherCommand(args, dataflowClient, outputStore);
      default:
        throw new IllegalArgumentException(
            "Invalid output type. Supported commands are: LAUNCHTEMPLATE, COLLECTMETRICS");
    }
  }