Interface MemoryStatus

All Known Implementing Classes:
AnotB, CompactSketch, Intersection, SetOperation, Sketch, Union, UpdateSketch

public interface MemoryStatus
Methods for inquiring the status of a backing Memory object.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if this object's internal data is backed by a Memory object, which may be on-heap or off-heap.
    default boolean
    Returns true if this object's internal data is backed by direct (off-heap) Memory.
    default boolean
    isSameResource(org.apache.datasketches.memory.Memory that)
    Returns true if the backing resource of this is identical with the backing resource of that.
  • Method Details

    • hasMemory

      default boolean hasMemory()
      Returns true if this object's internal data is backed by a Memory object, which may be on-heap or off-heap.
      Returns:
      true if this object's internal data is backed by a Memory object.
    • isDirect

      default boolean isDirect()
      Returns true if this object's internal data is backed by direct (off-heap) Memory.
      Returns:
      true if this object's internal data is backed by direct (off-heap) Memory.
    • isSameResource

      default boolean isSameResource(org.apache.datasketches.memory.Memory that)
      Returns true if the backing resource of this is identical with the backing resource of that. The capacities must be the same. If this is a region, the region offset must also be the same.
      Parameters:
      that - A different non-null and alive Memory object.
      Returns:
      true if the backing resource of this is identical with the backing resource of that.
      Throws:
      SketchesArgumentException - if that is not alive (already closed).