Package org.apache.whirr

Examples of org.apache.whirr.ClusterController.runScriptOnNodesMatching()


    ClusterController controller =
      (new ClusterControllerFactory()).create(spec.getServiceName());

    try {
      controller.launchCluster(spec);
      Map<? extends NodeMetadata, ExecResponse> responseMap = controller.runScriptOnNodesMatching(
        spec,
        Predicates.<NodeMetadata>alwaysTrue(),
        exec("cat /tmp/bootstrap-start /tmp/bootstrap-end /tmp/configure-start")
      );
      ExecResponse response = Iterables.get(responseMap.values(), 0);
View Full Code Here


                 ClusterSpec clusterSpec, String[] instances, String[] roles,
                 String fileName) throws Exception {
    ClusterController controller = createClusterController(clusterSpec.getServiceName());
    Predicate<NodeMetadata> condition = buildFilterPredicate(instances, roles, clusterSpec);

    return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
      clusterSpec, condition, execFile(fileName)));
  }

  private Predicate<NodeMetadata> buildFilterPredicate(String[] ids, String[] roles, ClusterSpec spec)
    throws IOException {
View Full Code Here

      ClusterSpec spec = getClusterSpec(optionSet);
      ClusterController controller = createClusterController(spec.getServiceName());

      Predicate<NodeMetadata> condition = buildFilterPredicate(optionSet, spec);

      return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
        spec, condition, execFile(optionSet.valueOf(scriptOption))));

    } catch(IllegalArgumentException e) {
      err.println(e.getMessage());
      printUsage(parser, err);
View Full Code Here

      ClusterSpec spec = getClusterSpec(optionSet);
      ClusterController controller = createClusterController(spec.getServiceName());

      Predicate<NodeMetadata> condition = buildFilterPredicate(optionSet, spec);

      return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
        spec, condition, execFile(optionSet.valueOf(scriptOption))));

    } catch(IllegalArgumentException e) {
      err.println(e.getMessage());
      printUsage(parser, err);
View Full Code Here

      ClusterSpec spec = getClusterSpec(optionSet);
      ClusterController controller = createClusterController(spec.getServiceName());

      Predicate<NodeMetadata> condition = buildFilterPredicate(optionSet, spec);

      return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
        spec, condition, execFile(optionSet.valueOf(scriptOption))));

    } catch(IllegalArgumentException e) {
      err.println(e.getMessage());
      printUsage(parser, err);
View Full Code Here

    ClusterController controller =
      (new ClusterControllerFactory()).create(spec.getServiceName());

    try {
      controller.launchCluster(spec);
      Map<? extends NodeMetadata, ExecResponse> responseMap = controller.runScriptOnNodesMatching(
        spec,
        Predicates.<NodeMetadata>alwaysTrue(),
        exec("cat /tmp/bootstrap-start /tmp/bootstrap-end /tmp/configure-start")
      );
      ExecResponse response = Iterables.get(responseMap.values(), 0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.