You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/19 00:55:46 UTC

[GitHub] [pinot] ankitsultana commented on a diff in pull request #9423: Cache Deleted Segment Names in Server to Avoid SegmentMissingError

ankitsultana commented on code in PR #9423:
URL: https://github.com/apache/pinot/pull/9423#discussion_r973807288


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -411,6 +429,31 @@ public void addOrReplaceSegment(String segmentName, IndexLoadingConfig indexLoad
         zkMetadata.getCrc());
   }
 
+  /**
+   * _segmentDataManagerMap is used for fetching segments that need to be queried. If a new segment is created,
+   * calling this method ensures that all queries in the future can use the new segment. This method may replace an
+   * existing segment with the same name.
+   */
+  @Nullable
+  protected SegmentDataManager registerSegment(String segmentName, SegmentDataManager segmentDataManager) {
+    SegmentDataManager oldSegmentDataManager = _segmentDataManagerMap.put(segmentName, segmentDataManager);

Review Comment:
   I think we may wanna make `_segmentDataManagerMap` private so concrete classes that extend `BaseTableDataManager` use the map only via the provided methods here.



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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