Class AbstractNonThreadSafeRefCounted

java.lang.Object
org.elasticsearch.compute.data.AbstractNonThreadSafeRefCounted
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable
Direct Known Subclasses:
AbstractArrowBufBlock, AbstractArrowBufVector, AbstractDelegatingCompoundBlock, BooleanArrayBlock, BooleanBigArrayBlock, BooleanBigArrayVector, BooleanVectorBlock, BytesRefArrayBlock, BytesRefVectorBlock, CompositeBlock, ConstantNullBlock, ConstantNullVector, DocBlock, DocVector, DoubleArrayBlock, DoubleBigArrayBlock, DoubleBigArrayVector, DoubleVectorBlock, FloatArrayBlock, FloatBigArrayBlock, FloatBigArrayVector, FloatVectorBlock, IntArrayBlock, IntBigArrayBlock, IntBigArrayVector, IntVectorBlock, LongArrayBlock, LongBigArrayBlock, LongBigArrayVector, LongRangeArrayBlock, LongVectorBlock, OrdinalBytesRefBlock, OrdinalBytesRefVector

public abstract class AbstractNonThreadSafeRefCounted extends Object implements org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable
Releasable, non-threadsafe version of AbstractRefCounted. Calls to decRef() and close() are equivalent.
  • Constructor Details

    • AbstractNonThreadSafeRefCounted

      public AbstractNonThreadSafeRefCounted()
  • Method Details

    • incRef

      public final void incRef()
      Specified by:
      incRef in interface org.elasticsearch.core.RefCounted
    • tryIncRef

      public final boolean tryIncRef()
      Specified by:
      tryIncRef in interface org.elasticsearch.core.RefCounted
    • decRef

      public final boolean decRef()
      Specified by:
      decRef in interface org.elasticsearch.core.RefCounted
    • hasReferences

      public final boolean hasReferences()
      Specified by:
      hasReferences in interface org.elasticsearch.core.RefCounted
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable
    • isReleased

      public final boolean isReleased()
    • closeInternal

      protected abstract void closeInternal()
      This is called when the number of references reaches zero. This is where resources should be released (adjusting circuit breakers if needed).