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

java.lang.Object
  extended by com.amazon.carbonado.qe.AbstractQueryExecutor<S>
      extended by com.amazon.carbonado.qe.KeyQueryExecutor<S>
All Implemented Interfaces:
QueryExecutor<S>

public class KeyQueryExecutor<S extends Storable>
extends AbstractQueryExecutor<S>

QueryExecutor which has a fully specified key, and so cursors produce at most one result.

Author:
Brian S O'Neill

Nested Class Summary
static interface KeyQueryExecutor.Support<S extends Storable>
          Provides support for KeyQueryExecutor.
 
Constructor Summary
KeyQueryExecutor(KeyQueryExecutor.Support<S> support, StorableIndex<S> index, FilteringScore<S> score)
           
 
Method Summary
 Cursor<S> fetch(FilterValues<S> values)
          Returns a new cursor using the given filter values.
 Filter<S> getFilter()
          Returns the filter used by this QueryExecutor.
 OrderingList<S> getOrdering()
          Returns an empty list.
 Class<S> getStorableType()
          Returns the storable type that this executor operates on.
 boolean printPlan(Appendable app, int indentLevel, FilterValues<S> values)
          Prints the query plan to any appendable, if applicable.
 
Methods inherited from class com.amazon.carbonado.qe.AbstractQueryExecutor
count, fetchSlice, increaseIndent, indent, newline, printNative
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyQueryExecutor

public KeyQueryExecutor(KeyQueryExecutor.Support<S> support,
                        StorableIndex<S> index,
                        FilteringScore<S> score)
Parameters:
index - index to use, which may be a primary key index
score - score determines how best to utilize the index
Throws:
IllegalArgumentException - if any parameter is null or if index is not unique or if score is not a key match
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>
Overrides:
getStorableType in class AbstractQueryExecutor<S extends Storable>

fetch

public Cursor<S> fetch(FilterValues<S> values)
                                 throws FetchException
Description copied from interface: QueryExecutor
Returns a new cursor using the given filter values.

Throws:
FetchException

getFilter

public Filter<S> getFilter()
Description copied from interface: QueryExecutor
Returns the filter used by this QueryExecutor.

Returns:
query filter, never null

getOrdering

public OrderingList<S> getOrdering()
Returns an empty list.

Returns:
query ordering in an unmodifiable list

printPlan

public boolean printPlan(Appendable app,
                         int indentLevel,
                         FilterValues<S> values)
                  throws IOException
Description copied from interface: QueryExecutor
Prints the query plan to any appendable, if applicable.

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


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