cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [05/10] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0.0
Date Fri, 09 Aug 2013 19:36:21 GMT
Merge branch 'cassandra-1.2' into cassandra-2.0.0

Conflicts:
	CHANGES.txt
	src/java/org/apache/cassandra/io/sstable/SSTableReader.java
	src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
	src/java/org/apache/cassandra/service/CacheService.java


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

Branch: refs/heads/cassandra-2.0
Commit: d62382bfec276d3fa4acd71216c4fe45bb788b77
Parents: 2bcfab0 f5d632f
Author: Yuki Morishita <yukim@apache.org>
Authored: Fri Aug 9 14:34:53 2013 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri Aug 9 14:34:53 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../db/compaction/CompactionController.java     |  2 +-
 .../cassandra/io/sstable/SSTableReader.java     | 36 ++++++++++++++++++--
 .../cassandra/metrics/ColumnFamilyMetrics.java  | 21 ++++++++++++
 .../apache/cassandra/service/CacheService.java  |  2 +-
 5 files changed, 58 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d62382bf/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 756e45c,f8c472c..ba644d3
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,22 -1,5 +1,23 @@@
 -1.2.9
 - * add --migrate option to sstableupgrade and sstablescrub (CASSANDRA-5831)
 +2.0.0
 + * fix CAS contention timeout (CASSANDRA-5830)
 + * fix HsHa to respect max frame size (CASSANDRA-4573)
 +Merged from 1.2:
 + * Correctly validate sparse composite cells in scrub (CASSANDRA-5855)
++ * Add KeyCacheHitRate metric to CF metrics (CASSANDRA-5868)
 +
 +
 +2.0.0-rc1
 + * improve DecimalSerializer performance (CASSANDRA-5837)
 + * fix potential spurious wakeup in AsyncOneResponse (CASSANDRA-5690)
 + * fix schema-related trigger issues (CASSANDRA-5774)
 + * Better validation when accessing CQL3 table from thrift (CASSANDRA-5138)
 + * Fix assertion error during repair (CASSANDRA-5801)
 + * Fix range tombstone bug (CASSANDRA-5805)
 + * DC-local CAS (CASSANDRA-5797)
 + * Add a native_protocol_version column to the system.local table (CASSANRDA-5819)
 + * Use index_interval from cassandra.yaml when upgraded (CASSANDRA-5822)
 + * Fix buffer underflow on socket close (CASSANDRA-5792)
 +Merged from 1.2:
   * fix bulk-loading compressed sstables (CASSANDRA-5820)
   * (Hadoop) fix quoting in CqlPagingRecordReader and CqlRecordWriter 
     (CASSANDRA-5824)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d62382bf/src/java/org/apache/cassandra/db/compaction/CompactionController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d62382bf/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/SSTableReader.java
index 31a40cb,8efa4f1..4a62d85
--- a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
@@@ -20,13 -20,11 +20,14 @@@ package org.apache.cassandra.io.sstable
  import java.io.*;
  import java.nio.ByteBuffer;
  import java.util.*;
 -import java.util.concurrent.atomic.AtomicInteger;
 +import java.util.concurrent.ExecutorService;
 +import java.util.concurrent.LinkedBlockingQueue;
 +import java.util.concurrent.TimeUnit;
  import java.util.concurrent.atomic.AtomicBoolean;
 -import java.util.concurrent.*;
 +import java.util.concurrent.atomic.AtomicInteger;
+ import java.util.concurrent.atomic.AtomicLong;
  
 +import com.google.common.primitives.Longs;
  import com.google.common.util.concurrent.RateLimiter;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
@@@ -101,10 -100,13 +102,13 @@@ public class SSTableReader extends SSTa
      private final AtomicBoolean isCompacted = new AtomicBoolean(false);
      private final AtomicBoolean isSuspect = new AtomicBoolean(false);
      private final SSTableDeletingTask deletingTask;
 -
 -    private final SSTableMetadata sstableMetadata;
 +    // not final since we need to be able to change level on a file.
 +    private volatile SSTableMetadata sstableMetadata;
  
+     private final AtomicLong keyCacheHit = new AtomicLong(0);
+     private final AtomicLong keyCacheRequest = new AtomicLong(0);
+ 
 -    public static long getApproximateKeyCount(Iterable<SSTableReader> sstables)
 +    public static long getApproximateKeyCount(Iterable<SSTableReader> sstables, CFMetaData
metadata)
      {
          long count = 0;
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d62382bf/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
index bc27d6f,d59cd50..96ab538
--- a/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
@@@ -22,9 -22,10 +22,10 @@@ import com.yammer.metrics.core.Counter
  import com.yammer.metrics.core.Gauge;
  import com.yammer.metrics.core.Histogram;
  import com.yammer.metrics.core.MetricName;
+ import com.yammer.metrics.util.RatioGauge;
  
  import org.apache.cassandra.db.ColumnFamilyStore;
 -import org.apache.cassandra.db.Table;
 +import org.apache.cassandra.db.Keyspace;
  import org.apache.cassandra.io.sstable.SSTableMetadata;
  import org.apache.cassandra.io.sstable.SSTableReader;
  import org.apache.cassandra.utils.EstimatedHistogram;
@@@ -276,7 -277,24 +279,25 @@@ public class ColumnFamilyMetric
                  return total;
              }
          });
 +        speculativeRetry = Metrics.newCounter(factory.createMetricName("SpeculativeRetry"));
+         keyCacheHitRate = Metrics.newGauge(factory.createMetricName("KeyCacheHitRate"),
new RatioGauge()
+         {
+             protected double getNumerator()
+             {
+                 long hits = 0L;
+                 for (SSTableReader sstable : cfs.getSSTables())
+                     hits += sstable.getKeyCacheHit();
+                 return hits;
+             }
+ 
+             protected double getDenominator()
+             {
+                 long requests = 0L;
+                 for (SSTableReader sstable : cfs.getSSTables())
+                     requests += sstable.getKeyCacheRequest();
+                 return Math.max(requests, 1); // to avoid NaN.
+             }
+         });
      }
  
      public void updateSSTableIterated(int count)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d62382bf/src/java/org/apache/cassandra/service/CacheService.java
----------------------------------------------------------------------


Mime
View raw message