use of org.apache.whirr.actions.ByonClusterAction in project whirr by apache.
the class ByonClusterController method destroyCluster.
/**
* Destroys a whirr BYON cluster.
* Because this is a BYON cluster it also stops the services.
*/
@Override
public void destroyCluster(ClusterSpec clusterSpec) throws IOException, InterruptedException {
// for BYON only
stopServices(clusterSpec);
LoadingCache<String, ClusterActionHandler> handlerMap = handlerMapFactory.create();
ClusterAction destroyer = new ByonClusterAction(DESTROY_ACTION, getCompute(), handlerMap);
destroyer.execute(clusterSpec, null);
}
use of org.apache.whirr.actions.ByonClusterAction in project whirr by apache.
the class ByonClusterController method bootstrapCluster.
/**
* Provisions the hardware for a BYON cluster.
*/
@Override
public Cluster bootstrapCluster(ClusterSpec clusterSpec) throws IOException, InterruptedException {
LoadingCache<String, ClusterActionHandler> handlerMap = handlerMapFactory.create();
ClusterAction bootstrapper = new ByonClusterAction(BOOTSTRAP_ACTION, getCompute(), handlerMap);
Cluster cluster = bootstrapper.execute(clusterSpec, null);
getClusterStateStore(clusterSpec).save(cluster);
return cluster;
}
use of org.apache.whirr.actions.ByonClusterAction in project whirr by apache.
the class ByonClusterController method configureServices.
/**
* Configures cluster services for a BYON cluster.
*/
@Override
public Cluster configureServices(ClusterSpec clusterSpec, Cluster cluster, Set<String> targetRoles, Set<String> targetInstanceIds) throws IOException, InterruptedException {
LoadingCache<String, ClusterActionHandler> handlerMap = handlerMapFactory.create();
ClusterAction configurer = new ByonClusterAction(CONFIGURE_ACTION, getCompute(), handlerMap);
cluster = configurer.execute(clusterSpec, cluster);
getClusterStateStore(clusterSpec).save(cluster);
return cluster;
}
Aggregations