Examples of liveInstances()


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))
      {
View Full Code Here

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

      {
        LiveInstanceChangeListener liveInstanceChangeListener =
            (LiveInstanceChangeListener) _listener;
        subscribeForChanges(changeContext, _path, true, true);
        List<LiveInstance> liveInstances =
            _accessor.getChildValues(keyBuilder.liveInstances());

        liveInstanceChangeListener.onLiveInstanceChange(liveInstances, changeContext);

      }
      else if (_changeType == CURRENT_STATE)
View Full Code Here

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

        {
          HelixDataAccessor accessor = _manager.getHelixDataAccessor();
          Builder keyBuilder = accessor.keyBuilder();

          List<LiveInstance> liveInstances =
              accessor.getChildValues(keyBuilder.liveInstances());

          for (LiveInstance liveInstance : liveInstances)
          {
            sessionIdMap.put(liveInstance.getInstanceName(), liveInstance.getSessionId());
          }
View Full Code Here

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

  }

  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())
    {
View Full Code Here

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

   * @return
   */
  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()

        Map<String, String> sessionIdMap = new HashMap<String, String>();
        if (recipientCriteria.isSessionSpecific()) {
          HelixDataAccessor accessor = _manager.getHelixDataAccessor();
          Builder keyBuilder = accessor.keyBuilder();

          List<LiveInstance> liveInstances = accessor.getChildValues(keyBuilder.liveInstances());

          for (LiveInstance liveInstance : liveInstances) {
            sessionIdMap.put(liveInstance.getInstanceName(), liveInstance.getSessionId());
          }
        }
View Full Code Here

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

    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 =
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) {
    List<ServiceMetadata> services = new ArrayList<ServiceMetadata>();
View Full Code Here

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
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.