congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SessionTrackerImpl$SessionImpl.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.zookeeper.server.SessionTrackerImpl$SessionImpl
constructor

Best Java code snippets using org.apache.zookeeper.server.SessionTrackerImpl$SessionImpl.<init> (Showing top 3 results out of 315)

origin: apache/zookeeper

@Override
public synchronized boolean trackSession(long id, int sessionTimeout) {
  boolean added = false;
  SessionImpl session = sessionsById.get(id);
  if (session == null){
    session = new SessionImpl(id, sessionTimeout);
  }
  // findbugs2.0.3 complains about get after put.
  // long term strategy would be use computeIfAbsent after JDK 1.8
  SessionImpl existedSession = sessionsById.putIfAbsent(id, session);
  if (existedSession != null) {
    session = existedSession;
  } else {
    added = true;
    LOG.debug("Adding session 0x" + Long.toHexString(id));
  }
  if (LOG.isTraceEnabled()) {
    String actionStr = added ? "Adding" : "Existing";
    ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK,
        "SessionTrackerImpl --- " + actionStr + " session 0x"
        + Long.toHexString(id) + " " + sessionTimeout);
  }
  updateSessionExpiry(session, sessionTimeout);
  return added;
}
origin: org.apache.zookeeper/zookeeper

synchronized public void addSession(long id, int sessionTimeout) {
  sessionsWithTimeout.put(id, sessionTimeout);
  if (sessionsById.get(id) == null) {
    SessionImpl s = new SessionImpl(id, sessionTimeout, 0);
    sessionsById.put(id, s);
    if (LOG.isTraceEnabled()) {
      ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK,
          "SessionTrackerImpl --- Adding session 0x"
          + Long.toHexString(id) + " " + sessionTimeout);
    }
  } else {
    if (LOG.isTraceEnabled()) {
      ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK,
          "SessionTrackerImpl --- Existing session 0x"
          + Long.toHexString(id) + " " + sessionTimeout);
    }
  }
  touchSession(id, sessionTimeout);
}
origin: org.apache.hadoop/zookeeper

synchronized public void addSession(long id, int sessionTimeout) {
  sessionsWithTimeout.put(id, sessionTimeout);
  if (sessionsById.get(id) == null) {
    SessionImpl s = new SessionImpl(id, sessionTimeout, 0);
    sessionsById.put(id, s);
    if (LOG.isTraceEnabled()) {
      ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK,
          "SessionTrackerImpl --- Adding session 0x"
          + Long.toHexString(id) + " " + sessionTimeout);
    }
  } else {
    if (LOG.isTraceEnabled()) {
      ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK,
          "SessionTrackerImpl --- Existing session 0x"
          + Long.toHexString(id) + " " + sessionTimeout);
    }
  }
  touchSession(id, sessionTimeout);
}
org.apache.zookeeper.serverSessionTrackerImpl$SessionImpl<init>

Popular methods of SessionTrackerImpl$SessionImpl

  • isClosing

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now