Package org.apache.helix.api.accessor

Examples of org.apache.helix.api.accessor.ClusterAccessor


  void removeConstraint(String[] optValues) {
    String clusterName = optValues[0];
    ConstraintType constraintType = ConstraintType.valueOf(optValues[1]);
    ConstraintId constraintId = ConstraintId.from(optValues[2]);
    ClusterAccessor accessor = clusterAccessor(clusterName);
    accessor.removeConstraint(constraintType, constraintId);
  }
View Full Code Here


    accessor.removeConstraint(constraintType, constraintId);
  }

  void listClusterInfo(String[] optValues) {
    String clusterName = optValues[0];
    ClusterAccessor accessor = clusterAccessor(clusterName);
    Set<ResourceId> resources = accessor.readResources().keySet();
    StringBuilder sb =
        new StringBuilder("Existing resources in cluster ").append(clusterName).append(":\n");
    for (ResourceId resourceId : resources) {
      sb.append(resourceId.stringify()).append('\n');
    }
    Set<ParticipantId> participants = accessor.readParticipants().keySet();
    sb.append("Participants in cluster ").append(clusterName).append(":\n");
    for (ParticipantId participantId : participants) {
      sb.append(participantId.stringify()).append('\n');
    }
    System.out.print(sb.toString());
View Full Code Here

    System.out.println(sb.toString());
  }

  void listResources(String[] optValues) {
    String clusterName = optValues[0];
    ClusterAccessor accessor = clusterAccessor(clusterName);
    Set<ResourceId> resources = accessor.readResources().keySet();
    StringBuilder sb =
        new StringBuilder("Existing resources in cluster ").append(clusterName).append(":\n");
    for (ResourceId resourceId : resources) {
      sb.append(resourceId.stringify()).append('\n');
    }
View Full Code Here

    System.out.print(sb.toString());
  }

  void listParticipants(String[] optValues) {
    String clusterName = optValues[0];
    ClusterAccessor accessor = clusterAccessor(clusterName);
    Set<ParticipantId> participants = accessor.readParticipants().keySet();
    StringBuilder sb =
        new StringBuilder("Participants in cluster ").append(clusterName).append(":\n");
    for (ParticipantId participantId : participants) {
      sb.append(participantId.stringify()).append('\n');
    }
View Full Code Here

    System.out.print(sb.toString());
  }

  void listStateModels(String[] optValues) {
    String clusterName = optValues[0];
    ClusterAccessor accessor = clusterAccessor(clusterName);
    Set<StateModelDefId> stateModelDefs = accessor.readStateModelDefinitions().keySet();
    StringBuilder sb =
        new StringBuilder("State models in cluster ").append(clusterName).append(":\n");
    for (StateModelDefId stateModelDefId : stateModelDefs) {
      sb.append(stateModelDefId.stringify()).append('\n');
    }
View Full Code Here

  void listStateModel(String[] optValues) {
    String clusterName = optValues[0];
    String stateModel = optValues[1];
    StateModelDefId stateModelDefId = StateModelDefId.from(stateModel);
    ClusterAccessor accessor = clusterAccessor(clusterName);
    Map<StateModelDefId, StateModelDefinition> stateModelDefs =
        accessor.readStateModelDefinitions();
    StateModelDefinition stateModelDef = stateModelDefs.get(stateModelDefId);
    StringBuilder sb = new StringBuilder("StateModelDefinition: ").append(stateModelDef.toString());
    System.out.println(sb.toString());
  }
View Full Code Here

  void listClusters(String[] optValues) {
    List<ClusterId> result = Lists.newArrayList();
    List<String> clusterNames = _baseAccessor.getChildNames("/", 0);
    for (String clusterName : clusterNames) {
      ClusterAccessor accessor = clusterAccessor(clusterName);
      if (accessor.isClusterStructureValid()) {
        result.add(ClusterId.from(clusterName));
      }
    }
    System.out.println("Existing clusters: " + result);
  }
View Full Code Here

    String[] keys = optValues[2].split("[\\s,]");
    String clusterName = scopeArgs[0];
    UserConfig userConfig;
    switch (type) {
    case CLUSTER:
      ClusterAccessor clusterAccessor = clusterAccessor(clusterName);
      userConfig = clusterAccessor.readUserConfig();
      removeKeysFromUserConfig(userConfig, keys);
      clusterAccessor.setUserConfig(userConfig);
      break;
    case RESOURCE:
      ResourceAccessor resourceAccessor = resourceAccessor(clusterName);
      ResourceId resourceId = ResourceId.from(scopeArgs[1]);
      userConfig = resourceAccessor.readUserConfig(resourceId);
View Full Code Here

  }

  void addStat(String[] optValues) {
    String clusterName = optValues[0];
    String statName = optValues[1];
    ClusterAccessor accessor = clusterAccessor(clusterName);
    accessor.addStat(statName);
  }
View Full Code Here

  }

  void dropStat(String[] optValues) {
    String clusterName = optValues[0];
    String statName = optValues[1];
    ClusterAccessor accessor = clusterAccessor(clusterName);
    accessor.dropStat(statName);
  }
View Full Code Here

TOP

Related Classes of org.apache.helix.api.accessor.ClusterAccessor

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.