xiangfu0 commented on code in PR #17998:
URL: https://github.com/apache/pinot/pull/17998#discussion_r3013102403
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/invertedindex/TextIndexHandler.java:
##########
@@ -339,23 +362,13 @@ private boolean hasTextIndexConfigurationChanged(String
columnName, SegmentDirec
}
/**
- * Clean up existing text index files for recovery purposes.
- *
- * @param indexDir the index directory
- * @param columnName the column name
+ * Delete legacy native text index files from both the segment root and the
versioned segment directory.
*/
- private void cleanupExistingTextIndexFiles(File indexDir, String columnName)
{
- // Remove any existing text index files for this column
- File[] textIndexFiles = indexDir.listFiles((dir, name) -> {
- // Look for text index files for this column
- return name.startsWith(columnName) &&
(name.endsWith(V1Constants.Indexes.LUCENE_V912_TEXT_INDEX_FILE_EXTENSION)
- || name.endsWith(".text.inprogress"));
- });
-
- if (textIndexFiles != null) {
- for (File file : textIndexFiles) {
- FileUtils.deleteQuietly(file);
- }
+ private void deleteLegacyNativeTextIndexFiles(File indexDir, File
segmentDirectory, String column) {
Review Comment:
You're right — `segmentWriter.removeIndex()` calls
`TextIndexUtils.cleanupTextIndex()` which already deletes native text files.
Removed `deleteLegacyNativeTextIndexFiles` and its call.
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/invertedindex/TextIndexHandler.java:
##########
@@ -339,23 +362,13 @@ private boolean hasTextIndexConfigurationChanged(String
columnName, SegmentDirec
}
/**
- * Clean up existing text index files for recovery purposes.
- *
- * @param indexDir the index directory
- * @param columnName the column name
+ * Delete legacy native text index files from both the segment root and the
versioned segment directory.
*/
- private void cleanupExistingTextIndexFiles(File indexDir, String columnName)
{
Review Comment:
Agreed, this is pre-existing code not changed in this PR. Will leave it for
a separate cleanup.
--
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]