9aman commented on code in PR #18148:
URL: https://github.com/apache/pinot/pull/18148#discussion_r3062167514
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/retention/strategy/TimeRetentionStrategy.java:
##########
@@ -32,21 +32,50 @@ public class TimeRetentionStrategy implements
RetentionStrategy {
private static final Logger LOGGER =
LoggerFactory.getLogger(TimeRetentionStrategy.class);
private final long _retentionMs;
+ private final boolean _useCreationTimeFallback;
public TimeRetentionStrategy(TimeUnit timeUnit, long timeValue) {
+ this(timeUnit, timeValue, false);
+ }
+
+ public TimeRetentionStrategy(TimeUnit timeUnit, long timeValue, boolean
useCreationTimeFallback) {
_retentionMs = timeUnit.toMillis(timeValue);
+ _useCreationTimeFallback = useCreationTimeFallback;
}
@Override
public boolean isPurgeable(String tableNameWithType, SegmentZKMetadata
segmentZKMetadata) {
// For realtime tables, only completed segments(DONE or UPLOADED) are
eligible for purging.
- //For offline tables, status defaults to UPLOADED which is completed, so
they proceed to normal retention
+ // For offline tables, status defaults to UPLOADED which is completed, so
they proceed to normal retention
if (!segmentZKMetadata.getStatus().isCompleted()) {
return false; // Incomplete segments don't have final end time and
should not be purged
}
- return isPurgeable(tableNameWithType, segmentZKMetadata.getSegmentName(),
segmentZKMetadata.getEndTimeMs());
Review Comment:
I intentionally kept that super simple.
It just takes in timestamps while this function handles all the complex
logic.
The caller can choose to keep things simple using the other function or use
this function if a logical interpretation of the ZK metadata is needed.
--
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]