com.amazon.carbonado.qe
Class IndexedQueryAnalyzer.Result

java.lang.Object
  extended by com.amazon.carbonado.qe.IndexedQueryAnalyzer.Result
Enclosing class:
IndexedQueryAnalyzer<S extends Storable>

public class IndexedQueryAnalyzer.Result
extends Object


Method Summary
 boolean canMergeRemainder(IndexedQueryAnalyzer.Result other)
          Returns true if the given result uses the same index as this, and in the same way.
 QueryExecutor<S> createExecutor()
          Creates a QueryExecutor based on this result.
 CompositeScore<S> getCompositeScore()
          Returns the score on how well the selected index performs the desired filtering and ordering.
 Filter<S> getFilter()
          Returns combined handled and remainder filter for this result.
 StorableIndex<?> getForeignIndex()
          Returns the foreign index that was selected, or null if a local index was selected.
 ChainedProperty<S> getForeignProperty()
          Returns the simple or chained property that maps to the selected foreign index.
 StorableIndex<S> getLocalIndex()
          Returns the local index that was selected, or null if a foreign index was selected.
 OrderingList<S> getOrdering()
          Returns combined handled and remainder orderings for this result.
 Filter<S> getRemainderFilter()
          Remainder filter which overrides that in composite score.
 OrderingList<S> getRemainderOrdering()
          Remainder orderings which override that in composite score.
 boolean handlesAnything()
          Returns true if the selected index does anything at all to filter results or to order them.
 boolean isIndexClustered()
          Returns true if local or foreign index is clustered.
 IndexedQueryAnalyzer.Result mergeRemainder(IndexedQueryAnalyzer.Result other)
          Merges the remainder filter and orderings of this result with the one given, returning a new result.
 IndexedQueryAnalyzer.Result mergeRemainderFilter(Filter<S> filter)
          Merges the remainder filter of this result with the given filter, returning a new result.
 String toString()
           
 IndexedQueryAnalyzer.Result withRemainderFilter(Filter<S> remainderFilter)
          Returns a new result with the remainder filter replaced.
 IndexedQueryAnalyzer.Result withRemainderOrdering(OrderingList<S> remainderOrdering)
          Returns a new result with the remainder ordering replaced.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

handlesAnything

public boolean handlesAnything()
Returns true if the selected index does anything at all to filter results or to order them. If not, a filtered and sorted full scan makes more sense.


getFilter

public Filter<S> getFilter()
Returns combined handled and remainder filter for this result.


getOrdering

public OrderingList<S> getOrdering()
Returns combined handled and remainder orderings for this result.


getCompositeScore

public CompositeScore<S> getCompositeScore()
Returns the score on how well the selected index performs the desired filtering and ordering.


getRemainderFilter

public Filter<S> getRemainderFilter()
Remainder filter which overrides that in composite score.


getRemainderOrdering

public OrderingList<S> getRemainderOrdering()
Remainder orderings which override that in composite score.


getLocalIndex

public StorableIndex<S> getLocalIndex()
Returns the local index that was selected, or null if a foreign index was selected.


getForeignIndex

public StorableIndex<?> getForeignIndex()
Returns the foreign index that was selected, or null if a local index was selected. If a foreign index has been selected, then a JoinedQueryExecutor is needed.


getForeignProperty

public ChainedProperty<S> getForeignProperty()
Returns the simple or chained property that maps to the selected foreign index. Returns null if foreign index was not selected. This property corresponds to the "targetToSourceProperty" of JoinedQueryExecutor.


isIndexClustered

public boolean isIndexClustered()
Returns true if local or foreign index is clustered. Scans of clustered indexes are generally faster.


canMergeRemainder

public boolean canMergeRemainder(IndexedQueryAnalyzer.Result other)
Returns true if the given result uses the same index as this, and in the same way. The only allowed differences are in the remainder filter and orderings.


mergeRemainder

public IndexedQueryAnalyzer.Result mergeRemainder(IndexedQueryAnalyzer.Result other)
Merges the remainder filter and orderings of this result with the one given, returning a new result. Call canMergeRemainder first to verify if the merge makes any sense.


mergeRemainderFilter

public IndexedQueryAnalyzer.Result mergeRemainderFilter(Filter<S> filter)
Merges the remainder filter of this result with the given filter, returning a new result. If handlesAnything return true, then it doesn't usually make sense to call this method.


withRemainderFilter

public IndexedQueryAnalyzer.Result withRemainderFilter(Filter<S> remainderFilter)
Returns a new result with the remainder filter replaced.


withRemainderOrdering

public IndexedQueryAnalyzer.Result withRemainderOrdering(OrderingList<S> remainderOrdering)
Returns a new result with the remainder ordering replaced.


createExecutor

public QueryExecutor<S> createExecutor()
                                                 throws SupportException,
                                                        FetchException,
                                                        RepositoryException
Creates a QueryExecutor based on this result.

Throws:
SupportException
FetchException
RepositoryException

toString

public String toString()
Overrides:
toString in class Object


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