cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdeggles...@apache.org
Subject [2/3] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11
Date Tue, 06 Nov 2018 23:53:59 GMT
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/trunk
Commit: 4b2692fc978764d93209db27c13b0fbdb5896034
Parents: a6a9dce e04efab
Author: Blake Eggleston <bdeggleston@gmail.com>
Authored: Tue Nov 6 11:59:49 2018 -0800
Committer: Blake Eggleston <bdeggleston@gmail.com>
Committed: Tue Nov 6 15:48:06 2018 -0800

----------------------------------------------------------------------
 .../io/sstable/format/big/BigFormat.java        |  2 +-
 .../io/sstable/metadata/MetadataCollector.java  | 18 ++++---
 .../org/apache/cassandra/db/KeyspaceTest.java   | 34 --------------
 .../apache/cassandra/db/filter/SliceTest.java   | 42 -----------------
 .../io/sstable/SSTableMetadataTest.java         | 49 --------------------
 5 files changed, 12 insertions(+), 133 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4b2692fc/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
index ea0214b,d4549dd..b62cb11
--- a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
@@@ -110,7 -111,7 +110,7 @@@ public class BigFormat implements SSTab
      // we always incremented the major version.
      static class BigVersion extends Version
      {
--        public static final String current_version = "mc";
++        public static final String current_version = "md";
          public static final String earliest_supported_version = "jb";
  
          // jb (2.0.1): switch from crc32 to adler32 for compression checksums

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4b2692fc/src/java/org/apache/cassandra/io/sstable/metadata/MetadataCollector.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/metadata/MetadataCollector.java
index a618c96,437d80f..0ac5187
--- a/src/java/org/apache/cassandra/io/sstable/metadata/MetadataCollector.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/MetadataCollector.java
@@@ -273,8 -272,11 +274,11 @@@ public class MetadataCollector implemen
  
      public Map<MetadataType, MetadataComponent> finalizeMetadata(String partitioner,
double bloomFilterFPChance, long repairedAt, SerializationHeader header)
      {
-         Preconditions.checkState(comparator.compare(maxClustering, minClustering) >=
0);
+         Preconditions.checkState((minClustering == null && maxClustering == null)
+                                  || comparator.compare(maxClustering, minClustering) >=
0);
+         ByteBuffer[] minValues = minClustering != null ? minClustering.getRawValues() :
EMPTY_CLUSTERING;
+         ByteBuffer[] maxValues = maxClustering != null ? maxClustering.getRawValues() :
EMPTY_CLUSTERING;
 -        Map<MetadataType, MetadataComponent> components = Maps.newHashMap();
 +        Map<MetadataType, MetadataComponent> components = new EnumMap<>(MetadataType.class);
          components.put(MetadataType.VALIDATION, new ValidationMetadata(partitioner, bloomFilterFPChance));
          components.put(MetadataType.STATS, new StatsMetadata(estimatedPartitionSize,
                                                               estimatedCellPerPartitionCount,

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4b2692fc/test/unit/org/apache/cassandra/db/KeyspaceTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/KeyspaceTest.java
index f2a9984,d864fa3..3c3b04b
--- a/test/unit/org/apache/cassandra/db/KeyspaceTest.java
+++ b/test/unit/org/apache/cassandra/db/KeyspaceTest.java
@@@ -452,40 -433,40 +452,6 @@@ public class KeyspaceTest extends CQLTe
          assertRowsInResult(cfs, command, expectedValues);
      }
  
--    @Test
--    public void testLimitSSTablesComposites() throws Throwable
--    {
--        // creates 10 sstables, composite columns like this:
--        // ---------------------
--        // k   |a0:0|a1:1|..|a9:9
--        // ---------------------
--        // ---------------------
--        // k   |a0:10|a1:11|..|a9:19
--        // ---------------------
--        // ...
--        // ---------------------
--        // k   |a0:90|a1:91|..|a9:99
--        // ---------------------
--        // then we slice out col1 = a5 and col2 > 85 -> which should let us just check
2 sstables and get 2 columns
-         createTable("CREATE TABLE %s (a text, b text, c int, d int, PRIMARY KEY (a, b, c))");
-         final ColumnFamilyStore cfs = getCurrentColumnFamilyStore();
 -        String tableName = createTable("CREATE TABLE %s (a text, b text, c int, d int, PRIMARY
KEY (a, b, c))");
 -        final ColumnFamilyStore cfs = Keyspace.open(KEYSPACE).getColumnFamilyStore(tableName);
--        cfs.disableAutoCompaction();
--
--        for (int j = 0; j < 10; j++)
--        {
--            for (int i = 0; i < 10; i++)
--                execute("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", "0", "a" + i,
j * 10 + i, 0);
--
--            cfs.forceBlockingFlush();
--        }
--
--        ((ClearableHistogram)cfs.metric.sstablesPerReadHistogram.cf).clear();
--        assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b, c) >= (?, ?) AND (b)
<= (?) LIMIT 1000", "0", "a5", 85, "a5"),
--                row("0", "a5", 85, 0),
--                row("0", "a5", 95, 0));
--        assertEquals(2, cfs.metric.sstablesPerReadHistogram.cf.getSnapshot().getMax(), 0.1);
--    }
--
      private void validateSliceLarge(ColumnFamilyStore cfs)
      {
          ClusteringIndexSliceFilter filter = slices(cfs, 1000, null, false);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4b2692fc/test/unit/org/apache/cassandra/db/filter/SliceTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/filter/SliceTest.java
index c2589d8,2f07a24..9188c94
--- a/test/unit/org/apache/cassandra/db/filter/SliceTest.java
+++ b/test/unit/org/apache/cassandra/db/filter/SliceTest.java
@@@ -226,48 -228,48 +226,6 @@@ public class SliceTes
          slice = Slice.make(makeBound(sk, 0), makeBound(ek, 2, 0, 0));
          assertTrue(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 0, 0)));
  
