cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1079985 - in /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra: db/CompactionManager.java io/sstable/SSTableWriter.java
Date Wed, 09 Mar 2011 20:44:34 GMT
Author: jbellis
Date: Wed Mar  9 20:44:34 2011
New Revision: 1079985

URL: http://svn.apache.org/viewvc?rev=1079985&view=rev
Log:
revert un-revied SSTableWriter changes

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java?rev=1079985&r1=1079984&r2=1079985&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java
Wed Mar  9 20:44:34 2011
@@ -927,7 +927,7 @@ public class CompactionManager implement
             return executor.submit(runnable);
     }
     
-    public Future<SSTableReader> submitSSTableBuild(final Descriptor desc)
+    public Future<SSTableReader> submitSSTableBuild(Descriptor desc)
     {
         // invalid descriptions due to missing or dropped CFS are handled by SSTW and StreamInSession.
         final SSTableWriter.Builder builder = SSTableWriter.createBuilder(desc);
@@ -938,7 +938,7 @@ public class CompactionManager implement
                 compactionLock.lock();
                 try
                 {
-                    executor.beginCompaction(desc.cfname, builder);
+                    executor.beginCompaction(builder.cfs.columnFamily, builder);
                     return builder.build();
                 }
                 finally

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java?rev=1079985&r1=1079984&r2=1079985&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
Wed Mar  9 20:44:34 2011
@@ -244,7 +244,7 @@ public class SSTableWriter extends SSTab
     public static class Builder implements ICompactionInfo
     {
         private final Descriptor desc;
-        private final ColumnFamilyStore cfs;
+        public final ColumnFamilyStore cfs;
         private BufferedRandomAccessFile dfile;
 
         public Builder(Descriptor desc)
@@ -252,14 +252,6 @@ public class SSTableWriter extends SSTab
 
             this.desc = desc;
             cfs = Table.open(desc.ksname).getColumnFamilyStore(desc.cfname);
-        }
-
-        // lazy-initialize the file to avoid opening it until it's actually executing on
the CompactionManager,
-        // since the 8MB buffers can use up heap quickly
-        private void maybeOpenFile()
-        {
-            if (dfile != null)
-                return;
             try
             {
                 dfile = new BufferedRandomAccessFile(new File(desc.filenameFor(SSTable.COMPONENT_DATA)),
"r", 8 * 1024 * 1024, true);
@@ -274,8 +266,6 @@ public class SSTableWriter extends SSTab
         {
             if (cfs.isInvalid())
                 return null;
-            maybeOpenFile();
-
             File ifile = new File(desc.filenameFor(SSTable.COMPONENT_INDEX));
             File ffile = new File(desc.filenameFor(SSTable.COMPONENT_FILTER));
             assert !ifile.exists();
@@ -342,10 +332,8 @@ public class SSTableWriter extends SSTab
 
         public long getTotalBytes()
         {
-            maybeOpenFile();
             try
             {
-                // (length is still valid post-close)
                 return dfile.length();
             }
             catch (IOException e)
@@ -356,8 +344,6 @@ public class SSTableWriter extends SSTab
 
         public long getBytesComplete()
         {
-            maybeOpenFile();
-            // (getFilePointer is still valid post-close)
             return dfile.getFilePointer();
         }
 



Mime
View raw message