Class BlockDiskKeyStore<K>
java.lang.Object
org.apache.commons.jcs3.auxiliary.disk.block.BlockDiskKeyStore<K>
This is responsible for storing the keys.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassClass for recycling and lru.classClass for recycling and lru.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final BlockDiskCache<K,?> we need this so we can communicate free blocks to the data store when keys fall off the LRUprotected final StringThe name to prefix log messages with.
- 
Constructor SummaryConstructorsConstructorDescriptionBlockDiskKeyStore(BlockDiskCacheAttributes cacheAttributes, BlockDiskCache<K, ?> blockDiskCache) Set the configuration options.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidThis is mainly used for testing.entrySet()Gets the entry set.int[]gets the object for the key.booleanisEmpty()Tests emptiness (size == 0).keySet()Gets the key set.protected voidloadKeys()Loads the keys from the .key file.voidPuts a int[] in the keyStore.int[]Remove by key.protected voidreset()Resets the file and creates a new key map.protected voidsaveKeys()Saves key file to disk.intsize()Gets the size of the key hash.
- 
Field Details- 
logCacheNameThe name to prefix log messages with.
- 
blockDiskCachewe need this so we can communicate free blocks to the data store when keys fall off the LRU
 
- 
- 
Constructor Details- 
BlockDiskKeyStorepublic BlockDiskKeyStore(BlockDiskCacheAttributes cacheAttributes, BlockDiskCache<K, ?> blockDiskCache) Set the configuration options.- Parameters:
- cacheAttributes-
- blockDiskCache- used for freeing
 
 
- 
- 
Method Details- 
clearMemoryMapThis is mainly used for testing. It leave the disk in tact, and just clears memory.
- 
entrySetGets the entry set.- Returns:
- entry set.
 
- 
getgets the object for the key.- Parameters:
- key-
- Returns:
- Object
 
- 
isEmptyTests emptiness (size == 0).- Returns:
- Whether or not this is empty.
- Since:
- 3.1
 
- 
keySetGets the key set.- Returns:
- key set.
 
- 
loadKeysLoads the keys from the .key file. The keys are stored individually on disk. They are added one by one to an LRUMap.
- 
putPuts a int[] in the keyStore.- Parameters:
- key-
- value-
 
- 
removeRemove by key.- Parameters:
- key-
- Returns:
- BlockDiskElementDescriptor if it was present, else null
 
- 
resetResets the file and creates a new key map.
- 
saveKeysSaves key file to disk. This gets the LRUMap entry set and write the entries out one by one after putting them in a wrapper.
- 
sizeGets the size of the key hash.- Returns:
- the number of keys.
 
 
-