Class OffHeapDataContainer

java.lang.Object
org.infinispan.container.impl.AbstractInternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>
org.infinispan.container.offheap.OffHeapDataContainer
All Implemented Interfaces:
Iterable<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>>, DataContainer<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>, InternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>

public class OffHeapDataContainer extends AbstractInternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>
Since:
9.4
Author:
wburns
  • Field Details

  • Constructor Details

    • OffHeapDataContainer

      public OffHeapDataContainer()
  • Method Details

    • start

      public void start()
    • stop

      public void stop()
    • getMapForSegment

      protected PeekableTouchableMap<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes> getMapForSegment(int segment)
      Specified by:
      getMapForSegment in class AbstractInternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>
    • getSegmentForKey

      protected int getSegmentForKey(Object key)
      Specified by:
      getSegmentForKey in class AbstractInternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>
    • spliterator

      public Spliterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> spliterator()
      Description copied from interface: DataContainer

      This spliterator only returns entries that are not expired, however it will not remove them while doing so.

      Returns:
      spliterator that doesn't produce expired entries
    • spliterator

      public Spliterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> spliterator(org.infinispan.commons.util.IntSet segments)
      Description copied from interface: InternalDataContainer
      Same as DataContainer.spliterator() except that only entries that map to the provided segments are returned via this spliterator. The spliterator will not return expired entries.
      Parameters:
      segments - segments of entries to return
      Returns:
      spliterator containing entries mapping to those segments that aren't expired
    • spliteratorIncludingExpired

      public Spliterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> spliteratorIncludingExpired()
      Description copied from interface: DataContainer
      Same as DataContainer.spliterator() except that is also returns expired entries.
      Returns:
      spliterator that returns all entries including expired ones
    • spliteratorIncludingExpired

      public Spliterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> spliteratorIncludingExpired(org.infinispan.commons.util.IntSet segments)
      Description copied from interface: InternalDataContainer
      Same as DataContainer.spliteratorIncludingExpired() except that only entries that map to the provided segments are returned via this spliterator. The spliterator will return expired entries as well.
      Parameters:
      segments - segments of entries to use
      Returns:
      spliterator containing entries mapping to those segments that could be expired
    • iterator

      public Iterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> iterator()
      Description copied from interface: DataContainer

      This iterator only returns entries that are not expired, however it will not remove them while doing so.

      Returns:
      iterator that doesn't produce expired entries
    • iterator

      public Iterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> iterator(org.infinispan.commons.util.IntSet segments)
      Description copied from interface: InternalDataContainer
      Same as DataContainer.iterator() except that only entries that map to the provided segments are returned via the iterator. The iterator will not return expired entries.
      Parameters:
      segments - segments of entries to use
      Returns:
      iterator that returns all entries mapped to the given segments
    • iteratorIncludingExpired

      public Iterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> iteratorIncludingExpired()
      Description copied from interface: DataContainer
      Same as DataContainer.iterator() except that is also returns expired entries.
      Returns:
      iterator that returns all entries including expired ones
    • iteratorIncludingExpired

      public Iterator<InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> iteratorIncludingExpired(org.infinispan.commons.util.IntSet segments)
      Description copied from interface: InternalDataContainer
      Same as DataContainer.iteratorIncludingExpired() except that only entries that map to the provided segments are returned via the iterator. The iterator can return expired entries.
      Parameters:
      segments - segments of entries to use
      Returns:
      iterator that returns all entries mapped to the given segments that could be expired
    • addSegments

      public void addSegments(org.infinispan.commons.util.IntSet segments)
      Description copied from interface: InternalDataContainer
      Sets what segments this data container should be using. Already associated segments are unaffected by this and takes a union of existing and new segments.
      Parameters:
      segments - segments to associate with this container
    • 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 via InternalDataContainer.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).

      Parameters:
      segments - segments that should no longer be associated with this container
    • sizeIncludingExpired

      public int sizeIncludingExpired()
      Returns:
      count of the number of entries in the container including expired entries
    • clear

      public void clear()
      Description copied from interface: DataContainer
      Removes all entries in the container
    • forEachSegment

      public void forEachSegment(ObjIntConsumer<PeekableTouchableMap<org.infinispan.commons.marshall.WrappedBytes,org.infinispan.commons.marshall.WrappedBytes>> segmentMapConsumer)
      Description copied from interface: InternalDataContainer
      Performs the given consumer for each map inside this container, once for each segment until all maps have been processed or the action throws an exception. Exceptions thrown by the action are relayed to the caller. The consumer will be provided with the segment as well that maps to the given segment.
      Parameters:
      segmentMapConsumer - The action to be performed for each element map