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 threadIndexSize = Thread.currentThread().getName().length();
|
||||||
int parallelTaskThreadSize = Constants.PARALLEL_TASK_THREAD_NAME_PREFIX.length();
|
int parallelTaskThreadSize = Constants.PARALLEL_TASK_THREAD_NAME_PREFIX.length();
|
||||||
|
int threadIndex = 0;
|
||||||
// Extract ThreadIndex from unique ThreadName which is set with '"ParallelTaskThread-"+index',
|
if (docCountArr.length > 1) {
|
||||||
// in TaskSequence.java's doParallelTasks()
|
// Extract ThreadIndex from unique ThreadName which is set with '"ParallelTaskThread-"+index',
|
||||||
int threadIndex =
|
// in TaskSequence.java's doParallelTasks()
|
||||||
Integer.parseInt(
|
threadIndex =
|
||||||
Thread.currentThread()
|
Integer.parseInt(
|
||||||
.getName()
|
Thread.currentThread()
|
||||||
.substring(parallelTaskThreadSize + 1, threadIndexSize));
|
.getName()
|
||||||
|
.substring(parallelTaskThreadSize + 1, threadIndexSize));
|
||||||
|
}
|
||||||
|
|
||||||
assert (threadIndex >= 0 && threadIndex < docCountArr.length)
|
assert (threadIndex >= 0 && threadIndex < docCountArr.length)
|
||||||
: "Please check threadIndex or docCountArr length";
|
: "Please check threadIndex or docCountArr length";
|
||||||
|
|
Loading…
Reference in New Issue