cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject cassandra git commit: Avoid expensive string op when trace logging is not enabled
Date Thu, 08 Jan 2015 20:40:18 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 5e797ebba -> bd3c47ca7


Avoid expensive string op when trace logging is not enabled


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

Branch: refs/heads/cassandra-2.0
Commit: bd3c47ca739a9b84ba68a19387bef8233e1f90e1
Parents: 5e797eb
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Thu Jan 8 14:39:29 2015 -0600
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Thu Jan 8 14:40:09 2015 -0600

----------------------------------------------------------------------
 .../apache/cassandra/db/index/composites/CompositesSearcher.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/bd3c47ca/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index eb618f4..b978021 100644
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@ -231,7 +231,8 @@ public class CompositesSearcher extends SecondaryIndexSearcher
                         if (!filter.columnFilter(dk.key).maySelectPrefix(baseComparator,
start))
                             continue;
 
-                        logger.trace("Adding index hit to current row for {}", indexComparator.getString(column.name()));
+                        if (logger.isTraceEnabled())
+                            logger.trace("Adding index hit to current row for {}", indexComparator.getString(column.name()));
 
                         // We always query the whole CQL3 row. In the case where the original
filter was a name filter this might be
                         // slightly wasteful, but this probably doesn't matter in practice
and it simplify things.


Mime
View raw message