Class ArrayMemcachedSessionLocator

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

public class ArrayMemcachedSessionLocator extends AbstractMemcachedSessionLocator
Session locator base on hash(key) mod sessions.size().Standard hash strategy
  • Field Details

  • Constructor Details

    • ArrayMemcachedSessionLocator

      public ArrayMemcachedSessionLocator()
    • ArrayMemcachedSessionLocator

      public ArrayMemcachedSessionLocator(HashAlgorithm hashAlgorighm)
  • Method Details

    • setHashAlgorighm

      public final void setHashAlgorighm(HashAlgorithm hashAlgorighm)
    • getHash

      public final long getHash(int size, String key)
    • getSessionByKey

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

      private Session getRandomSession(List<Session> sessions)
    • getNext

      public final long getNext(int size, long start)
    • updateSessions

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