Jackie-Jiang commented on a change in pull request #5177: Lucene DocId to 
PinotDocId cache
URL: https://github.com/apache/incubator-pinot/pull/5177#discussion_r400369668
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/segment/index/readers/text/LuceneTextIndexReader.java
 ##########
 @@ -169,5 +178,49 @@ public void close()
       throws IOException {
     _indexReader.close();
     _indexDirectory.close();
+    _docIdReaderWriter.close();
+  }
+
+  private class DocIdReaderWriter implements Closeable {
+    private PinotDataBuffer _buffer;
+
+    DocIdReaderWriter(File segmentIndexDir, String column, int numDocs) throws 
Exception {
+      int length = Integer.BYTES * numDocs;
+      File docIdMappingFile = new 
File(SegmentDirectoryPaths.findSegmentDirectory(segmentIndexDir),
+          column + LUCENE_TEXT_INDEX_DOCID_MAPPING_FILE_EXTENSION);
+      // For newly added segments, this file will not exist.
+      // For segment refresh, segment reload and server restart, file will 
exist,
+      // but we don't know if we are here for refresh v/s reload v/s restart.
+      // In case of refresh, we have to build the mapping again, but in case of
 
 Review comment:
   For segment refresh, this file should not exist as we delete the old segment

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to