Package org.apache.helix.api

Examples of org.apache.helix.api.State


      // get the error participants
      Map<ParticipantId, State> currentStateMap =
          currentStateOutput.getCurrentStateMap(resourceId, partitionId);
      Set<ParticipantId> errorParticipants = Sets.newHashSet();
      for (ParticipantId participantId : currentStateMap.keySet()) {
        State state = currentStateMap.get(participantId);
        if (state.equals(State.from(HelixDefinedState.ERROR))) {
          errorParticipants.add(participantId);
        }
      }

      // get the dropped and disabled map
      State initialState = stateModelDef.getTypedInitialState();
      Map<ParticipantId, State> participantStateMap = resourceAssignment.getReplicaMap(partitionId);
      Set<ParticipantId> participants = participantStateMap.keySet();
      Map<ParticipantId, State> droppedAndDisabledMap =
          ConstraintBasedAssignment.dropAndDisablePartitions(currentStateMap, participants,
              disabledParticipants, initialState);
View Full Code Here


    }
  }

  @Override
  public void doTransition(Message message, NotificationContext context) {
    State fromState = message.getTypedFromState();
    State toState = message.getTypedToState();
    PartitionId partition = message.getPartitionId();

    String key = (fromState + "-" + toState).toUpperCase();
    if (_errPartitions.containsKey(key) && _errPartitions.get(key).contains(partition.stringify())) {
      String errMsg =
View Full Code Here

    @Override
    public void doTransition(Message message, NotificationContext context) {
      HelixManager manager = context.getManager();
      HelixDataAccessor accessor = manager.getHelixDataAccessor();
      State fromState = message.getTypedFromState();
      State toState = message.getTypedToState();
      String instance = message.getTgtName();

      if (fromState.toString().equalsIgnoreCase("SLAVE")
          && toState.toString().equalsIgnoreCase("MASTER")) {

        // add a stat and report to ZK
        // perhaps should keep reporter per instance...
        ParticipantHealthReportCollectorImpl reporter =
            new ParticipantHealthReportCollectorImpl(manager, instance);
View Full Code Here

    @Override
    public void doTransition(Message message, NotificationContext context) {
      // System.err.println("doReset() invoked");
      super.doTransition(message, context);
      State fromState = message.getTypedFromState();
      State toState = message.getTypedToState();
      if (fromState.toString().equals("ERROR") && toState.toString().equals("OFFLINE")) {
        _errToOfflineInvoked++;
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.helix.api.State

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.