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 longallocatorCapacity()Capacity of allocators returned byMemoryAllocatorFactory.newAllocator().MemoryAllocatornewAllocator()Returns a new allocator with capacityMemoryAllocatorFactory.allocatorCapacity().
-
-
-
Constructor Detail
-
SingleMemoryAllocatorFactory
public SingleMemoryAllocatorFactory(MemoryAllocator allocator)
-
-
Method Detail
-
newAllocator
public MemoryAllocator newAllocator()
Description copied from interface:MemoryAllocatorFactoryReturns a new allocator with capacityMemoryAllocatorFactory.allocatorCapacity().- Specified by:
newAllocatorin interfaceMemoryAllocatorFactory
-
allocatorCapacity
public long allocatorCapacity()
Description copied from interface:MemoryAllocatorFactoryCapacity of allocators returned byMemoryAllocatorFactory.newAllocator().- Specified by:
allocatorCapacityin interfaceMemoryAllocatorFactory
-
-