tibrewalpratik17 commented on code in PR #14094:
URL: https://github.com/apache/pinot/pull/14094#discussion_r1779018465


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/ConcurrentMapPartitionUpsertMetadataManager.java:
##########
@@ -192,19 +192,8 @@ public void doRemoveExpiredPrimaryKeys() {
     AtomicInteger numTotalKeysMarkForDeletion = new AtomicInteger();
     AtomicInteger numDeletedKeysWithinTTLWindow = new AtomicInteger();
     double largestSeenComparisonValue = _largestSeenComparisonValue.get();
-    double metadataTTLKeysThreshold;
-    if (_metadataTTL > 0) {
-      metadataTTLKeysThreshold = largestSeenComparisonValue - _metadataTTL;
-    } else {
-      metadataTTLKeysThreshold = Double.MIN_VALUE;
-    }
-    double deletedKeysThreshold;
-    if (_deletedKeysTTL > 0) {
-      deletedKeysThreshold = largestSeenComparisonValue - _deletedKeysTTL;
-    } else {
-      deletedKeysThreshold = Double.MIN_VALUE;
-    }
-
+    double metadataTTLKeysThreshold = _metadataTTL > 0 ? 
largestSeenComparisonValue - _metadataTTL : 0;
+    double deletedKeysThreshold = _deletedKeysTTL > 0 ? 
largestSeenComparisonValue - _deletedKeysTTL : 0;

Review Comment:
   Yeah I saw we check `_metadataTTL / deletedKeysTTL > 0` before doing actual 
removal. IMO it might be cleaner and safer to set to `NEGATIVE_INFINITY` just 
in case someone removes the `_metadataTTL / deletedKeysTTL > 0` check in future 
without context. 



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to