Package org.infinispan.container.offheap
Class OffHeapConcurrentMap
- java.lang.Object
-
- org.infinispan.container.offheap.OffHeapConcurrentMap
-
- All Implemented Interfaces:
java.util.concurrent.ConcurrentMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>,java.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>,Lifecycle,PeekableMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
public class OffHeapConcurrentMap extends java.lang.Object implements java.util.concurrent.ConcurrentMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>, PeekableMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>, Lifecycle
- Since:
- 9.4
- Author:
- wburns
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOffHeapConcurrentMap.EntryListenerListener interface that is notified when certain operations occur for various memory addresses.
-
Constructor Summary
Constructors Constructor Description OffHeapConcurrentMap(int desiredSize, OffHeapMemoryAllocator allocator, OffHeapEntryFactory offHeapEntryFactory, OffHeapConcurrentMap.EntryListener listener)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
OffHeapConcurrentMap
public OffHeapConcurrentMap(int desiredSize, OffHeapMemoryAllocator allocator, OffHeapEntryFactory offHeapEntryFactory, OffHeapConcurrentMap.EntryListener listener)
-
-
Method Detail
-
getLocks
public StripedLock getLocks()
-
start
public void start()
Description copied from interface:LifecycleInvoked on component start
-
stop
public void stop()
Description copied from interface:LifecycleInvoked on component stop
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
compute
public InternalCacheEntry<WrappedBytes,WrappedBytes> compute(WrappedBytes key, java.util.function.BiFunction<? super WrappedBytes,? super InternalCacheEntry<WrappedBytes,WrappedBytes>,? extends InternalCacheEntry<WrappedBytes,WrappedBytes>> remappingFunction)
- Specified by:
computein interfacejava.util.concurrent.ConcurrentMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>- Specified by:
computein interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
get
public InternalCacheEntry<WrappedBytes,WrappedBytes> get(java.lang.Object key)
- Specified by:
getin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
peek
public InternalCacheEntry<WrappedBytes,WrappedBytes> peek(java.lang.Object key)
Description copied from interface:PeekableMapPeaks at a value for the given key. Note that this does not update any expiration or eviction information when this is performed on the map, unlike the get method.- Specified by:
peekin interfacePeekableMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>- Parameters:
key- The key to find the value for- Returns:
- The value mapping to this key
-
put
public InternalCacheEntry<WrappedBytes,WrappedBytes> put(WrappedBytes key, InternalCacheEntry<WrappedBytes,WrappedBytes> value)
- Specified by:
putin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
remove
public InternalCacheEntry<WrappedBytes,WrappedBytes> remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
putAll
public void putAll(java.util.Map<? extends WrappedBytes,? extends InternalCacheEntry<WrappedBytes,WrappedBytes>> m)
- Specified by:
putAllin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
putIfAbsent
public InternalCacheEntry<WrappedBytes,WrappedBytes> putIfAbsent(WrappedBytes key, InternalCacheEntry<WrappedBytes,WrappedBytes> value)
- Specified by:
putIfAbsentin interfacejava.util.concurrent.ConcurrentMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>- Specified by:
putIfAbsentin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
remove
public boolean remove(java.lang.Object key, java.lang.Object value)- Specified by:
removein interfacejava.util.concurrent.ConcurrentMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>- Specified by:
removein interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
replace
public boolean replace(WrappedBytes key, InternalCacheEntry<WrappedBytes,WrappedBytes> oldValue, InternalCacheEntry<WrappedBytes,WrappedBytes> newValue)
- Specified by:
replacein interfacejava.util.concurrent.ConcurrentMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>- Specified by:
replacein interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
replace
public InternalCacheEntry<WrappedBytes,WrappedBytes> replace(WrappedBytes key, InternalCacheEntry<WrappedBytes,WrappedBytes> value)
- Specified by:
replacein interfacejava.util.concurrent.ConcurrentMap<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>- Specified by:
replacein interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
keySet
public java.util.Set<WrappedBytes> keySet()
- Specified by:
keySetin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
values
public java.util.Collection<InternalCacheEntry<WrappedBytes,WrappedBytes>> values()
- Specified by:
valuesin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
entrySet
public java.util.Set<java.util.Map.Entry<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>> entrySet()
- Specified by:
entrySetin interfacejava.util.Map<WrappedBytes,InternalCacheEntry<WrappedBytes,WrappedBytes>>
-
-