Configure the tAmazonEMRListInstances component and the tJava component to retrieve and display the ID and name information of all
instance groups in a running cluster.
Procedure
-
Double-click the tAmazonEMRListInstances component to open its Basic settings view.
- In the Access Key and Secret Key fields, enter the authentication credentials required to access Amazon S3.
- Select the AWS region from the Region drop-down list. In this example, it is Asia Pacific (Tokyo).
- Clear the Filter master and core instances check box to list all instance groups, including the Master, Core, and Task type instance groups.
- In the Cluster id field, enter the ID of the cluster for which to list the instance groups. In this example, the returned value of the global variable CLUSTER_FINAL_ID of the previous tAmazonEMRManage component is used.
-
Double-click the tJava component to
open its Basic settings view.
-
In the Code field, enter the following
code to print the ID and Name information of each instance group in the
cluster.
System.out.println("\r\n===== Instance Group ====="); System.out.println("Instance Group ID: " + (String)globalMap.get("tAmazonEMRListInstances_1_CURRENT_GROUP_ID")); System.out.println("Instance Group Name: " + (String)globalMap.get("tAmazonEMRListInstances_1_CURRENT_GROUP_NAME"));