Examples of liveInstances()


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

    return _liveInstanceMap;
  }

  public boolean refresh(HelixDataAccessor accessor) {
    Builder keyBuilder = accessor.keyBuilder();
    _liveInstanceMap = accessor.getChildValuesMap(keyBuilder.liveInstances());

    Map<String, Map<String, HealthStat>> hsMap = new HashMap<String, Map<String, HealthStat>>();

    for (String instanceName : _liveInstanceMap.keySet()) {
      // xxx clearly getting znodes for the instance here...so get the
View Full Code Here

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

    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    String root = "/" + clusterName;
    if (accessor.getChildNames(keyBuilder.liveInstances()).size() > 0) {
      throw new HelixException(
          "There are still live instances in the cluster, shut them down first.");
    }

    if (accessor.getProperty(keyBuilder.controllerLeader()) != null) {
View Full Code Here

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

  }

  public static String parseInstanceName(String actualStatName, HelixManager manager) {
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    Builder kb = accessor.keyBuilder();
    List<LiveInstance> liveInstances = accessor.getChildValues(kb.liveInstances());
    for (LiveInstance instance : liveInstances) {
      String instanceName = instance.getInstanceName();
      if (actualStatName.startsWith(instanceName)) {
        return instanceName;
      }
View Full Code Here

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

    HelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    String root = "/" + clusterName;
    if (accessor.getChildNames(keyBuilder.liveInstances()).size() > 0) {
      throw new HelixException(
          "There are still live instances in the cluster, shut them down first.");
    }

    if (accessor.getProperty(keyBuilder.controllerLeader()) != null) {
View Full Code Here

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

    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

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

   */
  public boolean refresh(HelixDataAccessor accessor)
  {
    Builder keyBuilder = accessor.keyBuilder();
    _idealStateMap = accessor.getChildValuesMap(keyBuilder.idealStates());
    _liveInstanceMap = accessor.getChildValuesMap(keyBuilder.liveInstances());

    for (LiveInstance instance : _liveInstanceMap.values())
    {
      LOG.trace("live instance: " + instance.getInstanceName() + " "
          + instance.getSessionId());
View Full Code Here

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

  private void refreshCache()
  {
    Builder propertyKeyBuilder = new PropertyKey.Builder(cluster);
    HelixDataAccessor helixDataAccessor = admin.getHelixDataAccessor();
    List<LiveInstance> liveInstances = helixDataAccessor
        .getChildValues(propertyKeyBuilder.liveInstances());
    refreshCache(liveInstances);
  }

  private void refreshCache(List<LiveInstance> liveInstances)
  {
View Full Code Here

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

    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    String root = "/" + clusterName;
    if (accessor.getChildNames(keyBuilder.liveInstances()).size() > 0)
    {
      throw new HelixException("There are still live instances in the cluster, shut them down first.");
    }

    if (accessor.getProperty(keyBuilder.controllerLeader()) != null)
View Full Code Here

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

//    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()));
   
    // Idealstates are stored in a map from resource name to idealState ZNRecord
    List<ZNRecord> idealStateList = HelixProperty.convertToList(accessor.getChildValues(keyBuilder.idealStates()));
   
View Full Code Here

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

    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);
      }
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.