Module org.elasticsearch.compute
Package org.elasticsearch.compute.data
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
-
Field Summary
Fields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRef
-
Constructor Details
-
AbstractNonThreadSafeRefCounted
public AbstractNonThreadSafeRefCounted()
-
-
Method Details
-
incRef
public final void incRef()- Specified by:
incRefin interfaceorg.elasticsearch.core.RefCounted
-
tryIncRef
public final boolean tryIncRef()- Specified by:
tryIncRefin interfaceorg.elasticsearch.core.RefCounted
-
decRef
public final boolean decRef()- Specified by:
decRefin interfaceorg.elasticsearch.core.RefCounted
-
hasReferences
public final boolean hasReferences()- Specified by:
hasReferencesin interfaceorg.elasticsearch.core.RefCounted
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.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).
-