Class NativeAllocator
- java.lang.Object
-
- org.apache.cassandra.utils.memory.MemtableAllocator
-
- org.apache.cassandra.utils.memory.NativeAllocator
-
public class NativeAllocator extends MemtableAllocator
This NativeAllocator uses global slab allocation strategy with slab size that scales exponentially from 8kb to 1Mb to serve allocation of up to 128kb.
The slab allocation reduces heap fragmentation from small long-lived objects.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.utils.memory.MemtableAllocator
MemtableAllocator.SubAllocator
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNativeAllocator(NativePool pool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longallocate(int size, OpOrder.Group opGroup)DecoratedKeyclone(DecoratedKey key, OpOrder.Group writeOp)EnsureOnHeapensureOnHeap()Row.BuilderrowBuilder(OpOrder.Group opGroup)voidsetDiscarded()Indicate the memory and resources owned by this allocator are no longer referenced, and can be reclaimed/reused.-
Methods inherited from class org.apache.cassandra.utils.memory.MemtableAllocator
isLive, offHeap, onHeap, setDiscarding
-
-
-
-
Constructor Detail
-
NativeAllocator
protected NativeAllocator(NativePool pool)
-
-
Method Detail
-
rowBuilder
public Row.Builder rowBuilder(OpOrder.Group opGroup)
- Specified by:
rowBuilderin classMemtableAllocator
-
clone
public DecoratedKey clone(DecoratedKey key, OpOrder.Group writeOp)
- Specified by:
clonein classMemtableAllocator
-
ensureOnHeap
public EnsureOnHeap ensureOnHeap()
- Specified by:
ensureOnHeapin classMemtableAllocator
-
allocate
public long allocate(int size, OpOrder.Group opGroup)
-
setDiscarded
public void setDiscarded()
Description copied from class:MemtableAllocatorIndicate the memory and resources owned by this allocator are no longer referenced, and can be reclaimed/reused.- Overrides:
setDiscardedin classMemtableAllocator
-
-