cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [4/4] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0
Date Tue, 18 Aug 2015 09:02:50 GMT
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/cassandra-3.0
Commit: 6c69f07c2ed3a24398a55811f8c8cad326c3e2ce
Parents: 2350320 09147a8
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Tue Aug 18 10:56:06 2015 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Tue Aug 18 10:56:06 2015 +0200

----------------------------------------------------------------------
 .../DateTieredCompactionStrategy.java           |  7 +++----
 .../DateTieredCompactionStrategyOptions.java    | 21 ++++++++++++++++++++
 .../DateTieredCompactionStrategyTest.java       |  2 +-
 3 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6c69f07c/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
index a908884,0956962..ad14a9c
--- a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
@@@ -85,17 -81,17 +84,17 @@@ public class DateTieredCompactionStrate
       */
      private List<SSTableReader> getNextBackgroundSSTables(final int gcBefore)
      {
 -        if (cfs.getSSTables().isEmpty())
 +        if (Iterables.isEmpty(cfs.getSSTables(SSTableSet.LIVE)))
              return Collections.emptyList();
  
 -        Set<SSTableReader> uncompacting = Sets.intersection(sstables, cfs.getUncompactingSSTables());
 +        Set<SSTableReader> uncompacting = ImmutableSet.copyOf(filter(cfs.getUncompactingSSTables(),
sstables::contains));
  
          Set<SSTableReader> expired = Collections.emptySet();
-         // we only check for expired sstables every 10 minutes due to it being an expensive
operation
-         if (System.currentTimeMillis() - lastExpiredCheck > TimeUnit.MINUTES.toMillis(10))
+         // we only check for expired sstables every 10 minutes (by default) due to it being
an expensive operation
+         if (System.currentTimeMillis() - lastExpiredCheck > options.expiredSSTableCheckFrequency)
          {
              // Find fully expired SSTables. Those will be included no matter what.
 -            expired = CompactionController.getFullyExpiredSSTables(cfs, uncompacting, cfs.getOverlappingSSTables(uncompacting),
gcBefore);
 +            expired = CompactionController.getFullyExpiredSSTables(cfs, uncompacting, cfs.getOverlappingSSTables(SSTableSet.CANONICAL,
uncompacting), gcBefore);
              lastExpiredCheck = System.currentTimeMillis();
          }
          Set<SSTableReader> candidates = Sets.newHashSet(filterSuspectSSTables(uncompacting));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6c69f07c/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
index 7b3b9e7,0159c83..003a1cf
--- a/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
@@@ -319,8 -316,9 +319,9 @@@ public class DateTieredCompactionStrate
          options.put(DateTieredCompactionStrategyOptions.BASE_TIME_KEY, "30");
          options.put(DateTieredCompactionStrategyOptions.TIMESTAMP_RESOLUTION_KEY, "MILLISECONDS");
          options.put(DateTieredCompactionStrategyOptions.MAX_SSTABLE_AGE_KEY, Double.toString((1d
/ (24 * 60 * 60))));
+         options.put(DateTieredCompactionStrategyOptions.EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS_KEY,
"0");
          DateTieredCompactionStrategy dtcs = new DateTieredCompactionStrategy(cfs, options);
 -        for (SSTableReader sstable : cfs.getSSTables())
 +        for (SSTableReader sstable : cfs.getLiveSSTables())
              dtcs.addSSTable(sstable);
          dtcs.startup();
          assertNull(dtcs.getNextBackgroundTask((int) (System.currentTimeMillis() / 1000)));


Mime
View raw message