zacharymorn commented on a change in pull request #128:
URL: https://github.com/apache/lucene/pull/128#discussion_r697971217
##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
##########
@@ -321,6 +326,11 @@ public static void syncConcurrentMerges(MergeScheduler ms)
{
checker.setDoSlowChecks(doSlowChecks);
checker.setFailFast(failFast);
checker.setInfoStream(new PrintStream(output, false, IOUtils.UTF_8),
false);
+ if (concurrent) {
+ checker.setThreadCount(RandomizedTest.randomIntBetween(1, 5));
+ } else {
+ checker.setThreadCount(0);
Review comment:
Ok after some more thoughts I do think that makes sense, particularly
around the idea of this (`main` vs. `executor`) is really an implementation
detail that users shouldn't need to worry about, and so `-threadCount 1` to
represent single-threaded execution would be the most intuitive approach here.
I've pushed a new commit to update this accordingly.
Also, in the latest commit I've made it the default that when users don't
specify `-threadCount` value via command line, concurrent index checking will
be used on machines with more than 1 core, but the number of threads will be
capped at 4 via `Math.min(Runtime.getRuntime().availableProcessors(), 4)`. I
think this default behavior was discussed in multiple places in this PR, but
would like to double confirm that this is the preferred default setting we
would like to have (versus sequential index checking)?
##########
File path: lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
##########
@@ -450,6 +480,14 @@ public void setChecksumsOnly(boolean v) {
private boolean checksumsOnly;
+ /** Set threadCount used for parallelizing index integrity checking. */
+ public void setThreadCount(int tc) {
+ threadCount = tc;
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]