cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdeggles...@apache.org
Subject [1/3] cassandra git commit: ninja: fix out of date tests
Date Tue, 06 Nov 2018 23:53:58 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 e04efab3f -> 7bf617165
  refs/heads/trunk 51c8387de -> 3ebeef6d2


ninja: fix out of date tests


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

Branch: refs/heads/cassandra-3.0
Commit: 7bf617165e910f08db81917742ab8036215ab300
Parents: e04efab
Author: Blake Eggleston <bdeggleston@gmail.com>
Authored: Tue Nov 6 14:18:09 2018 -0800
Committer: Blake Eggleston <bdeggleston@gmail.com>
Committed: Tue Nov 6 15:43:58 2018 -0800

----------------------------------------------------------------------
 .../io/sstable/format/big/BigFormat.java        |  2 +-
 .../org/apache/cassandra/db/KeyspaceTest.java   | 34 --------------
 .../apache/cassandra/db/filter/SliceTest.java   | 42 -----------------
 .../io/sstable/SSTableMetadataTest.java         | 49 --------------------
 4 files changed, 1 insertion(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7bf61716/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
index d4549dd..ae93c5f 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
@@ -111,7 +111,7 @@ public class BigFormat implements SSTableFormat
     // 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/7bf61716/test/unit/org/apache/cassandra/db/KeyspaceTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/KeyspaceTest.java b/test/unit/org/apache/cassandra/db/KeyspaceTest.java
index d864fa3..dd11c1c 100644
--- a/test/unit/org/apache/cassandra/db/KeyspaceTest.java
+++ b/test/unit/org/apache/cassandra/db/KeyspaceTest.java
@@ -433,40 +433,6 @@ public class KeyspaceTest extends CQLTester
         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
-        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/7bf61716/test/unit/org/apache/cassandra/db/filter/SliceTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/filter/SliceTest.java b/test/unit/org/apache/cassandra/db/filter/SliceTest.java
index 2f07a24..606395c 100644
--- a/test/unit/org/apache/cassandra/db/filter/SliceTest.java
+++ b/test/unit/org/apache/cassandra/db/filter/SliceTest.java
@@ -228,48 +228,6 @@ public class SliceTest
         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/7bf61716/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
index ffe7b06..419eb25 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataTest.java
@@ -243,55 +243,6 @@ public class SSTableMetadataTest
         }
     }
 
-    @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