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()
Returns a cost estimate to run this predicate, higher figures cost more.boolean
hasChange()
Returns true if all returned ChangeData.hasChange() will be true.boolean
match(ChangeData cd)
Does this predicate match this object?static QueryOptions
oneResult()
boolean
postIndexMatch(Predicate<ChangeData> pred, ChangeData cd)
ResultSet<ChangeData>
read()
Returns read from the index and return the results.-
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, getFlattenedPredicateList, getLeafCount, getPredicateString, isLeaf, isMatchable, not, or, or, supportedForQueries
-
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()
Description copied from interface:DataSource
Returns read from the index and return the results.- Specified by:
read
in interfaceDataSource<ChangeData>
- Overrides:
read
in classIndexedQuery<Change.Id,ChangeData>
-
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()
Description copied from interface:Matchable
Returns a cost estimate to run this predicate, higher figures cost more.- Specified by:
getCost
in interfaceMatchable<ChangeData>
-
hasChange
public boolean hasChange()
Description copied from interface:ChangeDataSource
Returns true if all returned ChangeData.hasChange() will be true.- Specified by:
hasChange
in interfaceChangeDataSource
-
-