@Override public Cell localCopy(CFMetaData metadata, MemtableAllocator allocator, OpOrder.Group opGroup) { return allocator.clone(this, metadata, opGroup); }
public boolean isLive() { return allocator.isLive(); }
public String toString() { return String.format("Memtable-%s@%s(%s serialized bytes, %s ops, %.0f%%/%.0f%% of on/off-heap limit)", cfs.name, hashCode(), FBUtilities.prettyPrintMemory(liveDataSize.get()), currentOperations, 100 * allocator.onHeap().ownershipRatio(), 100 * allocator.offHeap().ownershipRatio()); }
private static int estimateRowOverhead(final int count) { // calculate row overhead try (final OpOrder.Group group = new OpOrder().start()) { int rowOverhead; MemtableAllocator allocator = MEMORY_POOL.newAllocator(); ConcurrentNavigableMap<PartitionPosition, Object> partitions = new ConcurrentSkipListMap<>(); final Object val = new Object(); for (int i = 0 ; i < count ; i++) partitions.put(allocator.clone(new BufferDecoratedKey(new LongToken(i), ByteBufferUtil.EMPTY_BYTE_BUFFER), group), val); double avgSize = ObjectSizes.measureDeep(partitions) / (double) count; rowOverhead = (int) ((avgSize - Math.floor(avgSize)) < 0.05 ? Math.floor(avgSize) : Math.ceil(avgSize)); rowOverhead -= ObjectSizes.measureDeep(new LongToken(0)); rowOverhead += AtomicBTreePartition.EMPTY_SIZE; allocator.setDiscarding(); allocator.setDiscarded(); return rowOverhead; } }
protected void finish() { allocator.onHeap().adjust(heapSize, writeOp); } }
@Override public Row staticRow() { return allocator.ensureOnHeap().applyToStatic(super.staticRow()); }
void setDiscarded() { allocator.setDiscarded(); }
public Long getValue() { return cfs.getTracker().getView().getCurrentMemtable().getAllocator().offHeap().owns(); } });
void setDiscarding(OpOrder.Barrier writeBarrier, AtomicReference<ReplayPosition> lastReplayPosition) { assert this.writeBarrier == null; this.lastReplayPosition = lastReplayPosition; this.writeBarrier = writeBarrier; allocator.setDiscarding(); }
private Row.Builder builder(Clustering clustering) { boolean isStatic = clustering == Clustering.STATIC_CLUSTERING; // We know we only insert/update one static per PartitionUpdate, so no point in saving the builder if (isStatic) return allocator.rowBuilder(writeOp); if (regularBuilder == null) regularBuilder = allocator.rowBuilder(writeOp); return regularBuilder; }
private static int estimateRowOverhead(final int count) { // calculate row overhead final OpOrder.Group group = new OpOrder().start(); int rowOverhead; MemtableAllocator allocator = MEMORY_POOL.newAllocator(); ConcurrentNavigableMap<RowPosition, Object> rows = new ConcurrentSkipListMap<>(); final Object val = new Object(); for (int i = 0 ; i < count ; i++) rows.put(allocator.clone(new BufferDecoratedKey(new LongToken((long) i), ByteBufferUtil.EMPTY_BYTE_BUFFER), group), val); double avgSize = ObjectSizes.measureDeep(rows) / (double) count; rowOverhead = (int) ((avgSize - Math.floor(avgSize)) < 0.05 ? Math.floor(avgSize) : Math.ceil(avgSize)); rowOverhead -= ObjectSizes.measureDeep(new LongToken((long) 0)); rowOverhead += AtomicBTreeColumns.EMPTY_SIZE; allocator.setDiscarding(); allocator.setDiscarded(); return rowOverhead; } }
protected void finish() { allocator.onHeap().adjust(heapSize, writeOp); } }
@Override public UnfilteredRowIterator unfilteredIterator(Holder current, ColumnFilter selection, Slices slices, boolean reversed) { return allocator.ensureOnHeap().applyToPartition(super.unfilteredIterator(current, selection, slices, reversed)); }
void setDiscarded() { allocator.setDiscarded(); }
public Long getValue() { return cfs.getTracker().getView().getCurrentMemtable().getAllocator().offHeap().owns(); } });
@VisibleForTesting public void setDiscarding(OpOrder.Barrier writeBarrier, AtomicReference<CommitLogPosition> commitLogUpperBound) { assert this.writeBarrier == null; this.commitLogUpperBound = commitLogUpperBound; this.writeBarrier = writeBarrier; allocator.setDiscarding(); }
private Row.Builder builder(Clustering clustering) { boolean isStatic = clustering == Clustering.STATIC_CLUSTERING; // We know we only insert/update one static per PartitionUpdate, so no point in saving the builder if (isStatic) return allocator.rowBuilder(writeOp); if (regularBuilder == null) regularBuilder = allocator.rowBuilder(writeOp); return regularBuilder; }