From a3920e89de3de56f8bdde84219bc4b51be2d59bd Mon Sep 17 00:00:00 2001 From: Ahmed Hussein Date: Tue, 31 Aug 2021 15:58:06 -0500 Subject: [PATCH] HDFS-15160. amend to fix javac error supressing unchecked warning --- .../hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java index 7adcd8e2f14..045c8cd2eec 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java @@ -201,16 +201,16 @@ class FsDatasetImpl implements FsDatasetSpi { * The deepCopyReplica call doesn't use the datasetock since it will lead the * potential deadlock with the {@link FsVolumeList#addBlockPool} call. */ + @SuppressWarnings("unchecked") @Override public Set deepCopyReplica(String bpid) throws IOException { - Set replicas = null; + Set replicas; try (AutoCloseableLock lock = datasetReadLock.acquire()) { replicas = new HashSet<>(volumeMap.replicas(bpid) == null ? Collections.EMPTY_SET : volumeMap.replicas(bpid)); } - return Collections.unmodifiableSet(replicas); }