dungba88 commented on code in PR #12624:
URL: https://github.com/apache/lucene/pull/12624#discussion_r1350439623


##########
lucene/core/src/java/org/apache/lucene/util/fst/BytesStore.java:
##########
@@ -21,19 +21,18 @@
 import java.util.List;
 import org.apache.lucene.store.DataInput;
 import org.apache.lucene.store.DataOutput;
-import org.apache.lucene.util.Accountable;
 import org.apache.lucene.util.RamUsageEstimator;
 
 // TODO: merge with PagedBytes, except PagedBytes doesn't
 // let you read while writing which FST needs
 
-class BytesStore extends DataOutput implements Accountable {
+class BytesStore extends FSTWriter {

Review Comment:
   An alternative way is to always use BytesStore for in-mem operator, then 
delegating the final write to a DataOutput, (which could also be supported by 
this approach as well). But then, it would have a problem:
   - If someone wants to use an in-mem DataOutput, they would need an extra 
write (one to the BytesStore and one to the in-mem DataOutput) and thus less 
efficient.
   - Another complication is that, the NodeHash used for suffix sharing would 
need to search the FST in both previous (flushed) nodes and frontier 
(in-writing) nodes, and thus breaking them into 2 different, independent 
data-structures would make it hard to control the read pointer.
   
   The approach in this PR would allow one to use either in-mem with 
BytesStore, or hybrid of in-mem & other DataOutput.



-- 
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