@Override public float usage() { if (usedMem() > 0) { return (usedMem() / (float) capacity()); } else { return 0.0f; } }
@Override public float usage() { if (usedMem() > 0) { return (usedMem() / (float) capacity()); } else { return 0.0f; } }
public static MemoryRowBlock createRowBlock(int rowNum) { long allocateStart = System.currentTimeMillis(); MemoryRowBlock rowBlock = new MemoryRowBlock(SchemaUtil.toDataTypes(schema), StorageUnit.KB * 128); long allocatedEnd = System.currentTimeMillis(); LOG.info(FileUtil.humanReadableByteCount(rowBlock.capacity(), true) + " bytes allocated " + (allocatedEnd - allocateStart) + " msec"); long writeStart = System.currentTimeMillis(); for (int i = 0; i < rowNum; i++) { fillRow(i, rowBlock.getWriter()); } long writeEnd = System.currentTimeMillis(); LOG.info("writing takes " + (writeEnd - writeStart) + " msec"); return rowBlock; }
rowBlock = new MemoryRowBlock(dataTypes, initialBufferSize, true, plan.getStorageType()); partitionMemoryMap.put(partId, rowBlock); totalBufferCapacity += rowBlock.capacity(); totalBufferCapacity -= rowBlock.capacity(); totalBufferCapacity += rowBlock.capacity(); // calculate resizeable buffer capacity usedBufferSize += (rowBlock.usedMem() - prevUsedMem);
rowBlock = new MemoryRowBlock(dataTypes, initialBufferSize, true, plan.getStorageType()); partitionMemoryMap.put(partId, rowBlock); totalBufferCapacity += rowBlock.capacity(); totalBufferCapacity -= rowBlock.capacity(); totalBufferCapacity += rowBlock.capacity(); // calculate resizeable buffer capacity usedBufferSize += (rowBlock.usedMem() - prevUsedMem);