You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by vi...@apache.org on 2013/03/02 03:42:55 UTC
git commit: dsnitch severity is not correctly set for compaction info
patch by Vijay; reviewed by jbellis for CASSANDRA-5255
Updated Branches:
refs/heads/cassandra-1.2 56b19f4af -> 71b2bd15d
dsnitch severity is not correctly set for compaction info
patch by Vijay; reviewed by jbellis for CASSANDRA-5255
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/71b2bd15
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/71b2bd15
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/71b2bd15
Branch: refs/heads/cassandra-1.2
Commit: 71b2bd15d2957e04eae8cc650a6b48b75deabe58
Parents: 56b19f4
Author: Vijay Parthasarathy <vi...@gmail.com>
Authored: Fri Mar 1 18:40:04 2013 -0800
Committer: Vijay Parthasarathy <vi...@gmail.com>
Committed: Fri Mar 1 18:40:04 2013 -0800
----------------------------------------------------------------------
.../cassandra/db/compaction/CompactionInfo.java | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/71b2bd15/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java b/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
index 295e34f..da67bab 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
@@ -122,7 +122,7 @@ public final class CompactionInfo implements Serializable
private volatile boolean stopRequested = false;
public abstract CompactionInfo getCompactionInfo();
double load = StorageService.instance.getLoad();
- boolean reportedSeverity = false;
+ double reportedSeverity = 0d;
public void stop()
{
@@ -138,7 +138,9 @@ public final class CompactionInfo implements Serializable
*/
public void started()
{
- reportedSeverity = StorageService.instance.reportSeverity(getCompactionInfo().getTotal()/load);
+ reportedSeverity = getCompactionInfo().getTotal() / load;
+ if (!StorageService.instance.reportSeverity(reportedSeverity))
+ reportedSeverity = 0d;
}
/**
@@ -146,9 +148,9 @@ public final class CompactionInfo implements Serializable
*/
public void finished()
{
- if (reportedSeverity)
- StorageService.instance.reportSeverity(-(getCompactionInfo().getTotal()/load));
- reportedSeverity = false;
+ if (reportedSeverity != 0d)
+ StorageService.instance.reportSeverity(-(reportedSeverity));
+ reportedSeverity = 0d;
}
}
}