com.amazon.carbonado.qe
Class AbstractQueryExecutor<S extends Storable>

java.lang.Object
  extended by com.amazon.carbonado.qe.AbstractQueryExecutor<S>
All Implemented Interfaces:
QueryExecutor<S>
Direct Known Subclasses:
FilteredQueryExecutor, FullScanQueryExecutor, IndexedQueryExecutor, IterableQueryExecutor, JoinedQueryExecutor, KeyQueryExecutor, SortedQueryExecutor, UnionQueryExecutor

public abstract class AbstractQueryExecutor<S extends Storable>
extends Object
implements QueryExecutor<S>

AbstractQueryExecutor implements a small set of common QueryExecutor methods.

Author:
Brian S O'Neill

Constructor Summary
AbstractQueryExecutor()
           
 
Method Summary
 long count(FilterValues<S> values)
          Counts results by opening a cursor and skipping entries.
 Cursor<S> fetchSlice(FilterValues<S> values, long from, Long to)
          Produces a slice via skip and limit cursors.
 Class<S> getStorableType()
          Returns the storable type that this executor operates on.
protected  int increaseIndent(int indentLevel)
          Adds a constant amount to the given indent level.
protected  void indent(Appendable app, int indentLevel)
          Appends spaces to the given appendable.
protected  void newline(Appendable app)
          Appends a newline character.
 boolean printNative(Appendable app, int indentLevel, FilterValues<S> values)
          Does nothing and returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.amazon.carbonado.qe.QueryExecutor
fetch, getFilter, getOrdering, printPlan
 

Constructor Detail

AbstractQueryExecutor

public AbstractQueryExecutor()
Method Detail

getStorableType

public Class<S> getStorableType()
Description copied from interface: QueryExecutor
Returns the storable type that this executor operates on.

Specified by:
getStorableType in interface QueryExecutor<S extends Storable>

fetchSlice

public Cursor<S> fetchSlice(FilterValues<S> values,
                            long from,
                            Long to)
                                      throws FetchException
Produces a slice via skip and limit cursors. Subclasses are encouraged to override with a more efficient implementation.

Specified by:
fetchSlice in interface QueryExecutor<S extends Storable>
Throws:
FetchException
Since:
1.2

count

public long count(FilterValues<S> values)
           throws FetchException
Counts results by opening a cursor and skipping entries. Subclasses are encouraged to override with a more efficient implementation.

Specified by:
count in interface QueryExecutor<S extends Storable>
Throws:
FetchException

printNative

public boolean printNative(Appendable app,
                           int indentLevel,
                           FilterValues<S> values)
                    throws IOException
Does nothing and returns false.

Specified by:
printNative in interface QueryExecutor<S extends Storable>
values - optional
Returns:
false if not implemented
Throws:
IOException

indent

protected void indent(Appendable app,
                      int indentLevel)
               throws IOException
Appends spaces to the given appendable. Useful for implementing printNative and printPlan.

Throws:
IOException

newline

protected void newline(Appendable app)
                throws IOException
Appends a newline character.

Throws:
IOException

increaseIndent

protected int increaseIndent(int indentLevel)
Adds a constant amount to the given indent level. Useful for implementing printNative and printPlan.



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