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>
,HasCardinality
,Paginated<T>
- Direct Known Subclasses:
IndexedAccountQuery
,IndexedChangeQuery
,IndexedGroupQuery
public class IndexedQuery<I,T> extends Predicate<T> implements DataSource<T>, Paginated<T>
Wrapper combining anIndexPredicate
together with aDataSource
that 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
DataSource
to 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.boolean
equals(Object other)
int
getCardinality()
Predicate<T>
getChild(int i)
Same asgetChildren().get(i)
int
getChildCount()
Same asgetChildren().size()
List<Predicate<T>>
getChildren()
Get the children of this predicate, if any.QueryOptions
getOptions()
int
hashCode()
ResultSet<T>
read()
ResultSet<FieldBundle>
readRaw()
ResultSet<T>
restart(int start, int pageSize)
ResultSet<T>
restart(Object searchAfter, int pageSize)
String
toString()
-
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:Predicate
Same asgetChildren().size()
- Overrides:
getChildCount
in classPredicate<T>
-
getChild
public Predicate<T> getChild(int i)
Description copied from class:Predicate
Same asgetChildren().get(i)
-
getChildren
public List<Predicate<T>> getChildren()
Description copied from class:Predicate
Get the children of this predicate, if any.- Overrides:
getChildren
in classPredicate<T>
-
getOptions
public QueryOptions getOptions()
- Specified by:
getOptions
in interfacePaginated<I>
-
getCardinality
public int getCardinality()
- Specified by:
getCardinality
in interfaceHasCardinality
- Returns:
- an estimate of the number of results a source can return.
-
read
public ResultSet<T> read()
- Specified by:
read
in interfaceDataSource<I>
- Returns:
- read from the database and return the results.
-
readRaw
public ResultSet<FieldBundle> readRaw()
- Specified by:
readRaw
in 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:Predicate
Create a copy of this predicate, with new children.
-
-