Merge branch 'cassandra-2.0' into cassandra-2.1

Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/58599a9a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/58599a9a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/58599a9a

Branch: refs/heads/cassandra-2.1
Commit: 58599a9a0793e8ec9ebd73e3ce9616f81783ff2c
Parents: 30df089 f283ed2
Author: Yuki Morishita <yu...@apache.org>
Authored: Wed Jul 8 12:06:51 2015 -0500
Committer: Yuki Morishita <yu...@apache.org>
Committed: Wed Jul 8 12:06:51 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/db/ColumnFamilyStore.java  | 13 +--------
 .../db/compaction/CompactionManager.java        | 28 +++++++-------------
 .../cassandra/metrics/CompactionMetrics.java    |  6 ++---
 .../db/compaction/CompactionsTest.java          | 12 ++++++---
 5 files changed, 24 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/58599a9a/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 0fbadbc,40bf463..bdc5dc2
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,25 -1,9 +1,26 @@@
 -2.0.18
 +2.1.9
 + * (cqlsh) Allow the SSL protocol version to be specified through the
 +   config file or environment variables (CASSANDRA-9544)
 +Merged from 2.0:
   * Scrub (recover) sstables even when -Index.db is missing, (CASSANDRA-9591)
+  * Fix growing pending background compaction (CASSANDRA-9662)
  
  
 -2.0.17
 +2.1.8
 + * (cqlsh) Fix bad check for CQL compatibility when DESCRIBE'ing
 +   COMPACT STORAGE tables with no clustering columns
 + * Warn when an extra-large partition is compacted (CASSANDRA-9643)
 + * Eliminate strong self-reference chains in sstable ref tidiers 
(CASSANDRA-9656)
 + * Ensure StreamSession uses canonical sstable reader instances 
(CASSANDRA-9700) 
 + * Ensure memtable book keeping is not corrupted in the event we shrink usage 
(CASSANDRA-9681)
 + * Update internal python driver for cqlsh (CASSANDRA-9064)
 + * Fix IndexOutOfBoundsException when inserting tuple with too many
 +   elements using the string literal notation (CASSANDRA-9559)
 + * Allow JMX over SSL directly from nodetool (CASSANDRA-9090)
 + * Fix incorrect result for IN queries where column not found (CASSANDRA-9540)
 + * Enable describe on indices (CASSANDRA-7814)
 + * ColumnFamilyStore.selectAndReference may block during compaction 
(CASSANDRA-9637)
 +Merged from 2.0:
   * Avoid NPE in AuthSuccess#decode (CASSANDRA-9727)
   * Add listen_address to system.local (CASSANDRA-9603)
   * Bug fixes to resultset metadata construction (CASSANDRA-9636)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/58599a9a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/58599a9a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 205f89e,5b5b39e..1e4c54a
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@@ -181,19 -145,12 +176,16 @@@ public class CompactionManager implemen
          logger.debug("Scheduling a background task check for {}.{} with {}",
                       cfs.keyspace.getName(),
                       cfs.name,
 -                     cfs.getCompactionStrategy().getClass().getSimpleName());
 +                     cfs.getCompactionStrategy().getName());
-         List<Future<?>> futures = new ArrayList<Future<?>>();
+         List<Future<?>> futures = new ArrayList<>();
 -
          // we must schedule it at least once, otherwise compaction will stop 
for a CF until next flush
-         do {
-             if (executor.isShutdown())
-             {
-                 logger.info("Executor has shut down, not submitting 
background task");
-                 return Collections.emptyList();
-             }
-             compactingCF.add(cfs);
-             futures.add(executor.submit(new BackgroundCompactionTask(cfs)));
-             // if we have room for more compactions, then fill up executor
-         } while (autoFill && executor.getActiveCount() + futures.size() < 
executor.getMaximumPoolSize());
++        if (executor.isShutdown())
++        {
++            logger.info("Executor has shut down, not submitting background 
task");
++            return Collections.emptyList();
++        }
+         compactingCF.add(cfs);
+         futures.add(executor.submit(new BackgroundCompactionCandidate(cfs)));
  
          return futures;
      }
@@@ -206,15 -163,9 +198,15 @@@
          return false;
      }
  
 +    public void finishCompactionsAndShutdown(long timeout, TimeUnit unit) 
throws InterruptedException
 +    {
 +        executor.shutdown();
 +        executor.awaitTermination(timeout, unit);
 +    }
 +
      // the actual sstables to compact are not determined until we run the 
BCT; that way, if new sstables
      // are created between task submission and execution, we execute against 
the most up-to-date information
-     class BackgroundCompactionTask implements Runnable
+     class BackgroundCompactionCandidate implements Runnable
      {
          private final ColumnFamilyStore cfs;
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/58599a9a/test/unit/org/apache/cassandra/db/compaction/CompactionsTest.java
----------------------------------------------------------------------

Reply via email to