me.prettyprint.cassandra.model
Class AbstractSliceQuery<K,N,V,T>

java.lang.Object
  extended by me.prettyprint.cassandra.model.AbstractBasicQuery<K,N,T>
      extended by me.prettyprint.cassandra.model.AbstractQuery<K,N,V,T>
          extended by me.prettyprint.cassandra.model.AbstractSliceQuery<K,N,V,T>
Type Parameters:
N -
T -
All Implemented Interfaces:
Query<T>
Direct Known Subclasses:
IndexedSlicesQuery, ThriftMultigetSliceCounterQuery, ThriftMultigetSliceQuery, ThriftMultigetSubSliceQuery, ThriftMultigetSuperSliceCounterQuery, ThriftMultigetSuperSliceQuery, ThriftRangeSlicesCounterQuery, ThriftRangeSlicesQuery, ThriftRangeSubSlicesQuery, ThriftRangeSuperSlicesCounterQuery, ThriftRangeSuperSlicesQuery, ThriftSliceCounterQuery, ThriftSliceQuery, ThriftSubSliceQuery, ThriftSuperSliceCounterQuery, ThriftSuperSliceQuery

public abstract class AbstractSliceQuery<K,N,V,T>
extends AbstractQuery<K,N,V,T>
implements Query<T>

Base type for SliceQuery, RangeSliceQuery and MultigetSliceQuery

Author:
Ran Tavory

Field Summary
protected  HSlicePredicate<N> slicePredicate
           
 
Fields inherited from class me.prettyprint.cassandra.model.AbstractQuery
valueSerializer
 
Fields inherited from class me.prettyprint.cassandra.model.AbstractBasicQuery
columnFamilyName, columnNameSerializer, keySerializer, keyspace
 
Constructor Summary
AbstractSliceQuery(Keyspace k, Serializer<K> keySerializer, Serializer<N> nameSerializer, Serializer<V> valueSerializer)
           
 
Method Summary
 Collection<N> getColumnNames()
           
 org.apache.cassandra.thrift.SlicePredicate getPredicate()
           
 Query<T> setColumnNames(Collection<N> columnNames)
          Sets the column names to be retrieved by this query
 Query<T> setColumnNames(N... columnNames)
          Sets the column names to be retrieved by this query
 Query<T> setRange(N start, N finish, boolean reversed, int count)
          Set a predicate of start/finish to retrieve a list of columns in this range.
 AbstractSliceQuery<K,N,V,T> setReturnKeysOnly()
          Wraps the underlying call to HSlicePredicate.setKeysOnlyPredicate() Use this for a substantial performance increase when you only need the keys returned
protected  String toStringInternal()
           
 
Methods inherited from class me.prettyprint.cassandra.model.AbstractQuery
getValueSerializer, setValueSerializer
 
Methods inherited from class me.prettyprint.cassandra.model.AbstractBasicQuery
getColumnNameSerializer, getKeySerializer, setColumnFamily, setColumnNameSerializer, setKeySerializer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface me.prettyprint.hector.api.query.Query
execute
 

Field Detail

slicePredicate

protected final HSlicePredicate<N> slicePredicate
Constructor Detail

AbstractSliceQuery

public AbstractSliceQuery(Keyspace k,
                          Serializer<K> keySerializer,
                          Serializer<N> nameSerializer,
                          Serializer<V> valueSerializer)
Method Detail

setColumnNames

public Query<T> setColumnNames(N... columnNames)
Sets the column names to be retrieved by this query

Parameters:
columns - a varargs of column names

setColumnNames

public Query<T> setColumnNames(Collection<N> columnNames)
Sets the column names to be retrieved by this query

Parameters:
columns - a Collection of column names

setReturnKeysOnly

public AbstractSliceQuery<K,N,V,T> setReturnKeysOnly()
Wraps the underlying call to HSlicePredicate.setKeysOnlyPredicate() Use this for a substantial performance increase when you only need the keys returned


getColumnNames

public Collection<N> getColumnNames()

setRange

public Query<T> setRange(N start,
                         N finish,
                         boolean reversed,
                         int count)
Set a predicate of start/finish to retrieve a list of columns in this range.

Parameters:
start - Start key
finish - End key
reversed -
count -
Returns:

getPredicate

public org.apache.cassandra.thrift.SlicePredicate getPredicate()
Returns:
the thrift representation of the predicate

toStringInternal

protected String toStringInternal()


Copyright © 2011. All Rights Reserved.