cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1211299 - in /cassandra/branches/cassandra-1.0: ./ src/java/org/apache/cassandra/cache/ src/java/org/apache/cassandra/concurrent/ src/java/org/apache/cassandra/db/compaction/ src/java/org/apache/cassandra/db/index/ src/java/org/apache/cass...
Date Wed, 07 Dec 2011 04:42:43 GMT
Author: jbellis
Date: Wed Dec  7 04:42:43 2011
New Revision: 1211299

URL: http://svn.apache.org/viewvc?rev=1211299&view=rev
Log:
revert compaction-stopping from 1.0.x

Removed:
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/UserInterruptedException.java
Modified:
    cassandra/branches/cassandra-1.0/CHANGES.txt
    cassandra/branches/cassandra-1.0/NEWS.txt
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/AutoSavingCache.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/AbstractCompactionIterable.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManager.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/db/compaction/CompactionTask.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeCmd.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeProbe.java

Modified: cassandra/branches/cassandra-1.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0/CHANGES.txt Wed Dec  7 04:42:43 2011
@@ -1,6 +1,5 @@
 1.0.6
  * fix adding to leveled manifest after streaming (CASSANDRA-3536)
- * 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/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/NEWS.txt?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/NEWS.txt (original)
+++ cassandra/branches/cassandra-1.0/NEWS.txt Wed Dec  7 04:42:43 2011
@@ -9,16 +9,6 @@ upgrade, just in case you need to roll b
 by version X, but the inverse is not necessarily the case.)
 
 
-1.0.5
-=====
-
-JMX
----
-    - A command has been added to stop running compaction. It is available
-      through JMX and through nodetool stop <type> (see the nodetool help for
-      details). Please note that stopped compaction are terminated and cannot
-      be restarted afterwards.
-
 1.0.4
 =====
 

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=1211299&r1=1211298&r2=1211299&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
Wed Dec  7 04:42:43 2011
@@ -190,7 +190,7 @@ public abstract class AutoSavingCache<K,
         }
     }
 
-    public class Writer extends CompactionInfo.Holder
+    public class Writer implements CompactionInfo.Holder
     {
         private final Set<K> keys;
         private final CompactionInfo info;
@@ -247,6 +247,7 @@ public abstract class AutoSavingCache<K,
 
             logger.debug("Saving {}", path);
             File tmpFile = File.createTempFile(path.getName(), null, path.getParentFile());
+
             DataOutputStream out = SequentialWriter.open(tmpFile, true).stream;
             try
             {
@@ -261,6 +262,7 @@ public abstract class AutoSavingCache<K,
             {
                 out.close();
             }
+
             path.delete(); // ignore error if it didn't exist
             if (!tmpFile.renameTo(path))
                 throw new IOException("Unable to rename " + tmpFile + " to " + path);

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
Wed Dec  7 04:42:43 2011
@@ -23,7 +23,6 @@ package org.apache.cassandra.concurrent;
 
 import java.util.concurrent.*;
 
-import org.apache.cassandra.db.compaction.UserInterruptedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -138,13 +137,10 @@ public class DebuggableThreadPoolExecuto
             }
             catch (ExecutionException e)
             {
-                Throwable actualException = e.getCause();
-                if (actualException instanceof UserInterruptedException)
-                    logger.info("Task interrupted by user: " + actualException);
-                else if (Thread.getDefaultUncaughtExceptionHandler() == null)
-                    logger.error("Error in ThreadPoolExecutor", actualException);
+                if (Thread.getDefaultUncaughtExceptionHandler() == null)
+                    logger.error("Error in ThreadPoolExecutor", e.getCause());
                 else
-                    Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(),
actualException);
+                    Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(),
e.getCause());
             }
         }
 

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/AbstractCompactionIterable.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/AbstractCompactionIterable.java?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/AbstractCompactionIterable.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/AbstractCompactionIterable.java
Wed Dec  7 04:42:43 2011
@@ -35,7 +35,7 @@ import org.apache.cassandra.service.Stor
 import org.apache.cassandra.utils.CloseableIterator;
 import org.apache.cassandra.utils.Throttle;
 
