Interface CacheCollection<E>

Type Parameters:
E - The type of the collection
All Superinterfaces:
CloseableIteratorCollection<E>, Collection<E>, Iterable<E>
All Known Subinterfaces:
CacheSet<E>
All Known Implementing Classes:
AbstractCacheBackedSet, CacheBackedEntrySet, CacheBackedKeySet, CacheSetMapper, InternalCacheSet, SimpleCacheImpl.CacheEntrySet, SimpleCacheImpl.EntrySet, SimpleCacheImpl.EntrySetBase, SimpleCacheImpl.KeySet, SimpleCacheImpl.Values, WriteableCacheCollectionMapper, WriteableCacheSetMapper

public interface CacheCollection<E> extends CloseableIteratorCollection<E>
A collection type that returns special Cache based streams that have additional options to tweak behavior.
Since:
8.0
  • Method Details

    • stream

      CacheStream<E> stream()
      Description copied from interface: CloseableIteratorCollection

      This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly

      Specified by:
      stream in interface CloseableIteratorCollection<E>
      Specified by:
      stream in interface Collection<E>
    • parallelStream

      CacheStream<E> parallelStream()
      Description copied from interface: CloseableIteratorCollection

      This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly

      Specified by:
      parallelStream in interface CloseableIteratorCollection<E>
      Specified by:
      parallelStream in interface Collection<E>
    • localPublisher

      @Experimental default org.reactivestreams.Publisher<E> localPublisher(int segment)
      Returns a publisher that will publish all elements that map to the given segment. Note this publisher may require going remotely to retrieve elements depending on the underlying configuration and flags applied to the original Cache used to create this CacheCollection.
      Parameters:
      segment - the segment that all published elements belong to
      Returns:
      Publisher that will publish the elements for the given segment
    • localPublisher

      @Experimental default org.reactivestreams.Publisher<E> localPublisher(IntSet segments)
      Returns a publisher that will publish all elements that map to the given segment. Note this publisher may require going remotely to retrieve elements depending on the underlying configuration and flags applied to the original Cache used to create this CacheCollection.
      Parameters:
      segments - the segments that all published elements belong to
      Returns:
      Publisher that will publish the elements for the given segments