Package com.google.gerrit.index.query
Class IndexedQuery<I,T>
- java.lang.Object
-
- com.google.gerrit.index.query.Predicate<T>
-
- com.google.gerrit.index.query.IndexedQuery<I,T>
-
- Type Parameters:
I- The type of the IDs by which the entities are stored in the index.T- The type of the entities that are stored in the index.
- All Implemented Interfaces:
DataSource<T>,Paginated<T>
- Direct Known Subclasses:
IndexedAccountQuery,IndexedChangeQuery,IndexedGroupQuery
public class IndexedQuery<I,T> extends Predicate<T> implements DataSource<T>, Paginated<T>
Wrapper combining anIndexPredicatetogether with aDataSourcethat returns matching results from the index.Appropriate to return as the rootmost predicate that can be processed using the secondary index; such predicates must also implement
DataSourceto be chosen by the query processor.
-
-
Constructor Summary
Constructors Constructor Description IndexedQuery(Index<I,T> index, Predicate<T> pred, QueryOptions opts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Predicate<T>copy(Collection<? extends Predicate<T>> children)Create a copy of this predicate, with new children.booleanequals(Object other)intgetCardinality()Returns an estimate of the number of results fromDataSource.read().Predicate<T>getChild(int i)Same asgetChildren().get(i)intgetChildCount()Same asgetChildren().size()List<Predicate<T>>getChildren()Get the children of this predicate, if any.QueryOptionsgetOptions()inthashCode()ResultSet<T>read()Returns read from the database and return the results.ResultSet<FieldBundle>readRaw()Returns read from the database and return the raw results.ResultSet<T>restart(int start)StringtoString()-
Methods inherited from class com.google.gerrit.index.query.Predicate
and, and, any, asMatchable, estimateCost, getFlattenedPredicateList, getLeafCount, getPredicateString, isLeaf, isMatchable, not, or, or, supportedForQueries
-
-
-
-
Field Detail
-
source
protected DataSource<T> source
-
-
Constructor Detail
-
IndexedQuery
public IndexedQuery(Index<I,T> index, Predicate<T> pred, QueryOptions opts) throws QueryParseException
- Throws:
QueryParseException
-
-
Method Detail
-
getChildCount
public int getChildCount()
Description copied from class:PredicateSame asgetChildren().size()- Overrides:
getChildCountin classPredicate<T>
-
getChild
public Predicate<T> getChild(int i)
Description copied from class:PredicateSame asgetChildren().get(i)
-
getChildren
public List<Predicate<T>> getChildren()
Description copied from class:PredicateGet the children of this predicate, if any.- Overrides:
getChildrenin classPredicate<T>
-
getOptions
public QueryOptions getOptions()
- Specified by:
getOptionsin interfacePaginated<I>
-
getCardinality
public int getCardinality()
Description copied from interface:DataSourceReturns an estimate of the number of results fromDataSource.read().- Specified by:
getCardinalityin interfaceDataSource<I>
-
read
public ResultSet<T> read()
Description copied from interface:DataSourceReturns read from the database and return the results.- Specified by:
readin interfaceDataSource<I>
-
readRaw
public ResultSet<FieldBundle> readRaw()
Description copied from interface:DataSourceReturns read from the database and return the raw results.- Specified by:
readRawin interfaceDataSource<I>
-
copy
public Predicate<T> copy(Collection<? extends Predicate<T>> children)
Description copied from class:PredicateCreate a copy of this predicate, with new children.
-
-