public static MemtablePool getMemtableAllocatorPool() { long heapLimit = ((long) conf.memtable_heap_space_in_mb) << 20; long offHeapLimit = ((long) conf.memtable_offheap_space_in_mb) << 20; switch (conf.memtable_allocation_type) { case unslabbed_heap_buffers: return new HeapPool(heapLimit, conf.memtable_cleanup_threshold, new ColumnFamilyStore.FlushLargestColumnFamily()); case heap_buffers: return new SlabPool(heapLimit, 0, conf.memtable_cleanup_threshold, new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_buffers: if (!FileUtils.isCleanerAvailable()) { logger.error("Could not free direct byte buffer: offheap_buffers is not a safe memtable_allocation_type without this ability, please adjust your config. This feature is only guaranteed to work on an Oracle JVM. Refusing to start."); System.exit(-1); } return new SlabPool(heapLimit, offHeapLimit, conf.memtable_cleanup_threshold, new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_objects: return new NativePool(heapLimit, offHeapLimit, conf.memtable_cleanup_threshold, new ColumnFamilyStore.FlushLargestColumnFamily()); default: throw new AssertionError(); } }
private static MemtablePool createMemtableAllocatorPool() { long heapLimit = DatabaseDescriptor.getMemtableHeapSpaceInMb() << 20; long offHeapLimit = DatabaseDescriptor.getMemtableOffheapSpaceInMb() << 20; switch (DatabaseDescriptor.getMemtableAllocationType()) { case unslabbed_heap_buffers: return new HeapPool(heapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case heap_buffers: return new SlabPool(heapLimit, 0, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_buffers: if (!FileUtils.isCleanerAvailable) { throw new IllegalStateException("Could not free direct byte buffer: offheap_buffers is not a safe memtable_allocation_type without this ability, please adjust your config. This feature is only guaranteed to work on an Oracle JVM. Refusing to start."); } return new SlabPool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_objects: return new NativePool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); default: throw new AssertionError(); } }
private static MemtablePool createMemtableAllocatorPool() { long heapLimit = DatabaseDescriptor.getMemtableHeapSpaceInMb() << 20; long offHeapLimit = DatabaseDescriptor.getMemtableOffheapSpaceInMb() << 20; switch (DatabaseDescriptor.getMemtableAllocationType()) { case unslabbed_heap_buffers: return new HeapPool(heapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case heap_buffers: return new SlabPool(heapLimit, 0, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_buffers: if (!FileUtils.isCleanerAvailable) { throw new IllegalStateException("Could not free direct byte buffer: offheap_buffers is not a safe memtable_allocation_type without this ability, please adjust your config. This feature is only guaranteed to work on an Oracle JVM. Refusing to start."); } return new SlabPool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_objects: return new NativePool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); default: throw new AssertionError(); } }
private static MemtablePool createMemtableAllocatorPool() { long heapLimit = DatabaseDescriptor.getMemtableHeapSpaceInMb() << 20; long offHeapLimit = DatabaseDescriptor.getMemtableOffheapSpaceInMb() << 20; switch (DatabaseDescriptor.getMemtableAllocationType()) { case unslabbed_heap_buffers: return new HeapPool(heapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case heap_buffers: return new SlabPool(heapLimit, 0, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_buffers: if (!FileUtils.isCleanerAvailable) { throw new IllegalStateException("Could not free direct byte buffer: offheap_buffers is not a safe memtable_allocation_type without this ability, please adjust your config. This feature is only guaranteed to work on an Oracle JVM. Refusing to start."); } return new SlabPool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_objects: return new NativePool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); default: throw new AssertionError(); } }
private static MemtablePool createMemtableAllocatorPool() { long heapLimit = DatabaseDescriptor.getMemtableHeapSpaceInMb() << 20; long offHeapLimit = DatabaseDescriptor.getMemtableOffheapSpaceInMb() << 20; switch (DatabaseDescriptor.getMemtableAllocationType()) { case unslabbed_heap_buffers: return new HeapPool(heapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case heap_buffers: return new SlabPool(heapLimit, 0, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_buffers: if (!FileUtils.isCleanerAvailable) { throw new IllegalStateException("Could not free direct byte buffer: offheap_buffers is not a safe memtable_allocation_type without this ability, please adjust your config. This feature is only guaranteed to work on an Oracle JVM. Refusing to start."); } return new SlabPool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); case offheap_objects: return new NativePool(heapLimit, offHeapLimit, DatabaseDescriptor.getMemtableCleanupThreshold(), new ColumnFamilyStore.FlushLargestColumnFamily()); default: throw new AssertionError(); } }