-public abstract class AbstractCompactionIterable extends CompactionInfo.Holder implements
Iterable<AbstractCompactedRow>
+public abstract class AbstractCompactionIterable implements Iterable<AbstractCompactedRow>,
CompactionInfo.Holder
 {
     private static Logger logger = LoggerFactory.getLogger(AbstractCompactionIterable.class);
 

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
Wed Dec  7 04:42:43 2011
@@ -24,6 +24,7 @@ import java.io.Serializable;
 public final class CompactionInfo implements Serializable
 {
     private static final long serialVersionUID = 3695381572726744816L;
+
     private final int id;
     private final String ksname;
     private final String cfname;
@@ -86,19 +87,8 @@ public final class CompactionInfo implem
         return buff.append(')').toString();
     }
 
-    public static abstract class Holder
+    public interface Holder
     {
-        private volatile boolean isStopped = false;
-        public abstract CompactionInfo getCompactionInfo();
-
-        public void stop()
-        {
-            isStopped = true;
-        }
-
-        public boolean isStopped()
-        {
-            return isStopped;
-        }
+        public CompactionInfo getCompactionInfo();
     }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManager.java?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
Wed Dec  7 04:42:43 2011
@@ -37,7 +37,6 @@ import org.apache.cassandra.concurrent.N
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.compaction.CompactionInfo.Holder;
 import org.apache.cassandra.db.index.SecondaryIndexBuilder;
 import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.io.sstable.*;
@@ -511,8 +510,6 @@ public class CompactionManager implement
 
             while (!dataFile.isEOF())
             {
-                if (scrubInfo.isStopped())
-                    throw new UserInterruptedException(scrubInfo.getCompactionInfo());
                 long rowStart = dataFile.getFilePointer();
                 if (logger.isDebugEnabled())
                     logger.debug("Reading row at " + rowStart);
@@ -719,8 +716,6 @@ public class CompactionManager implement
             {
                 while (scanner.hasNext())
                 {
-                    if (ci.isStopped())
-                        throw new UserInterruptedException(ci.getCompactionInfo());
                     SSTableIdentityIterator row = (SSTableIdentityIterator) scanner.next();
                     if (Range.isTokenInRanges(row.getKey().token, ranges))
                     {
@@ -842,8 +837,6 @@ public class CompactionManager implement
             validator.prepare(cfs);
             while (nni.hasNext())
             {
-                if (ci.isStopped())
-                    throw new UserInterruptedException(ci.getCompactionInfo());
                 AbstractCompactedRow row = nni.next();
                 validator.add(row);
             }
@@ -1112,7 +1105,7 @@ public class CompactionManager implement
         }
     }
 
-    private static class CleanupInfo extends CompactionInfo.Holder
+    private static class CleanupInfo implements CompactionInfo.Holder
     {
         private final SSTableReader sstable;
         private final SSTableScanner scanner;
@@ -1140,7 +1133,7 @@ public class CompactionManager implement
         }
     }
 
-    private static class ScrubInfo extends CompactionInfo.Holder
+    private static class ScrubInfo implements CompactionInfo.Holder
     {
         private final RandomAccessReader dataFile;
         private final SSTableReader sstable;
@@ -1167,14 +1160,4 @@ public class CompactionManager implement
             }
         }
     }
-
-    public void stopCompaction(String type)
-    {
-        OperationType operation = OperationType.valueOf(type);
-        for (Holder holder : CompactionExecutor.getCompactions())
-        {
-            if (holder.getCompactionInfo().getTaskType() == operation)
-                holder.stop();
-        }
-    }
 }

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=1211299&r1=1211298&r2=1211299&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
Wed Dec  7 04:42:43 2011
@@ -45,15 +45,4 @@ public interface CompactionManagerMBean
      * @param dataFiles a comma separated list of sstable filename to compact
      */
     public void forceUserDefinedCompaction(String ksname, String dataFiles);
-
-    /**
-     * Stop all running compaction-like tasks having the provided {@code type}.
-     * @param type the type of compaction to stop. Can be one of:
-     *   - COMPACTION
-     *   - VALIDATION
-     *   - CLEANUP
-     *   - SCRUB
-     *   - INDEX_BUILD
-     */
-    public void stopCompaction(String type);
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionTask.java?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Wed Dec  7 04:42:43 2011
@@ -152,9 +152,6 @@ public class CompactionTask extends Abst
             writers.add(writer);
             while (nni.hasNext())
             {
-                if (ci.isStopped())
-                    throw new UserInterruptedException(ci.getCompactionInfo());
-
                 AbstractCompactedRow row = nni.next();
                 if (row.isEmpty())
                     continue;

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
Wed Dec  7 04:42:43 2011
@@ -26,14 +26,14 @@ import org.apache.cassandra.db.Decorated
 import org.apache.cassandra.db.Table;
 import org.apache.cassandra.db.compaction.CompactionInfo;
 import org.apache.cassandra.db.compaction.OperationType;
-import org.apache.cassandra.db.compaction.UserInterruptedException;
 import org.apache.cassandra.io.sstable.ReducingKeyIterator;
 
 /**
  * Manages building an entire index from column family data. Runs on to compaction manager.
  */
-public class SecondaryIndexBuilder extends CompactionInfo.Holder
+public class SecondaryIndexBuilder implements  CompactionInfo.Holder
 {
+    
     private final ColumnFamilyStore cfs;
     private final SortedSet<ByteBuffer> columns;
     private final ReducingKeyIterator iter;
@@ -59,8 +59,6 @@ public class SecondaryIndexBuilder exten
     {
         while (iter.hasNext())
         {
-            if (isStopped())
-                throw new UserInterruptedException(getCompactionInfo());
             DecoratedKey<?> key = iter.next();
             Table.indexRow(key, cfs, columns);
         }

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=1211299&r1=1211298&r2=1211299&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 Wed
Dec  7 04:42:43 2011
@@ -109,7 +109,6 @@ public class NodeCmd
         SETCOMPACTIONTHROUGHPUT,
         SNAPSHOT,
         STATUSTHRIFT,
-        STOP,
         TPSTATS,
         UPGRADESSTABLES,
         VERSION,
@@ -168,7 +167,6 @@ 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, CLEANUP, SCRUB, INDEX_BUILD");
 
         String usage = String.format("java %s --host <arg> <command>%n", NodeCmd.class.getName());
         hf.printHelp(usage, "", options, "");
@@ -748,11 +746,6 @@ public class NodeCmd
 
                 case GOSSIPINFO : nodeCmd.printGossipInfo(System.out); break;
 
-                case STOP:
-                    if (arguments.length != 1) { badUse("stop requires a type."); }
-                    probe.stop(arguments[0].toUpperCase());
-                    break;
-
                 default :
                     throw new RuntimeException("Unreachable code.");
             }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=1211299&r1=1211298&r2=1211299&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/tools/NodeProbe.java Wed
Dec  7 04:42:43 2011
@@ -635,11 +635,6 @@ public class NodeProbe
     {
         return fdProxy.getAllEndpointStates();
     }
-
-    public void stop(String string)
-    {
-        compactionProxy.stopCompaction(string);
-    }
 }
 
 class ColumnFamilyStoreMBeanIterator implements Iterator<Map.Entry<String, ColumnFamilyStoreMBean>>



Mime
View raw message