public class BEncodedHeapBag extends AbstractMapStore implements MapStore
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,BEncodedHeap> |
bag |
private java.io.File |
baseDir |
private int |
buffermax |
private java.lang.String |
current |
private ByteOrder |
entryOrder |
private long |
fileAgeLimit |
private long |
fileSizeLimit |
private int |
keylength |
private java.lang.String |
prefix |
Constructor and Description |
---|
BEncodedHeapBag(java.io.File path,
java.lang.String prefix,
int keylength,
ByteOrder ordering,
int buffermax,
long fileAgeLimit,
long fileSizeLimit) |
Modifier and Type | Method and Description |
---|---|
private MapStore |
checkHeap(BEncodedHeap heap) |
void |
clear() |
void |
close()
most of the MapStore implementations are file-based, so we should consider a close method
|
boolean |
containsKey(java.lang.Object key) |
java.util.Map<java.lang.String,byte[]> |
get(java.lang.Object key) |
ByteOrder |
getOrdering()
the map should have an ordering on the key elements
|
private void |
init() |
boolean |
isEmpty() |
private MapStore |
keeperOf(byte[] key) |
CloneableIterator<byte[]> |
keyIterator()
the keys of the map should be iterable
|
static void |
main(java.lang.String[] args) |
private java.lang.String |
newFilename() |
private MapStore |
newHeap() |
java.util.Map<java.lang.String,byte[]> |
put(byte[] key,
java.util.Map<java.lang.String,byte[]> map) |
java.util.Map<java.lang.String,byte[]> |
remove(java.lang.Object key) |
int |
size() |
private static BEncodedHeapBag |
testHeapBag(java.io.File f) |
protected static java.util.Map<java.lang.String,byte[]> |
testMap(int i) |
containsValue, entrySet, iterator, keySet, map2String, putAll, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private java.util.Map<java.lang.String,BEncodedHeap> bag
private final java.io.File baseDir
private final java.lang.String prefix
private final int keylength
private final int buffermax
private final ByteOrder entryOrder
private java.lang.String current
private final long fileAgeLimit
private final long fileSizeLimit
public BEncodedHeapBag(java.io.File path, java.lang.String prefix, int keylength, ByteOrder ordering, int buffermax, long fileAgeLimit, long fileSizeLimit)
private void init()
public void close()
MapStore
public void clear()
clear
in interface java.util.Map<byte[],java.util.Map<java.lang.String,byte[]>>
private MapStore keeperOf(byte[] key)
private java.lang.String newFilename()
private MapStore newHeap()
private MapStore checkHeap(BEncodedHeap heap)
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<byte[],java.util.Map<java.lang.String,byte[]>>
public java.util.Map<java.lang.String,byte[]> put(byte[] key, java.util.Map<java.lang.String,byte[]> map)
put
in interface java.util.Map<byte[],java.util.Map<java.lang.String,byte[]>>
public java.util.Map<java.lang.String,byte[]> get(java.lang.Object key)
get
in interface java.util.Map<byte[],java.util.Map<java.lang.String,byte[]>>
public boolean isEmpty()
isEmpty
in interface java.util.Map<byte[],java.util.Map<java.lang.String,byte[]>>
public int size()
size
in interface java.util.Map<byte[],java.util.Map<java.lang.String,byte[]>>
public java.util.Map<java.lang.String,byte[]> remove(java.lang.Object key)
remove
in interface java.util.Map<byte[],java.util.Map<java.lang.String,byte[]>>
public ByteOrder getOrdering()
MapStore
getOrdering
in interface MapStore
public CloneableIterator<byte[]> keyIterator()
MapStore
keyIterator
in interface MapStore
protected static java.util.Map<java.lang.String,byte[]> testMap(int i)
private static BEncodedHeapBag testHeapBag(java.io.File f)
public static void main(java.lang.String[] args)