Mercurial Hosting > luan
diff src/goodjava/lucene/logging/LoggingIndexWriter.java @ 1504:f443542d8650
threading
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 11 May 2020 11:13:16 -0600 |
parents | 8a7b6b32c691 |
children | 86c5e7000ecf |
line wrap: on
line diff
--- a/src/goodjava/lucene/logging/LoggingIndexWriter.java Sun May 10 23:28:16 2020 -0600 +++ b/src/goodjava/lucene/logging/LoggingIndexWriter.java Mon May 11 11:13:16 2020 -0600 @@ -13,8 +13,6 @@ import java.util.List; import java.util.ArrayList; import java.util.Random; -import java.util.concurrent.Executors; -import java.util.concurrent.ExecutorService; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; @@ -45,7 +43,6 @@ private static final int OP_ADD_DOCUMENT = 3; private static final int OP_UPDATE_DOCUMENT = 4; private static final Random rnd = new Random(); - protected static final ExecutorService threadPool = Executors.newCachedThreadPool(); public final LuceneIndexWriter indexWriter; private final File logDir; @@ -346,7 +343,7 @@ } if( logs.size() > 3 ) { isMerging = true; - threadPool.execute(mergeLogs); + new Thread(mergeLogs).start(); // mergeLogs.run(); } }