Jackie-Jiang commented on code in PR #10536:
URL: https://github.com/apache/pinot/pull/10536#discussion_r1163222009
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/SegmentDeletionManager.java:
##########
@@ -74,12 +75,17 @@ public class SegmentDeletionManager {
RETENTION_DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
}
+ public interface SegmentDeletionHook {
+ void process(String tableName, List<String> segmentsToDelete);
+ }
+
private final ScheduledExecutorService _executorService;
private final String _dataDir;
private final String _helixClusterName;
private final HelixAdmin _helixAdmin;
private final ZkHelixPropertyStore<ZNRecord> _propertyStore;
private final long _defaultDeletedSegmentsRetentionMs;
+ private final ConcurrentLinkedQueue<SegmentDeletionHook>
_segmentDeletionHooks;
Review Comment:
For listener model, we usually register the listeners before starting the
service. I don't think we plan to make the listener registering dynamic after
controller is started. Another way is to simply make `register()`
`synchronized` since the access is also in synchronized block to avoid the
overhead of concurrent queue.
This is optional as the overhead of using a concurrent queue for very few
listeners should also be very small.
--
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]