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

java.lang.Object
  extended by com.netflix.astyanax.thrift.ThriftColumnFamilyQueryImpl<K,C>
Type Parameters:
K -
C -
All Implemented Interfaces:
ColumnFamilyQuery<K,C>

public class ThriftColumnFamilyQueryImpl<K,C>
extends Object
implements ColumnFamilyQuery<K,C>

Implementation of all column family queries using the thrift API.

Author:
elandau

Constructor Summary
ThriftColumnFamilyQueryImpl(ExecutorService executor, KeyspaceTracerFactory tracerFactory, Keyspace keyspace, ConnectionPool<org.apache.cassandra.thrift.Cassandra.Client> cp, ColumnFamily<K,C> columnFamily, ConsistencyLevel consistencyLevel, RetryPolicy retry)
           
 
Method Summary
 AllRowsQuery<K,C> getAllRows()
          Query to get an iterator to all rows in the column family
 RowQuery<K,C> getKey(K rowKey)
          Query a single key
 RowSliceQuery<K,C> getKeyRange(K startKey, K endKey, String startToken, String endToken, int count)
          Query a range of keys.
 RowSliceQuery<K,C> getKeySlice(Collection<K> keys)
          Query a non-contiguous set of keys.
 RowSliceQuery<K,C> getKeySlice(K[] keys)
          Query a non-contiguous set of keys.
 ColumnFamilyQuery<K,C> pinToHost(Host host)
          Run the query on the specified host
 IndexQuery<K,C> searchWithIndex()
          Search for keys matching the provided index clause
 ColumnFamilyQuery<K,C> setConsistencyLevel(ConsistencyLevel consistencyLevel)
          Set the consistency level for this operations.
 CqlQuery<K,C> withCql(String cql)
          Prepare a CQL Query
 ColumnFamilyQuery<K,C> withRetryPolicy(RetryPolicy retry)
          Set the retry policy to use instead of the default
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThriftColumnFamilyQueryImpl

public ThriftColumnFamilyQueryImpl(ExecutorService executor,
                                   KeyspaceTracerFactory tracerFactory,
                                   Keyspace keyspace,
                                   ConnectionPool<org.apache.cassandra.thrift.Cassandra.Client> cp,
                                   ColumnFamily<K,C> columnFamily,
                                   ConsistencyLevel consistencyLevel,
                                   RetryPolicy retry)
Method Detail

getKey

public RowQuery<K,C> getKey(K rowKey)
Description copied from interface: ColumnFamilyQuery
Query a single key

Specified by:
getKey in interface ColumnFamilyQuery<K,C>
Returns:

getKeyRange

public RowSliceQuery<K,C> getKeyRange(K startKey,
                                      K endKey,
                                      String startToken,
                                      String endToken,
                                      int count)
Description copied from interface: ColumnFamilyQuery
Query a range of keys. startKey and endKey cannot not be used with the RandomPartitioner.

Specified by:
getKeyRange in interface ColumnFamilyQuery<K,C>
count - Max number of keys to return
Returns:

getKeySlice

public RowSliceQuery<K,C> getKeySlice(K[] keys)
Description copied from interface: ColumnFamilyQuery
Query a non-contiguous set of keys.

Specified by:
getKeySlice in interface ColumnFamilyQuery<K,C>
Returns:

getKeySlice

public RowSliceQuery<K,C> getKeySlice(Collection<K> keys)
Description copied from interface: ColumnFamilyQuery
Query a non-contiguous set of keys.

Specified by:
getKeySlice in interface ColumnFamilyQuery<K,C>
Returns:

setConsistencyLevel

public ColumnFamilyQuery<K,C> setConsistencyLevel(ConsistencyLevel consistencyLevel)
Description copied from interface: ColumnFamilyQuery
Set the consistency level for this operations.

Specified by:
setConsistencyLevel in interface ColumnFamilyQuery<K,C>
Returns:

searchWithIndex

public IndexQuery<K,C> searchWithIndex()
Description copied from interface: ColumnFamilyQuery
Search for keys matching the provided index clause

Specified by:
searchWithIndex in interface ColumnFamilyQuery<K,C>
Returns:

withCql

public CqlQuery<K,C> withCql(String cql)
Description copied from interface: ColumnFamilyQuery
Prepare a CQL Query

Specified by:
withCql in interface ColumnFamilyQuery<K,C>
Returns:

getAllRows

public AllRowsQuery<K,C> getAllRows()
Description copied from interface: ColumnFamilyQuery
Query to get an iterator to all rows in the column family

Specified by:
getAllRows in interface ColumnFamilyQuery<K,C>
Returns:

pinToHost

public ColumnFamilyQuery<K,C> pinToHost(Host host)
Description copied from interface: ColumnFamilyQuery
Run the query on the specified host

Specified by:
pinToHost in interface ColumnFamilyQuery<K,C>
Returns:

withRetryPolicy

public ColumnFamilyQuery<K,C> withRetryPolicy(RetryPolicy retry)
Description copied from interface: ColumnFamilyQuery
Set the retry policy to use instead of the default

Specified by:
withRetryPolicy in interface ColumnFamilyQuery<K,C>
Returns:


Copyright © 2012. All Rights Reserved.