Search in sources :

Example 1 with ByonClusterAction

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);
}
Also used : ByonClusterAction(org.apache.whirr.actions.ByonClusterAction) ClusterActionHandler(org.apache.whirr.service.ClusterActionHandler) ByonClusterAction(org.apache.whirr.actions.ByonClusterAction)

Example 2 with ByonClusterAction

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;
}
Also used : ByonClusterAction(org.apache.whirr.actions.ByonClusterAction) ClusterActionHandler(org.apache.whirr.service.ClusterActionHandler) ByonClusterAction(org.apache.whirr.actions.ByonClusterAction)

Example 3 with ByonClusterAction

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;
}
Also used : ByonClusterAction(org.apache.whirr.actions.ByonClusterAction) ClusterActionHandler(org.apache.whirr.service.ClusterActionHandler) ByonClusterAction(org.apache.whirr.actions.ByonClusterAction)

Aggregations

ByonClusterAction (org.apache.whirr.actions.ByonClusterAction)3 ClusterActionHandler (org.apache.whirr.service.ClusterActionHandler)3