J-HowHuang commented on code in PR #20367:
URL: https://github.com/apache/pinot/pull/20367#discussion_r4706229138
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -1415,13 +1435,48 @@ protected boolean
isSegmentStatusCompleted(SegmentZKMetadata zkMetadata) {
|| zkMetadata.getStatus() ==
CommonConstants.Segment.Realtime.Status.UPLOADED;
}
- protected boolean canReuseExistingDirectoryForReload(SegmentZKMetadata
segmentZKMetadata, String currentSegmentTier,
- SegmentDirectory segmentDirectory, IndexLoadingConfig indexLoadingConfig)
+ /// Returns a directory that a reload without download can load as is, or
null when the reload must copy the current
+ /// directory out and reprocess it, e.g. to move the segment to another tier.
+ ///
+ /// `currentDirectory` is the segment's directory on its current tier. The
default returns it when the segment stays
+ /// on that tier and needs no reprocessing.
+ ///
+ /// Extensions may return another directory, e.g. a copy of the segment that
another replica already prepared on the
+ /// target tier. Such a directory must hold the segment with the CRC in
`zkMetadata`, be opened for the target tier
+ /// (`zkMetadata.getTier()`), and need no reprocessing for it. The reload
then closes `currentDirectory`, loads the
+ /// returned directory, and removes the local copy on the current tier. A
table that restores the validDocIds bitmap
+ /// on reload never loads another directory, since the bitmap lives only in
the local copy.
+ ///
+ /// Called under the segment lock.
+ @Nullable
+ protected SegmentDirectory getReusableDirectoryForReload(SegmentZKMetadata
zkMetadata,
Review Comment:
add canReuseExistingDirectoryForReload back and use it in the default
implementation of `getReusableDirectoryForReload`
--
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]