private void allocateMultiple(MemoryBuffer[] dest, int size) { if (allocator != null) { allocator.allocateMultiple(dest, size, bufferFactory, isStopped); } else { bufferManager.getAllocator().allocateMultiple(dest, size, bufferFactory); } }
private void allocateMultiple(MemoryBuffer[] dest, int size) { if (allocator != null) { allocator.allocateMultiple(dest, size, cacheWrapper.getDataBufferFactory(), isStopped); } else { cacheWrapper.getAllocator().allocateMultiple(dest, size, cacheWrapper.getDataBufferFactory()); } }
private static CacheChunk copyAndReplaceCandidateToNonCached( UncompressedCacheChunk candidateCached, long partOffset, long candidateEnd, DataCache cacheWrapper, MemoryBuffer[] singleAlloc) { // We thought we had the entire part to cache, but we don't; convert start to // non-cached. Since we are at the first gap, the previous stuff must be contiguous. singleAlloc[0] = null; cacheWrapper.getAllocator().allocateMultiple(singleAlloc, (int)(candidateEnd - partOffset)); MemoryBuffer buffer = singleAlloc[0]; cacheWrapper.reuseBuffer(buffer); ByteBuffer dest = buffer.getByteBufferRaw(); CacheChunk tcc = POOLS.tccPool.take(); tcc.init(buffer, partOffset, candidateEnd); copyAndReplaceUncompressedChunks(candidateCached, dest, tcc); return tcc; }
++ix; cacheWrapper.getAllocator().allocateMultiple(targetBuffers, bufferSize);
largeBuffers = new MemoryBuffer[largeBufCount]; allocator.allocateMultiple(largeBuffers, maxAlloc, cache.getDataBufferFactory()); for (int i = 0; i < largeBuffers.length; ++i) { smallBuffer = new MemoryBuffer[1]; allocator.allocateMultiple(smallBuffer, smallSize, cache.getDataBufferFactory()); ByteBuffer bb = smallBuffer[0].getByteBufferRaw(); copyDiskDataToCacheBuffer(array,
private static CacheChunk copyAndReplaceUncompressedToNonCached( BufferChunk bc, DataCache cacheWrapper, MemoryBuffer[] singleAlloc) { singleAlloc[0] = null; cacheWrapper.getAllocator().allocateMultiple(singleAlloc, bc.getLength()); MemoryBuffer buffer = singleAlloc[0]; cacheWrapper.reuseBuffer(buffer); ByteBuffer dest = buffer.getByteBufferRaw(); CacheChunk tcc = POOLS.tccPool.take(); tcc.init(buffer, bc.getOffset(), bc.getEnd()); copyUncompressedChunk(bc.getChunk(), dest); bc.replaceSelfWith(tcc); return tcc; }
cacheWrapper.getAllocator().allocateMultiple( targetBuffers, (int)(partCount == 1 ? streamLen : partSize));
if (isNewBuffer) { MemoryBuffer[] dest = new MemoryBuffer[1]; bufferManager.getAllocator().allocateMultiple(dest, size, bufferFactory); LlapSerDeDataBuffer newBuffer = (LlapSerDeDataBuffer)dest[0]; bb = newBuffer.getByteBufferRaw();