Class OffHeapDataContainer

    • Constructor Detail

      • OffHeapDataContainer

        public OffHeapDataContainer​(int desiredSize)
    • Method Detail

      • getActualAddressCount

        public static int getActualAddressCount​(int desiredSize)
      • start

        public void start()
      • stop

        public void stop()
      • getSegmentForKey

        protected int getSegmentForKey​(java.lang.Object key)
        Specified by:
        getSegmentForKey in class org.infinispan.container.impl.AbstractInternalDataContainer<WrappedBytes,​WrappedBytes>
      • spliterator

        public java.util.Spliterator<InternalCacheEntry<WrappedBytes,​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 java.util.Spliterator<InternalCacheEntry<WrappedBytes,​WrappedBytes>> spliterator​(IntSet segments)
        Description copied from interface: org.infinispan.container.impl.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 java.util.Spliterator<InternalCacheEntry<WrappedBytes,​WrappedBytes>> spliteratorIncludingExpired​(IntSet segments)
        Description copied from interface: org.infinispan.container.impl.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 java.util.Iterator<InternalCacheEntry<WrappedBytes,​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 java.util.Iterator<InternalCacheEntry<WrappedBytes,​WrappedBytes>> iterator​(IntSet segments)
        Description copied from interface: org.infinispan.container.impl.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 java.util.Iterator<InternalCacheEntry<WrappedBytes,​WrappedBytes>> iteratorIncludingExpired​(IntSet segments)
        Description copied from interface: org.infinispan.container.impl.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​(IntSet segments)
        Description copied from interface: org.infinispan.container.impl.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​(IntSet segments)
        Description copied from interface: org.infinispan.container.impl.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