}
@Override
protected void beforeConfigure(ClusterActionEvent event)
throws IOException, InterruptedException {
ClusterSpec clusterSpec = event.getClusterSpec();
Cluster cluster = event.getCluster();
int port = defaultPort;
if (configKeyPort != null) {
port = getConfiguration(clusterSpec).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 hbaseConfigureFunction = getConfiguration(clusterSpec).getString(
HBaseConstants.KEY_CONFIGURE_FUNCTION,
HBaseConstants.FUNCTION_POST_CONFIGURE);
String master = DnsUtil.resolveAddress(masterPublicAddress.getHostAddress());
String quorum = ZooKeeperCluster.getHosts(cluster);
String tarurl = getConfiguration(clusterSpec).getString(
HBaseConstants.KEY_TARBALL_URL);
addStatement(event, call(hbaseConfigureFunction, role,
HBaseConstants.PARAM_MASTER, master,
HBaseConstants.PARAM_QUORUM, quorum,
HBaseConstants.PARAM_PORT, Integer.toString(port),
HBaseConstants.PARAM_PROVIDER, clusterSpec.getProvider(),
HBaseConstants.PARAM_TARBALL_URL, tarurl));
}