Search in sources :

Example 1 with QueryProcessor.executeOnceInternal

use of org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal in project cassandra by apache.

the class SinglePartitionSliceCommandTest method testPartitionDeletionRowDeletionTie.

/**
 * Partition deletion should remove row deletion when tie
 */
@Test
public void testPartitionDeletionRowDeletionTie() {
    QueryProcessor.executeOnceInternal("CREATE TABLE ks.partition_row_deletion (k int, c int, v int, primary key (k, c))");
    TableMetadata metadata = Schema.instance.getTableMetadata("ks", "partition_row_deletion");
    ColumnFamilyStore cfs = Schema.instance.getColumnFamilyStoreInstance(metadata.id);
    cfs.disableAutoCompaction();
    BiFunction<Boolean, Boolean, List<Unfiltered>> tester = (flush, multiSSTable) -> {
        cfs.truncateBlocking();
        // timestamp and USING TIMESTAMP have different values to ensure the correct timestamp (the one specified in the
        // query) is the one being picked up. For safety reason we want to be able to ensure that further to its main goal
        // the test can also detect wrongful change of the code. The current timestamp retrieved from the ClientState is
        // ignored but nowInSeconds is retrieved from it and used for the DeletionTime.  It shows the difference between the
        // time at which the record was marked for deletion and the time at which it truly happened.
        final long timestamp = FBUtilities.timestampMicros();
        final int nowInSec = FBUtilities.nowInSeconds();
        QueryProcessor.executeOnceInternalWithNowAndTimestamp(nowInSec, timestamp, "DELETE FROM ks.partition_row_deletion USING TIMESTAMP 10 WHERE k=1");
        if (flush && multiSSTable)
            cfs.forceBlockingFlush();
        QueryProcessor.executeOnceInternalWithNowAndTimestamp(nowInSec, timestamp, "DELETE FROM ks.partition_row_deletion USING TIMESTAMP 10 WHERE k=1 and c=1");
        if (flush)
            cfs.forceBlockingFlush();
        QueryProcessor.executeOnceInternal("INSERT INTO ks.partition_row_deletion(k,c,v) VALUES(1,1,1) using timestamp 11");
        if (flush) {
            cfs.forceBlockingFlush();
            try {
                cfs.forceMajorCompaction();
            } catch (Throwable e) {
                throw new RuntimeException(e);
            }
        }
        try (UnfilteredRowIterator partition = getIteratorFromSinglePartition("SELECT * FROM ks.partition_row_deletion where k=1 and c=1")) {
            assertEquals(10, partition.partitionLevelDeletion().markedForDeleteAt());
            return toUnfiltereds(partition);
        }
    };
    List<Unfiltered> memtableUnfiltereds = tester.apply(false, false);
    List<Unfiltered> singleSSTableUnfiltereds = tester.apply(true, false);
    List<Unfiltered> multiSSTableUnfiltereds = tester.apply(true, true);
    assertEquals(1, singleSSTableUnfiltereds.size());
    String errorMessage = String.format("Expected %s but got %s", toString(memtableUnfiltereds, metadata), toString(singleSSTableUnfiltereds, metadata));
    assertEquals(errorMessage, memtableUnfiltereds, singleSSTableUnfiltereds);
    errorMessage = String.format("Expected %s but got %s", toString(singleSSTableUnfiltereds, metadata), toString(multiSSTableUnfiltereds, metadata));
    assertEquals(errorMessage, singleSSTableUnfiltereds, multiSSTableUnfiltereds);
    memtableUnfiltereds.forEach(u -> assertTrue("Expected no row deletion, but got " + u.toString(metadata, true), ((Row) u).deletion().isLive()));
}
Also used : TableMetadata(org.apache.cassandra.schema.TableMetadata) Arrays(java.util.Arrays) BiFunction(java.util.function.BiFunction) ByteBuffer(java.nio.ByteBuffer) RangeTombstoneMarker(org.apache.cassandra.db.rows.RangeTombstoneMarker) UnfilteredPartitionIterator(org.apache.cassandra.db.partitions.UnfilteredPartitionIterator) SelectStatement(org.apache.cassandra.cql3.statements.SelectStatement) BTreeSet(org.apache.cassandra.utils.btree.BTreeSet) ColumnFilter(org.apache.cassandra.db.filter.ColumnFilter) IntegerType(org.apache.cassandra.db.marshal.IntegerType) DatabaseDescriptor(org.apache.cassandra.config.DatabaseDescriptor) AbstractClusteringIndexFilter(org.apache.cassandra.db.filter.AbstractClusteringIndexFilter) FBUtilities(org.apache.cassandra.utils.FBUtilities) Util(org.apache.cassandra.Util) KeyspaceParams(org.apache.cassandra.schema.KeyspaceParams) Collectors(java.util.stream.Collectors) List(java.util.List) ColumnIdentifier(org.apache.cassandra.cql3.ColumnIdentifier) TableMetadata(org.apache.cassandra.schema.TableMetadata) DataLimits(org.apache.cassandra.db.filter.DataLimits) DataInputPlus(org.apache.cassandra.io.util.DataInputPlus) DataInputBuffer(org.apache.cassandra.io.util.DataInputBuffer) Iterables(com.google.common.collect.Iterables) PartitionUpdate(org.apache.cassandra.db.partitions.PartitionUpdate) ColumnMetadata(org.apache.cassandra.schema.ColumnMetadata) DataOutputBuffer(org.apache.cassandra.io.util.DataOutputBuffer) BeforeClass(org.junit.BeforeClass) Unfiltered(org.apache.cassandra.db.rows.Unfiltered) QueryProcessor(org.apache.cassandra.cql3.QueryProcessor) ClusteringIndexNamesFilter(org.apache.cassandra.db.filter.ClusteringIndexNamesFilter) Schema(org.apache.cassandra.schema.Schema) Int32Type(org.apache.cassandra.db.marshal.Int32Type) UTF8Type(org.apache.cassandra.db.marshal.UTF8Type) Lists(com.google.common.collect.Lists) Row(org.apache.cassandra.db.rows.Row) ConfigurationException(org.apache.cassandra.exceptions.ConfigurationException) UnfilteredRowIterator(org.apache.cassandra.db.rows.UnfilteredRowIterator) Assert.assertArrayEquals(org.junit.Assert.assertArrayEquals) Before(org.junit.Before) MessagingService(org.apache.cassandra.net.MessagingService) RowFilter(org.apache.cassandra.db.filter.RowFilter) Iterator(java.util.Iterator) ByteBufferUtil(org.apache.cassandra.utils.ByteBufferUtil) ClientState(org.apache.cassandra.service.ClientState) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) Test(org.junit.Test) ClusteringIndexSliceFilter(org.apache.cassandra.db.filter.ClusteringIndexSliceFilter) Ints(com.google.common.primitives.Ints) TimeUnit(java.util.concurrent.TimeUnit) SchemaLoader(org.apache.cassandra.SchemaLoader) Cell(org.apache.cassandra.db.rows.Cell) Assert(org.junit.Assert) QueryOptions(org.apache.cassandra.cql3.QueryOptions) Assert.assertEquals(org.junit.Assert.assertEquals) UnfilteredRowIterator(org.apache.cassandra.db.rows.UnfilteredRowIterator) List(java.util.List) Unfiltered(org.apache.cassandra.db.rows.Unfiltered) Test(org.junit.Test)

