Class BooleanHalfStorageEngine

java.lang.Object
org.terracotta.offheapstore.storage.BooleanHalfStorageEngine
All Implemented Interfaces:
HalfStorageEngine<Boolean>

public final class BooleanHalfStorageEngine extends Object implements HalfStorageEngine<Boolean>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(StorageEngine.Owner owner, long mask)
     
    void
    Called to indicate that all keys and values are now free.
    void
     
    boolean
    equals(Object object, int encoding)
    Called to determine the equality of the given Java object value against the given encoded form.
    void
    free(int encoding)
    Called to indicate that the associated encoded value is no longer needed.
    long
    Returns a measure of the amount of memory allocated for this storage engine.
    long
    Returns a measure of the total size of the keys and values stored in this storage engine.
    long
    Returns a measure of the amount of memory consumed by this storage engine.
    long
    Returns a measure of the amount of vital memory allocated for this storage engine.
    void
    Invalidate any local key/value caches.
    read(int encoding)
    Converts the supplied encoded value into its correct object form.
    boolean
     
    write(Boolean object, int hash)
    Converts the supplied value object into it's encoded form.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BooleanHalfStorageEngine

      private BooleanHalfStorageEngine()
  • Method Details

    • write

      public Integer write(Boolean object, int hash)
      Description copied from interface: HalfStorageEngine
      Converts the supplied value object into it's encoded form.
      Specified by:
      write in interface HalfStorageEngine<Boolean>
      Parameters:
      object - a value object
      hash - the keys hash
      Returns:
      encoded value
    • free

      public void free(int encoding)
      Description copied from interface: HalfStorageEngine
      Called to indicate that the associated encoded value is no longer needed.

      This call can be used to free any associated resources tied to the lifecycle of the supplied encoded value.

      Specified by:
      free in interface HalfStorageEngine<Boolean>
      Parameters:
      encoding - encoded value
    • read

      public Boolean read(int encoding)
      Description copied from interface: HalfStorageEngine
      Converts the supplied encoded value into its correct object form.
      Specified by:
      read in interface HalfStorageEngine<Boolean>
      Parameters:
      encoding - encoded value
      Returns:
      a decoded value object
    • equals

      public boolean equals(Object object, int encoding)
      Description copied from interface: HalfStorageEngine
      Called to determine the equality of the given Java object value against the given encoded form.

      Simple implementations will probably perform a decode on the given encoded form in order to do a regular Object.equals(Object) comparison. This method is provided to allow implementations to optimize this comparison if possible.

      Specified by:
      equals in interface HalfStorageEngine<Boolean>
      Parameters:
      object - a value object
      encoding - encoded value
      Returns:
      true if the value and the encoding are equal
    • clear

      public void clear()
      Description copied from interface: HalfStorageEngine
      Called to indicate that all keys and values are now free.
      Specified by:
      clear in interface HalfStorageEngine<Boolean>
    • getAllocatedMemory

      public long getAllocatedMemory()
      Description copied from interface: HalfStorageEngine
      Returns a measure of the amount of memory allocated for this storage engine.
      Specified by:
      getAllocatedMemory in interface HalfStorageEngine<Boolean>
      Returns:
      memory allocated for this engine in bytes
    • getOccupiedMemory

      public long getOccupiedMemory()
      Description copied from interface: HalfStorageEngine
      Returns a measure of the amount of memory consumed by this storage engine.
      Specified by:
      getOccupiedMemory in interface HalfStorageEngine<Boolean>
      Returns:
      memory occupied by this engine in bytes
    • getVitalMemory

      public long getVitalMemory()
      Description copied from interface: HalfStorageEngine
      Returns a measure of the amount of vital memory allocated for this storage engine.
      Specified by:
      getVitalMemory in interface HalfStorageEngine<Boolean>
      Returns:
      vital memory allocated for this engine in bytes
    • getDataSize

      public long getDataSize()
      Description copied from interface: HalfStorageEngine
      Returns a measure of the total size of the keys and values stored in this storage engine.
      Specified by:
      getDataSize in interface HalfStorageEngine<Boolean>
      Returns:
      size of the stored keys and values in bytes
    • invalidateCache

      public void invalidateCache()
      Description copied from interface: HalfStorageEngine
      Invalidate any local key/value caches.

      This is called to indicate the termination of a map write "phase". Caching is permitted within a write operation (i.e. to cache around allocation failures during eviction processes).

      Specified by:
      invalidateCache in interface HalfStorageEngine<Boolean>
    • bind

      public void bind(StorageEngine.Owner owner, long mask)
      Specified by:
      bind in interface HalfStorageEngine<Boolean>
    • destroy

      public void destroy()
      Specified by:
      destroy in interface HalfStorageEngine<Boolean>
    • shrink

      public boolean shrink()
      Specified by:
      shrink in interface HalfStorageEngine<Boolean>