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

java.lang.Object
  extended by com.amazon.carbonado.qe.UnionQueryAnalyzer<S>
All Implemented Interfaces:
QueryExecutorFactory<S>

public class UnionQueryAnalyzer<S extends Storable>
extends Object
implements QueryExecutorFactory<S>

Analyzes a query specification and determines how it can be executed as a union of smaller queries. If necessary, the UnionQueryAnalyzer will alter the query slightly, imposing a total ordering. Internally, an IndexedQueryAnalyzer is used for selecting the best indexes.

UnionQueryAnalyzer is sharable and thread-safe. An instance for a particular Storable type can be cached, avoiding repeated construction cost. In addition, the analyzer caches learned foreign indexes.

Author:
Brian S O'Neill

Nested Class Summary
 class UnionQueryAnalyzer.Result
           
 
Constructor Summary
UnionQueryAnalyzer(Class<S> type, RepositoryAccess access)
           
 
Method Summary
 UnionQueryAnalyzer.Result analyze(Filter<S> filter, OrderingList<S> ordering, QueryHints hints)
           
 QueryExecutor<S> executor(Filter<S> filter, OrderingList<S> ordering, QueryHints hints)
          Returns an executor that handles the given query specification.
 Class<S> getStorableType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnionQueryAnalyzer

public UnionQueryAnalyzer(Class<S> type,
                          RepositoryAccess access)
Parameters:
type - type of storable being queried
access - repository access for examing available indexes
Throws:
IllegalArgumentException - if type or indexProvider is null
Method Detail

getStorableType

public Class<S> getStorableType()
Specified by:
getStorableType in interface QueryExecutorFactory<S extends Storable>

analyze

public UnionQueryAnalyzer.Result analyze(Filter<S> filter,
                                         OrderingList<S> ordering,
                                         QueryHints hints)
                                  throws SupportException,
                                         RepositoryException
Parameters:
filter - optional filter which must be bound
ordering - optional properties which define desired ordering
hints - optional query hints
Throws:
SupportException
RepositoryException

executor

public QueryExecutor<S> executor(Filter<S> filter,
                                 OrderingList<S> ordering,
                                 QueryHints hints)
                                           throws RepositoryException
Returns an executor that handles the given query specification.

Specified by:
executor in interface QueryExecutorFactory<S extends Storable>
Parameters:
filter - optional filter which must be bound
ordering - optional properties which define desired ordering
hints - optional query hints
Throws:
RepositoryException


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