HBASE-25311 UI throws NPE (#2688)

Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Wellington Chevreuil <wellington.chevreuil@gmail.com>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
Bo Cui 2020-11-23 12:07:42 +08:00 committed by GitHub
parent a307d706c8
commit b0f20399e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -3621,8 +3621,15 @@ public class HMaster extends HRegionServer implements MasterServices {
List<ReplicationLoadSource> replicationLoadSources =
getServerManager().getLoad(serverName).getReplicationLoadSourceList();
for (ReplicationLoadSource replicationLoadSource : replicationLoadSources) {
replicationLoadSourceMap.get(replicationLoadSource.getPeerID())
.add(new Pair<>(serverName, replicationLoadSource));
List<Pair<ServerName, ReplicationLoadSource>> replicationLoadSourceList =
replicationLoadSourceMap.get(replicationLoadSource.getPeerID());
if (replicationLoadSourceList == null) {
LOG.debug("{} does not exist, but it exists "
+ "in znode(/hbase/replication/rs). when the rs restarts, peerId is deleted, so "
+ "we just need to ignore it", replicationLoadSource.getPeerID());
continue;
}
replicationLoadSourceList.add(new Pair<>(serverName, replicationLoadSource));
}
}
for (List<Pair<ServerName, ReplicationLoadSource>> loads : replicationLoadSourceMap.values()) {