Class SingleMemoryAllocatorFactory
- java.lang.Object
-
- org.apache.druid.frame.allocation.SingleMemoryAllocatorFactory
-
- All Implemented Interfaces:
MemoryAllocatorFactory
public class SingleMemoryAllocatorFactory extends Object implements MemoryAllocatorFactory
Wraps a singleMemoryAllocator
. The same instance is returned on each call tonewAllocator()
, after validating that it is 100% free. CallingnewAllocator()
before freeing all previously-allocated memory leads to an IllegalStateException.
-
-
Constructor Summary
Constructors Constructor Description SingleMemoryAllocatorFactory(MemoryAllocator allocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
allocatorCapacity()
Capacity of allocators returned byMemoryAllocatorFactory.newAllocator()
.MemoryAllocator
newAllocator()
Returns a new allocator with capacityMemoryAllocatorFactory.allocatorCapacity()
.
-
-
-
Constructor Detail
-
SingleMemoryAllocatorFactory
public SingleMemoryAllocatorFactory(MemoryAllocator allocator)
-
-
Method Detail
-
newAllocator
public MemoryAllocator newAllocator()
Description copied from interface:MemoryAllocatorFactory
Returns a new allocator with capacityMemoryAllocatorFactory.allocatorCapacity()
.- Specified by:
newAllocator
in interfaceMemoryAllocatorFactory
-
allocatorCapacity
public long allocatorCapacity()
Description copied from interface:MemoryAllocatorFactory
Capacity of allocators returned byMemoryAllocatorFactory.newAllocator()
.- Specified by:
allocatorCapacity
in interfaceMemoryAllocatorFactory
-
-