This is an automated email from the ASF dual-hosted git repository.

benedict pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 7b9b61cb5bccd064b0a3980c6884d0cba3dd09db
Author: Jordan West <jorda...@gmail.com>
AuthorDate: Mon Aug 19 10:10:37 2019 -0700

    Rename StatsMetadata estimatedColumnCount to estimatedCellPerPartitionCount
    
    patch by Jordan West; reviewed by Benedict for CASSANDRA-15285
---
 .../cassandra/io/sstable/format/SSTableReader.java   |  2 +-
 .../cassandra/io/sstable/metadata/StatsMetadata.java | 20 ++++++++++----------
 .../cassandra/tools/SSTableMetadataViewer.java       |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java 
b/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
index aa4ca55..550429f 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
@@ -1945,7 +1945,7 @@ public abstract class SSTableReader extends SSTable 
implements SelfRefCounted<SS
 
     public EstimatedHistogram getEstimatedColumnCount()
     {
-        return sstableMetadata.estimatedColumnCount;
+        return sstableMetadata.estimatedCellPerPartitionCount;
     }
 
     public double getEstimatedDroppableTombstoneRatio(int gcBefore)
diff --git 
a/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java 
b/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java
index 5d464fe..f4e5beb 100755
--- a/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java
@@ -47,7 +47,7 @@ public class StatsMetadata extends MetadataComponent
     public static final ISerializer<IntervalSet<CommitLogPosition>> 
commitLogPositionSetSerializer = 
IntervalSet.serializer(CommitLogPosition.serializer);
 
     public final EstimatedHistogram estimatedPartitionSize;
-    public final EstimatedHistogram estimatedColumnCount;
+    public final EstimatedHistogram estimatedCellPerPartitionCount;
     public final IntervalSet<CommitLogPosition> commitLogIntervals;
     public final long minTimestamp;
     public final long maxTimestamp;
@@ -70,7 +70,7 @@ public class StatsMetadata extends MetadataComponent
     public final EncodingStats encodingStats;
 
     public StatsMetadata(EstimatedHistogram estimatedPartitionSize,
-                         EstimatedHistogram estimatedColumnCount,
+                         EstimatedHistogram estimatedCellPerPartitionCount,
                          IntervalSet<CommitLogPosition> commitLogIntervals,
                          long minTimestamp,
                          long maxTimestamp,
@@ -91,7 +91,7 @@ public class StatsMetadata extends MetadataComponent
                          boolean isTransient)
     {
         this.estimatedPartitionSize = estimatedPartitionSize;
-        this.estimatedColumnCount = estimatedColumnCount;
+        this.estimatedCellPerPartitionCount = estimatedCellPerPartitionCount;
         this.commitLogIntervals = commitLogIntervals;
         this.minTimestamp = minTimestamp;
         this.maxTimestamp = maxTimestamp;
@@ -124,7 +124,7 @@ public class StatsMetadata extends MetadataComponent
      */
     public double getEstimatedDroppableTombstoneRatio(int gcBefore)
     {
-        long estimatedColumnCount = this.estimatedColumnCount.mean() * 
this.estimatedColumnCount.count();
+        long estimatedColumnCount = this.estimatedCellPerPartitionCount.mean() 
* this.estimatedCellPerPartitionCount.count();
         if (estimatedColumnCount > 0)
         {
             double droppable = getDroppableTombstonesBefore(gcBefore);
@@ -145,7 +145,7 @@ public class StatsMetadata extends MetadataComponent
     public StatsMetadata mutateLevel(int newLevel)
     {
         return new StatsMetadata(estimatedPartitionSize,
-                                 estimatedColumnCount,
+                                 estimatedCellPerPartitionCount,
                                  commitLogIntervals,
                                  minTimestamp,
                                  maxTimestamp,
@@ -169,7 +169,7 @@ public class StatsMetadata extends MetadataComponent
     public StatsMetadata mutateRepairedMetadata(long newRepairedAt, UUID 
newPendingRepair, boolean newIsTransient)
     {
         return new StatsMetadata(estimatedPartitionSize,
-                                 estimatedColumnCount,
+                                 estimatedCellPerPartitionCount,
                                  commitLogIntervals,
                                  minTimestamp,
                                  maxTimestamp,
@@ -199,7 +199,7 @@ public class StatsMetadata extends MetadataComponent
         StatsMetadata that = (StatsMetadata) o;
         return new EqualsBuilder()
                        .append(estimatedPartitionSize, 
that.estimatedPartitionSize)
-                       .append(estimatedColumnCount, that.estimatedColumnCount)
+                       .append(estimatedCellPerPartitionCount, 
that.estimatedCellPerPartitionCount)
                        .append(commitLogIntervals, that.commitLogIntervals)
                        .append(minTimestamp, that.minTimestamp)
                        .append(maxTimestamp, that.maxTimestamp)
@@ -225,7 +225,7 @@ public class StatsMetadata extends MetadataComponent
     {
         return new HashCodeBuilder()
                        .append(estimatedPartitionSize)
-                       .append(estimatedColumnCount)
+                       .append(estimatedCellPerPartitionCount)
                        .append(commitLogIntervals)
                        .append(minTimestamp)
                        .append(maxTimestamp)
@@ -252,7 +252,7 @@ public class StatsMetadata extends MetadataComponent
         {
             int size = 0;
             size += 
EstimatedHistogram.serializer.serializedSize(component.estimatedPartitionSize);
-            size += 
EstimatedHistogram.serializer.serializedSize(component.estimatedColumnCount);
+            size += 
EstimatedHistogram.serializer.serializedSize(component.estimatedCellPerPartitionCount);
             size += 
CommitLogPosition.serializer.serializedSize(component.commitLogIntervals.upperBound().orElse(CommitLogPosition.NONE));
             size += 8 + 8 + 4 + 4 + 4 + 4 + 8 + 8; // mix/max timestamp(long), 
min/maxLocalDeletionTime(int), min/max TTL, compressionRatio(double), 
repairedAt (long)
             size += 
TombstoneHistogram.serializer.serializedSize(component.estimatedTombstoneDropTime);
@@ -290,7 +290,7 @@ public class StatsMetadata extends MetadataComponent
         public void serialize(Version version, StatsMetadata component, 
DataOutputPlus out) throws IOException
         {
             
EstimatedHistogram.serializer.serialize(component.estimatedPartitionSize, out);
-            
EstimatedHistogram.serializer.serialize(component.estimatedColumnCount, out);
+            
EstimatedHistogram.serializer.serialize(component.estimatedCellPerPartitionCount,
 out);
             
CommitLogPosition.serializer.serialize(component.commitLogIntervals.upperBound().orElse(CommitLogPosition.NONE),
 out);
             out.writeLong(component.minTimestamp);
             out.writeLong(component.maxTimestamp);
diff --git a/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java 
b/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
index 8ff964f..8f7e8a5 100755
--- a/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
+++ b/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
@@ -398,7 +398,7 @@ public class SSTableMetadataViewer
                                                       String::valueOf);
             rowSize.printHistogram(out, color, unicode);
             field("Column Count", "");
-            TermHistogram cellCount = new 
TermHistogram(stats.estimatedColumnCount,
+            TermHistogram cellCount = new 
TermHistogram(stats.estimatedCellPerPartitionCount,
                                                         "Columns",
                                                         String::valueOf,
                                                         String::valueOf);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to