cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/3] git commit: fix countAllBatches query patch by Lyuben Todorov; reviewed by jbellis for CASSANDRA-7300
Date Sun, 25 May 2014 12:24:02 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 f64dc4527 -> 3aef07dba
  refs/heads/trunk f5c54aac9 -> d1af97927


fix countAllBatches query
patch by Lyuben Todorov; reviewed by jbellis for CASSANDRA-7300


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

Branch: refs/heads/cassandra-2.1
Commit: 3aef07dbaac8234832f34aa8f087e24ec18723a9
Parents: f64dc45
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Sun May 25 07:23:43 2014 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Sun May 25 07:23:43 2014 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/BatchlogManager.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3aef07db/src/java/org/apache/cassandra/db/BatchlogManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/BatchlogManager.java b/src/java/org/apache/cassandra/db/BatchlogManager.java
index 4e7e412..d49c620 100644
--- a/src/java/org/apache/cassandra/db/BatchlogManager.java
+++ b/src/java/org/apache/cassandra/db/BatchlogManager.java
@@ -99,7 +99,8 @@ public class BatchlogManager implements BatchlogManagerMBean
 
     public int countAllBatches()
     {
-        return (int) executeInternal("SELECT count(*) FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.BATCHLOG_CF).one().getLong("count");
+        String query = String.format("SELECT count(*) FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.BATCHLOG_CF);
+        return (int) executeInternal(query).one().getLong("count");
     }
 
     public long getTotalBatchesReplayed()


Mime
View raw message