org.codehaus.wadi.impl
Class FixedWidthSessionIdFactory
java.lang.Object
org.codehaus.wadi.impl.FixedWidthSessionIdFactory
- All Implemented Interfaces:
- PartitionMapper, SessionIdFactory
- public class FixedWidthSessionIdFactory
- extends Object
- implements SessionIdFactory, PartitionMapper
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_log
protected final Log _log
_defaultChars
protected static final char[] _defaultChars
_divider
protected final char[] _divider
_random
protected Random _random
_lookup
protected final int[] _lookup
_keyLength
protected final int _keyLength
_chars
protected final char[] _chars
_base
protected final int _base
_sectLength
protected final int _sectLength
_numPartitions
protected final int _numPartitions
_partitionLength
protected final int _partitionLength
FixedWidthSessionIdFactory
public FixedWidthSessionIdFactory(int width,
int numPartitions)
FixedWidthSessionIdFactory
public FixedWidthSessionIdFactory(int width,
char[] chars,
int numPartitions)
create
public String create()
- Specified by:
create
in interface SessionIdFactory
getSessionIdLength
public int getSessionIdLength()
- Specified by:
getSessionIdLength
in interface SessionIdFactory
setSessionIdLength
public void setSessionIdLength(int l)
- Specified by:
setSessionIdLength
in interface SessionIdFactory
create
public String create(int partition)
encode
protected int encode(long sect,
int iters,
char[] buffer,
int offset)
getPartition
public int getPartition(String key)
decode
protected int decode(char[] buffer,
int from,
int length)
size
protected int size(long l)
size
protected int size(int n)
main
public static void main(String[] args)
map
public int map(Object key)
- Description copied from interface:
PartitionMapper
- Given a key, map it to the corresponding Partition index.
- Specified by:
map
in interface PartitionMapper
- Parameters:
key
-
- Returns:
Copyright © 2004-2006 Core Developers Network Ltd.. All Rights Reserved.