mikemccand commented on code in PR #12552:
URL: https://github.com/apache/lucene/pull/12552#discussion_r1325827523


##########
lucene/codecs/src/java/org/apache/lucene/codecs/memory/FSTTermsReader.java:
##########
@@ -191,7 +193,9 @@ final class TermsReader extends Terms {
       this.sumTotalTermFreq = sumTotalTermFreq;
       this.sumDocFreq = sumDocFreq;
       this.docCount = docCount;
-      this.dict = new FST<>(in, in, new FSTTermOutputs(fieldInfo));
+      OffHeapFSTStore offHeapFSTStore = new OffHeapFSTStore();
+      this.dict = new FST<>(in, in, new FSTTermOutputs(fieldInfo), 
offHeapFSTStore);
+      in.skipBytes(offHeapFSTStore.size());

Review Comment:
   I was worried at first that we are not cloning this `IndexInput` anywhere 
and that this would cause concurrency bugs when two queries pull a `TermsEnum` 
here, but we are OK because `OffHeapFSTStore` does this cloning when it [pulls 
a random access slice from the 
`IndexInput`](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/util/fst/OffHeapFSTStore.java#L66).



-- 
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: issues-unsubscr...@lucene.apache.org

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

Reply via email to