mirror of https://github.com/apache/lucene.git
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:
parent
a7369d7f59
commit
ece8ea715c
|
@ -347,7 +347,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
|
||||||
|
|
||||||
Bits timeoutCheckingAcceptDocs =
|
Bits timeoutCheckingAcceptDocs =
|
||||||
new Bits() {
|
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;
|
private int calls;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -537,7 +537,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
|
||||||
|
|
||||||
private static class ExitablePointTree implements PointValues.PointTree {
|
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 pointValues;
|
||||||
private final PointValues.PointTree in;
|
private final PointValues.PointTree in;
|
||||||
|
@ -634,7 +634,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
|
||||||
|
|
||||||
private static class ExitableIntersectVisitor implements PointValues.IntersectVisitor {
|
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 PointValues.IntersectVisitor in;
|
||||||
private final QueryTimeout queryTimeout;
|
private final QueryTimeout queryTimeout;
|
||||||
|
|
Loading…
Reference in New Issue