balmukundblr commented on a change in pull request #132: URL: https://github.com/apache/lucene/pull/132#discussion_r634992701
########## File path: lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java ########## @@ -102,19 +103,33 @@ public void close() throws IOException { public DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException { Path f = null; String name = null; - synchronized (this) { - if (nextFile >= inputFiles.size()) { - // exhausted files, start a new round, unless forever set to false. - if (!forever) { - throw new NoMoreDataException(); - } - nextFile = 0; - iteration++; - } - f = inputFiles.get(nextFile++); - name = f.toRealPath() + "_" + iteration; + int inputFilesSize = inputFiles.size(); + + if (threadIndexCreated == false) { + createThreadIndex(); + } + + // Getting file index value which is set for each thread + int index = Integer.parseInt(Thread.currentThread().getName().substring(12)); Review comment: -Yes, TaskSequence.java is only where new Index threads are created. -We want to ensure that the name of Index threads maintains a guaranteed sequence and we explicitly setup thread names in TaskSequence.java. The thread name maintains "IndexThread-<index>" pattern where <index> is an integer. So, it is safe to parse the thread name to int. We'll also add necessary comments in ReutersContentSource.java as well. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org