Search in sources :

Example 1 with GobblinTaskRunner

use of org.apache.gobblin.cluster.GobblinTaskRunner in project incubator-gobblin by apache.

the class GobblinAWSTaskRunner method main.

public static void main(String[] args) throws Exception {
    final Options options = buildOptions();
    try {
        final CommandLine cmd = new DefaultParser().parse(options, args);
        if (!cmd.hasOption(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME) || !cmd.hasOption(GobblinClusterConfigurationKeys.HELIX_INSTANCE_NAME_OPTION_NAME) || !cmd.hasOption(GobblinAWSConfigurationKeys.APP_WORK_DIR)) {
            printUsage(options);
            System.exit(1);
        }
        if (System.getProperty("log4j.configuration") == null) {
            Log4jConfigHelper.updateLog4jConfiguration(GobblinTaskRunner.class, GobblinAWSConfigurationKeys.GOBBLIN_AWS_LOG4J_CONFIGURATION_FILE);
        }
        LOGGER.info(JvmUtils.getJvmInputArguments());
        final String applicationName = cmd.getOptionValue(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME);
        final String helixInstanceName = cmd.getOptionValue(GobblinClusterConfigurationKeys.HELIX_INSTANCE_NAME_OPTION_NAME);
        final String appWorkDir = cmd.getOptionValue(GobblinAWSConfigurationKeys.APP_WORK_DIR);
        final GobblinTaskRunner gobblinTaskRunner = new GobblinAWSTaskRunner(applicationName, helixInstanceName, ConfigFactory.load(), Optional.of(new Path(appWorkDir)));
        gobblinTaskRunner.start();
    } catch (ParseException pe) {
        printUsage(options);
        System.exit(1);
    }
}
Also used : Path(org.apache.hadoop.fs.Path) Options(org.apache.commons.cli.Options) CommandLine(org.apache.commons.cli.CommandLine) GobblinTaskRunner(org.apache.gobblin.cluster.GobblinTaskRunner) ParseException(org.apache.commons.cli.ParseException) DefaultParser(org.apache.commons.cli.DefaultParser)

Example 2 with GobblinTaskRunner

use of org.apache.gobblin.cluster.GobblinTaskRunner in project incubator-gobblin by apache.

the class GobblinYarnTaskRunner method main.

public static void main(String[] args) throws Exception {
    Options options = buildOptions();
    try {
        CommandLine cmd = new DefaultParser().parse(options, args);
        if (!cmd.hasOption(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME) || !cmd.hasOption(GobblinClusterConfigurationKeys.HELIX_INSTANCE_NAME_OPTION_NAME)) {
            printUsage(options);
            System.exit(1);
        }
        Log4jConfigurationHelper.updateLog4jConfiguration(GobblinTaskRunner.class, GobblinYarnConfigurationKeys.GOBBLIN_YARN_LOG4J_CONFIGURATION_FILE, GobblinYarnConfigurationKeys.GOBBLIN_YARN_LOG4J_CONFIGURATION_FILE);
        LOGGER.info(JvmUtils.getJvmInputArguments());
        ContainerId containerId = ConverterUtils.toContainerId(System.getenv().get(ApplicationConstants.Environment.CONTAINER_ID.key()));
        String applicationName = cmd.getOptionValue(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME);
        String helixInstanceName = cmd.getOptionValue(GobblinClusterConfigurationKeys.HELIX_INSTANCE_NAME_OPTION_NAME);
        GobblinTaskRunner gobblinTaskRunner = new GobblinYarnTaskRunner(applicationName, helixInstanceName, containerId, ConfigFactory.load(), Optional.<Path>absent());
        gobblinTaskRunner.start();
    } catch (ParseException pe) {
        printUsage(options);
        System.exit(1);
    }
}
Also used : Options(org.apache.commons.cli.Options) CommandLine(org.apache.commons.cli.CommandLine) ContainerId(org.apache.hadoop.yarn.api.records.ContainerId) GobblinTaskRunner(org.apache.gobblin.cluster.GobblinTaskRunner) ParseException(org.apache.commons.cli.ParseException) DefaultParser(org.apache.commons.cli.DefaultParser)

Aggregations

CommandLine (org.apache.commons.cli.CommandLine)2 DefaultParser (org.apache.commons.cli.DefaultParser)2 Options (org.apache.commons.cli.Options)2 ParseException (org.apache.commons.cli.ParseException)2 GobblinTaskRunner (org.apache.gobblin.cluster.GobblinTaskRunner)2 Path (org.apache.hadoop.fs.Path)1 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)1