Search in sources :

Example 6 with ColumnFilter

use of org.apache.cassandra.db.filter.ColumnFilter in project cassandra by apache.

the class SinglePartitionSliceCommandTest method toCQLStringIsSafeToCall.

@Test
public void toCQLStringIsSafeToCall() throws IOException {
    DecoratedKey key = metadata.partitioner.decorateKey(ByteBufferUtil.bytes("k1"));
    ColumnFilter columnFilter = ColumnFilter.selection(RegularAndStaticColumns.of(s));
    Slice slice = Slice.make(ClusteringBound.BOTTOM, ClusteringBound.inclusiveEndOf(ByteBufferUtil.bytes("i1")));
    ClusteringIndexSliceFilter sliceFilter = new ClusteringIndexSliceFilter(Slices.with(metadata.comparator, slice), false);
    ReadCommand cmd = new SinglePartitionReadCommand(false, MessagingService.VERSION_30, metadata, FBUtilities.nowInSeconds(), columnFilter, RowFilter.NONE, DataLimits.NONE, key, sliceFilter);
    String ret = cmd.toCQLString();
    Assert.assertNotNull(ret);
    Assert.assertFalse(ret.isEmpty());
}
Also used : ClusteringIndexSliceFilter(org.apache.cassandra.db.filter.ClusteringIndexSliceFilter) ColumnFilter(org.apache.cassandra.db.filter.ColumnFilter) Test(org.junit.Test)

Aggregations

ColumnFilter (org.apache.cassandra.db.filter.ColumnFilter)6 Test (org.junit.Test)4 ClusteringIndexSliceFilter (org.apache.cassandra.db.filter.ClusteringIndexSliceFilter)3 UnfilteredPartitionIterator (org.apache.cassandra.db.partitions.UnfilteredPartitionIterator)3 DataInputBuffer (org.apache.cassandra.io.util.DataInputBuffer)2 DataOutputBuffer (org.apache.cassandra.io.util.DataOutputBuffer)2 Iterables (com.google.common.collect.Iterables)1 Iterators (com.google.common.collect.Iterators)1 ByteBuffer (java.nio.ByteBuffer)1 java.util (java.util)1 ArrayList (java.util.ArrayList)1 Function (java.util.function.Function)1 Predicate (java.util.function.Predicate)1 Supplier (java.util.function.Supplier)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 StreamSupport (java.util.stream.StreamSupport)1 SchemaLoader (org.apache.cassandra.SchemaLoader)1 Util (org.apache.cassandra.Util)1 ColumnIdentifier (org.apache.cassandra.cql3.ColumnIdentifier)1