noob-se7en commented on code in PR #18148:
URL: https://github.com/apache/pinot/pull/18148#discussion_r3062279552
##########
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 dont think that a good idea to leave to caller to understand the
difference. Caller can call any method and both method should be consistent.
Passing invalid timestamp in second method behaves differently than the
other method.
--
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]