cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [3/3] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0
Date Wed, 28 Oct 2015 08:10:31 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/27ca4915
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/27ca4915
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/27ca4915

Branch: refs/heads/cassandra-3.0
Commit: 27ca4915e9a08c9582ebf077f2cc66821494f0b9
Parents: d856d3d 5a356a7
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Wed Oct 28 09:04:30 2015 +0100
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Wed Oct 28 09:04:30 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../DateTieredCompactionStrategy.java           | 46 +++++++-----
 .../DateTieredCompactionStrategyTest.java       | 73 ++++++++++++++------
 3 files changed, 82 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ca4915/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index f8dffb0,9021e9d..9b81b6e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,17 -1,12 +1,18 @@@
 -2.2.4
 +3.0
 + * Fix batches on multiple tables (CASSANDRA-10554)
 + * Ensure compaction options are validated when updating KeyspaceMetadata (CASSANDRA-10569)
 + * Flatten Iterator Transformation Hierarchy (CASSANDRA-9975)
 + * Remove token generator (CASSANDRA-5261)
 + * RolesCache should not be created for any authenticator that does not requireAuthentication
(CASSANDRA-10562)
 + * Fix LogTransaction checking only a single directory for files (CASSANDRA-10421)
 + * Support encrypted and plain traffic on the same port (CASSANDRA-10559)
 + * Fix handling of range tombstones when reading old format sstables (CASSANDRA-10360)
 + * Aggregate with Initial Condition fails with C* 3.0 (CASSANDRA-10367)
 +Merged from 2.2:
   * Expose phi values from failure detector via JMX and tweak debug
     and trace logging (CASSANDRA-9526)
 - * Fix RangeNamesQueryPager (CASSANDRA-10509)
 - * Deprecate Pig support (CASSANDRA-10542)
 - * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
  Merged from 2.1:
+  * Do STCS in DTCS windows (CASSANDRA-10276)
 - * Don't try to get ancestors from half-renamed sstables (CASSANDRA-10501)
   * Avoid repetition of JVM_OPTS in debian package (CASSANDRA-10251)
   * Fix potential NPE from handling result of SIM.highestSelectivityIndex (CASSANDRA-10550)
   * Fix paging issues with partitions containing only static columns data (CASSANDRA-10381)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ca4915/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
index cfb0079,fe8f135..65fec2b
--- a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
@@@ -380,7 -389,7 +390,7 @@@ public class DateTieredCompactionStrate
          if (modifier == null)
              return null;
  
-         return Arrays.<AbstractCompactionTask>asList(new CompactionTask(cfs, modifier,
gcBefore));
 -        return Collections.<AbstractCompactionTask>singleton(new CompactionTask(cfs,
modifier, gcBefore, false));
++        return Collections.<AbstractCompactionTask>singleton(new CompactionTask(cfs,
modifier, gcBefore));
      }
  
      @Override
@@@ -428,9 -437,11 +438,11 @@@
          Map<String, String> uncheckedOptions = AbstractCompactionStrategy.validateOptions(options);
          uncheckedOptions = DateTieredCompactionStrategyOptions.validateOptions(options,
uncheckedOptions);
  
 -        uncheckedOptions.remove(CFPropDefs.KW_MINCOMPACTIONTHRESHOLD);
 -        uncheckedOptions.remove(CFPropDefs.KW_MAXCOMPACTIONTHRESHOLD);
 +        uncheckedOptions.remove(CompactionParams.Option.MIN_THRESHOLD.toString());
 +        uncheckedOptions.remove(CompactionParams.Option.MAX_THRESHOLD.toString());
  
+         uncheckedOptions = SizeTieredCompactionStrategyOptions.validateOptions(options,
uncheckedOptions);
+ 
          return uncheckedOptions;
      }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ca4915/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
index 003a1cf,2824d3a..01a6dfa
--- a/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java
@@@ -32,10 -32,11 +32,11 @@@ import org.apache.cassandra.Util
  import org.apache.cassandra.db.ColumnFamilyStore;
  import org.apache.cassandra.db.DecoratedKey;
  import org.apache.cassandra.db.Keyspace;
 -import org.apache.cassandra.db.Mutation;
 +import org.apache.cassandra.db.RowUpdateBuilder;
++import org.apache.cassandra.db.lifecycle.SSTableSet;
  import org.apache.cassandra.exceptions.ConfigurationException;
  import org.apache.cassandra.io.sstable.format.SSTableReader;
 -import org.apache.cassandra.locator.SimpleStrategy;
 +import org.apache.cassandra.schema.KeyspaceParams;
  import org.apache.cassandra.utils.Pair;
  
  import static org.apache.cassandra.db.compaction.DateTieredCompactionStrategy.getBuckets;
