Package org.apache.whirr.service.Cluster

Examples of org.apache.whirr.service.Cluster.Instance


    Cluster cluster = event.getCluster();

    // TODO: wait for regionservers to come up?

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    LOG.info("Web UI available at http://{}",
      DnsUtil.resolveAddress(masterPublicAddress.getHostAddress()));
    String quorum = ZooKeeperCluster.getHosts(cluster);
    Properties config = createClientSideProperties(masterPublicAddress, quorum);
View Full Code Here


  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    Instance instance = cluster.getInstanceMatching(
      role(HBaseMasterClusterActionHandler.ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      REGIONSERVER_WEB_UI_PORT);
View Full Code Here

    return Sets.newHashSet(Collections2.transform(Sets.newHashSet(nodes),
        new Function<NodeMetadata, Instance>() {
      @Override
      public Instance apply(NodeMetadata node) {
        try {
        return new Instance(node.getCredentials(), roles,
            InetAddress.getByName(Iterables.get(node.getPublicAddresses(), 0)),
            InetAddress.getByName(Iterables.get(node.getPrivateAddresses(), 0)),
            node.getId());
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
View Full Code Here

      public boolean apply(NodeMetadata nodeMetadata) {
        // Check it's the correct cluster
        if (!nodeMetadata.getTag().equals(clusterSpec.getClusterName())) {
          return false;
        }
        Instance instance = nodeIdToInstanceMap.get(nodeMetadata.getId());
        if (instance == null) {
          LOG.debug("No instance for {} found in map", nodeMetadata);
          return false;
        }
        return RolePredicates.onlyRolesIn(roles).apply(instance);
View Full Code Here

import org.junit.Test;

public class CassandraClusterActionHandlerTest {

  private Instance getInstance(String id) throws UnknownHostException {
    return new Instance(new Credentials("", ""), Sets.newHashSet(""),
        InetAddress.getLocalHost(), InetAddress.getLocalHost(), id);
  }
View Full Code Here

        InetAddress.getLocalHost(), InetAddress.getLocalHost(), id);
  }
 
  @Test()
  public void testGetSeeds() throws UnknownHostException {
    Instance one = getInstance("1");
    Instance two = getInstance("2");
   
    Set<Instance> instances = Sets.newLinkedHashSet();
    instances.add(one);
   
    CassandraClusterActionHandler handler = new CassandraClusterActionHandler();
View Full Code Here

    Cluster cluster = event.getCluster();
   
    // TODO: wait for TTs to come up (done in test for the moment)
   
    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress namenodePublicAddress = instance.getPublicAddress();
    InetAddress jobtrackerPublicAddress = namenodePublicAddress;

    LOG.info("Namenode web UI available at http://{}:{}",
      DnsUtil.resolveAddress(namenodePublicAddress.getHostAddress()),
      NAMENODE_WEB_UI_PORT);
View Full Code Here

  protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Authorizing firewall");
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      MASTER_WEB_UI_PORT);
View Full Code Here

    Cluster cluster = event.getCluster();

    // TODO: wait for regionservers to come up?

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    LOG.info("Web UI available at http://{}",
      DnsUtil.resolveAddress(masterPublicAddress.getHostAddress()));
    String quorum = ZooKeeperCluster.getHosts(cluster);
    Properties config = createClientSideProperties(masterPublicAddress, quorum);
View Full Code Here

  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    Instance instance = cluster.getInstanceMatching(
      role(HBaseMasterClusterActionHandler.ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    ComputeServiceContext computeServiceContext =
      ComputeServiceContextBuilder.build(clusterSpec);
    FirewallSettings.authorizeIngress(computeServiceContext, instance, clusterSpec,
      REGIONSERVER_WEB_UI_PORT);
View Full Code Here

TOP

Related Classes of org.apache.whirr.service.Cluster.Instance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.