private static ByteBuffer maybeTakeFromPool(int size, boolean allocateOnHeapWhenExhausted) { if (size < 0) throw new IllegalArgumentException("Size must be positive (" + size + ")"); if (size == 0) return EMPTY_BUFFER; if (size > CHUNK_SIZE) { if (logger.isTraceEnabled()) logger.trace("Requested buffer size {} is bigger than {}, allocating directly", FBUtilities.prettyPrintMemory(size), FBUtilities.prettyPrintMemory(CHUNK_SIZE)); return localPool.get().allocate(size, allocateOnHeapWhenExhausted); } return localPool.get().get(size); }
private static ByteBuffer maybeTakeFromPool(int size, boolean allocateOnHeapWhenExhausted) { if (size < 0) throw new IllegalArgumentException("Size must be positive (" + size + ")"); if (size == 0) return EMPTY_BUFFER; if (size > CHUNK_SIZE) { if (logger.isTraceEnabled()) logger.trace("Requested buffer size {} is bigger than {}, allocating directly", FBUtilities.prettyPrintMemory(size), FBUtilities.prettyPrintMemory(CHUNK_SIZE)); return localPool.get().allocate(size, allocateOnHeapWhenExhausted); } return localPool.get().get(size); }
private static ByteBuffer maybeTakeFromPool(int size, boolean allocateOnHeapWhenExhausted) { if (size < 0) throw new IllegalArgumentException("Size must be positive (" + size + ")"); if (size == 0) return EMPTY_BUFFER; if (size > CHUNK_SIZE) { if (logger.isTraceEnabled()) logger.trace("Requested buffer size {} is bigger than {}, allocating directly", FBUtilities.prettyPrintMemory(size), FBUtilities.prettyPrintMemory(CHUNK_SIZE)); return localPool.get().allocate(size, allocateOnHeapWhenExhausted); } return localPool.get().get(size); }
private static ByteBuffer maybeTakeFromPool(int size, boolean allocateOnHeapWhenExhausted) { if (size < 0) throw new IllegalArgumentException("Size must be positive (" + size + ")"); if (size == 0) return EMPTY_BUFFER; if (size > CHUNK_SIZE) { if (logger.isTraceEnabled()) logger.trace("Requested buffer size {} is bigger than {}, allocating directly", FBUtilities.prettyPrintMemory(size), FBUtilities.prettyPrintMemory(CHUNK_SIZE)); return localPool.get().allocate(size, allocateOnHeapWhenExhausted); } return localPool.get().get(size); }