com.netflix.astyanax.thrift
Class AbstractIndexQueryImpl<K,C>

java.lang.Object
  extended by com.netflix.astyanax.thrift.AbstractIndexQueryImpl<K,C>
All Implemented Interfaces:
Execution<Rows<K,C>>, IndexQuery<K,C>

public abstract class AbstractIndexQueryImpl<K,C>
extends Object
implements IndexQuery<K,C>


Field Summary
protected  ColumnFamily<K,C> columnFamily
           
protected  boolean firstPage
           
protected  org.apache.cassandra.thrift.IndexClause indexClause
           
protected  boolean isPaginating
           
protected  boolean paginateNoMore
           
protected  org.apache.cassandra.thrift.SlicePredicate predicate
           
 
Constructor Summary
AbstractIndexQueryImpl(ColumnFamily<K,C> columnFamily)
           
 
Method Summary
 IndexColumnExpression<K,C> addExpression()
          Add an expression (EQ, GT, GTE, LT, LTE) to the clause.
 IndexQuery<K,C> addPreparedExpressions(Collection<PreparedIndexExpression<K,C>> expressions)
          Add a set of prepare index expressions.
 IndexQuery<K,C> autoPaginateRows(boolean autoPaginate)
          Automatically sets the next start key so that the next call to execute will fetch the next block of rows
 IndexQuery<K,C> setIsPaginating()
           
 IndexQuery<K,C> setLimit(int count)
          Limit the number of rows in the response
protected  void setNextStartKey(ByteBuffer byteBuffer)
           
 IndexQuery<K,C> setRowLimit(int count)
          Limits the number of rows returned
 IndexQuery<K,C> setStartKey(K key)
          ?
 IndexQuery<K,C> withColumnRange(ByteBuffer startColumn, ByteBuffer endColumn, boolean reversed, int count)
          Specify a range and provide pre-constructed start and end columns.
 IndexQuery<K,C> withColumnRange(ByteBufferRange range)
          Specify a range of composite columns.
 IndexQuery<K,C> withColumnRange(C startColumn, C endColumn, boolean reversed, int count)
          Specify a range of columns to return.
 IndexQuery<K,C> withColumnSlice(C... columns)
          Specify a non-contiguous set of columns to retrieve.
 IndexQuery<K,C> withColumnSlice(Collection<C> columns)
          Specify a non-contiguous set of columns to retrieve.
 IndexQuery<K,C> withColumnSlice(ColumnSlice<C> slice)
          Use this when your application caches the column slice.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.netflix.astyanax.Execution
execute, executeAsync
 

Field Detail

indexClause

protected final org.apache.cassandra.thrift.IndexClause indexClause

predicate

protected org.apache.cassandra.thrift.SlicePredicate predicate

isPaginating

protected boolean isPaginating

paginateNoMore

protected boolean paginateNoMore

firstPage

protected boolean firstPage

columnFamily

protected ColumnFamily<K,C> columnFamily
Constructor Detail

AbstractIndexQueryImpl

public AbstractIndexQueryImpl(ColumnFamily<K,C> columnFamily)
Method Detail

withColumnSlice

public IndexQuery<K,C> withColumnSlice(C... columns)
Description copied from interface: IndexQuery
Specify a non-contiguous set of columns to retrieve.

Specified by:
withColumnSlice in interface IndexQuery<K,C>
Returns:

withColumnSlice

public IndexQuery<K,C> withColumnSlice(Collection<C> columns)
Description copied from interface: IndexQuery
Specify a non-contiguous set of columns to retrieve.

Specified by:
withColumnSlice in interface IndexQuery<K,C>
Returns:

withColumnSlice

public IndexQuery<K,C> withColumnSlice(ColumnSlice<C> slice)
Description copied from interface: IndexQuery
Use this when your application caches the column slice.

Specified by:
withColumnSlice in interface IndexQuery<K,C>
Returns:

withColumnRange

public IndexQuery<K,C> withColumnRange(C startColumn,
                                       C endColumn,
                                       boolean reversed,
                                       int count)
Description copied from interface: IndexQuery
Specify a range of columns to return.

Specified by:
withColumnRange in interface IndexQuery<K,C>
Parameters:
startColumn - First column in the range
endColumn - Last column in the range
reversed - True if the order should be reversed. Note that for reversed, startColumn should be greater than endColumn.
count - Maximum number of columns to return (similar to SQL LIMIT)
Returns:

withColumnRange

public IndexQuery<K,C> withColumnRange(ByteBufferRange range)
Description copied from interface: IndexQuery
Specify a range of composite columns. Use this in conjunction with the AnnotatedCompositeSerializer.buildRange().

Specified by:
withColumnRange in interface IndexQuery<K,C>
Returns:

withColumnRange

public IndexQuery<K,C> withColumnRange(ByteBuffer startColumn,
                                       ByteBuffer endColumn,
                                       boolean reversed,
                                       int count)
Description copied from interface: IndexQuery
Specify a range and provide pre-constructed start and end columns. Use this with Composite columns

Specified by:
withColumnRange in interface IndexQuery<K,C>
Returns:

setLimit

public IndexQuery<K,C> setLimit(int count)
Description copied from interface: IndexQuery
Limit the number of rows in the response

Specified by:
setLimit in interface IndexQuery<K,C>
Returns:

setRowLimit

public IndexQuery<K,C> setRowLimit(int count)
Description copied from interface: IndexQuery
Limits the number of rows returned

Specified by:
setRowLimit in interface IndexQuery<K,C>
Returns:

setStartKey

public IndexQuery<K,C> setStartKey(K key)
Description copied from interface: IndexQuery
?

Specified by:
setStartKey in interface IndexQuery<K,C>
Returns:

setNextStartKey

protected void setNextStartKey(ByteBuffer byteBuffer)

addPreparedExpressions

public IndexQuery<K,C> addPreparedExpressions(Collection<PreparedIndexExpression<K,C>> expressions)
Description copied from interface: IndexQuery
Add a set of prepare index expressions.

Specified by:
addPreparedExpressions in interface IndexQuery<K,C>
Returns:

addExpression

public IndexColumnExpression<K,C> addExpression()
Description copied from interface: IndexQuery
Add an expression (EQ, GT, GTE, LT, LTE) to the clause. Expressions are inherently ANDed

Specified by:
addExpression in interface IndexQuery<K,C>
Returns:

setIsPaginating

public IndexQuery<K,C> setIsPaginating()
Specified by:
setIsPaginating in interface IndexQuery<K,C>
Returns:

autoPaginateRows

public IndexQuery<K,C> autoPaginateRows(boolean autoPaginate)
Description copied from interface: IndexQuery
Automatically sets the next start key so that the next call to execute will fetch the next block of rows

Specified by:
autoPaginateRows in interface IndexQuery<K,C>
Returns:


Copyright © 2012. All Rights Reserved.