Package org.apache.hadoop.hbase.nio
Class RefCnt
java.lang.Object
org.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
org.apache.hadoop.hbase.nio.RefCnt
- All Implemented Interfaces:
org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
@Private
public class RefCnt
extends org.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
Maintain an reference count integer inside to track life cycle of
ByteBuff
, if the
reference count become 0, it'll call ByteBuffAllocator.Recycler.free()
exactly once.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RefCnt
create()
Create anRefCnt
with an initial reference count = 1.static RefCnt
create
(ByteBuffAllocator.Recycler recycler) protected final void
boolean
Returns true if this refCnt has a recycler.private void
private void
maybeRecord
(Object hint) boolean
release()
boolean
release
(int decrement) org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
retain()
org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
retain
(int increment) touch()
final org.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
Methods inherited from class org.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
refCnt, setRefCnt
-
Field Details
-
detector
-
recycler
-
leak
-
-
Constructor Details
-
RefCnt
-
-
Method Details
-
create
-
create
-
hasRecycler
Returns true if this refCnt has a recycler. -
retain
- Specified by:
retain
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
retain
in classorg.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
-
retain
- Specified by:
retain
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
retain
in classorg.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
-
release
- Specified by:
release
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
release
in classorg.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
-
release
- Specified by:
release
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
release
in classorg.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
-
deallocate
- Specified by:
deallocate
in classorg.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
-
touch
- Specified by:
touch
in interfaceorg.apache.hbase.thirdparty.io.netty.util.ReferenceCounted
- Overrides:
touch
in classorg.apache.hbase.thirdparty.io.netty.util.AbstractReferenceCounted
-
touch
-
getRecycler
-
maybeRecord
-
maybeRecord
-