cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1211118 - in /cassandra/branches/cassandra-1.0: CHANGES.txt src/java/org/apache/cassandra/cache/AutoSavingCache.java src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java src/java/org/apache/cassandra/tools/NodeCmd.java
Date Tue, 06 Dec 2011 20:52:18 GMT
Author: jbellis
Date: Tue Dec  6 20:52:18 2011
New Revision: 1211118

URL: http://svn.apache.org/viewvc?rev=1211118&view=rev
Log:
revert interruptible cache saving
patch by slebresne; reviewed by jbellis for CASSANDRA-3566

Modified:
    cassandra/branches/cassandra-1.0/CHANGES.txt
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/AutoSavingCache.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java

Modified: cassandra/branches/cassandra-1.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1211118&r1=1211117&r2=1211118&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0/CHANGES.txt Tue Dec  6 20:52:18 2011
@@ -1,6 +1,6 @@
 1.0.6
  * fix adding to leveled manifest after streaming (CASSANDRA-3536)
- * add command to stop compactions (CASSANDRA-1740)
+ * add command to stop compactions (CASSANDRA-1740, 3566)
  * filter out unavailable cipher suites when using encryption (CASSANDRA-3178)
  * (HADOOP) add old-style api support for CFIF and CFRR (CASSANDRA-2799)
  * Support TimeUUIDType column names in Stress.java tool (CASSANDRA-3541)

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/AutoSavingCache.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/AutoSavingCache.java?rev=1211118&r1=1211117&r2=1211118&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/AutoSavingCache.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/AutoSavingCache.java
Tue Dec  6 20:52:18 2011
@@ -38,7 +38,6 @@ import org.apache.cassandra.db.Decorated
 import org.apache.cassandra.db.compaction.CompactionInfo;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.compaction.OperationType;
-import org.apache.cassandra.db.compaction.UserInterruptedException;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.io.util.SequentialWriter;
 import org.apache.cassandra.service.StorageService;
@@ -253,25 +252,20 @@ public abstract class AutoSavingCache<K,
             {
                 for (K key : keys)
                 {
-                    if (isStopped())
-                        throw new UserInterruptedException(getCompactionInfo());
                     ByteBuffer bytes = translateKey(key);
                     ByteBufferUtil.writeWithLength(bytes, out);
                     bytesWritten += bytes.remaining();
                 }
-                out.flush();
-                path.delete(); // ignore error if it didn't exist
-                if (!tmpFile.renameTo(path))
-                    throw new IOException("Unable to rename " + tmpFile + " to " + path);
-                logger.info(String.format("Saved %s (%d items) in %d ms",
-                            path.getName(), keys.size(), (System.currentTimeMillis() - start)));
             }
             finally
             {
-                FileUtils.closeQuietly(out);
-                if (tmpFile.exists())
-                    tmpFile.delete();
+                out.close();
             }
+            path.delete(); // ignore error if it didn't exist
+            if (!tmpFile.renameTo(path))
+                throw new IOException("Unable to rename " + tmpFile + " to " + path);
+            logger.info(String.format("Saved %s (%d items) in %d ms",
+                        path.getName(), keys.size(), (System.currentTimeMillis() - start)));
         }
     }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java?rev=1211118&r1=1211117&r2=1211118&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
Tue Dec  6 20:52:18 2011
@@ -51,8 +51,6 @@ public interface CompactionManagerMBean
      * @param type the type of compaction to stop. Can be one of:
      *   - COMPACTION
      *   - VALIDATION
-     *   - KEY_CACHE_SAVE
-     *   - ROW_CACHE_SAVE
      *   - CLEANUP
      *   - SCRUB
      *   - INDEX_BUILD

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=1211118&r1=1211117&r2=1211118&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java Tue
Dec  6 20:52:18 2011
@@ -168,7 +168,7 @@ public class NodeCmd
         // Four args
         addCmdHelp(header, "setcachecapacity <keyspace> <cfname> <keycachecapacity>
<rowcachecapacity>", "Set the key and row cache capacities of a given column family");
         addCmdHelp(header, "setcompactionthreshold <keyspace> <cfname> <minthreshold>
<maxthreshold>", "Set the min and max compaction thresholds for a given column family");
-        addCmdHelp(header, "stop <compaction_type>", "Supported types are COMPACTION,
VALIDATION, KEY_CACHE_SAVE, ROW_CACHE_SAVE,CLEANUP, SCRUB, INDEX_BUILD");
+        addCmdHelp(header, "stop <compaction_type>", "Supported types are COMPACTION,
VALIDATION, CLEANUP, SCRUB, INDEX_BUILD");
 
         String usage = String.format("java %s --host <arg> <command>%n", NodeCmd.class.getName());
         hf.printHelp(usage, "", options, "");



Mime
View raw message