mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.1' into trunk
This commit is contained in:
commit
944c1716d6
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
|
||||
2.1.0-rc2
|
||||
* Fix heap size calculation for CompoundSparseCellName and
|
||||
CompoundSparseCellName.WithCollection (CASSANDRA-7421)
|
||||
* Allow counter mutations in UNLOGGED batches (CASSANDRA-7351)
|
||||
* Modify reconcile logic to always pick a tombstone over a counter cell
|
||||
(CASSANDRA-7346)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public class ColumnIdentifier implements Selectable, IMeasurableMemory
|
|||
+ ObjectSizes.sizeOf(text);
|
||||
}
|
||||
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return EMPTY_SIZE
|
||||
+ ObjectSizes.sizeOnHeapExcludingData(bytes)
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ public class AtomicBTreeColumns extends ColumnFamily
|
|||
indexer.insert(insert);
|
||||
insert = insert.localCopy(metadata, allocator, writeOp);
|
||||
this.dataSize += insert.cellDataSize();
|
||||
this.heapSize += insert.excessHeapSizeExcludingData();
|
||||
this.heapSize += insert.unsharedHeapSizeExcludingData();
|
||||
if (inserted == null)
|
||||
inserted = new ArrayList<>();
|
||||
inserted.add(insert);
|
||||
|
|
@ -366,7 +366,7 @@ public class AtomicBTreeColumns extends ColumnFamily
|
|||
{
|
||||
reconciled = reconciled.localCopy(metadata, allocator, writeOp);
|
||||
dataSize += reconciled.cellDataSize() - existing.cellDataSize();
|
||||
heapSize += reconciled.excessHeapSizeExcludingData() - existing.excessHeapSizeExcludingData();
|
||||
heapSize += reconciled.unsharedHeapSizeExcludingData() - existing.unsharedHeapSizeExcludingData();
|
||||
if (inserted == null)
|
||||
inserted = new ArrayList<>();
|
||||
inserted.add(reconciled);
|
||||
|
|
|
|||
|
|
@ -84,9 +84,9 @@ public class BufferCell extends AbstractCell
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return EMPTY_SIZE + name.excessHeapSizeExcludingData() + ObjectSizes.sizeOnHeapExcludingData(value);
|
||||
return EMPTY_SIZE + name.unsharedHeapSizeExcludingData() + ObjectSizes.sizeOnHeapExcludingData(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public interface Cell extends OnDiskAtom
|
|||
|
||||
// returns the size of the Cell and all references on the heap, excluding any costs associated with byte arrays
|
||||
// that would be allocated by a localCopy, as these will be accounted for by the allocator
|
||||
public long excessHeapSizeExcludingData();
|
||||
public long unsharedHeapSizeExcludingData();
|
||||
|
||||
public int serializedSize(CellNameType type, TypeSizes typeSizes);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class NativeCell extends AbstractNativeCell
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ public class NativeCounterCell extends NativeCell implements CounterCell
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public class NativeDeletedCell extends NativeCell implements DeletedCell
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ public class NativeExpiringCell extends NativeCell implements ExpiringCell
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ public class RowIndexEntry implements IMeasurableMemory
|
|||
{
|
||||
long entrySize = 0;
|
||||
for (IndexHelper.IndexInfo idx : columnsIndex)
|
||||
entrySize += idx.excessHeapSize();
|
||||
entrySize += idx.unsharedHeapSize();
|
||||
|
||||
return BASE_SIZE
|
||||
+ entrySize
|
||||
|
|
|
|||
|
|
@ -74,5 +74,5 @@ public interface CellName extends Composite
|
|||
@Override
|
||||
public CellName copy(CFMetaData cfm, AbstractAllocator allocator);
|
||||
|
||||
public long excessHeapSizeExcludingData();
|
||||
public long unsharedHeapSizeExcludingData();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.apache.cassandra.utils.memory.AbstractAllocator;
|
|||
*/
|
||||
public class CompoundComposite extends AbstractComposite
|
||||
{
|
||||
private static final long EMPTY_SIZE = ObjectSizes.measure(new CompoundComposite(null, 0, false));
|
||||
private static final long HEAP_SIZE = ObjectSizes.measure(new CompoundComposite(null, 0, false));
|
||||
|
||||
// We could use a List, but we'll create such object *a lot* and using a array+size is not
|
||||
// all that harder, so we save the List object allocation.
|
||||
|
|
@ -73,12 +73,12 @@ public class CompoundComposite extends AbstractComposite
|
|||
|
||||
public long unsharedHeapSize()
|
||||
{
|
||||
return EMPTY_SIZE + ObjectSizes.sizeOnHeapOf(elements);
|
||||
return HEAP_SIZE + ObjectSizes.sizeOnHeapOf(elements);
|
||||
}
|
||||
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return EMPTY_SIZE + ObjectSizes.sizeOnHeapExcludingData(elements);
|
||||
return HEAP_SIZE + ObjectSizes.sizeOnHeapExcludingData(elements);
|
||||
}
|
||||
|
||||
public Composite copy(CFMetaData cfm, AbstractAllocator allocator)
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class CompoundDenseCellName extends CompoundComposite implements CellName
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return HEAP_SIZE + ObjectSizes.sizeOnHeapExcludingData(elements);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,18 @@ public class CompoundSparseCellName extends CompoundComposite implements CellNam
|
|||
this.columnName = columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long unsharedHeapSize()
|
||||
{
|
||||
return HEAP_SIZE + ObjectSizes.sizeOnHeapOf(elements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return HEAP_SIZE + ObjectSizes.sizeOnHeapExcludingData(elements);
|
||||
}
|
||||
|
||||
public int size()
|
||||
{
|
||||
return size + 1;
|
||||
|
|
@ -156,13 +168,15 @@ public class CompoundSparseCellName extends CompoundComposite implements CellNam
|
|||
@Override
|
||||
public long unsharedHeapSize()
|
||||
{
|
||||
return super.unsharedHeapSize() + ObjectSizes.sizeOnHeapOf(collectionElement);
|
||||
return HEAP_SIZE + ObjectSizes.sizeOnHeapOf(elements)
|
||||
+ ObjectSizes.sizeOnHeapExcludingData(collectionElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return super.excessHeapSizeExcludingData() + ObjectSizes.sizeOnHeapExcludingData(collectionElement);
|
||||
return HEAP_SIZE + ObjectSizes.sizeOnHeapExcludingData(elements)
|
||||
+ ObjectSizes.sizeOnHeapExcludingData(collectionElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ public class SimpleDenseCellName extends SimpleComposite implements CellName
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return EMPTY_SIZE + ObjectSizes.sizeOnHeapExcludingData(element);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ public class SimpleSparseCellName extends AbstractComposite implements CellName
|
|||
return true;
|
||||
}
|
||||
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return EMPTY_SIZE + columnName.excessHeapSizeExcludingData();
|
||||
return EMPTY_SIZE + columnName.unsharedHeapSizeExcludingData();
|
||||
}
|
||||
|
||||
public long unsharedHeapSize()
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class SimpleSparseInternedCellName extends SimpleSparseCellName
|
|||
}
|
||||
|
||||
@Override
|
||||
public long excessHeapSizeExcludingData()
|
||||
public long unsharedHeapSizeExcludingData()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ public class IndexHelper
|
|||
}
|
||||
}
|
||||
|
||||
public long excessHeapSize()
|
||||
public long unsharedHeapSize()
|
||||
{
|
||||
return EMPTY_SIZE + firstName.unsharedHeapSize() + lastName.unsharedHeapSize();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue