Package org.apache.helix.api.config

Examples of org.apache.helix.api.config.ResourceConfig$Delta


            .equals(message.getTypedTgtSessionId())) {
          continue;
        }

        ResourceId resourceId = message.getResourceId();
        ResourceConfig resource = resourceMap.get(resourceId);
        if (resource == null) {
          continue;
        }

        if (!message.getBatchMessageMode()) {
          PartitionId partitionId = message.getPartitionId();
          Partition partition = resource.getSubUnit(partitionId);
          if (partition != null) {
            currentStateOutput.setPendingState(resourceId, partitionId, participantId,
                message.getTypedToState());
          } else {
            // log
          }
        } else {
          List<PartitionId> partitionNames = message.getPartitionIds();
          if (!partitionNames.isEmpty()) {
            for (PartitionId partitionId : partitionNames) {
              Partition partition = resource.getSubUnit(partitionId);
              if (partition != null) {
                currentStateOutput.setPendingState(resourceId, partitionId, participantId,
                    message.getTypedToState());
              } else {
                // log
              }
            }
          }
        }
      }

      // add current state
      SessionId sessionId = liveParticipant.getRunningInstance().getSessionId();
      Map<ResourceId, CurrentState> curStateMap = liveParticipant.getCurrentStateMap();
      for (CurrentState curState : curStateMap.values()) {
        if (!sessionId.equals(curState.getTypedSessionId())) {
          continue;
        }

        ResourceId resourceId = curState.getResourceId();
        StateModelDefId stateModelDefId = curState.getStateModelDefId();
        ResourceConfig resource = resourceMap.get(resourceId);
        if (resource == null) {
          continue;
        }

        if (stateModelDefId != null) {
View Full Code Here


    Iterator<Message> iter = messages.iterator();
    while (iter.hasNext()) {
      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);
        continue;
      }
View Full Code Here

    for (ResourceId resourceId : resourceMap.keySet()) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Processing resource:" + resourceId);
      }
      ResourceConfig resourceConfig = resourceMap.get(resourceId);
      RebalancerConfig rebalancerConfig = resourceConfig.getRebalancerConfig();
      RebalancerContext context = rebalancerConfig.getRebalancerContext(RebalancerContext.class);
      StateModelDefinition stateModelDef = stateModelDefs.get(context.getStateModelDefId());
      ResourceAssignment resourceAssignment = null;
      if (rebalancerConfig != null) {
        HelixRebalancer rebalancer = rebalancerConfig.getRebalancer();
View Full Code Here

TOP

Related Classes of org.apache.helix.api.config.ResourceConfig$Delta

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.