--        // the slice technically falls within the sstable range, but since the first component
is restricted to
--        // a single value, we can check that the second component does not fall within its
min/max
--        slice = Slice.make(makeBound(sk, 1, 2, 0), makeBound(ek, 1, 3, 0));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same case, but with a missing start component
--        slice = Slice.make(makeBound(sk, 1, 2), makeBound(ek, 1, 3, 0));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same case, but with a missing end component
--        slice = Slice.make(makeBound(sk, 1, 2, 0), makeBound(ek, 1, 3));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same case, but with a missing start and end components
--        slice = Slice.make(makeBound(sk, 1, 2), makeBound(ek, 1, 3));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same case, but with missing start and end components and different lengths for
start and end
--        slice = Slice.make(makeBound(sk, 1, 2), makeBound(ek, 1));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--
--        // same as the previous set of tests, but the second component is equal in the slice
start and end
--        slice = Slice.make(makeBound(sk, 1, 2, 0), makeBound(ek, 1, 2, 0));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same case, but with a missing start component
--        slice = Slice.make(makeBound(sk, 1, 2), makeBound(ek, 1, 2, 0));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same case, but with a missing end component
--        slice = Slice.make(makeBound(sk, 1, 2, 0), makeBound(ek, 1, 2));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same case, but with a missing start and end components
--        slice = Slice.make(makeBound(sk, 1, 2), makeBound(ek, 1, 2));
--        assertFalse(slice.intersects(cc, columnNames(1, 0, 0), columnNames(2, 1, 0)));
--
--        // same as the previous tests, but it's the third component that doesn't fit in
its range this time
--        slice = Slice.make(makeBound(sk, 1, 1, 2), makeBound(ek, 1, 1, 3));
--        assertFalse(slice.intersects(cc, columnNames(1, 1, 0), columnNames(2, 2, 1)));
--
          // empty min/max column names
          slice = Slice.make(makeBound(sk), makeBound(ek));
          assertTrue(slice.intersects(cc, columnNames(), columnNames()));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4b2692fc/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
index ffe7b06,ffe7b06..419eb25
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
@@@ -243,55 -243,55 +243,6 @@@ public class SSTableMetadataTes
          }
      }
  
--    @Test
--    public void testMaxMinComposites() throws CharacterCodingException, ExecutionException,
InterruptedException
--    {
--        /*
--        creates two sstables, columns like this:
--        ---------------------
--        k   |a0:9|a1:8|..|a9:0
--        ---------------------
--        and
--        ---------------------
--        k2  |b0:9|b1:8|..|b9:0
--        ---------------------
--        meaning max columns are b9 and 9, min is a0 and 0
--         */
--        Keyspace keyspace = Keyspace.open(KEYSPACE1);
--
--        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore("StandardComposite2");
--
--        for (int i = 0; i < 10; i++)
--        {
--            new RowUpdateBuilder(cfs.metadata, 0, "k")
--                .clustering("a" + (9 - i), getBytes(i))
--                .add("val", ByteBufferUtil.EMPTY_BYTE_BUFFER)
--                .build()
--                .applyUnsafe();
--
--        }
--        cfs.forceBlockingFlush();
--
--        for (int i = 0; i < 10; i++)
--        {
--            new RowUpdateBuilder(cfs.metadata, 0, "k2")
--            .clustering("b" + (9 - i), getBytes(i))
--            .add("val", ByteBufferUtil.EMPTY_BYTE_BUFFER)
--            .build()
--            .applyUnsafe();
--        }
--        cfs.forceBlockingFlush();
--        cfs.forceMajorCompaction();
--        assertEquals(cfs.getLiveSSTables().size(), 1);
--        for (SSTableReader sstable : cfs.getLiveSSTables())
--        {
--            assertEquals("b9", ByteBufferUtil.string(sstable.getSSTableMetadata().maxClusteringValues.get(0)));
--            assertEquals(9, ByteBufferUtil.toInt(sstable.getSSTableMetadata().maxClusteringValues.get(1)));
--            assertEquals("a0", ByteBufferUtil.string(sstable.getSSTableMetadata().minClusteringValues.get(0)));
--            assertEquals(0, ByteBufferUtil.toInt(sstable.getSSTableMetadata().minClusteringValues.get(1)));
--        }
--    }
--
      /*@Test
      public void testLegacyCounterShardTracking()
      {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message