sunithabeeram commented on a change in pull request #3942: Set processingException when all queried segments cannot be acquired URL: https://github.com/apache/incubator-pinot/pull/3942#discussion_r267806504
########## File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java ########## @@ -156,6 +165,35 @@ public void removeSegment(@Nonnull String segmentName) { } } + /** + * Called when a segment is deleted. The actual handling of segment delete is outside of this method. + * This method provides book-keeping around deleted segments. + * @param segmentName name of the segment to track. + */ + public void trackDeletedSegment(@Nonnull String segmentName) { + // add segment to the cache + _deletedSegmentsCache.put(segmentName, true); + } + + /** + * Check if a segment is recently deleted. + * + * @param segmentName name of the segment to check. + * @return true if segment is in the cache, false otherwise + */ + public boolean isRecentlyDeleted(@Nonnull String segmentName) { + return _deletedSegmentsCache.getIfPresent(segmentName) != null; + } + + /** + * Remove a segment from the deleted cache if it is being added back. + * + * @param segmentName name of the segment that needs to removed from the cache (if needed) + */ + private void untrackIfDeleted(@Nonnull String segmentName) { Review comment: I am ambivalent about this. If you feel strongly, I can change it. Will see if Subbu has any input. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org