Search in sources :

Example 6 with Expression

use of org.apache.cassandra.index.sasi.plan.Expression in project cassandra by apache.

the class OnDiskIndexTest method expressionFor.

private static Expression expressionFor(long lower, boolean lowerInclusive, long upper, boolean upperInclusive) {
    Expression expression = new Expression("", LongType.instance);
    expression.add(lowerInclusive ? Operator.GTE : Operator.GT, LongType.instance.decompose(lower));
    expression.add(upperInclusive ? Operator.LTE : Operator.LT, LongType.instance.decompose(upper));
    return expression;
}
Also used : Expression(org.apache.cassandra.index.sasi.plan.Expression)

Example 7 with Expression

use of org.apache.cassandra.index.sasi.plan.Expression in project cassandra by apache.

the class OnDiskIndexTest method expressionFor.

private static Expression expressionFor(Operator op, AbstractType<?> validator, ByteBuffer term) {
    Expression expression = new Expression("", validator);
    expression.add(op, term);
    return expression;
}
Also used : Expression(org.apache.cassandra.index.sasi.plan.Expression)

Aggregations

Expression (org.apache.cassandra.index.sasi.plan.Expression)7 ByteBuffer (java.nio.ByteBuffer)3 RangeUnionIterator (org.apache.cassandra.index.sasi.utils.RangeUnionIterator)2 File (java.io.File)1 java.util (java.util)1 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)1 ConcurrentSkipListSet (java.util.concurrent.ConcurrentSkipListSet)1 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)1 DecoratedKey (org.apache.cassandra.db.DecoratedKey)1 AbstractType (org.apache.cassandra.db.marshal.AbstractType)1 ColumnIndex (org.apache.cassandra.index.sasi.conf.ColumnIndex)1 Token (org.apache.cassandra.index.sasi.disk.Token)1 RangeIterator (org.apache.cassandra.index.sasi.utils.RangeIterator)1 Test (org.junit.Test)1