cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [1/3] git commit: Add trace entries about concurrent range requests
Date Tue, 12 Aug 2014 18:31:49 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 7f1671c37 -> 0cf2e14c5


Add trace entries about concurrent range requests

Patch and review by Tyler Hobbs and Sylvain Lebresne for CASSANDRA-7599


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

Branch: refs/heads/trunk
Commit: 6795b6ec607d58fe32216c15d4ce8d50f260eab7
Parents: dbc4582
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Tue Aug 12 13:30:04 2014 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Tue Aug 12 13:30:47 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 src/java/org/apache/cassandra/service/StorageProxy.java | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6795b6ec/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2970632..de45aeb 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.0-rc6
+ * Add tracing entries about concurrent range requests (CASSANDRA-7599)
  * (cqlsh) Fix DESCRIBE for NTS keyspaces (CASSANDRA-7729)
  * Remove netty buffer ref-counting (CASSANDRA-7735)
  * Pass mutated cf to index updater for use by PRSI (CASSANDRA-7742)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6795b6ec/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index 63dc391..d963ee0 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -1449,7 +1449,7 @@ public class StorageProxy implements StorageProxyMBean
     public static List<Row> getRangeSlice(AbstractRangeCommand command, ConsistencyLevel
consistency_level)
     throws UnavailableException, ReadTimeoutException
     {
-        Tracing.trace("Determining replicas to query");
+        Tracing.trace("Computing ranges to query");
         long startTime = System.nanoTime();
 
         Keyspace keyspace = Keyspace.open(command.keyspace);
@@ -1478,6 +1478,7 @@ public class StorageProxy implements StorageProxyMBean
                                   : Math.max(1, Math.min(ranges.size(), (int) Math.ceil(command.limit()
/ resultRowsPerRange)));
             logger.debug("Estimated result rows per range: {}; requested rows: {}, ranges.size():
{}; concurrent range requests: {}",
                          resultRowsPerRange, command.limit(), ranges.size(), concurrencyFactor);
+            Tracing.trace("Submitting range requests on {} ranges with a concurrency of {}
({} rows per range expected)", new Object[]{ ranges.size(), concurrencyFactor, resultRowsPerRange});
 
             boolean haveSufficientRows = false;
             int i = 0;
@@ -1488,6 +1489,7 @@ public class StorageProxy implements StorageProxyMBean
             {
                 List<Pair<AbstractRangeCommand, ReadCallback<RangeSliceReply, Iterable<Row>>>>
scanHandlers = new ArrayList<>(concurrencyFactor);
                 int concurrentFetchStartingIndex = i;
+                int concurrentRequests = 0;
                 while ((i - concurrentFetchStartingIndex) < concurrencyFactor)
                 {
                     AbstractBounds<RowPosition> range = nextRange == null
@@ -1500,6 +1502,7 @@ public class StorageProxy implements StorageProxyMBean
                                                         ? consistency_level.filterForQuery(keyspace,
liveEndpoints)
                                                         : nextFilteredEndpoints;
                     ++i;
+                    ++concurrentRequests;
 
                     // getRestrictedRange has broken the queried range into per-[vnode] token
ranges, but this doesn't take
                     // the replication factor into account. If the intersection of live endpoints
for 2 consecutive ranges
@@ -1562,6 +1565,7 @@ public class StorageProxy implements StorageProxyMBean
                     }
                     scanHandlers.add(Pair.create(nodeCmd, handler));
                 }
+                Tracing.trace("Submitted {} concurrent range requests covering {} ranges",
concurrentRequests, i - concurrentFetchStartingIndex);
 
                 List<AsyncOneResponse> repairResponses = new ArrayList<>();
                 for (Pair<AbstractRangeCommand, ReadCallback<RangeSliceReply, Iterable<Row>>>
cmdPairHandler : scanHandlers)


Mime
View raw message