@@@ -55,8 -55,9 +55,8 @@@ public class DateTieredCompactionStrate
      {
          SchemaLoader.prepareServer();
          SchemaLoader.createKeyspace(KEYSPACE1,
-                                     KeyspaceParams.simple(1),
 -                                    SimpleStrategy.class,
 -                                    KSMetaData.optsWithRF(1),
--                                    SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD1));
++                KeyspaceParams.simple(1),
++                SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD1));
      }
  
      @Test
@@@ -221,12 -221,12 +221,12 @@@
          }
          cfs.forceBlockingFlush();
  
 -        List<SSTableReader> sstrs = new ArrayList<>(cfs.getSSTables());
 +        List<SSTableReader> sstrs = new ArrayList<>(cfs.getLiveSSTables());
  
-         List<SSTableReader> newBucket = newestBucket(Collections.singletonList(sstrs.subList(0,
2)), 4, 32, 9, 10);
+         List<SSTableReader> newBucket = newestBucket(Collections.singletonList(sstrs.subList(0,
2)), 4, 32, 9, 10, new SizeTieredCompactionStrategyOptions());
          assertTrue("incoming bucket should not be accepted when it has below the min threshold
SSTables", newBucket.isEmpty());
  
-         newBucket = newestBucket(Collections.singletonList(sstrs.subList(0, 2)), 4, 32,
10, 10);
+         newBucket = newestBucket(Collections.singletonList(sstrs.subList(0, 2)), 4, 32,
10, 10, new SizeTieredCompactionStrategyOptions());
          assertFalse("non-incoming bucket should be accepted when it has at least 2 SSTables",
newBucket.isEmpty());
  
          assertEquals("an sstable with a single value should have equal min/max timestamps",
sstrs.get(0).getMinTimestamp(), sstrs.get(0).getMaxTimestamp());
@@@ -334,4 -318,44 +322,47 @@@
          t.transaction.abort();
      }
  
+     @Test
+     public void testSTCSBigWindow()
+     {
+         Keyspace keyspace = Keyspace.open(KEYSPACE1);
+         ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF_STANDARD1);
+         cfs.truncateBlocking();
+         cfs.disableAutoCompaction();
+         ByteBuffer bigValue = ByteBuffer.wrap(new byte[10000]);
+         ByteBuffer value = ByteBuffer.wrap(new byte[100]);
+         int numSSTables = 40;
+         // create big sstabels out of half:
+         long timestamp = System.currentTimeMillis();
+         for (int r = 0; r < numSSTables / 2; r++)
+         {
+             for (int i = 0; i < 10; i++)
+             {
+                 DecoratedKey key = Util.dk(String.valueOf(r));
 -                Mutation rm = new Mutation(KEYSPACE1, key.getKey());
 -                rm.add(CF_STANDARD1, Util.cellname("column"), bigValue, timestamp);
 -                rm.apply();
++                new RowUpdateBuilder(cfs.metadata, timestamp, key.getKey())
++                    .clustering("column")
++                    .add("val", bigValue).build().applyUnsafe();
+             }
+             cfs.forceBlockingFlush();
+         }
+         // and small ones:
+         for (int r = 0; r < numSSTables / 2; r++)
+         {
+             DecoratedKey key = Util.dk(String.valueOf(r));
 -            Mutation rm = new Mutation(KEYSPACE1, key.getKey());
 -            rm.add(CF_STANDARD1, Util.cellname("column"), value, timestamp);
 -            rm.apply();
++            new RowUpdateBuilder(cfs.metadata, timestamp, key.getKey())
++                .clustering("column")
++                .add("val", value).build().applyUnsafe();
+             cfs.forceBlockingFlush();
+         }
+         Map<String, String> options = new HashMap<>();
+         options.put(SizeTieredCompactionStrategyOptions.MIN_SSTABLE_SIZE_KEY, "1");
+         DateTieredCompactionStrategy dtcs = new DateTieredCompactionStrategy(cfs, options);
 -        for (SSTableReader sstable : cfs.getSSTables())
++        for (SSTableReader sstable : cfs.getSSTables(SSTableSet.CANONICAL))
+             dtcs.addSSTable(sstable);
 -        assertEquals(20, dtcs.getNextBackgroundTask(0).transaction.originals().size());
++        AbstractCompactionTask task = dtcs.getNextBackgroundTask(0);
++        assertEquals(20, task.transaction.originals().size());
++        task.transaction.abort();
++
+     }
+ 
  }


Mime
View raw message