com.amazon.carbonado.qe
Interface QueryExecutor<S extends Storable>

All Known Implementing Classes:
AbstractQueryExecutor, DelegatedQueryExecutor, FilteredQueryExecutor, FullScanQueryExecutor, IndexedQueryExecutor, IterableQueryExecutor, JoinedQueryExecutor, KeyQueryExecutor, SortedQueryExecutor, UnionQueryExecutor

public interface QueryExecutor<S extends Storable>

Performs all the actual work of executing a query. QueryExecutors are linked together forming a query plan.

Author:
Brian S O'Neill
See Also:
QueryExecutorFactory

Method Summary
 long count(FilterValues<S> values)
          Counts the query results using the given filter values.
 Cursor<S> fetch(FilterValues<S> values)
          Returns a new cursor using the given filter values.
 Cursor<S> fetchSlice(FilterValues<S> values, long from, Long to)
          Returns a new cursor using the given filter values and slice.
 Filter<S> getFilter()
          Returns the filter used by this QueryExecutor.
 OrderingList<S> getOrdering()
          Returns the result ordering of this QueryExecutor.
 Class<S> getStorableType()
          Returns the storable type that this executor operates on.
 boolean printNative(Appendable app, int indentLevel, FilterValues<S> values)
          Prints the native query to any appendable, if applicable.
 boolean printPlan(Appendable app, int indentLevel, FilterValues<S> values)
          Prints the query plan to any appendable, if applicable.
 

Method Detail

getStorableType

Class<S> getStorableType()
Returns the storable type that this executor operates on.


fetch

Cursor<S> fetch(FilterValues<S> values)
                                 throws FetchException
Returns a new cursor using the given filter values.

Throws:
FetchException

fetchSlice

Cursor<S> fetchSlice(FilterValues<S> values,
                     long from,
                     Long to)
                                      throws FetchException
Returns a new cursor using the given filter values and slice.

Throws:
FetchException
Since:
1.2

count

long count(FilterValues<S> values)
           throws FetchException
Counts the query results using the given filter values.

Throws:
FetchException

getFilter

Filter<S> getFilter()
Returns the filter used by this QueryExecutor.

Returns:
query filter, never null

getOrdering

OrderingList<S> getOrdering()
Returns the result ordering of this QueryExecutor.

Returns:
query ordering in an unmodifiable list

printNative

boolean printNative(Appendable app,
                    int indentLevel,
                    FilterValues<S> values)
                    throws IOException
Prints the native query to any appendable, if applicable.

Parameters:
values - optional
Returns:
false if not implemented
Throws:
IOException

printPlan

boolean printPlan(Appendable app,
                  int indentLevel,
                  FilterValues<S> values)
                  throws IOException
Prints the query plan to any appendable, if applicable.

Parameters:
values - optional
Returns:
false if not implemented
Throws:
IOException


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.