adoroszlai commented on code in PR #7395:
URL: https://github.com/apache/ozone/pull/7395#discussion_r1830926299


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java:
##########
@@ -1231,46 +1227,18 @@ private boolean applyFilters(Table.KeyValue<String, 
OmKeyInfo> entry, ParamInfo
 
     LOG.debug("Applying filters on : {}", entry.getKey());
 
-    long epochMillis =
-        ReconUtils.convertToEpochMillis(paramInfo.getCreationDate(), 
"MM-dd-yyyy HH:mm:ss", TimeZone.getDefault());
-    Predicate<Table.KeyValue<String, OmKeyInfo>> keyAgeFilter = keyData -> {
-      try {
-        return keyData.getValue().getCreationTime() >= epochMillis;
-      } catch (IOException e) {
-        throw new RuntimeException(e);
-      }
-    };
-    Predicate<Table.KeyValue<String, OmKeyInfo>> keyReplicationFilter =
-        keyData -> {
-          try {
-            return 
keyData.getValue().getReplicationConfig().getReplicationType().name()
-                .equals(paramInfo.getReplicationType());
-          } catch (IOException e) {
-            try {
-              throw new IOException(e);
-            } catch (IOException ex) {
-              throw new RuntimeException(ex);
-            }
-          }
-        };
-    Predicate<Table.KeyValue<String, OmKeyInfo>> keySizeFilter = keyData -> {
-      try {
-        return keyData.getValue().getDataSize() >= paramInfo.getKeySize();
-      } catch (IOException e) {
-        throw new RuntimeException(e);
-      }
-    };
-
-    List<Table.KeyValue<String, OmKeyInfo>> filteredKeyList = Stream.of(entry)
-        .filter(keyData -> !StringUtils.isEmpty(paramInfo.getCreationDate()) ? 
keyAgeFilter.test(keyData) : true)
-        .filter(
-            keyData -> !StringUtils.isEmpty(paramInfo.getReplicationType()) ? 
keyReplicationFilter.test(keyData) : true)
-        .filter(keySizeFilter)
-        .collect(Collectors.toList());
+    if (!StringUtils.isEmpty(paramInfo.getCreationDate())
+        && !(entry.getValue().getCreationTime() >= 
paramInfo.getCreationDateEpoch())) {

Review Comment:
   nit: 
   
   ```suggestion
           && (entry.getValue().getCreationTime() < 
paramInfo.getCreationDateEpoch())) {
   ```



-- 
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]

Reply via email to