Examples of instanceConfigs()


Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

    Builder keyBuilder = accessor.keyBuilder();

    if (_init) {
      _idealStateCacheMap = accessor.getChildValuesMap(keyBuilder.idealStates());
      _liveInstanceCacheMap = accessor.getChildValuesMap(keyBuilder.liveInstances());
      _instanceConfigCacheMap = accessor.getChildValuesMap(keyBuilder.instanceConfigs());
      _resourceConfigCacheMap = accessor.getChildValuesMap(keyBuilder.resourceConfigs());
      _constraintCacheMap = accessor.getChildValuesMap(keyBuilder.constraints());
    }
    _idealStateMap = Maps.newHashMap(_idealStateCacheMap);
    _liveInstanceMap = Maps.newHashMap(_liveInstanceCacheMap);
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

  private void refresh(List<ExternalView> externalViewList, NotificationContext changeContext) {
    HelixDataAccessor accessor = changeContext.getManager().getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    RoutingTable newRoutingTable = new RoutingTable();
    List<InstanceConfig> configList = accessor.getChildValues(keyBuilder.instanceConfigs());
    Map<String, InstanceConfig> instanceConfigMap = new HashMap<String, InstanceConfig>();
    for (InstanceConfig config : configList) {
      instanceConfigMap.put(config.getId(), config);
      newRoutingTable.addConfig(config);
    }
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

    public static StatusUpdateContents getStatusUpdateContents(HelixDataAccessor accessor,
        String instance, String resourceGroup, String sessionID, String partition) {
      Builder keyBuilder = accessor.keyBuilder();

      List<ZNRecord> instances =
          HelixProperty.convertToList(accessor.getChildValues(keyBuilder.instanceConfigs()));
      List<ZNRecord> partitionRecords = new ArrayList<ZNRecord>();
      for (ZNRecord znRecord : instances) {
        String instanceName = znRecord.getId();
        if (!instanceName.equals(instance)) {
          continue;
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

    Builder keyBuilder = new Builder(manager.getClusterName());
    for (ChangeType notificationType : _notificationTypes) {
      if (notificationType == ChangeType.LIVE_INSTANCE) {
        manager.removeListener(keyBuilder.liveInstances(), _particHolder);
      } else if (notificationType == ChangeType.CONFIG) {
        manager.removeListener(keyBuilder.instanceConfigs(), _particHolder);
      } else if (notificationType == ChangeType.EXTERNAL_VIEW) {
        manager.removeListener(keyBuilder.externalViews(), _particHolder);
      } else {
        LOG.error("Unsupport notificationType:" + notificationType.toString());
      }
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

    logger.info("Scanning status updates ...");
    try {
      HelixDataAccessor accessor = _manager.getHelixDataAccessor();
      Builder keyBuilder = accessor.keyBuilder();

      List<String> instances = accessor.getChildNames(keyBuilder.instanceConfigs());
      for (String instanceName : instances) {
        scanPath(HelixUtil.getInstancePropertyPath(_manager.getClusterName(), instanceName,
            PropertyType.STATUSUPDATES), _thresholdNoChangeInMs);
        scanPath(HelixUtil.getInstancePropertyPath(_manager.getClusterName(), instanceName,
            PropertyType.ERRORS), _thresholdNoChangeInMs * 3);
 
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

      int instances = 0;
      Map<String, LiveInstance> liveInstanceMap =
          accessor.getChildValuesMap(keyBuilder.liveInstances());
      Map<String, InstanceConfig> instanceConfigMap =
          accessor.getChildValuesMap(keyBuilder.instanceConfigs());
      for (String liveInstanceName : liveInstanceMap.keySet()) {
        if (instanceConfigMap.get(liveInstanceName).containsTag(instanceGroupTag)) {
          instances++;
        }
      }
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

    Builder keyBuilder = accessor.keyBuilder();
    // List<ZNRecord> instanceConfigs = accessor.getChildValues(PropertyType.CONFIGS,
    // ConfigScopeProperty.PARTICIPANT.toString());

    List<ZNRecord> instanceConfigs =
        HelixProperty.convertToList(accessor.getChildValues(keyBuilder.instanceConfigs()));

    List<ZNRecord> liveInstances =
        HelixProperty.convertToList(accessor.getChildValues(keyBuilder.liveInstances()));
    List<ZNRecord> stateModelDefs =
        HelixProperty.convertToList(accessor.getChildValues(keyBuilder.stateModelDefs()));
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

    for (LiveInstance instance : _liveInstanceMap.values()) {
      LOG.trace("live instance: " + instance.getParticipantId() + " " + instance.getTypedSessionId());
    }

    _stateModelDefMap = accessor.getChildValuesMap(keyBuilder.stateModelDefs());
    _instanceConfigMap = accessor.getChildValuesMap(keyBuilder.instanceConfigs());
    _constraintMap = accessor.getChildValuesMap(keyBuilder.constraints());

    Map<String, Map<String, Message>> msgMap = new HashMap<String, Map<String, Message>>();
    for (String instanceName : _liveInstanceMap.keySet()) {
      Map<String, Message> map = accessor.getChildValuesMap(keyBuilder.messages(instanceName));
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

        String instanceGroupTag = idealState.getInstanceGroupTag();
        int instances = 0;
        Map<String, LiveInstance> liveInstanceMap =
            accessor.getChildValuesMap(keyBuilder.liveInstances());
        Map<String, InstanceConfig> instanceCfgMap =
            accessor.getChildValuesMap(keyBuilder.instanceConfigs());
        for (String liveInstanceName : liveInstanceMap.keySet()) {
          if (instanceCfgMap.get(liveInstanceName).containsTag(instanceGroupTag)) {
            instances++;
          }
        }
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.instanceConfigs()

    switch (scope) {
    case CLUSTER:
      propertyKey = keyBuilder.clusterConfigs();
      break;
    case PARTICIPANT:
      propertyKey = keyBuilder.instanceConfigs();
      break;
    case RESOURCE:
      propertyKey = keyBuilder.resourceConfigs();
      break;
    default:
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.