Class ElectionMemcachedSessionLocator

java.lang.Object
net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
net.rubyeye.xmemcached.impl.ElectionMemcachedSessionLocator
All Implemented Interfaces:
MemcachedSessionLocator

public class ElectionMemcachedSessionLocator extends AbstractMemcachedSessionLocator
Election hash strategy
  • Field Details

    • sessions

      private transient volatile List<Session> sessions
    • hashAlgorithm

      private final HashAlgorithm hashAlgorithm
  • Constructor Details

    • ElectionMemcachedSessionLocator

      public ElectionMemcachedSessionLocator()
    • ElectionMemcachedSessionLocator

      public ElectionMemcachedSessionLocator(HashAlgorithm hashAlgorithm)
  • Method Details

    • getSessionByKey

      public Session getSessionByKey(String key)
      Description copied from interface: MemcachedSessionLocator
      Returns a session by special key.
      Parameters:
      key -
      Returns:
    • getSessionByElection

      private Session getSessionByElection(String key, List<Session> copySessionList)
    • updateSessions

      public void updateSessions(Collection<Session> list)
      Description copied from interface: MemcachedSessionLocator
      Update sessions when session was added or removed.
      Parameters:
      list - The newer sessions