diff options
Diffstat (limited to 'java/com/google/gerrit/server/query/account/AccountQueryProcessor.java')
-rw-r--r-- | java/com/google/gerrit/server/query/account/AccountQueryProcessor.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/java/com/google/gerrit/server/query/account/AccountQueryProcessor.java b/java/com/google/gerrit/server/query/account/AccountQueryProcessor.java index 2e29bbd4f6..9893d1a778 100644 --- a/java/com/google/gerrit/server/query/account/AccountQueryProcessor.java +++ b/java/com/google/gerrit/server/query/account/AccountQueryProcessor.java @@ -30,6 +30,7 @@ import com.google.gerrit.server.account.AccountState; import com.google.gerrit.server.index.account.AccountIndexCollection; import com.google.gerrit.server.index.account.AccountIndexRewriter; import com.google.gerrit.server.index.account.AccountSchemaDefinitions; +import com.google.gerrit.server.notedb.Sequences; import com.google.inject.Inject; import com.google.inject.Provider; @@ -41,6 +42,8 @@ import com.google.inject.Provider; */ public class AccountQueryProcessor extends QueryProcessor<AccountState> { private final AccountControl.Factory accountControlFactory; + private final Sequences sequences; + private final IndexConfig indexConfig; static { // It is assumed that basic rewrites do not touch visibleto predicates. @@ -57,7 +60,8 @@ public class AccountQueryProcessor extends QueryProcessor<AccountState> { IndexConfig indexConfig, AccountIndexCollection indexes, AccountIndexRewriter rewriter, - AccountControl.Factory accountControlFactory) { + AccountControl.Factory accountControlFactory, + Sequences sequences) { super( metricMaker, AccountSchemaDefinitions.INSTANCE, @@ -67,16 +71,28 @@ public class AccountQueryProcessor extends QueryProcessor<AccountState> { FIELD_LIMIT, () -> limitsFactory.create(userProvider.get()).getQueryLimit()); this.accountControlFactory = accountControlFactory; + this.sequences = sequences; + this.indexConfig = indexConfig; } @Override protected Predicate<AccountState> enforceVisibility(Predicate<AccountState> pred) { return new AndSource<>( - pred, new AccountIsVisibleToPredicate(accountControlFactory.get()), start); + pred, new AccountIsVisibleToPredicate(accountControlFactory.get()), start, indexConfig); } @Override protected String formatForLogging(AccountState accountState) { return accountState.account().id().toString(); } + + @Override + protected int getIndexSize() { + return sequences.lastAccountId(); + } + + @Override + protected int getBatchSize() { + return sequences.accountBatchSize(); + } } |