cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [10/10] cassandra git commit: Merge branch 'cassandra-2.2' into trunk
Date Wed, 08 Jul 2015 17:16:57 GMT
Merge branch 'cassandra-2.2' into trunk


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

Branch: refs/heads/trunk
Commit: 83e378737888ad47931ac713b50188f77da2ff56
Parents: 5eed967 ce63a2e
Author: Yuki Morishita <yukim@apache.org>
Authored: Wed Jul 8 12:16:31 2015 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Wed Jul 8 12:16:31 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/83e37873/CHANGES.txt
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/83e37873/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index e3e9b03,4038aa7..6cf2e18
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@@ -180,19 -176,16 +175,16 @@@ public class CompactionManager implemen
          logger.debug("Scheduling a background task check for {}.{} with {}",
                       cfs.keyspace.getName(),
                       cfs.name,
 -                     cfs.getCompactionStrategy().getName());
 +                     cfs.getCompactionStrategyManager().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;
      }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/83e37873/src/java/org/apache/cassandra/metrics/CompactionMetrics.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/metrics/CompactionMetrics.java
index 20a5685,eb00728..19eadc8
--- a/src/java/org/apache/cassandra/metrics/CompactionMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/CompactionMetrics.java
@@@ -61,11 -62,10 +62,10 @@@ public class CompactionMetrics implemen
                  for (String keyspaceName : Schema.instance.getKeyspaces())
                  {
                      for (ColumnFamilyStore cfs : Keyspace.open(keyspaceName).getColumnFamilyStores())
 -                        n += cfs.getCompactionStrategy().getEstimatedRemainingTasks();
 +                        n += cfs.getCompactionStrategyManager().getEstimatedRemainingTasks();
                  }
-                 for (ThreadPoolExecutor collector : collectors)
-                     n += collector.getTaskCount() - collector.getCompletedTaskCount();
-                 return n;
+                 // add number of currently running compactions
+                 return n + compactions.size();
              }
          });
          completedTasks = Metrics.register(factory.createMetricName("CompletedTasks"), new
Gauge<Long>()

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


Mime
View raw message