|
GridGain 4.3.1e
Enterprise "Big Data" Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentSkipListMap<K,V>
org.gridgain.grid.lang.utils.GridBoundedConcurrentOrderedMap<K,V>
public class GridBoundedConcurrentOrderedMap<K,V>
Concurrent ordered map that automatically manages its maximum size.
Once it exceeds its maximum, it will start removing smallest elements
until the maximum is reached again. If optional listener is set
via GridBoundedConcurrentOrderedMap.evictionListener(GridInClosure2) method, then listener
will be notified for every eviction.
Note that due to concurrent nature of this map, it may grow slightly larger than its maximum allowed size, but in this case it will quickly readjust back to allowed size.
Note that GridBoundedConcurrentOrderedMap.remove(Object) and GridBoundedConcurrentOrderedMap.remove(Object, Object) methods
are not supported for this kind of map.
![]() |
![]() |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
GridBoundedConcurrentOrderedMap(int max)
Constructs a new, empty map that orders its elements according to their natural ordering. |
|
GridBoundedConcurrentOrderedMap(int max,
Comparator<? super K> comparator)
Constructs a new, empty set that orders its elements according to the specified comparator. |
|
GridBoundedConcurrentOrderedMap(int max,
Map<? extends K,? extends V> map)
Constructs a new map containing the elements in the specified map, that orders its elements according to their natural ordering. |
|
GridBoundedConcurrentOrderedMap(int max,
SortedMap<K,V> map)
Constructs a new map containing the same elements and using the same ordering as the specified sorted map. |
|
| Method Summary | |
|---|---|
GridBoundedConcurrentOrderedMap<K,V> |
clone()
|
GridInClosure2<K,V> |
evictionListener()
Gets closure listener to be called for every eviction event. |
void |
evictionListener(GridInClosure2<K,V> lsnr)
Sets closure listener to be called for every eviction event. |
V |
put(K k,
V v)
|
V |
putIfAbsent(K k,
V v)
|
V |
remove(Object o)
This method is not supported and always throws UnsupportedOperationException. |
boolean |
remove(Object key,
Object val)
This method is not supported and always throws UnsupportedOperationException. |
int |
size()
Approximate size at this point of time. |
| Methods inherited from class java.util.concurrent.ConcurrentSkipListMap |
|---|
ceilingEntry, ceilingKey, clear, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, equals, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, isEmpty, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, replace, replace, subMap, subMap, tailMap, tailMap, values |
| Methods inherited from class java.util.AbstractMap |
|---|
hashCode, putAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
hashCode, putAll |
| Constructor Detail |
|---|
public GridBoundedConcurrentOrderedMap(int max)
max - Upper bound of this map.
public GridBoundedConcurrentOrderedMap(int max,
Comparator<? super K> comparator)
max - Upper bound of this map.comparator - The comparator that will be used to order this map.
If null, the natural
ordering of the elements will be used.
public GridBoundedConcurrentOrderedMap(int max,
Map<? extends K,? extends V> map)
ClassCastException - if the elements in map are
not Comparable, or are not mutually comparable.
NullPointerException - if the specified map or any
of its elements are null.max - Upper bound of this map.map - The elements that will comprise the new map.
public GridBoundedConcurrentOrderedMap(int max,
SortedMap<K,V> map)
NullPointerException - if the specified sorted map or any
of its elements are null.max - Upper bound of this map.map - Sorted map whose elements will comprise the new map.| Method Detail |
|---|
public void evictionListener(GridInClosure2<K,V> lsnr)
lsnr - Closure to be called for every eviction event.public GridInClosure2<K,V> evictionListener()
@Nullable
public V put(K k,
V v)
put in interface Map<K,V>put in class ConcurrentSkipListMap<K,V>
@Nullable
public V putIfAbsent(K k,
V v)
putIfAbsent in interface ConcurrentMap<K,V>putIfAbsent in class ConcurrentSkipListMap<K,V>public int size()
size
methods on other concurrent collections, this method executes
in constant time without traversal of the elements.
size in interface Map<K,V>size in class ConcurrentSkipListMap<K,V>public GridBoundedConcurrentOrderedMap<K,V> clone()
clone in class ConcurrentSkipListMap<K,V>public V remove(Object o)
UnsupportedOperationException.
remove in interface Map<K,V>remove in class ConcurrentSkipListMap<K,V>o -
public boolean remove(Object key,
Object val)
UnsupportedOperationException.
remove in interface ConcurrentMap<K,V>remove in class ConcurrentSkipListMap<K,V>key - val -
|
GridGain 4.3.1e
Enterprise "Big Data" Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - In-Memory Big Data
|
|
|