somandal commented on code in PR #9982:
URL: https://github.com/apache/pinot/pull/9982#discussion_r1048869427


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/BaseIndexHandler.java:
##########
@@ -93,6 +100,24 @@ protected void 
createForwardIndexIfNeeded(SegmentDirectory.Writer segmentWriter,
       _tmpForwardIndexColumns.add(columnName);
     }
 
+    // Update the segmentMetadata
+    File indexDir = _segmentMetadata.getIndexDir();

Review Comment:
   > As per my understanding, whenever we update metadata properties file, we 
also want to update the in-memory segmentMetadata data-structure. Is that 
correct?
   
   Yes that's my understanding as well. 
   
   > 
   
   So one problem is that in the `BaseIndexHandler` I have the following code 
(unimportant code removed):
   
   ```
       
invertedIndexAndDictionaryBasedForwardIndexCreator.regenerateForwardIndex();
   
   ...
   ...
   
       // Update the segmentMetadata
       File indexDir = _segmentMetadata.getIndexDir();
       reloadSegmentMetadata(indexDir, columnName);
   ```
   
   
`invertedIndexAndDictionaryBasedForwardIndexCreator.regenerateForwardIndex()` 
calls the metadata file update part. Even if I moved the in-memory update part 
closer to the file update in this scenario, I'll need to call `_segmentMetadata 
= new SegmentMetadataImpl(indexDir);` in this function since we're creating a 
new `SegmentMetadata` object, similar to the reason why I need to do this in 
`SegmentPreProcessor`. Is that okay?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to