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 8KiB to 1MiB to serve allocation of up to 128KiB.
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)Clonercloner(OpOrder.Group opGroup)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)
-
clone
public DecoratedKey clone(DecoratedKey key, OpOrder.Group writeOp)
-
cloner
public Cloner cloner(OpOrder.Group opGroup)
- Specified by:
clonerin 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
-
-