Fix ExitableDirectoryReader sampling constants to be power-of-2 (#11850)

If it's performance sensitive enough that we should do sampling, then we should avoid integer division too.
This commit is contained in:
Robert Muir 2022-10-15 12:05:15 -04:00 committed by GitHub
parent a7369d7f59
commit ece8ea715c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -347,7 +347,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
Bits timeoutCheckingAcceptDocs =
new Bits() {
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 10;
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 16;
private int calls;
@Override
@ -537,7 +537,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
private static class ExitablePointTree implements PointValues.PointTree {
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 10;
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 16;
private final PointValues pointValues;
private final PointValues.PointTree in;
@ -634,7 +634,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
private static class ExitableIntersectVisitor implements PointValues.IntersectVisitor {
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 10;
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 16;
private PointValues.IntersectVisitor in;
private final QueryTimeout queryTimeout;