cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject git commit: Track added sstable size correctly
Date Mon, 01 Sep 2014 07:14:02 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1.0 b8be49b5e -> de62175f2


Track added sstable size correctly

Patch by marcuse; reviewed by jbellis for CASSANDRA-7239


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/de62175f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/de62175f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/de62175f

Branch: refs/heads/cassandra-2.1.0
Commit: de62175f27e3c06951dbf073c6092e7f15f216ca
Parents: b8be49b
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Mon Sep 1 09:09:53 2014 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Mon Sep 1 09:09:53 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                       | 1 +
 src/java/org/apache/cassandra/db/DataTracker.java | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/de62175f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5eb5fd8..c202586 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.0-rc7
+ * Track added sstable size correctly (CASSANDRA-7239)
  * (cqlsh) Fix case insensitivity (CASSANDRA-7834)
  * Fix failure to stream ranges when moving (CASSANDRA-7836)
  * Correctly remove tmplink files (CASSANDRA-7803)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/de62175f/src/java/org/apache/cassandra/db/DataTracker.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DataTracker.java b/src/java/org/apache/cassandra/db/DataTracker.java
index e574143..097d8cc 100644
--- a/src/java/org/apache/cassandra/db/DataTracker.java
+++ b/src/java/org/apache/cassandra/db/DataTracker.java
@@ -252,6 +252,12 @@ public class DataTracker
     {
         replace(sstables, Collections.<SSTableReader>emptyList());
         notifySSTablesChanged(sstables, allReplacements, compactionType);
+        for (SSTableReader sstable : sstables)
+        {
+            long bytesOnDisk = sstable.bytesOnDisk();
+            cfstore.metric.totalDiskSpaceUsed.inc(bytesOnDisk);
+            cfstore.metric.liveDiskSpaceUsed.inc(bytesOnDisk);
+        }
     }
 
     public void addInitialSSTables(Collection<SSTableReader> sstables)


Mime
View raw message