Class IndexedChangeQuery
- java.lang.Object
-
- com.google.gerrit.index.query.Predicate<T>
-
- com.google.gerrit.index.query.IndexedQuery<Change.Id,ChangeData>
-
- com.google.gerrit.server.index.change.IndexedChangeQuery
-
- All Implemented Interfaces:
DataSource<ChangeData>
,Matchable<ChangeData>
,Paginated<ChangeData>
,ChangeDataSource
public class IndexedChangeQuery extends IndexedQuery<Change.Id,ChangeData> implements ChangeDataSource, Matchable<ChangeData>
Wrapper combining anIndexPredicate
together with aChangeDataSource
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
ChangeDataSource
to be chosen by the query processor.
-
-
Field Summary
-
Fields inherited from class com.google.gerrit.index.query.IndexedQuery
index, source
-
-
Constructor Summary
Constructors Constructor Description IndexedChangeQuery(ChangeIndex index, Predicate<ChangeData> pred, QueryOptions opts)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QueryOptions
createOptions(IndexConfig config, int start, int pageSize, int pageSizeMultiplier, int limit, Set<String> fields)
static QueryOptions
createOptions(IndexConfig config, int start, int limit, Set<String> fields)
int
getCost()
boolean
hasChange()
boolean
match(ChangeData cd)
Does this predicate match this object?static QueryOptions
oneResult()
boolean
postIndexMatch(Predicate<ChangeData> pred, ChangeData cd)
ResultSet<ChangeData>
read()
-
Methods inherited from class com.google.gerrit.index.query.IndexedQuery
copy, equals, getCardinality, getChild, getChildCount, getChildren, getOptions, hashCode, readRaw, restart, restart, toString
-
Methods inherited from class com.google.gerrit.index.query.Predicate
and, and, any, asMatchable, estimateCost, getLeafCount, isMatchable, not, or, or
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.gerrit.index.query.DataSource
getCardinality, readRaw
-
-
-
-
Constructor Detail
-
IndexedChangeQuery
public IndexedChangeQuery(ChangeIndex index, Predicate<ChangeData> pred, QueryOptions opts) throws QueryParseException
- Throws:
QueryParseException
-
-
Method Detail
-
oneResult
public static QueryOptions oneResult()
-
createOptions
public static QueryOptions createOptions(IndexConfig config, int start, int limit, Set<String> fields)
-
createOptions
public static QueryOptions createOptions(IndexConfig config, int start, int pageSize, int pageSizeMultiplier, int limit, Set<String> fields)
-
read
public ResultSet<ChangeData> read()
- Specified by:
read
in interfaceDataSource<ChangeData>
- Overrides:
read
in classIndexedQuery<Change.Id,ChangeData>
- Returns:
- read from the database and return the results.
-
postIndexMatch
public boolean postIndexMatch(Predicate<ChangeData> pred, ChangeData cd)
-
match
public boolean match(ChangeData cd)
Description copied from interface:Matchable
Does this predicate match this object?- Specified by:
match
in interfaceMatchable<ChangeData>
-
getCost
public int getCost()
- Specified by:
getCost
in interfaceMatchable<ChangeData>
- Returns:
- a cost estimate to run this predicate, higher figures cost more.
-
hasChange
public boolean hasChange()
- Specified by:
hasChange
in interfaceChangeDataSource
- Returns:
- true if all returned ChangeData.hasChange() will be true.
-
-