HDFS-17451. RBF: fix spotbugs for redundant nullcheck of dns. (#6697)
This commit is contained in:
parent
6404692c09
commit
782c501441
@ -1089,13 +1089,7 @@ public DatanodeInfo[] getDatanodeReport(DatanodeReportType type)
|
|||||||
DatanodeInfo[] getCachedDatanodeReport(DatanodeReportType type)
|
DatanodeInfo[] getCachedDatanodeReport(DatanodeReportType type)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
try {
|
try {
|
||||||
DatanodeInfo[] dns = this.dnCache.get(type);
|
return 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;
|
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
LOG.error("Cannot get the DN report for {}", type, e);
|
LOG.error("Cannot get the DN report for {}", type, e);
|
||||||
Throwable cause = e.getCause();
|
Throwable cause = e.getCause();
|
||||||
|
Loading…
Reference in New Issue
Block a user