This is an automated email from the ASF dual-hosted git repository.

huhaiyang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 782c50144169 HDFS-17451. RBF: fix spotbugs for redundant nullcheck of 
dns. (#6697)
782c50144169 is described below

commit 782c5014416920b4cfaf1f24a516b4436d8c72bf
Author: Jian Zhang <1361320...@qq.com>
AuthorDate: Tue Apr 23 19:11:51 2024 +0800

    HDFS-17451. RBF: fix spotbugs for redundant nullcheck of dns. (#6697)
---
 .../hadoop/hdfs/server/federation/router/RouterRpcServer.java     | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
index 865756514eff..fe1323c4b5fe 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
@@ -1089,13 +1089,7 @@ public class RouterRpcServer extends AbstractService 
implements ClientProtocol,
   DatanodeInfo[] getCachedDatanodeReport(DatanodeReportType type)
       throws IOException {
     try {
-      DatanodeInfo[] dns = this.dnCache.get(type);
-      if (dns == null) {
-        LOG.debug("Get null DN report from cache");
-        dns = getCachedDatanodeReportImpl(type);
-        this.dnCache.put(type, dns);
-      }
-      return dns;
+      return this.dnCache.get(type);
     } catch (ExecutionException e) {
       LOG.error("Cannot get the DN report for {}", type, e);
       Throwable cause = e.getCause();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to