|
|||||||||
| Home >> All >> com >> opensymphony >> oscache >> base >> [ algorithm overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.opensymphony.oscache.base.algorithm
Class AbstractConcurrentReadCache

java.lang.Objectjava.util.AbstractMap
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, java.io.Serializable
- Direct Known Subclasses:
- FIFOCache, LRUCache, UnlimitedCache
- public abstract class AbstractConcurrentReadCache
- extends java.util.AbstractMap
- implements java.util.Map, java.lang.Cloneable, java.io.Serializable
- extends java.util.AbstractMap
A version of Hashtable that supports mostly-concurrent reading, but exclusive writing. Because reads are not limited to periods without writes, a concurrent reader policy is weaker than a classic reader/writer policy, but is generally faster and allows more concurrency. This class is a good choice especially for tables that are mainly created by one thread during the start-up phase of a program, and from then on, are mainly read (with perhaps occasional additions or removals) in many threads. If you also need concurrency among writes, consider instead using ConcurrentHashMap.
Successful retrievals using get(key) and containsKey(key) usually run without locking. Unsuccessful ones (i.e., when the key is not present) do involve brief synchronization (locking). Also, the size and isEmpty methods are always synchronized.
Because retrieval operations can ordinarily overlap with writing operations (i.e., put, remove, and their derivatives), retrievals can only be guaranteed to return the results of the most recently completed operations holding upon their onset. Retrieval operations may or may not return results reflecting in-progress writing operations. However, the retrieval operations do always return consistent results -- either those holding before any single modification or after it, but never a nonsense result. For aggregate operations such as putAll and clear, concurrent reads may reflect insertion or removal of only some entries. In those rare contexts in which you use a hash table to synchronize operations across threads (for example, to prevent reads until after clears), you should either encase operations in synchronized blocks, or instead use java.util.Hashtable.
This class also supports optional guaranteed
exclusive reads, simply by surrounding a call within a synchronized
block, as in
AbstractConcurrentReadCache t; ... Object v;
synchronized(t) { v = t.get(k); }
But this is not usually necessary in practice. For
example, it is generally inefficient to write:
AbstractConcurrentReadCache t; ... // Inefficient version
Object key; ...
Object value; ...
synchronized(t) {
if (!t.containsKey(key))
t.put(key, value);
// other code if not previously present
}
else {
// other code if it was previously present
}
}
Instead, just take advantage of the fact that put returns
null if the key was not previously present:
AbstractConcurrentReadCache t; ... // Use this instead
Object key; ...
Object value; ...
Object oldValue = t.put(key, value);
if (oldValue == null) {
// other code if not previously present
}
else {
// other code if it was previously present
}
Iterators and Enumerations (i.e., those returned by keySet().iterator(), entrySet().iterator(), values().iterator(), keys(), and elements()) return elements reflecting the state of the hash table at some point at or since the creation of the iterator/enumeration. They will return at most one instance of each element (via next()/nextElement()), but might or might not reflect puts and removes that have been processed since they were created. They do not throw ConcurrentModificationException. However, these iterators are designed to be used by only one thread at a time. Sharing an iterator across multiple threads may lead to unpredictable results if the table is being concurrently modified. Again, you can ensure interference-free iteration by enclosing the iteration in a synchronized block.
This class may be used as a direct replacement for any use of java.util.Hashtable that does not depend on readers being blocked during updates. Like Hashtable but unlike java.util.HashMap, this class does NOT allow null to be used as a key or value. This class is also typically faster than ConcurrentHashMap when there is usually only one thread updating the table, but possibly many retrieving values from it.
Implementation note: A slightly faster implementation of this class will be possible once planned Java Memory Model revisions are in place.
[ Introduction to this package. ]
| Nested Class Summary | |
protected static class |
AbstractConcurrentReadCache.Entry
AbstractConcurrentReadCache collision list entry. |
protected class |
AbstractConcurrentReadCache.HashIterator
|
protected class |
AbstractConcurrentReadCache.KeyIterator
|
protected class |
AbstractConcurrentReadCache.ValueIterator
|
| Nested classes inherited from class java.util.AbstractMap |
|
| Field Summary | |
protected java.lang.Boolean |
barrierLock
Lock used only for its memory effects. |
protected int |
count
The total number of mappings in the hash table. |
static int |
DEFAULT_INITIAL_CAPACITY
The default initial number of table slots for this table (32). |
static float |
DEFAULT_LOAD_FACTOR
The default load factor for this table. |
protected int |
DEFAULT_MAX_ENTRIES
Default cache capacity (number of entries). |
protected java.util.Set |
entrySet
|
protected java.util.HashMap |
groups
A HashMap containing the group information. |
protected java.util.Set |
keySet
|
protected java.lang.Object |
lastWrite
field written to only to guarantee lock ordering. |
protected float |
loadFactor
The load factor for the hash table. |
protected static org.apache.commons.logging.Log |
log
|
protected int |
maxEntries
Cache capacity (number of entries). |
private static int |
MAXIMUM_CAPACITY
The maximum capacity. |
protected boolean |
memoryCaching
Use memory cache or not. |
private static int |
MINIMUM_CAPACITY
The minimum capacity. |
protected static java.lang.String |
NULL
|
private boolean |
overflowPersistence
Use overflow persistence caching. |
protected com.opensymphony.oscache.base.persistence.PersistenceListener |
persistenceListener
Persistence listener. |
protected AbstractConcurrentReadCache.Entry[] |
table
The hash table data. |
protected int |
threshold
The table is rehashed when its size exceeds this threshold. |
protected int |
UNLIMITED
Max number of element in cache when considered unlimited. |
protected boolean |
unlimitedDiskCache
Use unlimited disk caching. |
protected java.util.Collection |
values
|
| Fields inherited from class java.util.AbstractMap |
|
| Constructor Summary | |
AbstractConcurrentReadCache()
Constructs a new, empty map with a default initial capacity and load factor. |
|
AbstractConcurrentReadCache(int initialCapacity)
Constructs a new, empty map with the specified initial capacity and default load factor. |
|
AbstractConcurrentReadCache(int initialCapacity,
float loadFactor)
Constructs a new, empty map with the specified initial capacity and the specified load factor. |
|
AbstractConcurrentReadCache(java.util.Map t)
Constructs a new map with the same mappings as the given map. |
|
| Method Summary | |
private void |
addGroupMappings(java.lang.String key,
java.util.Set newGroups,
boolean persist)
Add this cache key to the groups specified groups. |
int |
capacity()
Return the number of slots in this table. |
void |
clear()
Removes all mappings from this map. |
java.lang.Object |
clone()
Returns a shallow copy of this. |
boolean |
contains(java.lang.Object value)
Tests if some key maps into the specified value in this table. |
boolean |
containsKey(java.lang.Object key)
Tests if the specified object is a key in this table. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in this table. |
java.util.Set |
entrySet()
Returns a collection view of the mappings contained in this map. |
protected boolean |
findAndRemoveEntry(java.util.Map.Entry entry)
Helper method for entrySet remove. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this table. |
java.util.Set |
getGroup(java.lang.String groupName)
Returns a set of the cache keys that reside in a particular group. |
protected java.util.Set |
getGroupForReading(java.lang.String groupName)
Get ref to group. |
protected java.util.Map |
getGroupsForReading()
Get ref to groups. |
int |
getMaxEntries()
Retrieve the cache capacity (number of entries). |
com.opensymphony.oscache.base.persistence.PersistenceListener |
getPersistenceListener()
Get the persistence listener. |
protected AbstractConcurrentReadCache.Entry[] |
getTableForReading()
Get ref to table; the reference and the cells it accesses will be at least as fresh as from last use of barrierLock |
private static int |
hash(java.lang.Object x)
Return hash code for Object x. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
boolean |
isMemoryCaching()
Check if memory caching is used. |
boolean |
isOverflowPersistence()
Check if we use overflowPersistence |
boolean |
isUnlimitedDiskCache()
Check if we use unlimited disk cache. |
protected abstract void |
itemPut(java.lang.Object key)
Notify the underlying implementation that an item was put in the cache. |
protected abstract void |
itemRemoved(java.lang.Object key)
Notify the underlying implementation that an item was removed from the cache. |
protected abstract void |
itemRetrieved(java.lang.Object key)
Notify any underlying algorithm that an item has been retrieved from the cache. |
java.util.Enumeration |
keys()
Returns an enumeration of the keys in this table. |
java.util.Set |
keySet()
Returns a set view of the keys contained in this map. |
float |
loadFactor()
Return the load factor |
private int |
p2capacity(int initialCapacity)
Returns the appropriate capacity (power of two) for the specified initial capacity argument. |
protected void |
persistClear()
Removes the entire cache from persistent storage. |
protected void |
persistRemove(java.lang.Object key)
Remove an object from the persistence. |
protected void |
persistRemoveGroup(java.lang.String groupName)
Removes a cache group using the persistence listener. |
protected java.lang.Object |
persistRetrieve(java.lang.Object key)
Retrieve an object from the persistence listener. |
protected java.util.Set |
persistRetrieveGroup(java.lang.String groupName)
Retrieves a cache group using the persistence listener. |
protected void |
persistStore(java.lang.Object key,
java.lang.Object obj)
Store an object in the cache using the persistence listener. |
protected void |
persistStoreGroup(java.lang.String groupName,
java.util.Set group)
Creates or Updates a cache group using the persistence listener. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
OpenSymphony BEGIN |
private java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
boolean persist)
|
void |
putAll(java.util.Map t)
Copies all of the mappings from the specified map to this one. |
private void |
readObject(java.io.ObjectInputStream s)
Reconstitute the AbstractConcurrentReadCache. |
protected void |
recordModification(java.lang.Object x)
Force a memory synchronization that will cause all readers to see table. |
protected void |
rehash()
Rehashes the contents of this map into a new table with a larger capacity. |
java.lang.Object |
remove(java.lang.Object key)
OpenSymphony BEGIN |
private java.lang.Object |
remove(java.lang.Object key,
boolean invokeAlgorithm)
|
private void |
removeGroupMappings(java.lang.String key,
java.util.Set oldGroups,
boolean persist)
Remove this CacheEntry from the groups it no longer belongs to. |
protected abstract java.lang.Object |
removeItem()
The cache has reached its cacpacity and an item needs to be removed. |
void |
setMaxEntries(int newLimit)
Set the cache capacity |
void |
setMemoryCaching(boolean memoryCaching)
Sets the memory caching flag. |
void |
setOverflowPersistence(boolean overflowPersistence)
Sets the overflowPersistence flag |
void |
setPersistenceListener(com.opensymphony.oscache.base.persistence.PersistenceListener listener)
Set the persistence listener to use. |
void |
setUnlimitedDiskCache(boolean unlimitedDiskCache)
Sets the unlimited disk caching flag. |
int |
size()
Returns the total number of cache entries held in this map. |
protected java.lang.Object |
sput(java.lang.Object key,
java.lang.Object value,
int hash,
boolean persist)
OpenSymphony BEGIN |
protected java.lang.Object |
sremove(java.lang.Object key,
int hash,
boolean invokeAlgorithm)
OpenSymphony BEGIN |
private void |
updateGroups(com.opensymphony.oscache.base.CacheEntry oldValue,
com.opensymphony.oscache.base.CacheEntry newValue,
boolean persist)
Updates the groups to reflect the differences between the old and new cache entries. |
private void |
updateGroups(java.lang.Object oldValue,
java.lang.Object newValue,
boolean persist)
Updates the groups to reflect the differences between the old and new cache entries. |
java.util.Collection |
values()
Returns a collection view of the values contained in this map. |
private void |
writeObject(java.io.ObjectOutputStream s)
Save the state of the AbstractConcurrentReadCache instance to a stream. |
| Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
| Field Detail |
DEFAULT_INITIAL_CAPACITY
public static int DEFAULT_INITIAL_CAPACITY
- The default initial number of table slots for this table (32).
Used when not otherwise specified in constructor.
MINIMUM_CAPACITY
private static final int MINIMUM_CAPACITY
- The minimum capacity.
Used if a lower value is implicitly specified
by either of the constructors with arguments.
MUST be a power of two.
- See Also:
- Constant Field Values
MAXIMUM_CAPACITY
private static final int MAXIMUM_CAPACITY
- The maximum capacity.
Used if a higher value is implicitly specified
by either of the constructors with arguments.
MUST be a power of two <= 1<<30.
- See Also:
- Constant Field Values
DEFAULT_LOAD_FACTOR
public static final float DEFAULT_LOAD_FACTOR
- The default load factor for this table.
Used when not otherwise specified in constructor, the default is 0.75f.
- See Also:
- Constant Field Values
NULL
protected static final java.lang.String NULL
- See Also:
- Constant Field Values
log
protected static org.apache.commons.logging.Log log
barrierLock
protected final java.lang.Boolean barrierLock
- Lock used only for its memory effects. We use a Boolean
because it is serializable, and we create a new one because
we need a unique object for each cache instance.
lastWrite
protected transient java.lang.Object lastWrite
- field written to only to guarantee lock ordering.
table
protected transient AbstractConcurrentReadCache.Entry[] table
- The hash table data.
count
protected transient int count
- The total number of mappings in the hash table.
persistenceListener
protected com.opensymphony.oscache.base.persistence.PersistenceListener persistenceListener
- Persistence listener.
memoryCaching
protected boolean memoryCaching
- Use memory cache or not.
unlimitedDiskCache
protected boolean unlimitedDiskCache
- Use unlimited disk caching.
loadFactor
protected float loadFactor
- The load factor for the hash table.
DEFAULT_MAX_ENTRIES
protected final int DEFAULT_MAX_ENTRIES
- Default cache capacity (number of entries).
- See Also:
- Constant Field Values
UNLIMITED
protected final int UNLIMITED
- Max number of element in cache when considered unlimited.
- See Also:
- Constant Field Values
values
protected transient java.util.Collection values
groups
protected java.util.HashMap groups
- A HashMap containing the group information.
Each entry uses the group name as the key, and holds a
Setof containing keys of all the cache entries that belong to that particular group.
entrySet
protected transient java.util.Set entrySet
keySet
protected transient java.util.Set keySet
maxEntries
protected int maxEntries
- Cache capacity (number of entries).
threshold
protected int threshold
- The table is rehashed when its size exceeds this threshold.
(The value of this field is always (int)(capacity * loadFactor).)
overflowPersistence
private boolean overflowPersistence
- Use overflow persistence caching.
| Constructor Detail |
AbstractConcurrentReadCache
public AbstractConcurrentReadCache(int initialCapacity,
float loadFactor)
- Constructs a new, empty map with the specified initial capacity and the specified load factor.
AbstractConcurrentReadCache
public AbstractConcurrentReadCache(int initialCapacity)
- Constructs a new, empty map with the specified initial capacity and default load factor.
AbstractConcurrentReadCache
public AbstractConcurrentReadCache()
- Constructs a new, empty map with a default initial capacity and load factor.
AbstractConcurrentReadCache
public AbstractConcurrentReadCache(java.util.Map t)
- Constructs a new map with the same mappings as the given map.
The map is created with a capacity of twice the number of mappings in
the given map or 11 (whichever is greater), and a default load factor.
| Method Detail |
isEmpty
public boolean isEmpty()
- Returns true if this map contains no key-value mappings.
- Specified by:
isEmptyin interfacejava.util.Map
getGroup
public java.util.Set getGroup(java.lang.String groupName)
- Returns a set of the cache keys that reside in a particular group.
setMaxEntries
public void setMaxEntries(int newLimit)
- Set the cache capacity
getMaxEntries
public int getMaxEntries()
- Retrieve the cache capacity (number of entries).
setMemoryCaching
public void setMemoryCaching(boolean memoryCaching)
- Sets the memory caching flag.
isMemoryCaching
public boolean isMemoryCaching()
- Check if memory caching is used.
setPersistenceListener
public void setPersistenceListener(com.opensymphony.oscache.base.persistence.PersistenceListener listener)
- Set the persistence listener to use.
getPersistenceListener
public com.opensymphony.oscache.base.persistence.PersistenceListener getPersistenceListener()
- Get the persistence listener.
setUnlimitedDiskCache
public void setUnlimitedDiskCache(boolean unlimitedDiskCache)
- Sets the unlimited disk caching flag.
isUnlimitedDiskCache
public boolean isUnlimitedDiskCache()
- Check if we use unlimited disk cache.
isOverflowPersistence
public boolean isOverflowPersistence()
- Check if we use overflowPersistence
setOverflowPersistence
public void setOverflowPersistence(boolean overflowPersistence)
- Sets the overflowPersistence flag
capacity
public int capacity()
- Return the number of slots in this table.
clear
public void clear()
- Removes all mappings from this map.
- Specified by:
clearin interfacejava.util.Map
clone
public java.lang.Object clone()
- Returns a shallow copy of this.
AbstractConcurrentReadCache instance: the keys and
values themselves are not cloned.
contains
public boolean contains(java.lang.Object value)
- Tests if some key maps into the specified value in this table.
This operation is more expensive than the
containsKeymethod.Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework).
containsKey
public boolean containsKey(java.lang.Object key)
- Tests if the specified object is a key in this table.
- Specified by:
containsKeyin interfacejava.util.Map
containsValue
public boolean containsValue(java.lang.Object value)
- Returns true if this map maps one or more keys to the
specified value. Note: This method requires a full internal
traversal of the hash table, and so is much slower than
method containsKey.
- Specified by:
containsValuein interfacejava.util.Map
elements
public java.util.Enumeration elements()
- Returns an enumeration of the values in this table.
Use the Enumeration methods on the returned object to fetch the elements
sequentially.
entrySet
public java.util.Set entrySet()
- Returns a collection view of the mappings contained in this map.
Each element in the returned collection is a Map.Entry. The
collection is backed by the map, so changes to the map are reflected in
the collection, and vice-versa. The collection supports element
removal, which removes the corresponding mapping from the map, via the
Iterator.remove, Collection.remove,
removeAll, retainAll, and clear operations.
It does not support the add or addAll operations.
- Specified by:
entrySetin interfacejava.util.Map
get
public java.lang.Object get(java.lang.Object key)
- Returns the value to which the specified key is mapped in this table.
- Specified by:
getin interfacejava.util.Map
keySet
public java.util.Set keySet()
- Returns a set view of the keys contained in this map.
The set is backed by the map, so changes to the map are reflected in the set, and
vice-versa. The set supports element removal, which removes the
corresponding mapping from this map, via the Iterator.remove,
Set.remove, removeAll, retainAll, and
clear operations. It does not support the add or
addAll operations.
- Specified by:
keySetin interfacejava.util.Map
keys
public java.util.Enumeration keys()
- Returns an enumeration of the keys in this table.
loadFactor
public float loadFactor()
- Return the load factor
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
- OpenSymphony BEGIN
- Specified by:
putin interfacejava.util.Map
putAll
public void putAll(java.util.Map t)
- Copies all of the mappings from the specified map to this one.
These mappings replace any mappings that this map had for any of the
keys currently in the specified Map.
- Specified by:
putAllin interfacejava.util.Map
remove
public java.lang.Object remove(java.lang.Object key)
- OpenSymphony BEGIN
- Specified by:
removein interfacejava.util.Map
size
public int size()
- Returns the total number of cache entries held in this map.
- Specified by:
sizein interfacejava.util.Map
values
public java.util.Collection values()
- Returns a collection view of the values contained in this map.
The collection is backed by the map, so changes to the map are reflected in
the collection, and vice-versa. The collection supports element
removal, which removes the corresponding mapping from this map, via the
Iterator.remove, Collection.remove,
removeAll, retainAll, and clear operations.
It does not support the add or addAll operations.
- Specified by:
valuesin interfacejava.util.Map
getGroupForReading
protected final java.util.Set getGroupForReading(java.lang.String groupName)
- Get ref to group.
CACHE-127 Synchronized copying of the group entry set since
the new HashSet(Collection c) constructor uses the iterator.
This may slow things down but it is better than a
ConcurrentModificationException. We might have to revisit the
code if performance is too adversely impacted.
getGroupsForReading
protected final java.util.Map getGroupsForReading()
- Get ref to groups.
The reference and the cells it
accesses will be at least as fresh as from last
use of barrierLock
getTableForReading
protected final AbstractConcurrentReadCache.Entry[] getTableForReading()
- Get ref to table; the reference and the cells it
accesses will be at least as fresh as from last
use of barrierLock
recordModification
protected final void recordModification(java.lang.Object x)
- Force a memory synchronization that will cause
all readers to see table. Call only when already
holding main synch lock.
findAndRemoveEntry
protected boolean findAndRemoveEntry(java.util.Map.Entry entry)
- Helper method for entrySet remove.
persistRemove
protected void persistRemove(java.lang.Object key)
- Remove an object from the persistence.
persistRemoveGroup
protected void persistRemoveGroup(java.lang.String groupName)
- Removes a cache group using the persistence listener.
persistRetrieve
protected java.lang.Object persistRetrieve(java.lang.Object key)
- Retrieve an object from the persistence listener.
persistRetrieveGroup
protected java.util.Set persistRetrieveGroup(java.lang.String groupName)
- Retrieves a cache group using the persistence listener.
persistStore
protected void persistStore(java.lang.Object key, java.lang.Object obj)
- Store an object in the cache using the persistence listener.
persistStoreGroup
protected void persistStoreGroup(java.lang.String groupName, java.util.Set group)
- Creates or Updates a cache group using the persistence listener.
persistClear
protected void persistClear()
- Removes the entire cache from persistent storage.
itemPut
protected abstract void itemPut(java.lang.Object key)
- Notify the underlying implementation that an item was put in the cache.
itemRetrieved
protected abstract void itemRetrieved(java.lang.Object key)
- Notify any underlying algorithm that an item has been retrieved from the cache.
itemRemoved
protected abstract void itemRemoved(java.lang.Object key)
- Notify the underlying implementation that an item was removed from the cache.
removeItem
protected abstract java.lang.Object removeItem()
- The cache has reached its cacpacity and an item needs to be removed.
(typically according to an algorithm such as LRU or FIFO).
readObject
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, java.lang.ClassNotFoundException
- Reconstitute the AbstractConcurrentReadCache.
instance from a stream (i.e.,
deserialize it).
rehash
protected void rehash()
- Rehashes the contents of this map into a new table with a larger capacity.
This method is called automatically when the
number of keys in this map exceeds its capacity and load factor.
sput
protected java.lang.Object sput(java.lang.Object key, java.lang.Object value, int hash, boolean persist)
- OpenSymphony BEGIN
sremove
protected java.lang.Object sremove(java.lang.Object key, int hash, boolean invokeAlgorithm)
- OpenSymphony BEGIN
writeObject
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
- Save the state of the AbstractConcurrentReadCache instance to a stream.
(i.e., serialize it).
hash
private static int hash(java.lang.Object x)
- Return hash code for Object x.
Since we are using power-of-two
tables, it is worth the effort to improve hashcode via
the same multiplicative scheme as used in IdentityHashMap.
addGroupMappings
private void addGroupMappings(java.lang.String key, java.util.Set newGroups, boolean persist)
- Add this cache key to the groups specified groups.
We have to treat the
memory and disk group mappings seperately so they remain valid for their
corresponding memory/disk caches. (eg if mem is limited to 100 entries
and disk is unlimited, the group mappings will be different).
p2capacity
private int p2capacity(int initialCapacity)
- Returns the appropriate capacity (power of two) for the specified
initial capacity argument.
put
private java.lang.Object put(java.lang.Object key, java.lang.Object value, boolean persist)
remove
private java.lang.Object remove(java.lang.Object key, boolean invokeAlgorithm)
removeGroupMappings
private void removeGroupMappings(java.lang.String key, java.util.Set oldGroups, boolean persist)
- Remove this CacheEntry from the groups it no longer belongs to.
We have to treat the memory and disk group mappings seperately so they remain
valid for their corresponding memory/disk caches. (eg if mem is limited
to 100 entries and disk is unlimited, the group mappings will be
different).
updateGroups
private void updateGroups(java.lang.Object oldValue, java.lang.Object newValue, boolean persist)
- Updates the groups to reflect the differences between the old and new
cache entries. Either of the old or new values can be
nullor contain anullgroup list, in which case the entry's groups will all be added or removed respectively.
updateGroups
private void updateGroups(com.opensymphony.oscache.base.CacheEntry oldValue, com.opensymphony.oscache.base.CacheEntry newValue, boolean persist)
- Updates the groups to reflect the differences between the old and new cache entries.
Either of the old or new values can be
nullor contain anullgroup list, in which case the entry's groups will all be added or removed respectively.
|
|||||||||
| Home >> All >> com >> opensymphony >> oscache >> base >> [ algorithm overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC