public class BEncodedHeapShard extends AbstractMapStore implements MapStore
Modifier and Type | Class and Description |
---|---|
static class |
BEncodedHeapShard.B64ShardMethod |
static interface |
BEncodedHeapShard.Method |
Modifier and Type | Field and Description |
---|---|
private java.io.File |
baseDir |
private java.util.concurrent.ConcurrentHashMap<java.lang.String,MapStore> |
shard |
private BEncodedHeapShard.Method |
shardMethod |
Constructor and Description |
---|
BEncodedHeapShard(java.io.File baseDir,
BEncodedHeapShard.Method shardMethod) |
Modifier and Type | Method and Description |
---|---|
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) |
MapStore |
openBag(java.lang.String shardfile) |
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 BEncodedHeapShard |
testHeapShard(java.io.File f) |
containsValue, entrySet, iterator, keySet, map2String, putAll, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private java.util.concurrent.ConcurrentHashMap<java.lang.String,MapStore> shard
private final java.io.File baseDir
private final BEncodedHeapShard.Method shardMethod
public BEncodedHeapShard(java.io.File baseDir, BEncodedHeapShard.Method shardMethod)
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)
public MapStore openBag(java.lang.String shardfile)
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
private static BEncodedHeapShard testHeapShard(java.io.File f)
public static void main(java.lang.String[] args)