public class BlockDiskKeyStore<K> extends Object
Modifier and Type | Class and Description |
---|---|
class |
BlockDiskKeyStore.LRUMapCountLimited
Class for recycling and lru.
|
class |
BlockDiskKeyStore.LRUMapSizeLimited
Class for recycling and lru.
|
Modifier and Type | Field and Description |
---|---|
protected BlockDiskCache<K,?> |
blockDiskCache
we need this so we can communicate free blocks to the data store when
keys fall off the LRU
|
protected String |
logCacheName
The name to prefix log messages with.
|
Constructor and Description |
---|
BlockDiskKeyStore(BlockDiskCacheAttributes cacheAttributes,
BlockDiskCache<K,?> blockDiskCache)
Set the configuration options.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearMemoryMap()
This is mainly used for testing.
|
Set<Map.Entry<K,int[]>> |
entrySet()
Gets the entry set.
|
int[] |
get(K key)
gets the object for the key.
|
boolean |
isEmpty()
Tests emptiness (size == 0).
|
Set<K> |
keySet()
Gets the key set.
|
protected void |
loadKeys()
Loads the keys from the .key file.
|
void |
put(K key,
int[] value)
Puts a int[] in the keyStore.
|
int[] |
remove(K key)
Remove by key.
|
protected void |
reset()
Resets the file and creates a new key map.
|
protected void |
saveKeys()
Saves key file to disk.
|
int |
size()
Gets the size of the key hash.
|
protected final String logCacheName
protected final BlockDiskCache<K,?> blockDiskCache
public BlockDiskKeyStore(BlockDiskCacheAttributes cacheAttributes, BlockDiskCache<K,?> blockDiskCache)
cacheAttributes
- blockDiskCache
- used for freeingprotected void clearMemoryMap()
public boolean isEmpty()
protected void loadKeys()
public int[] remove(K key)
key
- protected void reset()
protected void saveKeys()
public int size()
Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.