Class SegmentedBoundedOffHeapDataContainer

  • 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>
    Direct Known Subclasses:
    BoundedOffHeapDataContainer

    public class SegmentedBoundedOffHeapDataContainer
    extends AbstractDelegatingInternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
    Since:
    9.4
    Author:
    wburns
    • Constructor Detail

      • SegmentedBoundedOffHeapDataContainer

        public SegmentedBoundedOffHeapDataContainer​(int addressCount,
                                                    int numSegments,
                                                    long maxSize,
                                                    EvictionType type)
    • Method Detail

      • start

        public void start()
      • stop

        public void stop()
      • put

        public void put​(org.infinispan.commons.marshall.WrappedBytes key,
                        org.infinispan.commons.marshall.WrappedBytes value,
                        Metadata metadata)
        Description copied from interface: DataContainer
        Puts an entry in the cache along with metadata adding information such lifespan of entry, max idle time, version information...etc.

        The key must be activate by invoking ActivationManager.onUpdate(Object, boolean).

        Specified by:
        put in interface DataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Overrides:
        put in class AbstractDelegatingDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Parameters:
        key - key under which to store entry
        value - value to store
        metadata - metadata of the entry
      • put

        public void put​(int segment,
                        org.infinispan.commons.marshall.WrappedBytes key,
                        org.infinispan.commons.marshall.WrappedBytes value,
                        Metadata metadata,
                        long createdTimestamp,
                        long lastUseTimestamp)
        Description copied from interface: InternalDataContainer
        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.

        Note: The timestamps ignored if the entry already exists in the data container.

        Specified by:
        put in interface InternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Overrides:
        put in class AbstractDelegatingInternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Parameters:
        segment - segment for the key
        key - key under which to store entry
        value - value to store
        metadata - metadata of the entry
        createdTimestamp - creation timestamp, or -1 to use the current time
        lastUseTimestamp - last use timestamp, or -1 to use the current time
      • compute

        public InternalCacheEntry<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes> compute​(int segment,
                                                                                                                                           org.infinispan.commons.marshall.WrappedBytes key,
                                                                                                                                           DataContainer.ComputeAction<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes> action)
        Description copied from interface: InternalDataContainer
        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.
        Specified by:
        compute in interface InternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Overrides:
        compute in class AbstractDelegatingInternalDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Parameters:
        segment - segment for the key
        key - The key.
        action - The action that will compute the new value.
        Returns:
        The InternalCacheEntry associated to the key.
      • getSize

        public long getSize​(long address)
      • capacity

        public long capacity()
        Description copied from interface: DataContainer
        Returns the capacity of the underlying container. This is only supported if the container is bounded. An UnsupportedOperationException is thrown otherwise.
        Specified by:
        capacity in interface DataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Overrides:
        capacity in class AbstractDelegatingDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Returns:
      • evictionSize

        public long evictionSize()
        Description copied from interface: DataContainer
        Returns how large the eviction size is currently. This is only supported if the container is bounded. An UnsupportedOperationException is thrown otherwise. This value will always be lower than the value returned from DataContainer.capacity()
        Specified by:
        evictionSize in interface DataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Overrides:
        evictionSize in class AbstractDelegatingDataContainer<org.infinispan.commons.marshall.WrappedBytes,​org.infinispan.commons.marshall.WrappedBytes>
        Returns:
        how large the counted eviction is