Package org.apache.helix.PropertyKey

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


    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

    Builder keyBuilder = accessor.keyBuilder();

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

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

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

    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

        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

        + ", by controller: " + _manager);
    HelixDataAccessor accessor = _manager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();
    BaseDataAccessor<ZNRecord> baseAccessor = accessor.getBaseDataAccessor();

    List<String> instances = accessor.getChildNames(keyBuilder.instanceConfigs());
    for (String instance : instances) {
      // dump participant status updates
      String statusUpdatePath =
          HelixUtil.getInstancePropertyPath(_manager.getClusterName(), instance,
              PropertyType.STATUSUPDATES);
View Full Code Here

      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

    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

    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

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.