}
@Override
protected void beforeConfigure(ClusterActionEvent event)
throws IOException, InterruptedException {
ClusterSpec clusterSpec = event.getClusterSpec();
Cluster cluster = event.getCluster();
int port = defaultPort;
if (configKeyPort != null) {
port = clusterSpec.getConfiguration().getInt(configKeyPort, defaultPort);
}
Cluster.Instance instance = cluster.getInstanceMatching(
role(HBaseMasterClusterActionHandler.ROLE));
InetAddress masterPublicAddress = instance.getPublicAddress();
ComputeServiceContext computeServiceContext =
ComputeServiceContextBuilder.build(clusterSpec);
FirewallSettings.authorizeIngress(computeServiceContext, instance,
clusterSpec, port);
String hbaseConfigureRunUrl = clusterSpec.getConfiguration().getString(
HBaseConstants.KEY_CONFIGURE_RUNURL,
HBaseConstants.SCRIPT_POST_CONFIGURE);
String master = DnsUtil.resolveAddress(masterPublicAddress.getHostAddress());
String quorum = ZooKeeperCluster.getHosts(cluster);
addRunUrl(event, hbaseConfigureRunUrl, role,
HBaseConstants.PARAM_MASTER, master,
HBaseConstants.PARAM_QUORUM, quorum,
HBaseConstants.PARAM_PORT, Integer.toString(port),
HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider());
}