Package org.apache.helix.PropertyKey

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


    List<String> subPaths =
        _helixAccessor.getChildNames(keyBuilder.sessions(_instanceName));
    for (String previousSessionId : subPaths)
    {
      List<CurrentState> previousCurrentStates =
          _helixAccessor.getChildValues(keyBuilder.currentStates(_instanceName,
                                                                 previousSessionId));

      for (CurrentState previousCurrentState : previousCurrentStates)
      {
        if (!previousSessionId.equalsIgnoreCase(_sessionId))
View Full Code Here


        allCurStateMap.put(instanceName, new HashMap<String, Map<String, CurrentState>>());
      }
      Map<String, Map<String, CurrentState>> curStateMap =
          allCurStateMap.get(instanceName);
      Map<String, CurrentState> map =
          accessor.getChildValuesMap(keyBuilder.currentStates(instanceName, sessionId));
      curStateMap.put(sessionId, map);
    }

    for (String instance : allCurStateMap.keySet())
    {
View Full Code Here

        String instanceName = PropertyPathConfig.getInstanceNameFromPath(_path);
        String[] pathParts = _path.split("/");

        // TODO: fix this
        List<CurrentState> currentStates =
            _accessor.getChildValues(keyBuilder.currentStates(instanceName,
                                                              pathParts[pathParts.length - 1]));

        currentStateChangeListener.onStateChange(instanceName,
                                                 currentStates,
                                                 changeContext);
View Full Code Here

    // message read
    List<Message> readMsgs = new ArrayList<Message>();

    String sessionId = manager.getSessionId();
    List<String> curResourceNames =
        accessor.getChildNames(keyBuilder.currentStates(instanceName, sessionId));
    List<PropertyKey> createCurStateKeys = new ArrayList<PropertyKey>();
    List<CurrentState> metaCurStates = new ArrayList<CurrentState>();
    Set<String> createCurStateNames = new HashSet<String>();

    changeContext.add(NotificationContext.TASK_EXECUTOR_KEY, this);
View Full Code Here

      if (!allCurStateMap.containsKey(instanceName)) {
        allCurStateMap.put(instanceName, new HashMap<String, Map<String, CurrentState>>());
      }
      Map<String, Map<String, CurrentState>> curStateMap = allCurStateMap.get(instanceName);
      Map<String, CurrentState> map =
          accessor.getChildValuesMap(keyBuilder.currentStates(instanceName, sessionId));
      curStateMap.put(sessionId, map);
    }

    for (String instance : allCurStateMap.keySet()) {
      allCurStateMap.put(instance, Collections.unmodifiableMap(allCurStateMap.get(instance)));
View Full Code Here

    if (lastSessions != null) {
      for (String session : lastSessions.keySet()) {
        if (!curSessions.containsKey(session)) {
          // remove current-state listener for expired session
          String instanceName = lastSessions.get(session).getInstanceName();
          manager.removeListener(keyBuilder.currentStates(instanceName, session), this);
        }
      }
    }

    if (lastInstances != null) {
View Full Code Here

    if (lastSessions != null) {
      for (String session : lastSessions.keySet()) {
        if (!curSessions.containsKey(session)) {
          // remove current-state listener for expired session
          String instanceName = lastSessions.get(session).getInstanceName();
          manager.removeListener(keyBuilder.currentStates(instanceName, session), this);
        }
      }
    }

    if (lastInstances != null) {
View Full Code Here

        new HashMap<String, Map<String, Map<String, CurrentState>>>();
    for (String instanceName : _liveInstanceMap.keySet()) {
      LiveInstance liveInstance = _liveInstanceMap.get(instanceName);
      String sessionId = liveInstance.getSessionId();
      List<String> currentStateNames =
          accessor.getChildNames(keyBuilder.currentStates(instanceName, sessionId));
      for (String currentStateName : currentStateNames) {
        currentStateKeys.add(keyBuilder.currentState(instanceName, sessionId, currentStateName));
      }

      // ensure an empty current state map for all live instances and sessions
View Full Code Here

    // message read
    List<Message> readMsgs = new ArrayList<Message>();

    String sessionId = manager.getSessionId();
    List<String> curResourceNames =
        accessor.getChildNames(keyBuilder.currentStates(instanceName, sessionId));
    List<PropertyKey> createCurStateKeys = new ArrayList<PropertyKey>();
    List<CurrentState> metaCurStates = new ArrayList<CurrentState>();
    Set<String> createCurStateNames = new HashSet<String>();

    for (Message message : messages) {
View Full Code Here

    // message read
    List<Message> readMsgs = new ArrayList<Message>();

    String sessionId = manager.getSessionId();
    List<String> curResourceNames =
        accessor.getChildNames(keyBuilder.currentStates(instanceName, sessionId));
    List<PropertyKey> createCurStateKeys = new ArrayList<PropertyKey>();
    List<CurrentState> metaCurStates = new ArrayList<CurrentState>();
    Set<String> createCurStateNames = new HashSet<String>();

    for (Message message : messages) {
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.