Package org.apache.helix.api.id

Examples of org.apache.helix.api.id.ParticipantId


    // start participant
    ClusterId clusterId = ClusterId.from(clusterName);
    HelixParticipant[] participants = new HelixParticipant[n];
    for (int i = 0; i < n; i++) {
      int port = 12918 + i;
      ParticipantId participantId = ParticipantId.from("localhost_" + port);

      participants[i] = connection.createParticipant(clusterId, participantId);
      participants[i].getStateMachineEngine().registerStateModelFactory(
        StateModelDefId.from("MasterSlave"), new TestHelixConnection.MockStateModelFactory());
View Full Code Here


        Map<ResourceId, CurrentState> currentStateMap = Collections.emptyMap();
        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);
View Full Code Here

    }

    ResourceCurrentState currentStateOutput = new ResourceCurrentState();

    for (Participant liveParticipant : cluster.getLiveParticipantMap().values()) {
      ParticipantId participantId = liveParticipant.getId();

      // add pending messages
      Map<MessageId, Message> instanceMsgs = liveParticipant.getMessageMap();
      for (Message message : instanceMsgs.values()) {
        if (!MessageType.STATE_TRANSITION.toString().equalsIgnoreCase(message.getMsgType())) {
View Full Code Here

    String clusterName = optValues[0];
    String participantName = optValues[1];
    String tag = optValues[2];

    ParticipantAccessor accessor = participantAccessor(clusterName);
    ParticipantId participantId = ParticipantId.from(participantName);

    ParticipantConfig.Delta delta = new ParticipantConfig.Delta(participantId);
    delta.addTag(tag);
    accessor.updateParticipant(participantId, delta);
  }
View Full Code Here

    String clusterName = optValues[0];
    String participantName = optValues[1];
    String tag = optValues[2];

    ParticipantAccessor accessor = participantAccessor(clusterName);
    ParticipantId participantId = ParticipantId.from(participantName);

    ParticipantConfig.Delta delta = new ParticipantConfig.Delta(participantId);
    delta.removeTag(tag);
    accessor.updateParticipant(participantId, delta);
  }
View Full Code Here

  }

  void enablePartition(String[] optValues) {
    boolean enabled = Boolean.parseBoolean(optValues[0].toLowerCase());
    String clusterName = optValues[1];
    ParticipantId participantId = ParticipantId.from(optValues[2]);
    ResourceId resourceId = ResourceId.from(optValues[3]);

    Set<PartitionId> partitionIdSet = new HashSet<PartitionId>();
    for (int i = 4; i < optValues.length; i++) {
      partitionIdSet.add(PartitionId.from(optValues[i]));
View Full Code Here

      ClusterAccessor accessor = clusterAccessor(clusterName);
      results = keyValueMap(accessor.readUserConfig(), null, keys);
      break;
    }
    case PARTICIPANT: {
      ParticipantId participantId = ParticipantId.from(scopeArgs[1]);
      ParticipantAccessor accessor = participantAccessor(clusterName);
      results = keyValueMap(accessor.readUserConfig(participantId), null, keys);
      break;
    }
    case RESOURCE: {
View Full Code Here

      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(userConfig);
      break;
    }
    case PARTICIPANT: {
      ParticipantId participantId = ParticipantId.from(scopeArgs[1]);
      ParticipantAccessor accessor = participantAccessor(clusterName);
      Scope<ParticipantId> scope = Scope.participant(participantId);
      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(participantId, userConfig);
      break;
View Full Code Here

  void listParticipantInfo(String[] optValues) {
    String clusterName = optValues[0];
    String participantName = optValues[1];
    ParticipantAccessor accessor = participantAccessor(clusterName);
    ParticipantId participantId = ParticipantId.from(participantName);
    Participant participant = accessor.readParticipant(participantId);
    StringBuilder sb =
        new StringBuilder("Participant ").append(participantName).append(" in cluster ")
            .append(clusterName).append(":\n").append("hostName: ")
            .append(participant.getHostName()).append(", port: ").append(participant.getPort())
View Full Code Here

      removeKeysFromUserConfig(userConfig, keys);
      resourceAccessor.setUserConfig(resourceId, userConfig);
      break;
    case PARTICIPANT:
      ParticipantAccessor participantAccessor = participantAccessor(clusterName);
      ParticipantId participantId = ParticipantId.from(scopeArgs[1]);
      userConfig = participantAccessor.readUserConfig(participantId);
      removeKeysFromUserConfig(userConfig, keys);
      participantAccessor.setUserConfig(participantId, userConfig);
      break;
    case PARTITION:
View Full Code Here

TOP

Related Classes of org.apache.helix.api.id.ParticipantId

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.