com.thimbleware.jmemcached.storage
Interface CacheStorage<K,V extends SizedItem>

All Superinterfaces:
java.util.concurrent.ConcurrentMap<K,V>, java.util.Map<K,V>
All Known Implementing Classes:
BlockStorageCacheStorage, ConcurrentLinkedHashMap

public interface CacheStorage<K,V extends SizedItem>
extends java.util.concurrent.ConcurrentMap<K,V>

The interface for cache storage. Essentially a concurrent map but with methods for investigating the heap state of the storage unit and with additional support for explicit resource-cleanup (close()).


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 int capacity()
           
 void close()
          Close the storage unit, deallocating any resources it might be currently holding.
 long getMemoryCapacity()
           
 long getMemoryUsed()
           
 
Methods inherited from interface java.util.concurrent.ConcurrentMap
putIfAbsent, remove, replace, replace
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

getMemoryCapacity

long getMemoryCapacity()
Returns:
the capacity (in bytes) of the storage

getMemoryUsed

long getMemoryUsed()
Returns:
the current usage (in bytes) of the storage

capacity

int capacity()
Returns:
the capacity (in # of items) of the storage

close

void close()
           throws java.io.IOException
Close the storage unit, deallocating any resources it might be currently holding.

Throws:
java.io.IOException - thrown if IO faults occur anywhere during close.


Copyright © 2008-2011 ThimbleWare. All Rights Reserved.