Package org.apache.whirr.state

Examples of org.apache.whirr.state.ClusterStateStore


    when(controller.getNodes((ClusterSpec) any())).thenReturn(
        (Set) Sets.newLinkedHashSet(Lists.newArrayList(node1, node2)));
    when(controller.getInstances((ClusterSpec)any(), (ClusterStateStore)any()))
        .thenCallRealMethod();

    ClusterStateStore memStore = new MemoryClusterStateStore();
    memStore.save(createTestCluster(
      new String[]{"id1", "id2"}, new String[]{"role1", "role2"}));

    ClusterStateStoreFactory stateStoreFactory = mock(ClusterStateStoreFactory.class);
    when(stateStoreFactory.create((ClusterSpec) any())).thenReturn(memStore);
View Full Code Here


      return -1;
    }
  }

  public int run(InputStream in, PrintStream out, PrintStream err, ClusterSpec clusterSpec) throws Exception {
    ClusterStateStore stateStore = createClusterStateStore(clusterSpec);
    ClusterController controller = createClusterController(clusterSpec.getServiceName());

    for (Cluster.Instance instance : controller.getInstances(clusterSpec, stateStore)) {
      out.println(Joiner.on('\t').useForNull("-").join(
        instance.getId(),
View Full Code Here

TOP

Related Classes of org.apache.whirr.state.ClusterStateStore

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.