public class SegmentedBoundedOffHeapDataContainer extends AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>
DataContainer.ComputeAction<K,V>| Modifier and Type | Field and Description |
|---|---|
protected OffHeapMemoryAllocator |
allocator |
protected long |
currentSize |
protected DefaultSegmentedDataContainer |
dataContainer |
protected EvictionManager |
evictionManager |
protected long |
firstAddress |
protected long |
lastAddress |
protected Lock |
lruLock |
protected long |
maxSize |
protected int |
numSegments |
protected OffHeapEntryFactory |
offHeapEntryFactory |
protected DataOperationOrderer |
orderer |
protected ComponentRef<PassivationManager> |
passivator |
protected boolean |
useCount |
| Constructor and Description |
|---|
SegmentedBoundedOffHeapDataContainer(int numSegments,
long maxSize,
EvictionType type) |
| Modifier and Type | Method and Description |
|---|---|
long |
capacity()
Returns the capacity of the underlying container.
|
InternalCacheEntry<WrappedBytes,WrappedBytes> |
compute(int segment,
WrappedBytes key,
DataContainer.ComputeAction<WrappedBytes,WrappedBytes> action)
Same as
DataContainer.compute(Object, ComputeAction) except that the segment of the key can provided to
update entries without calculating the segment for the given key. |
InternalCacheEntry<WrappedBytes,WrappedBytes> |
compute(WrappedBytes key,
DataContainer.ComputeAction<WrappedBytes,WrappedBytes> action)
Computes the new value for the key.
|
protected InternalDataContainer<WrappedBytes,WrappedBytes> |
delegate() |
long |
evictionSize()
Returns how large the eviction size is currently.
|
protected OffHeapConcurrentMap |
getMapThatContainsKey(byte[] key) |
long |
getSize(long address) |
void |
put(int segment,
WrappedBytes key,
WrappedBytes value,
Metadata metadata,
PrivateMetadata internalMetadata,
long createdTimestamp,
long lastUseTimestamp)
Same as
DataContainer.put(Object, Object, Metadata) except that the segment of the key can provided to
write/lookup entries without calculating the segment for the given key. |
void |
put(WrappedBytes key,
WrappedBytes value,
Metadata metadata)
Puts an entry in the cache along with metadata adding information such lifespan of entry, max idle time, version
information...etc.
|
void |
start() |
void |
stop() |
addRemovalListener, addSegments, clear, clear, containsKey, containsKey, evict, evict, forEach, forEach, get, get, iterator, iterator, iteratorIncludingExpired, iteratorIncludingExpired, peek, peek, remove, remove, removeRemovalListener, removeSegments, resize, size, size, sizeIncludingExpired, sizeIncludingExpired, spliterator, spliterator, spliteratorIncludingExpired, spliteratorIncludingExpired, touchclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcleanUp, publisherprotected OffHeapMemoryAllocator allocator
protected OffHeapEntryFactory offHeapEntryFactory
protected EvictionManager evictionManager
protected ComponentRef<PassivationManager> passivator
protected DataOperationOrderer orderer
protected final long maxSize
protected final Lock lruLock
protected final boolean useCount
protected final int numSegments
protected volatile long currentSize
protected long firstAddress
protected long lastAddress
protected DefaultSegmentedDataContainer dataContainer
public SegmentedBoundedOffHeapDataContainer(int numSegments,
long maxSize,
EvictionType type)
public void start()
public void stop()
protected InternalDataContainer<WrappedBytes,WrappedBytes> delegate()
delegate in class AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>public void put(WrappedBytes key, WrappedBytes value, Metadata metadata)
DataContainerkey must be activate by invoking ActivationManager.activateAsync(Object, int)
boolean)}.put in interface DataContainer<WrappedBytes,WrappedBytes>put in class AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>key - key under which to store entryvalue - value to storemetadata - metadata of the entrypublic void put(int segment,
WrappedBytes key,
WrappedBytes value,
Metadata metadata,
PrivateMetadata internalMetadata,
long createdTimestamp,
long lastUseTimestamp)
InternalDataContainerDataContainer.put(Object, Object, Metadata) except that the segment of the key can provided to
write/lookup entries without calculating the segment for the given key.
Note: The timestamps ignored if the entry already exists in the data container.
put in interface InternalDataContainer<WrappedBytes,WrappedBytes>put in class AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>segment - segment for the keykey - key under which to store entryvalue - value to storemetadata - metadata of the entrycreatedTimestamp - creation timestamp, or -1 to use the current timelastUseTimestamp - last use timestamp, or -1 to use the current timepublic InternalCacheEntry<WrappedBytes,WrappedBytes> compute(WrappedBytes key, DataContainer.ComputeAction<WrappedBytes,WrappedBytes> action)
DataContainerDataContainer.ComputeAction.compute(Object,
org.infinispan.container.entries.InternalCacheEntry, InternalEntryFactory).
The key must be activated by invoking ActivationManager.activateAsync(Object, int).
Note the entry provided to DataContainer.ComputeAction may be expired as these
entries are not filtered as many other methods do.
compute in interface DataContainer<WrappedBytes,WrappedBytes>compute in class AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>key - The key.action - The action that will compute the new value.InternalCacheEntry associated to the key.public InternalCacheEntry<WrappedBytes,WrappedBytes> compute(int segment, WrappedBytes key, DataContainer.ComputeAction<WrappedBytes,WrappedBytes> action)
InternalDataContainerDataContainer.compute(Object, ComputeAction) except that the segment of the key can provided to
update entries without calculating the segment for the given key.compute in interface InternalDataContainer<WrappedBytes,WrappedBytes>compute in class AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>segment - segment for the keykey - The key.action - The action that will compute the new value.InternalCacheEntry associated to the key.protected OffHeapConcurrentMap getMapThatContainsKey(byte[] key)
public long getSize(long address)
public long capacity()
DataContainerUnsupportedOperationException is thrown
otherwise.capacity in interface DataContainer<WrappedBytes,WrappedBytes>capacity in class AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>public long evictionSize()
DataContainerUnsupportedOperationException is thrown otherwise. This value will always be lower than the value returned
from DataContainer.capacity()evictionSize in interface DataContainer<WrappedBytes,WrappedBytes>evictionSize in class AbstractDelegatingInternalDataContainer<WrappedBytes,WrappedBytes>Copyright © 2022 JBoss by Red Hat. All rights reserved.