Tabnine Logo
SessionTrackerImpl$SessionImpl.isClosing
Code IndexAdd Tabnine to your IDE (free)

How to use
isClosing
method
in
org.apache.zookeeper.server.SessionTrackerImpl$SessionImpl

Best Java code snippets using org.apache.zookeeper.server.SessionTrackerImpl$SessionImpl.isClosing (Showing top 7 results out of 315)

origin: apache/zookeeper

public synchronized void checkSession(long sessionId, Object owner)
    throws KeeperException.SessionExpiredException,
    KeeperException.SessionMovedException,
    KeeperException.UnknownSessionException {
  LOG.debug("Checking session 0x" + Long.toHexString(sessionId));
  SessionImpl session = sessionsById.get(sessionId);
  if (session == null) {
    throw new KeeperException.UnknownSessionException();
  }
  if (session.isClosing()) {
    throw new KeeperException.SessionExpiredException();
  }
  if (session.owner == null) {
    session.owner = owner;
  } else if (session.owner != owner) {
    throw new KeeperException.SessionMovedException();
  }
}
origin: apache/zookeeper

synchronized public void setOwner(long id, Object owner) throws SessionExpiredException {
  SessionImpl session = sessionsById.get(id);
  if (session == null || session.isClosing()) {
    throw new KeeperException.SessionExpiredException();
  }
  session.owner = owner;
}
origin: org.apache.zookeeper/zookeeper

synchronized public boolean touchSession(long sessionId, int timeout) {
  if (LOG.isTraceEnabled()) {
    ZooTrace.logTraceMessage(LOG,
                 ZooTrace.CLIENT_PING_TRACE_MASK,
                 "SessionTrackerImpl --- Touch session: 0x"
        + Long.toHexString(sessionId) + " with timeout " + timeout);
  }
  SessionImpl s = sessionsById.get(sessionId);
  // Return false, if the session doesn't exists or marked as closing
  if (s == null || s.isClosing()) {
    return false;
  }
  long expireTime = roundToInterval(Time.currentElapsedTime() + timeout);
  if (s.tickTime >= expireTime) {
    // Nothing needs to be done
    return true;
  }
  SessionSet set = sessionSets.get(s.tickTime);
  if (set != null) {
    set.sessions.remove(s);
  }
  s.tickTime = expireTime;
  set = sessionSets.get(s.tickTime);
  if (set == null) {
    set = new SessionSet();
    sessionSets.put(expireTime, set);
  }
  set.sessions.add(s);
  return true;
}
origin: apache/zookeeper

Assert.assertTrue("Session didn't expired", sessionImpl.isClosing());
Assert.assertFalse("Session didn't expired", sessionTrackerImpl
    .touchSession(sessionId, sessionTimeout));
origin: org.apache.zookeeper/zookeeper

synchronized public void checkSession(long sessionId, Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException {
  SessionImpl session = sessionsById.get(sessionId);
  if (session == null || session.isClosing()) {
    throw new KeeperException.SessionExpiredException();
  }
  if (session.owner == null) {
    session.owner = owner;
  } else if (session.owner != owner) {
    throw new KeeperException.SessionMovedException();
  }
}
origin: org.apache.zookeeper/zookeeper

  synchronized public void setOwner(long id, Object owner) throws SessionExpiredException {
    SessionImpl session = sessionsById.get(id);
    if (session == null || session.isClosing()) {
      throw new KeeperException.SessionExpiredException();
    }
    session.owner = owner;
  }
}
origin: apache/zookeeper

synchronized public boolean touchSession(long sessionId, int timeout) {
  SessionImpl s = sessionsById.get(sessionId);
  if (s == null) {
    logTraceTouchInvalidSession(sessionId, timeout);
    return false;
  }
  if (s.isClosing()) {
    logTraceTouchClosingSession(sessionId, timeout);
    return false;
  }
  updateSessionExpiry(s, timeout);
  return true;
}
org.apache.zookeeper.serverSessionTrackerImpl$SessionImplisClosing

Popular methods of SessionTrackerImpl$SessionImpl

  • <init>

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Kernel (java.awt.image)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top 12 Jupyter Notebook extensions
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