cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject svn commit: r1176926 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/db/compaction/CompactionManager.java
Date Wed, 28 Sep 2011 15:46:48 GMT
Author: xedin
Date: Wed Sep 28 15:46:48 2011
New Revision: 1176926

URL: http://svn.apache.org/viewvc?rev=1176926&view=rev
Log:
Fix Scrub compaction finishing
patch by Pavel Yaskevich; reviewed by Jonathan Ellis for (CASSANDRA-3255)

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1176926&r1=1176925&r2=1176926&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Wed Sep 28 15:46:48 2011
@@ -12,7 +12,7 @@
    contains non-hex characters (CASSANDRA-3231)
  * Keep SimpleSnitch proximity ordering unchanged from what the Strategy
    generates, as intended (CASSANDRA-3262)
-
+ * fix Scrub compaction finishing (CASSANDRA-3255)
 
 0.8.6
  * revert CASSANDRA-2388

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java?rev=1176926&r1=1176925&r2=1176926&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
Wed Sep 28 15:46:48 2011
@@ -655,6 +655,8 @@ public class CompactionManager implement
         final BufferedRandomAccessFile dataFile = BufferedRandomAccessFile.getUncachingReader(sstable.getFilename());
         String indexFilename = sstable.descriptor.filenameFor(Component.PRIMARY_INDEX);
         BufferedRandomAccessFile indexFile = BufferedRandomAccessFile.getUncachingReader(indexFilename);
+        ScrubInfo scrubInfo = new ScrubInfo(dataFile, sstable);
+
         try
         {
             ByteBuffer nextIndexKey = ByteBufferUtil.readWithShortLength(indexFile);
@@ -664,10 +666,16 @@ public class CompactionManager implement
                 assert firstRowPositionFromIndex == 0 : firstRowPositionFromIndex;
             }
 
-            SSTableWriter writer = maybeCreateWriter(cfs, compactionFileLocation, expectedBloomFilterSize,
null, Collections.singletonList(sstable));
-            executor.beginCompaction(new ScrubInfo(dataFile, sstable));
+            SSTableWriter writer = maybeCreateWriter(cfs,
+                                                     compactionFileLocation,
+                                                     expectedBloomFilterSize,
+                                                     null,
+                                                     Collections.singletonList(sstable));
+
             int goodRows = 0, badRows = 0, emptyRows = 0;
 
+            executor.beginCompaction(scrubInfo);
+
             while (!dataFile.isEOF())
             {
                 long rowStart = dataFile.getFilePointer();
@@ -807,6 +815,8 @@ public class CompactionManager implement
         {
             FileUtils.closeQuietly(dataFile);
             FileUtils.closeQuietly(indexFile);
+
+            executor.finishCompaction(scrubInfo);
         }
     }
 



Mime
View raw message