abhioncbr commented on code in PR #12866:
URL: https://github.com/apache/pinot/pull/12866#discussion_r1559170172


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/fst/FSTBuilder.java:
##########
@@ -36,28 +36,31 @@
  */
 public class FSTBuilder {
   public static final Logger LOGGER = 
LoggerFactory.getLogger(FSTBuilder.class);
-  private final FSTCompiler<Long> _builder = new 
FSTCompiler<>(FST.INPUT_TYPE.BYTE4, PositiveIntOutputs.getSingleton());
+  private final FSTCompiler<Long> _fstCompiler =
+      (new FSTCompiler.Builder<>(FST.INPUT_TYPE.BYTE4, 
PositiveIntOutputs.getSingleton())).build();
   private final IntsRefBuilder _scratch = new IntsRefBuilder();
 
   public static FST<Long> buildFST(SortedMap<String, Integer> input)
       throws IOException {
     PositiveIntOutputs fstOutput = PositiveIntOutputs.getSingleton();
-    FSTCompiler<Long> fstCompiler = new FSTCompiler<>(FST.INPUT_TYPE.BYTE4, 
fstOutput);
+    FSTCompiler.Builder<Long> fstCompilerBuilder = new 
FSTCompiler.Builder<>(FST.INPUT_TYPE.BYTE4, fstOutput);
+    FSTCompiler<Long> fstCompiler = fstCompilerBuilder.build();
 
     IntsRefBuilder scratch = new IntsRefBuilder();
     for (Map.Entry<String, Integer> entry : input.entrySet()) {
       fstCompiler.add(Util.toUTF16(entry.getKey(), scratch), 
entry.getValue().longValue());
     }
-    return fstCompiler.compile();
+
+    return FST.fromFSTReader(fstCompiler.compile(), 
fstCompiler.getFSTReader());

Review Comment:
   This 
[change](https://github.com/apache/lucene/commit/63d4ba938fe0a4a82e615dd66e716684016cfc32)
 in Lucene mentions about getting an FST object from the FSTCompiler. 



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to