Search in sources :

Example 6 with EmrClient

use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.

the class TerminateJobFlow method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "   <id>\n\n" + "Where:\n" + "   id - an id of a job flow to shut down.\n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String id = args[0];
    Region region = Region.US_WEST_2;
    EmrClient emrClient = EmrClient.builder().region(region).build();
    terminateFlow(emrClient, id);
    emrClient.close();
}
Also used : EmrClient(software.amazon.awssdk.services.emr.EmrClient) Region(software.amazon.awssdk.regions.Region)

Example 7 with EmrClient

use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.

the class CreateHiveCluster method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "   <jar> <myClass> <keys> <logUri> <name>\n\n" + "Where:\n" + "   jar - a path to a JAR file run during the step. \n\n" + "   myClass - the name of the main class in the specified Java file. \n\n" + "   keys - The name of the Amazon EC2 key pair. \n\n" + "   logUri - The Amazon S3 bucket where the logs are located (for example,  s3://<BucketName>/logs/). \n\n" + "   name - The name of the job flow. \n\n";
    if (args.length != 5) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String jar = args[0];
    String myClass = args[1];
    String keys = args[2];
    String logUri = args[3];
    String name = args[4];
    Region region = Region.US_WEST_2;
    EmrClient emrClient = EmrClient.builder().region(region).build();
    String jobFlowId = createCluster(emrClient, jar, myClass, keys, logUri, name);
    System.out.println("The job flow id is " + jobFlowId);
    emrClient.close();
}
Also used : EmrClient(software.amazon.awssdk.services.emr.EmrClient) Region(software.amazon.awssdk.regions.Region)

Example 8 with EmrClient

use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.

the class CustomEmrfsMaterials method main.

public static void main(String[] args) {
    final String usage = "\n" + "Usage: " + "   <jar> <myClass> <keys> <logUri> <name>\n\n" + "Where:\n" + "   jar - a path to a JAR file run during the step. \n\n" + "   myClass - the name of the main class in the specified Java file. \n\n" + "   keys - The name of the Amazon EC2 key pair. \n\n" + "   logUri - The Amazon S3 bucket where the logs are located (for example,  s3://<BucketName>/logs/). \n\n" + "   name - The name of the job flow. \n\n";
    if (args.length != 5) {
        System.out.println(usage);
        System.exit(1);
    }
    String jar = args[0];
    String myClass = args[1];
    String keys = args[2];
    String logUri = args[3];
    String name = args[4];
    Region region = Region.US_WEST_2;
    EmrClient emrClient = EmrClient.builder().region(region).build();
    String jobFlowId = createEmrfsCluster(emrClient, jar, myClass, keys, logUri, name);
    System.out.println("The job flow id is " + jobFlowId);
}
Also used : EmrClient(software.amazon.awssdk.services.emr.EmrClient) Region(software.amazon.awssdk.regions.Region)

Example 9 with EmrClient

use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.

the class CreateSparkCluster method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "   <jar> <myClass> <keys> <logUri> <name>\n\n" + "Where:\n" + "   jar - a path to a JAR file run during the step. \n\n" + "   myClass - the name of the main class in the specified Java file. \n\n" + "   keys - The name of the Amazon EC2 key pair. \n\n" + "   logUri - The Amazon S3 bucket where the logs are located (for example,  s3://<BucketName>/logs/). \n\n" + "   name - The name of the job flow. \n\n";
    if (args.length != 5) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String jar = args[0];
    String myClass = args[1];
    String keys = args[2];
    String logUri = args[3];
    String name = args[4];
    Region region = Region.US_WEST_2;
    EmrClient emrClient = EmrClient.builder().region(region).build();
    String jobFlowId = createCluster(emrClient, jar, myClass, keys, logUri, name);
    System.out.println("The job flow id is " + jobFlowId);
    emrClient.close();
}
Also used : EmrClient(software.amazon.awssdk.services.emr.EmrClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

Region (software.amazon.awssdk.regions.Region)9 EmrClient (software.amazon.awssdk.services.emr.EmrClient)9