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

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

public abstract class AbstractThriftAllRowsQueryImpl<K,C>
extends Object
implements AllRowsQuery<K,C>


Field Summary
protected  org.apache.cassandra.thrift.SlicePredicate predicate
           
 
Constructor Summary
AbstractThriftAllRowsQueryImpl(ColumnFamily<K,C> columnFamily)
           
 
Method Summary
 int getBlockSize()
           
protected  ExceptionCallback getExceptionCallback()
           
protected abstract  List<org.apache.cassandra.thrift.KeySlice> getNextBlock(org.apache.cassandra.thrift.KeyRange range)
           
 boolean getRepeatLastToken()
           
 AllRowsQuery<K,C> setBlockSize(int blockSize)
           
 AllRowsQuery<K,C> setExceptionCallback(ExceptionCallback cb)
          Sets the exception handler to use when handling exceptions inside Iterator.next().
 AllRowsQuery<K,C> setRepeatLastToken(boolean repeatLastToken)
          If true will repeat the last token in the previous block.
 AllRowsQuery<K,C> setRowLimit(int rowLimit)
          Maximum number of rows to return for each incremental query to Cassandra.
 AllRowsQuery<K,C> withColumnRange(ByteBuffer startColumn, ByteBuffer endColumn, boolean reversed, int count)
          Specify a range and provide pre-constructed start and end columns.
 AllRowsQuery<K,C> withColumnRange(ByteBufferRange range)
          Specify a range of composite columns.
 AllRowsQuery<K,C> withColumnRange(C startColumn, C endColumn, boolean reversed, int count)
          Specify a range of columns to return.
 AllRowsQuery<K,C> withColumnSlice(C... columns)
          Specify a non-contiguous set of columns to retrieve.
 AllRowsQuery<K,C> withColumnSlice(Collection<C> columns)
          Specify a non-contiguous set of columns to retrieve.
 AllRowsQuery<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.query.AllRowsQuery
executeWithCallback
 
Methods inherited from interface com.netflix.astyanax.Execution
execute, executeAsync
 

Field Detail

predicate

protected org.apache.cassandra.thrift.SlicePredicate predicate
Constructor Detail

AbstractThriftAllRowsQueryImpl

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

setExceptionCallback

public AllRowsQuery<K,C> setExceptionCallback(ExceptionCallback cb)
Description copied from interface: AllRowsQuery
Sets the exception handler to use when handling exceptions inside Iterator.next(). This gives the caller a chance to implement a backoff strategy or stop the iteration.

Specified by:
setExceptionCallback in interface AllRowsQuery<K,C>
Returns:

getExceptionCallback

protected ExceptionCallback getExceptionCallback()

withColumnSlice

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

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

withColumnSlice

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

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

withColumnRange

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

Specified by:
withColumnRange in interface AllRowsQuery<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 AllRowsQuery<K,C> withColumnRange(ByteBuffer startColumn,
                                         ByteBuffer endColumn,
                                         boolean reversed,
                                         int count)
Description copied from interface: AllRowsQuery
Specify a range and provide pre-constructed start and end columns. Use this with Composite columns

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

withColumnSlice

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

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

withColumnRange

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

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

setBlockSize

public AllRowsQuery<K,C> setBlockSize(int blockSize)
Specified by:
setBlockSize in interface AllRowsQuery<K,C>

setRowLimit

public AllRowsQuery<K,C> setRowLimit(int rowLimit)
Description copied from interface: AllRowsQuery
Maximum number of rows to return for each incremental query to Cassandra. This limit also represents the page size when paginating.

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

getBlockSize

public int getBlockSize()

setRepeatLastToken

public AllRowsQuery<K,C> setRepeatLastToken(boolean repeatLastToken)
Description copied from interface: AllRowsQuery
If true will repeat the last token in the previous block.

Specified by:
setRepeatLastToken in interface AllRowsQuery<K,C>
Returns:

getRepeatLastToken

public boolean getRepeatLastToken()

getNextBlock

protected abstract List<org.apache.cassandra.thrift.KeySlice> getNextBlock(org.apache.cassandra.thrift.KeyRange range)


Copyright © 2012. All Rights Reserved.