Examples of currentStates()


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

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

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

    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

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

      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

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

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

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

        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

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

    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

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

        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

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

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

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

      if (session.equals(_sessionId)) {
        continue;
      }
     
      List<CurrentState> lastCurStates =
          _helixAccessor.getChildValues(keyBuilder.currentStates(_instanceName, session));

      for (CurrentState lastCurState : lastCurStates) {
        logger.info("Carrying over old session: " + session + ", resource: "
            + lastCurState.getId() + " to current session: " + _sessionId);
        String stateModelDefRef = lastCurState.getStateModelDefRef();
View Full Code Here

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

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