krishan1390 commented on code in PR #18381:
URL: https://github.com/apache/pinot/pull/18381#discussion_r3248157763


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -1410,6 +1483,22 @@ protected void removeBackup(File indexDir)
 
   @Override
   public boolean tryLoadExistingSegment(SegmentZKMetadata zkMetadata, 
IndexLoadingConfig indexLoadingConfig) {
+    ImmutableSegment segment = tryLoadExistingSegmentInternal(zkMetadata, 
indexLoadingConfig);
+    if (segment == null) {
+      return false;
+    }
+    addSegment(segment, zkMetadata);
+    return true;
+  }
+
+  /**
+   * Just Loads a segment from the existing on-disk copy without registering 
it in {@code _segmentDataManagerMap} or
+   * invoking other hooks.
+   * Returns {@code null} when the on-disk copy is absent, has a stale CRC 
under or fails to load
+   */
+  @Nullable
+  public ImmutableSegment tryLoadExistingSegmentInternal(SegmentZKMetadata 
zkMetadata,

Review Comment:
   Ideally this method should be named tryLoadExistingSegment() itself and the 
current tryLoadExistingSegment() should become tryRegisterExistingSegment(). 
But the current method is a method in the TDM interface itself so couldn't 
rename that.
   
   can rename this to  tryLoadExistingSegmentWithoutRegistering() but I don't 
think thats also good enough
   
   wdyt ? 



-- 
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