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>
,HasCardinality
,Matchable<ChangeData>
,Paginated<ChangeData>
,ChangeDataSource
public class IndexedChangeQuery
extends IndexedQuery<Change.Id,ChangeData>
implements ChangeDataSource, Matchable<ChangeData>
Wrapper combining an
IndexPredicate
together with a ChangeDataSource
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gerrit.index.query.Predicate
Predicate.Any<T>
-
Field Summary
Fields inherited from class com.google.gerrit.index.query.IndexedQuery
index, source
-
Constructor Summary
ConstructorsConstructorDescriptionIndexedChangeQuery
(ChangeIndex index, Predicate<ChangeData> pred, QueryOptions opts) -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryOptions
createOptions
(IndexConfig config, int start, int pageSize, int pageSizeMultiplier, int limit, boolean allowIncompleteResults, Set<String> fields) 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
Returns true if all returned ChangeData.hasChange() will be true.boolean
match
(ChangeData cd) Does this predicate match this object?boolean
postIndexMatch
(Predicate<ChangeData> pred, ChangeData cd) 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, 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
readRaw
Methods inherited from interface com.google.gerrit.index.query.HasCardinality
getCardinality
-
Constructor Details
-
IndexedChangeQuery
public IndexedChangeQuery(ChangeIndex index, Predicate<ChangeData> pred, QueryOptions opts) throws QueryParseException - Throws:
QueryParseException
-
-
Method Details
-
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) -
createOptions
public static QueryOptions createOptions(IndexConfig config, int start, int pageSize, int pageSizeMultiplier, int limit, boolean allowIncompleteResults, Set<String> fields) -
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
-
match
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
-