pythaac commented on code in PR #10619:
URL: https://github.com/apache/gravitino/pull/10619#discussion_r3022930325
##########
core/src/main/java/org/apache/gravitino/stats/storage/LancePartitionStatisticStorage.java:
##########
@@ -350,12 +350,24 @@ private void dropStatisticsImpl(Long tableId,
List<PartitionStatisticsDrop> drop
@Override
public void close() throws IOException {
+ datasetCache.ifPresent(
+ cache -> {
+ cache
+ .asMap()
+ .values()
+ .forEach(
+ dataset -> {
+ if (dataset != null) {
+ dataset.close();
+ }
+ });
+ cache.invalidateAll();
+ });
+
if (allocator != null) {
allocator.close();
}
Review Comment:
Thank you for your suggestion! I've updated the loop to improve safety
against exceptions and the code clarity.
--
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]