Package org.apache.helix.api

Examples of org.apache.helix.api.Participant


      for (String resourceName : instanceCurStateMap.keySet()) {
        curStateMap.put(ResourceId.from(resourceName), instanceCurStateMap.get(resourceName));
      }
    }

    return new Participant(participantId, hostName, port, isEnabled, disabledPartitionIdSet, tags,
        runningInstance, curStateMap, msgMap, userConfig);
  }
View Full Code Here


   * @param oldParticipantId the participant to drop
   * @param newParticipantId the participant that takes its place
   * @return true if swap successful, false otherwise
   */
  public boolean swapParticipants(ParticipantId oldParticipantId, ParticipantId newParticipantId) {
    Participant oldParticipant = readParticipant(oldParticipantId);
    if (oldParticipant == null) {
      LOG.error("Could not swap participants because the old participant does not exist");
      return false;
    }
    if (oldParticipant.isEnabled()) {
      LOG.error("Could not swap participants because the old participant is still enabled");
      return false;
    }
    if (oldParticipant.isAlive()) {
      LOG.error("Could not swap participants because the old participant is still live");
      return false;
    }
    Participant newParticipant = readParticipant(newParticipantId);
    if (newParticipant == null) {
      LOG.error("Could not swap participants because the new participant does not exist");
      return false;
    }
    dropParticipant(oldParticipantId);
View Full Code Here

        Map<ParticipantId, Participant> liveParticipantMap =
            new HashMap<ParticipantId, Participant>();
        // set up some participants
        for (String nodeName : _liveNodes) {
          ParticipantId participantId = ParticipantId.from(nodeName);
          Participant participant =
              new Participant(participantId, "hostname", 0, true, disabledPartitionIdSet, tags,
                  null, currentStateMap, messageMap, new UserConfig(
                      Scope.participant(participantId)));
          liveParticipantMap.put(participantId, participant);
        }
        List<ParticipantId> participantPreferenceList =
View Full Code Here

      Message message = iter.next();
      ResourceId resourceId = message.getResourceId();
      ResourceConfig resource = resourceMap.get(resourceId);

      ParticipantId participantId = ParticipantId.from(message.getTgtName());
      Participant liveParticipant = liveParticipantMap.get(participantId);
      String participantVersion = null;
      if (liveParticipant != null) {
        participantVersion = liveParticipant.getRunningInstance().getVersion().toString();
      }

      if (resource == null || !resource.getBatchMessageMode() || participantVersion == null
          || !properties.isFeatureSupported("batch_message", participantVersion)) {
        outputMessages.add(message);
View Full Code Here

    Map<String, Integer> throttleCounterMap = new HashMap<String, Integer>();

    if (constraint != null) {
      // go through all pending messages, they should be counted but not throttled
      for (ParticipantId participantId : cluster.getLiveParticipantMap().keySet()) {
        Participant liveParticipant = cluster.getLiveParticipantMap().get(participantId);
        throttle(throttleCounterMap, constraint, new ArrayList<Message>(liveParticipant
            .getMessageMap().values()), false);
      }
    }

    // go through all new messages, throttle if necessary
View Full Code Here

TOP

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

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.