HDFS-15160. amend to fix javac error supressing unchecked warning

This commit is contained in:
Ahmed Hussein 2021-08-31 15:58:06 -05:00 committed by He Xiaoqiao
parent 3c03ade285
commit a3920e89de
No known key found for this signature in database
GPG Key ID: A80CC124E9A0FA63
1 changed files with 2 additions and 2 deletions

View File

@ -201,16 +201,16 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
* The deepCopyReplica call doesn't use the datasetock since it will lead the * The deepCopyReplica call doesn't use the datasetock since it will lead the
* potential deadlock with the {@link FsVolumeList#addBlockPool} call. * potential deadlock with the {@link FsVolumeList#addBlockPool} call.
*/ */
@SuppressWarnings("unchecked")
@Override @Override
public Set<? extends Replica> deepCopyReplica(String bpid) public Set<? extends Replica> deepCopyReplica(String bpid)
throws IOException { throws IOException {
Set<? extends Replica> replicas = null; Set<? extends Replica> replicas;
try (AutoCloseableLock lock = datasetReadLock.acquire()) { try (AutoCloseableLock lock = datasetReadLock.acquire()) {
replicas = replicas =
new HashSet<>(volumeMap.replicas(bpid) == null ? Collections.EMPTY_SET new HashSet<>(volumeMap.replicas(bpid) == null ? Collections.EMPTY_SET
: volumeMap.replicas(bpid)); : volumeMap.replicas(bpid));
} }
return Collections.unmodifiableSet(replicas); return Collections.unmodifiableSet(replicas);
} }