mirror of https://github.com/apache/lucene.git
LUCENE-10058: fix gradle lucene:benchmark:run error (#253)
This commit is contained in:
parent
5813292de2
commit
191ee3ad3e
|
@ -107,14 +107,16 @@ public class ReutersContentSource extends ContentSource {
|
|||
|
||||
int threadIndexSize = Thread.currentThread().getName().length();
|
||||
int parallelTaskThreadSize = Constants.PARALLEL_TASK_THREAD_NAME_PREFIX.length();
|
||||
|
||||
// Extract ThreadIndex from unique ThreadName which is set with '"ParallelTaskThread-"+index',
|
||||
// in TaskSequence.java's doParallelTasks()
|
||||
int threadIndex =
|
||||
Integer.parseInt(
|
||||
Thread.currentThread()
|
||||
.getName()
|
||||
.substring(parallelTaskThreadSize + 1, threadIndexSize));
|
||||
int threadIndex = 0;
|
||||
if (docCountArr.length > 1) {
|
||||
// Extract ThreadIndex from unique ThreadName which is set with '"ParallelTaskThread-"+index',
|
||||
// in TaskSequence.java's doParallelTasks()
|
||||
threadIndex =
|
||||
Integer.parseInt(
|
||||
Thread.currentThread()
|
||||
.getName()
|
||||
.substring(parallelTaskThreadSize + 1, threadIndexSize));
|
||||
}
|
||||
|
||||
assert (threadIndex >= 0 && threadIndex < docCountArr.length)
|
||||
: "Please check threadIndex or docCountArr length";
|
||||
|
|
Loading…
Reference in New Issue