Interface Region

All Known Subinterfaces:
CollectionRegion, EntityRegion, GeneralDataRegion, QueryResultsRegion, TimestampsRegion, TransactionalDataRegion
All Known Implementing Classes:
BaseGeneralDataRegionAdapter, BaseRegionAdapter, BaseTransactionalDataRegionAdapter, CollectionRegionAdapter, EntityRegionAdapter, QueryResultsRegionAdapter, TimestampsRegionAdapter

public interface Region
Defines a contract for accessing a particular named region within the underlying cache implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determine whether this region contains data for the given key.
    void
    The "end state" contract of the region's lifecycle.
    long
    The count of entries currently contained in the regions in-memory store.
    long
    The count of entries currently contained in the regions disk store.
    Retrieve the name of this region.
    long
    The number of bytes is this cache region currently consuming in memory.
    int
     
    long
     
    Get the contents of this region as a map.
  • Method Details

    • getName

      String getName()
      Retrieve the name of this region.
      Returns:
      The region name
    • destroy

      void destroy() throws CacheException
      The "end state" contract of the region's lifecycle. Called during SessionFactory.close() to give the region a chance to cleanup.
      Throws:
      CacheException - Indicates problem shutting down
    • contains

      boolean contains(Object key)
      Determine whether this region contains data for the given key.

      The semantic here is whether the cache contains data visible for the current call context. This should be viewed as a "best effort", meaning blocking should be avoid if possible.

      Parameters:
      key - The cache key
      Returns:
      True if the underlying cache contains corresponding data; false otherwise.
    • getSizeInMemory

      long getSizeInMemory()
      The number of bytes is this cache region currently consuming in memory.
      Returns:
      The number of bytes consumed by this region; -1 if unknown or unsupported.
    • getElementCountInMemory

      long getElementCountInMemory()
      The count of entries currently contained in the regions in-memory store.
      Returns:
      The count of entries in memory; -1 if unknown or unsupported.
    • getElementCountOnDisk

      long getElementCountOnDisk()
      The count of entries currently contained in the regions disk store.
      Returns:
      The count of entries on disk; -1 if unknown or unsupported.
    • toMap

      Map toMap()
      Get the contents of this region as a map.

      Implementors which do not support this notion should simply return an empty map.

      Returns:
      The content map.
    • nextTimestamp

      long nextTimestamp()
    • getTimeout

      int getTimeout()