cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1135869 - in /cassandra/trunk: CHANGES.txt conf/cassandra.yaml src/java/org/apache/cassandra/config/Config.java src/java/org/apache/cassandra/config/DatabaseDescriptor.java src/java/org/apache/cassandra/db/commitlog/CommitLog.java
Date Wed, 15 Jun 2011 00:22:02 GMT
Author: jbellis
Date: Wed Jun 15 00:22:02 2011
New Revision: 1135869

URL: http://svn.apache.org/viewvc?rev=1135869&view=rev
Log:
removed commitlog_rotation_threshold_in_mb configuration
patch by Patricio Echague; reviewed by jbellis for CASSANDRA-2771

Modified:
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/conf/cassandra.yaml
    cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
    cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1135869&r1=1135868&r2=1135869&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Wed Jun 15 00:22:02 2011
@@ -1,6 +1,7 @@
 1.0-dev
  * removed binarymemtable (CASSANDRA-2692)
  * add commitlog_total_space_in_mb to prevent fragmented logs (CASSANDRA-2427)
+ * removed commitlog_rotation_threshold_in_mb configuration (CASSANDRA-2771)
 
 
 0.8.1

Modified: cassandra/trunk/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/cassandra.yaml?rev=1135869&r1=1135868&r2=1135869&view=diff
==============================================================================
--- cassandra/trunk/conf/cassandra.yaml (original)
+++ cassandra/trunk/conf/cassandra.yaml Wed Jun 15 00:22:02 2011
@@ -77,9 +77,6 @@ commitlog_directory: /var/lib/cassandra/
 # saved caches
 saved_caches_directory: /var/lib/cassandra/saved_caches
 
-# Size to allow commitlog to grow to before creating a new segment 
-commitlog_rotation_threshold_in_mb: 128
-
 # commitlog_sync may be either "periodic" or "batch." 
 # When in batch mode, Cassandra won't ack writes until the commit log
 # has been fsynced to disk.  It will wait up to

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/Config.java?rev=1135869&r1=1135868&r2=1135869&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/Config.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/Config.java Wed Jun 15 00:22:02 2011
@@ -58,7 +58,6 @@ public class Config
     
     public Integer memtable_flush_writers = null; // will get set to the length of data dirs
in DatabaseDescriptor
     public Integer memtable_total_space_in_mb;
-    public Integer commitlog_total_space_in_mb = 4096;
 
     public Integer sliced_buffer_size_in_kb = 64;
     
@@ -90,7 +89,7 @@ public class Config
 
     // Commit Log
     public String commitlog_directory;
-    public Integer commitlog_rotation_threshold_in_mb;
+    public Integer commitlog_total_space_in_mb = 4096;
     public CommitLogSync commitlog_sync;
     public Double commitlog_sync_batch_window_in_ms;
     public Integer commitlog_sync_period_in_ms;

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=1135869&r1=1135868&r2=1135869&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Wed Jun 15
00:22:02 2011
@@ -766,14 +766,6 @@ public class DatabaseDescriptor
         currentIndex = (currentIndex + 1) % conf.data_file_directories.length;
         return dataFileDirectory;
     }
-    
-    /* threshold after which commit log should be rotated. */
-    public static int getCommitLogSegmentSize() 
-    {
-        return conf.commitlog_rotation_threshold_in_mb != null ?
-               conf.commitlog_rotation_threshold_in_mb * 1024 * 1024 :
-               128*1024*1024;
-    }
 
     public static String getCommitLogLocation()
     {

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java?rev=1135869&r1=1135868&r2=1135869&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java Wed Jun 15 00:22:02
2011
@@ -90,8 +90,8 @@ public class CommitLog implements Commit
     private final Deque<CommitLogSegment> segments = new ArrayDeque<CommitLogSegment>();
 
     private final ICommitLogExecutorService executor;
-    
-    private volatile int segmentSize = 128*1024*1024; // roll after log gets this big
+
+    private static final int SEGMENT_SIZE = 128*1024*1024; // roll after log gets this big
 
     /**
      * param @ table - name of table for which we are maintaining
@@ -104,7 +104,6 @@ public class CommitLog implements Commit
         try
         {
             DatabaseDescriptor.createAllDirectories();
-            segmentSize = DatabaseDescriptor.getCommitLogSegmentSize();
         }
         catch (IOException e)
         {
@@ -539,7 +538,7 @@ public class CommitLog implements Commit
             {
                 currentSegment().write(rowMutation);
                 // roll log if necessary
-                if (currentSegment().length() >= segmentSize)
+                if (currentSegment().length() >= SEGMENT_SIZE)
                 {
                     sync();
                     segments.add(new CommitLogSegment());



Mime
View raw message