You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by st...@apache.org on 2016/06/27 02:42:13 UTC

cassandra git commit: Chunk cache to request compressor-compatible buffers if pool space is exhausted

Repository: cassandra
Updated Branches:
  refs/heads/trunk fb221095c -> ac53b720b


Chunk cache to request compressor-compatible buffers if pool space is exhausted

pathch by Branimir Lambov; reviewed by Stefania Alborghetti for CASSANDRA-11993


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

Branch: refs/heads/trunk
Commit: ac53b720bd53641eb178a0a26f84df85108dfe7c
Parents: fb22109
Author: Branimir Lambov <br...@datastax.com>
Authored: Fri Jun 24 18:04:50 2016 +0200
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Mon Jun 27 10:40:29 2016 +0800

----------------------------------------------------------------------
 CHANGES.txt                                                | 1 +
 src/java/org/apache/cassandra/cache/ChunkCache.java        | 3 ++-
 src/java/org/apache/cassandra/io/compress/ICompressor.java | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac53b720/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5b72016..9486c53 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.8
+ * Chunk cache to request compressor-compatible buffers if pool space is exhausted (CASSANDRA-11993)
  * Remove DatabaseDescriptor dependencies from SequentialWriter (CASSANDRA-11579)
  * Move skip_stop_words filter before stemming (CASSANDRA-12078)
  * Support seek() in EncryptedFileSegmentInputStream (CASSANDRA-11957)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac53b720/src/java/org/apache/cassandra/cache/ChunkCache.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cache/ChunkCache.java b/src/java/org/apache/cassandra/cache/ChunkCache.java
index 9c32746..e6296bd 100644
--- a/src/java/org/apache/cassandra/cache/ChunkCache.java
+++ b/src/java/org/apache/cassandra/cache/ChunkCache.java
@@ -31,6 +31,7 @@ import com.google.common.util.concurrent.MoreExecutors;
 import com.github.benmanes.caffeine.cache.*;
 import com.codahale.metrics.Timer;
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.io.compress.BufferType;
 import org.apache.cassandra.io.sstable.CorruptSSTableException;
 import org.apache.cassandra.io.util.*;
 import org.apache.cassandra.metrics.CacheMissMetrics;
@@ -152,7 +153,7 @@ public class ChunkCache
         metrics.misses.mark();
         try (Timer.Context ctx = metrics.missLatency.time())
         {
-            ByteBuffer buffer = BufferPool.get(key.file.chunkSize());
+            ByteBuffer buffer = BufferPool.get(key.file.chunkSize(), key.file.preferredBufferType());
             assert buffer != null;
             rebufferer.readChunk(key.position, buffer);
             return new Buffer(buffer, key.position);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac53b720/src/java/org/apache/cassandra/io/compress/ICompressor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/compress/ICompressor.java b/src/java/org/apache/cassandra/io/compress/ICompressor.java
index 5719834..40dc7c2 100644
--- a/src/java/org/apache/cassandra/io/compress/ICompressor.java
+++ b/src/java/org/apache/cassandra/io/compress/ICompressor.java
@@ -49,7 +49,7 @@ public interface ICompressor
     public BufferType preferredBufferType();
 
     /**
-     * Checks if the given buffer would be supported by the compressor. If a type is supported the compressor must be
+     * Checks if the given buffer would be supported by the compressor. If a type is supported, the compressor must be
      * able to use it in combination with all other supported types.
      *
      * Direct and memory-mapped buffers must be supported by all compressors.