LUCENE-10058: fix gradle lucene:benchmark:run error (#253)

This commit is contained in:
51search 2021-08-23 22:36:33 +08:00 committed by GitHub
parent 5813292de2
commit 191ee3ad3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -107,14 +107,16 @@ public class ReutersContentSource extends ContentSource {
int threadIndexSize = Thread.currentThread().getName().length();
int parallelTaskThreadSize = Constants.PARALLEL_TASK_THREAD_NAME_PREFIX.length();
int threadIndex = 0;
if (docCountArr.length > 1) {
// Extract ThreadIndex from unique ThreadName which is set with '"ParallelTaskThread-"+index',
// in TaskSequence.java's doParallelTasks()
int threadIndex =
threadIndex =
Integer.parseInt(
Thread.currentThread()
.getName()
.substring(parallelTaskThreadSize + 1, threadIndexSize));
}
assert (threadIndex >= 0 && threadIndex < docCountArr.length)
: "Please check threadIndex or docCountArr length";