thomasmueller commented on a change in pull request #508:
URL: https://github.com/apache/jackrabbit-oak/pull/508#discussion_r825693644
##########
File path:
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/MultithreadedTraverseWithSortStrategy.java
##########
@@ -304,14 +364,18 @@ void createInitialTasks(NodeStateEntryTraverserFactory
nodeStateEntryTraverserFa
void addTask(TraversingRange range, NodeStateEntryTraverserFactory
nodeStateEntryTraverserFactory, BlobStore blobStore,
ConcurrentLinkedQueue<String> completedTasks) throws
IOException {
taskQueue.add(new TraverseAndSortTask(range, comparator, blobStore,
storeDir,
- compressionEnabled, completedTasks, taskQueue, phaser,
nodeStateEntryTraverserFactory, memoryManager, dumpThreshold));
+ compressionEnabled, completedTasks, taskQueue, phaser,
nodeStateEntryTraverserFactory, memoryManager, dumpThreshold, sortedFiles));
}
@Override
public File createSortedStoreFile() throws IOException, CompositeException
{
String watcherThreadName = "watcher";
+ String mergerThreadName = "merger";
Thread watcher = new Thread(new TaskRunner(), watcherThreadName);
watcher.start();
+ File sortedFile = new File(storeDir,
getSortedStoreFileName(compressionEnabled));
+ Thread merger = new Thread(new MergeRunner(sortedFile),
mergerThreadName);
Review comment:
Could you set setDaemon(true) please? (For watcher as well.) So that the
JVM will stop if this is the only living thread. I see you have already set the
thread name, that's good.
--
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]