Skip to content
Permalink
Browse files
address review comment
  • Loading branch information
Ewocker committed Mar 14, 2022
1 parent 9561450 commit 1dc55933f044251aaed8fab590018203a64f22a4
Showing 3 changed files with 7 additions and 3 deletions.
@@ -68,7 +68,7 @@ public class FlatFileNodeStoreBuilder {
/**
* Default value for {@link #PROP_MERGE_THREAD_POOL_SIZE}
*/
static final int DEFAULT_NUMBER_OF_MERGE_TASK_THREADS = 4;
static final int DEFAULT_NUMBER_OF_MERGE_TASK_THREADS = 1;
/**
* System property for specifying number of threads for parallel merge when using {@link MultithreadedTraverseWithSortStrategy}
*/
@@ -372,9 +372,11 @@ public File createSortedStoreFile() throws IOException, CompositeException {
String watcherThreadName = "watcher";
String mergerThreadName = "merger";
Thread watcher = new Thread(new TaskRunner(), watcherThreadName);
watcher.setDaemon(true);
watcher.start();
File sortedFile = new File(storeDir, getSortedStoreFileName(compressionEnabled));
Thread merger = new Thread(new MergeRunner(sortedFile), mergerThreadName);
merger.setDaemon(true);
merger.start();
phaser.awaitAdvance(Phases.WAITING_FOR_TASK_SPLITS.value);
log.debug("All tasks completed. Signalling {} to proceed to result collection.", watcherThreadName);
@@ -579,7 +581,7 @@ public void run() {
results.add(executorService.submit(mergeTask));
}
} catch (InterruptedException e) {
log.error("Failed while draining from sortedFiles {}", e);
log.error("Failed while draining from sortedFiles", e);
}
}

@@ -34,7 +34,9 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.*;
import java.util.concurrent.Callable;
import java.util.concurrent.Phaser;
import java.util.concurrent.LinkedBlockingQueue;

import static org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentTraverser.TraversingRange;
import static org.apache.jackrabbit.oak.index.indexer.document.flatfile.MultithreadedTraverseWithSortStrategy.DirectoryHelper;

0 comments on commit 1dc5593

Please sign in to comment.