Skip to content

Commit d583990

Browse files
committed
Reuse TantivySearcher across queries via searcher pool
1 parent 17597cc commit d583990

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

paimon-tantivy/paimon-tantivy-index/src/main/java/org/apache/paimon/tantivy/index/ArchiveLayout.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package org.apache.paimon.tantivy.index;
2020

21-
/** Parsed archive header: file names, byte offsets, and lengths within the archive stream. */
2221
class ArchiveLayout {
2322
final String[] fileNames;
2423
final long[] fileOffsets;

paimon-tantivy/paimon-tantivy-index/src/main/java/org/apache/paimon/tantivy/index/TantivyFullTextGlobalIndexerFactory.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ public class TantivyFullTextGlobalIndexerFactory implements GlobalIndexerFactory
2828

2929
public static final String IDENTIFIER = "tantivy-fulltext";
3030

31-
/**
32-
* Shared pool across all indexers created by this factory. This factory instance is a JVM-level
33-
* singleton (loaded once via {@link java.util.ServiceLoader}), so the pool naturally survives
34-
* across queries and scanners.
35-
*
36-
* <p>The pool is initialized lazily on the first {@link #create} call so that the pool size can
37-
* be read from user-supplied options.
38-
*/
3931
private volatile TantivySearcherPool searcherPool;
4032

4133
@Override

paimon-tantivy/paimon-tantivy-index/src/main/java/org/apache/paimon/tantivy/index/TantivySearcherPool.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@
3535
* Pool of {@link TantivySearcher} instances keyed by index file identity ({@code filePath@size}).
3636
*
3737
* <p>Each searcher holds the Tantivy index open in Rust memory (including the FST term dictionary).
38-
* Pooling avoids the repeated cost of loading the index on every query.
3938
*
4039
* <p>At most one idle searcher is kept per key. Under concurrent queries on the same shard, the
41-
* last entry to be returned wins; the others are closed immediately. Entries idle for more than
42-
* {@link #EXPIRE_AFTER_ACCESS_MINUTES} minutes are evicted and closed automatically. The total
43-
* number of idle entries across all keys is bounded by {@code maxSize}.
40+
* last entry to be returned wins; the others are closed immediately. The total number of idle
41+
* entries across all keys is bounded by {@code maxSize}.
4442
*
4543
* <p>Thread-safe. Borrow/return semantics guarantee at most one thread uses a given entry at a
4644
* time.

0 commit comments

Comments
 (0)