Copilot commented on code in PR #8755:
URL: https://github.com/apache/ozone/pull/8755#discussion_r2190587386
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -624,4 +659,22 @@ public void compactDb() {
LOG.warn("compact rocksdb error in {}", dbFilePath, e);
}
}
+
+ private static class CachedPendingDeletion {
+ private final long size;
+ private final long expiryTimeMillis;
+
+ CachedPendingDeletion(long size, long cacheDurationMillis) {
+ this.size = size;
+ this.expiryTimeMillis = System.currentTimeMillis() +
TimeUnit.MILLISECONDS.toMillis(cacheDurationMillis);
Review Comment:
[nitpick] The `cacheDurationMillis` is already in milliseconds, so wrapping
it in `TimeUnit.MILLISECONDS.toMillis` is redundant. Consider simplifying to
`System.currentTimeMillis() + cacheDurationMillis`.
```suggestion
this.expiryTimeMillis = System.currentTimeMillis() +
cacheDurationMillis;
```
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/StorageLocationReport.java:
##########
@@ -362,7 +376,7 @@ public Builder setCommitted(long committed) {
}
/**
- * Sets the free space available to spare.
+ * Sets the pending deletetion bytes space available to spare.
Review Comment:
[nitpick] There is a typo in the Javadoc (`deletetion`) and the description
is misleading. Please correct it to something like `Sets the bytes pending
deletion for this storage location.`
```suggestion
* Sets the bytes pending deletion for this storage location.
```
--
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]