use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.
the class ListClusters method main.
public static void main(String[] args) {
Region region = Region.US_WEST_2;
EmrClient emrClient = EmrClient.builder().region(region).build();
listAllClusters(emrClient);
emrClient.close();
}
use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.
the class CreateCluster 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 = createAppCluster(emrClient, jar, myClass, keys, logUri, name);
System.out.println("The job flow id is " + jobFlowId);
emrClient.close();
}
use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.
the class AddSteps method main.
public static void main(String[] args) {
final String usage = "\n" + "Usage: " + " <jar> <myClass> <jobFlowId> \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" + " jobFlowId - The id of the job flow. \n\n";
if (args.length != 3) {
System.out.println(usage);
System.exit(1);
}
String jar = args[0];
String myClass = args[1];
String jobFlowId = args[2];
Region region = Region.US_WEST_2;
EmrClient emrClient = EmrClient.builder().region(region).build();
addNewStep(emrClient, jobFlowId, jar, myClass);
emrClient.close();
}
use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.
the class CreateEmrFleet method main.
public static void main(String[] args) throws Exception {
Region region = Region.US_EAST_1;
EmrClient emr = EmrClient.builder().region(region).build();
createFleet(emr);
}
use of software.amazon.awssdk.services.emr.EmrClient in project aws-doc-sdk-examples by awsdocs.
the class DescribeCluster method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <clusterId> \n\n" + "Where:\n" + " clusterId - The identifier of the cluster to describe. \n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String clusterId = args[0];
Region region = Region.US_WEST_2;
EmrClient emrClient = EmrClient.builder().region(region).build();
describeMyCluster(emrClient, clusterId);
emrClient.close();
}