Examples of RebalancerRef


Examples of org.apache.helix.controller.rebalancer.RebalancerRef

  /**
   * Get a reference to the user-defined rebalancer associated with this resource(if any)
   * @return RebalancerRef
   */
  public RebalancerRef getRebalancerRef() {
    RebalancerRef ref = null;
    String className = getRebalancerClassName();
    if (className != null) {
      ref = RebalancerRef.from(getRebalancerClassName());
    } else {
      switch (getRebalanceMode()) {
View Full Code Here

Examples of org.apache.helix.controller.rebalancer.RebalancerRef

      RebalancerConfig rebalancerConfig = resourceConfig.getRebalancerConfig();
      IdealState idealState = resourceConfig.getIdealState();
      StateModelDefinition stateModelDef = stateModelDefs.get(idealState.getStateModelDefId());
      ResourceAssignment resourceAssignment = null;
      // use a cached rebalancer if possible
      RebalancerRef ref = idealState.getRebalancerRef();
      HelixRebalancer rebalancer = null;
      if (_rebalancerMap.containsKey(resourceId)) {
        HelixRebalancer candidateRebalancer = _rebalancerMap.get(resourceId);
        if (ref != null && candidateRebalancer.getClass().equals(ref.toString())) {
          rebalancer = candidateRebalancer;
        }
      }

      // otherwise instantiate a new one
      if (rebalancer == null) {
        if (ref != null) {
          rebalancer = ref.getRebalancer();
        }
        HelixManager manager = event.getAttribute("helixmanager");
        ControllerContextProvider provider =
            event.getAttribute(AttributeName.CONTEXT_PROVIDER.toString());
        if (rebalancer == null) {
View Full Code Here

Examples of org.apache.helix.controller.rebalancer.RebalancerRef

    builder.anyLiveParticipant(anyLiveParticipant).replicaCount(replicaCount)
        .maxPartitionsPerParticipant(idealState.getMaxPartitionsPerInstance())
        .participantGroupTag(idealState.getInstanceGroupTag())
        .stateModelDefId(idealState.getStateModelDefId())
        .stateModelFactoryId(idealState.getStateModelFactoryId());
    RebalancerRef rebalancerRef = idealState.getRebalancerRef();
    if (rebalancerRef != null) {
      builder.rebalancerRef(rebalancerRef);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.