Package org.infinispan.container.impl
Class L1SegmentedDataContainer<K,V>
- java.lang.Object
-
- org.infinispan.container.impl.AbstractInternalDataContainer<K,V>
-
- org.infinispan.container.impl.DefaultSegmentedDataContainer<K,V>
-
- org.infinispan.container.impl.L1SegmentedDataContainer<K,V>
-
- All Implemented Interfaces:
Iterable<InternalCacheEntry<K,V>>
,DataContainer<K,V>
,InternalDataContainer<K,V>
public class L1SegmentedDataContainer<K,V> extends DefaultSegmentedDataContainer<K,V>
Segmented data container that also allows for non owned segments to be written to a temporary map (L1). This temporary map is cleared whenever a segment becomes no longer owned.If the segment is owned, only the owner segment is used. If the segment is not owned it will query the temporary map to see if the object is stored there.
- Since:
- 9.3
- Author:
- wburns
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.infinispan.container.impl.AbstractInternalDataContainer
AbstractInternalDataContainer.EntryIterator, AbstractInternalDataContainer.Values
-
Nested classes/interfaces inherited from interface org.infinispan.container.DataContainer
DataContainer.ComputeAction<K,V>
-
-
Field Summary
-
Fields inherited from class org.infinispan.container.impl.DefaultSegmentedDataContainer
maps, mapSupplier, shouldStopSegments
-
Fields inherited from class org.infinispan.container.impl.AbstractInternalDataContainer
activator, configuration, entryFactory, evictionManager, expirationManager, keyPartitioner, listeners, passivator, timeService
-
-
Constructor Summary
Constructors Constructor Description L1SegmentedDataContainer(Supplier<PeekableTouchableMap<K,InternalCacheEntry<K,V>>> mapSupplier, int numSegments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all entries in the containervoid
clear(org.infinispan.commons.util.IntSet segments)
Removes all entries that map to the given segmentsPeekableTouchableMap<K,InternalCacheEntry<K,V>>
getMapForSegment(int segment)
Iterator<InternalCacheEntry<K,V>>
iteratorIncludingExpired()
Same asDataContainer.iterator()
except that is also returns expired entries.Iterator<InternalCacheEntry<K,V>>
iteratorIncludingExpired(org.infinispan.commons.util.IntSet segments)
Same asDataContainer.iteratorIncludingExpired()
except that only entries that map to the provided segments are returned via the iterator.void
removeSegments(org.infinispan.commons.util.IntSet segments)
Removes and un-associates the given segments.Spliterator<InternalCacheEntry<K,V>>
spliteratorIncludingExpired()
Same asDataContainer.spliterator()
except that is also returns expired entries.Spliterator<InternalCacheEntry<K,V>>
spliteratorIncludingExpired(org.infinispan.commons.util.IntSet segments)
Same asDataContainer.spliteratorIncludingExpired()
except that only entries that map to the provided segments are returned via this spliterator.void
stop()
-
Methods inherited from class org.infinispan.container.impl.DefaultSegmentedDataContainer
addSegments, forEach, getSegmentForKey, iterator, iterator, sizeIncludingExpired, sizeIncludingExpired, spliterator, spliterator, start
-
Methods inherited from class org.infinispan.container.impl.AbstractInternalDataContainer
addRemovalListener, applyListener, compute, compute, computeEntryRemoved, computeEntryWritten, containsKey, containsKey, entrySet, evict, evict, expiredIterationPredicate, filterExpiredEntries, get, get, keySet, peek, peek, put, put, remove, remove, removeRemovalListener, touch, values
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.DataContainer
capacity, evictionSize, executeTask, executeTask, resize, size
-
Methods inherited from interface org.infinispan.container.impl.InternalDataContainer
size
-
-
-
-
Constructor Detail
-
L1SegmentedDataContainer
public L1SegmentedDataContainer(Supplier<PeekableTouchableMap<K,InternalCacheEntry<K,V>>> mapSupplier, int numSegments)
-
-
Method Detail
-
stop
public void stop()
- Overrides:
stop
in classDefaultSegmentedDataContainer<K,V>
-
getMapForSegment
public PeekableTouchableMap<K,InternalCacheEntry<K,V>> getMapForSegment(int segment)
- Overrides:
getMapForSegment
in classDefaultSegmentedDataContainer<K,V>
-
iteratorIncludingExpired
public Iterator<InternalCacheEntry<K,V>> iteratorIncludingExpired(org.infinispan.commons.util.IntSet segments)
Description copied from interface:InternalDataContainer
Same asDataContainer.iteratorIncludingExpired()
except that only entries that map to the provided segments are returned via the iterator. The iterator can return expired entries.- Specified by:
iteratorIncludingExpired
in interfaceInternalDataContainer<K,V>
- Overrides:
iteratorIncludingExpired
in classDefaultSegmentedDataContainer<K,V>
- Parameters:
segments
- segments of entries to use- Returns:
- iterator that returns all entries mapped to the given segments that could be expired
-
iteratorIncludingExpired
public Iterator<InternalCacheEntry<K,V>> iteratorIncludingExpired()
Description copied from interface:DataContainer
Same asDataContainer.iterator()
except that is also returns expired entries.- Specified by:
iteratorIncludingExpired
in interfaceDataContainer<K,V>
- Overrides:
iteratorIncludingExpired
in classDefaultSegmentedDataContainer<K,V>
- Returns:
- iterator that returns all entries including expired ones
-
spliteratorIncludingExpired
public Spliterator<InternalCacheEntry<K,V>> spliteratorIncludingExpired(org.infinispan.commons.util.IntSet segments)
Description copied from interface:InternalDataContainer
Same asDataContainer.spliteratorIncludingExpired()
except that only entries that map to the provided segments are returned via this spliterator. The spliterator will return expired entries as well.- Specified by:
spliteratorIncludingExpired
in interfaceInternalDataContainer<K,V>
- Overrides:
spliteratorIncludingExpired
in classDefaultSegmentedDataContainer<K,V>
- Parameters:
segments
- segments of entries to use- Returns:
- spliterator containing entries mapping to those segments that could be expired
-
spliteratorIncludingExpired
public Spliterator<InternalCacheEntry<K,V>> spliteratorIncludingExpired()
Description copied from interface:DataContainer
Same asDataContainer.spliterator()
except that is also returns expired entries.- Specified by:
spliteratorIncludingExpired
in interfaceDataContainer<K,V>
- Overrides:
spliteratorIncludingExpired
in classDefaultSegmentedDataContainer<K,V>
- Returns:
- spliterator that returns all entries including expired ones
-
clear
public void clear()
Description copied from interface:DataContainer
Removes all entries in the container- Specified by:
clear
in interfaceDataContainer<K,V>
- Overrides:
clear
in classDefaultSegmentedDataContainer<K,V>
-
clear
public void clear(org.infinispan.commons.util.IntSet segments)
Removes all entries that map to the given segments- Specified by:
clear
in interfaceInternalDataContainer<K,V>
- Overrides:
clear
in classAbstractInternalDataContainer<K,V>
- Parameters:
segments
- the segments to clear data for
-
removeSegments
public void removeSegments(org.infinispan.commons.util.IntSet segments)
Description copied from interface:InternalDataContainer
Removes and un-associates the given segments. This will notify any listeners registered viaInternalDataContainer.addRemovalListener(Consumer)
of entries that were removed due to no longer being associated with this container. There is no guarantee if the consumer is invoked once or multiple times for a given group of segments and could be in any order.When this method is invoked an implementation is free to remove any entries that don't map to segments currently associated with this container. Note that entries that were removed due to their segments never being associated with this container do not notify listeners registered via
InternalDataContainer.addRemovalListener(Consumer)
.- Specified by:
removeSegments
in interfaceInternalDataContainer<K,V>
- Overrides:
removeSegments
in classDefaultSegmentedDataContainer<K,V>
- Parameters:
segments
- segments that should no longer be associated with this container
-
-