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()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()ResultSet<FieldBundle>readRaw()ResultSet<T>restart(int start)StringtoString()-
Methods inherited from class com.google.gerrit.index.query.Predicate
and, and, any, asMatchable, estimateCost, getLeafCount, isMatchable, not, or, or
-
-
-
-
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()
- Specified by:
getCardinalityin interfaceDataSource<I>- Returns:
- an estimate of the number of results from
DataSource.read().
-
read
public ResultSet<T> read()
- Specified by:
readin interfaceDataSource<I>- Returns:
- read from the database and return the results.
-
readRaw
public ResultSet<FieldBundle> readRaw()
- Specified by:
readRawin interfaceDataSource<I>- Returns:
- read from the database and return the raw results.
-
copy
public Predicate<T> copy(Collection<? extends Predicate<T>> children)
Description copied from class:PredicateCreate a copy of this predicate, with new children.
-
-