cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject [2/2] git commit: rename RandomAccessReader.MAX_BYTES_IN_PAGE_CACHE
Date Wed, 29 Feb 2012 10:10:32 GMT
rename RandomAccessReader.MAX_BYTES_IN_PAGE_CACHE

patch by scode; reviewed by xedin for CASSANDRA-3948


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

Branch: refs/heads/trunk
Commit: 49e134c7331aa78e7d178a4cf6a381651b624cc9
Parents: d5469b6
Author: Peter Schuller <peter.schuller@infidyne.com>
Authored: Wed Feb 29 02:09:09 2012 -0800
Committer: Peter Schuller <peter.schuller@infidyne.com>
Committed: Wed Feb 29 02:09:09 2012 -0800

----------------------------------------------------------------------
 .../cassandra/io/util/RandomAccessReader.java      |    4 ++--
 .../apache/cassandra/io/util/SequentialWriter.java |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/49e134c7/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/RandomAccessReader.java b/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
index 336cce8..d6f3bf9 100644
--- a/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
+++ b/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
@@ -30,7 +30,7 @@ import org.apache.cassandra.utils.CLibrary;
 
 public class RandomAccessReader extends RandomAccessFile implements FileDataInput
 {
-    public static final long MAX_BYTES_IN_PAGE_CACHE = (long) Math.pow(2, 27); // 128mb
+    public static final long CACHE_FLUSH_INTERVAL_IN_BYTES = (long) Math.pow(2, 27); // 128mb
 
     // default buffer size, 64Kb
     public static final int DEFAULT_BUFFER_SIZE = 65536;
@@ -135,7 +135,7 @@ public class RandomAccessReader extends RandomAccessFile implements FileDataInpu
 
         bytesSinceCacheFlush += read;
 
-        if (skipIOCache && bytesSinceCacheFlush >= MAX_BYTES_IN_PAGE_CACHE)
+        if (skipIOCache && bytesSinceCacheFlush >= CACHE_FLUSH_INTERVAL_IN_BYTES)
         {
             // with random I/O we can't control what we are skipping so
             // it will be more appropriate to just skip a whole file after

http://git-wip-us.apache.org/repos/asf/cassandra/blob/49e134c7/src/java/org/apache/cassandra/io/util/SequentialWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/SequentialWriter.java b/src/java/org/apache/cassandra/io/util/SequentialWriter.java
index 596d72e..70098cb 100644
--- a/src/java/org/apache/cassandra/io/util/SequentialWriter.java
+++ b/src/java/org/apache/cassandra/io/util/SequentialWriter.java
@@ -214,7 +214,7 @@ public class SequentialWriter extends OutputStream
                 // periodically we update this starting offset
                 bytesSinceCacheFlush += validBufferBytes;
 
-                if (bytesSinceCacheFlush >= RandomAccessReader.MAX_BYTES_IN_PAGE_CACHE)
+                if (bytesSinceCacheFlush >= RandomAccessReader.CACHE_FLUSH_INTERVAL_IN_BYTES)
                 {
                     CLibrary.trySkipCache(this.fd, ioCacheStartOffset, 0);
                     ioCacheStartOffset = bufferOffset;


Mime
View raw message