From 0db26cb60aa90d8722731bab54df4b44e2c3d390 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Thu, 15 Aug 2024 16:42:34 -0700 Subject: [PATCH] Addressed review comments --- .../om/request/snapshot/OMSnapshotPurgeRequest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotPurgeRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotPurgeRequest.java index b0676a0f8d9..8a438f4c68e 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotPurgeRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotPurgeRequest.java @@ -232,12 +232,12 @@ private void updateSnapshotChainAndCache( private SnapshotInfo getUpdatedSnapshotInfo(String snapshotTableKey, OMMetadataManager omMetadataManager) throws IOException { - if (updatedSnapshotInfos.containsKey(snapshotTableKey)) { - return updatedSnapshotInfos.get(snapshotTableKey); - } else { - SnapshotInfo snapshotInfo = omMetadataManager.getSnapshotInfoTable().get(snapshotTableKey); + SnapshotInfo snapshotInfo = updatedSnapshotInfos.get(snapshotTableKey); + + if (snapshotInfo == null) { + snapshotInfo = omMetadataManager.getSnapshotInfoTable().get(snapshotTableKey); updatedSnapshotInfos.put(snapshotTableKey, snapshotInfo); - return snapshotInfo; } + return snapshotInfo; } }