Class ChangeQueryProcessor
- java.lang.Object
-
- com.google.gerrit.index.query.QueryProcessor<ChangeData>
-
- com.google.gerrit.server.query.change.ChangeQueryProcessor
-
- All Implemented Interfaces:
DynamicOptions.BeanReceiver
,PluginDefinedAttributesFactory
public class ChangeQueryProcessor extends QueryProcessor<ChangeData> implements DynamicOptions.BeanReceiver, PluginDefinedAttributesFactory
Query processor for the change index.Instances are one-time-use. Other singleton classes should inject a Provider rather than holding on to a single instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ChangeQueryProcessor.ChangeAttributeFactory
Register a ChangeAttributeFactory in a config Module like this:-
Nested classes/interfaces inherited from class com.google.gerrit.index.query.QueryProcessor
QueryProcessor.Metrics
-
-
Field Summary
-
Fields inherited from class com.google.gerrit.index.query.QueryProcessor
start
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<PluginDefinedInfo>
create(ChangeData cd)
protected QueryOptions
createOptions(IndexConfig indexConfig, int start, int limit, Set<String> requestedFields)
ChangeQueryProcessor
enforceVisibility(boolean enforce)
Specify whether to enforce visibility by filtering out results that are not visible to the user.protected Predicate<ChangeData>
enforceVisibility(Predicate<ChangeData> pred)
Invoked after the query was rewritten.protected String
formatForLogging(ChangeData changeData)
DynamicOptions.DynamicBean
getDynamicBean(String plugin)
void
setDynamicBean(String plugin, DynamicOptions.DynamicBean dynamicBean)
-
Methods inherited from class com.google.gerrit.index.query.QueryProcessor
isDisabled, query, query, setRequestedFields, setStart, setUserProvidedLimit
-
-
-
-
Method Detail
-
enforceVisibility
public ChangeQueryProcessor enforceVisibility(boolean enforce)
Description copied from class:QueryProcessor
Specify whether to enforce visibility by filtering out results that are not visible to the user.Enforcing visibility may have performance consequences, as the index system may need to post-filter a large number of results to fill even a modest limit.
If visibility is enforced, the user's
queryLimit
global capability is also used to bound the total number of results. If this capability is non-positive, this results in the entire query processor beingdisabled
.- Overrides:
enforceVisibility
in classQueryProcessor<ChangeData>
- Parameters:
enforce
- whether to enforce visibility.- Returns:
- this.
-
createOptions
protected QueryOptions createOptions(IndexConfig indexConfig, int start, int limit, Set<String> requestedFields)
- Overrides:
createOptions
in classQueryProcessor<ChangeData>
-
setDynamicBean
public void setDynamicBean(String plugin, DynamicOptions.DynamicBean dynamicBean)
- Specified by:
setDynamicBean
in interfaceDynamicOptions.BeanReceiver
-
getDynamicBean
public DynamicOptions.DynamicBean getDynamicBean(String plugin)
-
create
public List<PluginDefinedInfo> create(ChangeData cd)
- Specified by:
create
in interfacePluginDefinedAttributesFactory
-
enforceVisibility
protected Predicate<ChangeData> enforceVisibility(Predicate<ChangeData> pred)
Description copied from class:QueryProcessor
Invoked after the query was rewritten. Subclasses must overwrite this method to filter out results that are not visible to the calling user.- Specified by:
enforceVisibility
in classQueryProcessor<ChangeData>
- Parameters:
pred
- the query- Returns:
- the modified query
-
formatForLogging
protected String formatForLogging(ChangeData changeData)
- Specified by:
formatForLogging
in classQueryProcessor<ChangeData>
-
-