Example 2 with QueryProcessor.executeOnceInternal

use of org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal in project cassandra by apache.

the class SASIIndexTest method testConditionalsWithReversedType.

@Test
public void testConditionalsWithReversedType() {
    final String TABLE_NAME = "reversed_clustering";
    QueryProcessor.executeOnceInternal(String.format("CREATE TABLE IF NOT EXISTS %s.%s (pk text, ck int, v int, PRIMARY KEY (pk, ck)) " + "WITH CLUSTERING ORDER BY (ck DESC);", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("CREATE CUSTOM INDEX ON %s.%s (ck) USING 'org.apache.cassandra.index.sasi.SASIIndex'", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("CREATE CUSTOM INDEX ON %s.%s (v) USING 'org.apache.cassandra.index.sasi.SASIIndex'", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (pk, ck, v) VALUES ('Alex', 1, 1);", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (pk, ck, v) VALUES ('Alex', 2, 2);", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (pk, ck, v) VALUES ('Alex', 3, 3);", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (pk, ck, v) VALUES ('Tom', 1, 1);", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (pk, ck, v) VALUES ('Tom', 2, 2);", KS_NAME, TABLE_NAME));
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (pk, ck, v) VALUES ('Tom', 3, 3);", KS_NAME, TABLE_NAME));
    UntypedResultSet resultSet = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE ck <= 2;", KS_NAME, TABLE_NAME));
    CQLTester.assertRowsIgnoringOrder(resultSet, CQLTester.row("Alex", 1, 1), CQLTester.row("Alex", 2, 2), CQLTester.row("Tom", 1, 1), CQLTester.row("Tom", 2, 2));
    resultSet = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE ck <= 2 AND v > 1 ALLOW FILTERING;", KS_NAME, TABLE_NAME));
    CQLTester.assertRowsIgnoringOrder(resultSet, CQLTester.row("Alex", 2, 2), CQLTester.row("Tom", 2, 2));
    resultSet = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE ck < 2;", KS_NAME, TABLE_NAME));
    CQLTester.assertRowsIgnoringOrder(resultSet, CQLTester.row("Alex", 1, 1), CQLTester.row("Tom", 1, 1));
    resultSet = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE ck >= 2;", KS_NAME, TABLE_NAME));
    CQLTester.assertRowsIgnoringOrder(resultSet, CQLTester.row("Alex", 2, 2), CQLTester.row("Alex", 3, 3), CQLTester.row("Tom", 2, 2), CQLTester.row("Tom", 3, 3));
    resultSet = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE ck >= 2 AND v < 3 ALLOW FILTERING;", KS_NAME, TABLE_NAME));
    CQLTester.assertRowsIgnoringOrder(resultSet, CQLTester.row("Alex", 2, 2), CQLTester.row("Tom", 2, 2));
    resultSet = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE ck > 2;", KS_NAME, TABLE_NAME));
    CQLTester.assertRowsIgnoringOrder(resultSet, CQLTester.row("Alex", 3, 3), CQLTester.row("Tom", 3, 3));
}
Also used : UntypedResultSet(org.apache.cassandra.cql3.UntypedResultSet)

Example 3 with QueryProcessor.executeOnceInternal

use of org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal in project cassandra by apache.

the class SASIIndexTest method testLIKEAndEQSemanticsWithDifferenceKindsOfIndexes.

private void testLIKEAndEQSemanticsWithDifferenceKindsOfIndexes(String containsTable, String prefixTable, String analyzedPrefixTable, String tokenizedContainsTable, boolean forceFlush) {
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (?, ?);", KS_NAME, containsTable), 0, "Pavel");
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (?, ?);", KS_NAME, prefixTable), 0, "Jean-Claude");
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (?, ?);", KS_NAME, analyzedPrefixTable), 0, "Jean-Claude");
    QueryProcessor.executeOnceInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (?, ?);", KS_NAME, tokenizedContainsTable), 0, "Pavel");
    if (forceFlush) {
        Keyspace keyspace = Keyspace.open(KS_NAME);
        for (String table : Arrays.asList(containsTable, prefixTable, analyzedPrefixTable)) keyspace.getColumnFamilyStore(table).forceBlockingFlush();
    }
    UntypedResultSet results;
    // CONTAINS
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Pav';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(0, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Pav%%';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Pavel';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v = 'Pav';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(0, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v = 'Pavel';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    try {
        QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v = 'Pav';", KS_NAME, tokenizedContainsTable));
        Assert.fail();
    } catch (InvalidRequestException e) {
    // expected since CONTAINS + analyzed indexes only support LIKE
    }
    try {
        QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Pav%%';", KS_NAME, tokenizedContainsTable));
        Assert.fail();
    } catch (InvalidRequestException e) {
    // expected since CONTAINS + analyzed only support LIKE
    }
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Pav%%';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE '%%Pav';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(0, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE '%%Pav%%';", KS_NAME, containsTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    // PREFIX
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v = 'Jean';", KS_NAME, prefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(0, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v = 'Jean-Claude';", KS_NAME, prefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Jea';", KS_NAME, prefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(0, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Jea%%';", KS_NAME, prefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    try {
        QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE '%%Jea';", KS_NAME, prefixTable));
        Assert.fail();
    } catch (InvalidRequestException e) {
    // expected since PREFIX indexes only support LIKE '<term>%'
    }
    try {
        QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE '%%Jea%%';", KS_NAME, prefixTable));
        Assert.fail();
    } catch (InvalidRequestException e) {
    // expected since PREFIX indexes only support LIKE '<term>%'
    }
    try {
        QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v = 'Jean';", KS_NAME, analyzedPrefixTable));
        Assert.fail();
    } catch (InvalidRequestException e) {
    // expected since PREFIX indexes only support EQ without tokenization
    }
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Jean';", KS_NAME, analyzedPrefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Claude';", KS_NAME, analyzedPrefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Jean-Claude';", KS_NAME, analyzedPrefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Jean%%';", KS_NAME, analyzedPrefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    results = QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE 'Claude%%';", KS_NAME, analyzedPrefixTable));
    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());
    try {
        QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE '%%Jean';", KS_NAME, analyzedPrefixTable));
        Assert.fail();
    } catch (InvalidRequestException e) {
    // expected since PREFIX indexes only support LIKE '<term>%' and LIKE '<term>'
    }
    try {
        QueryProcessor.executeOnceInternal(String.format("SELECT * FROM %s.%s WHERE v LIKE '%%Claude%%';", KS_NAME, analyzedPrefixTable));
        Assert.fail();
    } catch (InvalidRequestException e) {
    // expected since PREFIX indexes only support LIKE '<term>%' and LIKE '<term>'
    }
    for (String table : Arrays.asList(containsTable, prefixTable, analyzedPrefixTable)) QueryProcessor.executeOnceInternal(String.format("TRUNCATE TABLE %s.%s", KS_NAME, table));
}
Also used : UntypedResultSet(org.apache.cassandra.cql3.UntypedResultSet) InvalidRequestException(org.apache.cassandra.exceptions.InvalidRequestException)

Example 4 with QueryProcessor.executeOnceInternal

use of org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal in project cassandra by apache.

the class SinglePartitionSliceCommandTest method testPartitionDeletionRangeDeletionTie.

/**
 * Partition deletion should remove range deletion when tie
 */
@Test
public void testPartitionDeletionRangeDeletionTie() {
    QueryProcessor.executeOnceInternal("CREATE TABLE ks.partition_range_deletion (k int, c1 int, c2 int, v int, primary key (k, c1, c2))");
    TableMetadata metadata = Schema.instance.getTableMetadata("ks", "partition_range_deletion");
    ColumnFamilyStore cfs = Schema.instance.getColumnFamilyStoreInstance(metadata.id);
    cfs.disableAutoCompaction();
    BiFunction<Boolean, Boolean, List<Unfiltered>> tester = (flush, multiSSTable) -> {
        cfs.truncateBlocking();
        // timestamp and USING TIMESTAMP have different values to ensure the correct timestamp (the one specified in the
        // query) is the one being picked up. For safety reason we want to be able to ensure that further to its main goal
        // the test can also detect wrongful change of the code. The current timestamp retrieved from the ClientState is
        // ignored but nowInSeconds is retrieved from it and used for the DeletionTime.  It shows the difference between the
        // time at which the record was marked for deletion and the time at which it truly happened.
        final long timestamp = FBUtilities.timestampMicros();
        final int nowInSec = FBUtilities.nowInSeconds();
        QueryProcessor.executeOnceInternalWithNowAndTimestamp(nowInSec, timestamp, "DELETE FROM ks.partition_range_deletion USING TIMESTAMP 10 WHERE k=1");
        if (flush && multiSSTable)
            cfs.forceBlockingFlush();
        QueryProcessor.executeOnceInternalWithNowAndTimestamp(nowInSec, timestamp, "DELETE FROM ks.partition_range_deletion USING TIMESTAMP 10 WHERE k=1 and c1=1");
        if (flush)
            cfs.forceBlockingFlush();
        QueryProcessor.executeOnceInternal("INSERT INTO ks.partition_range_deletion(k,c1,c2,v) VALUES(1,1,1,1) using timestamp 11");
        if (flush) {
            cfs.forceBlockingFlush();
            try {
                cfs.forceMajorCompaction();
            } catch (Throwable e) {
                throw new RuntimeException(e);
            }
        }
        try (UnfilteredRowIterator partition = getIteratorFromSinglePartition("SELECT * FROM ks.partition_range_deletion where k=1 and c1=1 and c2=1")) {
            assertEquals(10, partition.partitionLevelDeletion().markedForDeleteAt());
            return toUnfiltereds(partition);
        }
    };
    List<Unfiltered> memtableUnfiltereds = tester.apply(false, false);
    List<Unfiltered> singleSSTableUnfiltereds = tester.apply(true, false);
    List<Unfiltered> multiSSTableUnfiltereds = tester.apply(true, true);
    assertEquals(1, singleSSTableUnfiltereds.size());
    String errorMessage = String.format("Expected %s but got %s", toString(memtableUnfiltereds, metadata), toString(singleSSTableUnfiltereds, metadata));
    assertEquals(errorMessage, memtableUnfiltereds, singleSSTableUnfiltereds);
    errorMessage = String.format("Expected %s but got %s", toString(singleSSTableUnfiltereds, metadata), toString(multiSSTableUnfiltereds, metadata));
    assertEquals(errorMessage, singleSSTableUnfiltereds, multiSSTableUnfiltereds);
    memtableUnfiltereds.forEach(u -> assertTrue("Expected row, but got " + u.toString(metadata, true), u.isRow()));
}
Also used : TableMetadata(org.apache.cassandra.schema.TableMetadata) Arrays(java.util.Arrays) BiFunction(java.util.function.BiFunction) ByteBuffer(java.nio.ByteBuffer) RangeTombstoneMarker(org.apache.cassandra.db.rows.RangeTombstoneMarker) UnfilteredPartitionIterator(org.apache.cassandra.db.partitions.UnfilteredPartitionIterator) SelectStatement(org.apache.cassandra.cql3.statements.SelectStatement) BTreeSet(org.apache.cassandra.utils.btree.BTreeSet) ColumnFilter(org.apache.cassandra.db.filter.ColumnFilter) IntegerType(org.apache.cassandra.db.marshal.IntegerType) DatabaseDescriptor(org.apache.cassandra.config.DatabaseDescriptor) AbstractClusteringIndexFilter(org.apache.cassandra.db.filter.AbstractClusteringIndexFilter) FBUtilities(org.apache.cassandra.utils.FBUtilities) Util(org.apache.cassandra.Util) KeyspaceParams(org.apache.cassandra.schema.KeyspaceParams) Collectors(java.util.stream.Collectors) List(java.util.List) ColumnIdentifier(org.apache.cassandra.cql3.ColumnIdentifier) TableMetadata(org.apache.cassandra.schema.TableMetadata) DataLimits(org.apache.cassandra.db.filter.DataLimits) DataInputPlus(org.apache.cassandra.io.util.DataInputPlus) DataInputBuffer(org.apache.cassandra.io.util.DataInputBuffer) Iterables(com.google.common.collect.Iterables) PartitionUpdate(org.apache.cassandra.db.partitions.PartitionUpdate) ColumnMetadata(org.apache.cassandra.schema.ColumnMetadata) DataOutputBuffer(org.apache.cassandra.io.util.DataOutputBuffer) BeforeClass(org.junit.BeforeClass) Unfiltered(org.apache.cassandra.db.rows.Unfiltered) QueryProcessor(org.apache.cassandra.cql3.QueryProcessor) ClusteringIndexNamesFilter(org.apache.cassandra.db.filter.ClusteringIndexNamesFilter) Schema(org.apache.cassandra.schema.Schema) Int32Type(org.apache.cassandra.db.marshal.Int32Type) UTF8Type(org.apache.cassandra.db.marshal.UTF8Type) Lists(com.google.common.collect.Lists) Row(org.apache.cassandra.db.rows.Row) ConfigurationException(org.apache.cassandra.exceptions.ConfigurationException) UnfilteredRowIterator(org.apache.cassandra.db.rows.UnfilteredRowIterator) Assert.assertArrayEquals(org.junit.Assert.assertArrayEquals) Before(org.junit.Before) MessagingService(org.apache.cassandra.net.MessagingService) RowFilter(org.apache.cassandra.db.filter.RowFilter) Iterator(java.util.Iterator) ByteBufferUtil(org.apache.cassandra.utils.ByteBufferUtil) ClientState(org.apache.cassandra.service.ClientState) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) Test(org.junit.Test) ClusteringIndexSliceFilter(org.apache.cassandra.db.filter.ClusteringIndexSliceFilter) Ints(com.google.common.primitives.Ints) TimeUnit(java.util.concurrent.TimeUnit) SchemaLoader(org.apache.cassandra.SchemaLoader) Cell(org.apache.cassandra.db.rows.Cell) Assert(org.junit.Assert) QueryOptions(org.apache.cassandra.cql3.QueryOptions) Assert.assertEquals(org.junit.Assert.assertEquals) UnfilteredRowIterator(org.apache.cassandra.db.rows.UnfilteredRowIterator) List(java.util.List) Unfiltered(org.apache.cassandra.db.rows.Unfiltered) Test(org.junit.Test)

Aggregations

Iterables (com.google.common.collect.Iterables)2 Lists (com.google.common.collect.Lists)2 Ints (com.google.common.primitives.Ints)2 IOException (java.io.IOException)2 ByteBuffer (java.nio.ByteBuffer)2 Arrays (java.util.Arrays)2 Iterator (java.util.Iterator)2 List (java.util.List)2 TimeUnit (java.util.concurrent.TimeUnit)2 BiFunction (java.util.function.BiFunction)2 Collectors (java.util.stream.Collectors)2 SchemaLoader (org.apache.cassandra.SchemaLoader)2 Util (org.apache.cassandra.Util)2 DatabaseDescriptor (org.apache.cassandra.config.DatabaseDescriptor)2 ColumnIdentifier (org.apache.cassandra.cql3.ColumnIdentifier)2 QueryOptions (org.apache.cassandra.cql3.QueryOptions)2 QueryProcessor (org.apache.cassandra.cql3.QueryProcessor)2 UntypedResultSet (org.apache.cassandra.cql3.UntypedResultSet)2 SelectStatement (org.apache.cassandra.cql3.statements.SelectStatement)2 AbstractClusteringIndexFilter (org.apache.cassandra.db.filter.AbstractClusteringIndexFilter)2