HBASE-18330 NPE in ReplicationZKLockCleanerChore
This commit is contained in:
parent
5f54e28510
commit
01db60d65b
|
@ -520,6 +520,9 @@ public class ReplicationPeersZKImpl extends ReplicationStateZKBase implements Re
|
|||
if (queuesClient == null) return;
|
||||
try {
|
||||
List<String> replicators = queuesClient.getListOfReplicators();
|
||||
if (replicators == null || replicators.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (String replicator : replicators) {
|
||||
List<String> queueIds = queuesClient.getAllQueues(replicator);
|
||||
for (String queueId : queueIds) {
|
||||
|
|
|
@ -98,7 +98,7 @@ public class ReplicationQueuesClientZKImpl extends ReplicationStateZKBase implem
|
|||
for (int retry = 0; ; retry++) {
|
||||
int v0 = getQueuesZNodeCversion();
|
||||
List<String> rss = getListOfReplicators();
|
||||
if (rss == null) {
|
||||
if (rss == null || rss.isEmpty()) {
|
||||
LOG.debug("Didn't find any region server that replicates, won't prevent any deletions.");
|
||||
return ImmutableSet.of();
|
||||
}
|
||||
|
|
|
@ -77,6 +77,9 @@ public class ReplicationZKNodeCleaner {
|
|||
Set<String> peerIds = new HashSet<>(this.replicationPeers.getAllPeerIds());
|
||||
try {
|
||||
List<String> replicators = this.queuesClient.getListOfReplicators();
|
||||
if (replicators == null || replicators.isEmpty()) {
|
||||
return undeletedQueues;
|
||||
}
|
||||
for (String replicator : replicators) {
|
||||
List<String> queueIds = this.queuesClient.getAllQueues(replicator);
|
||||
for (String queueId : queueIds) {
|
||||
|
|
|
@ -323,6 +323,9 @@ public class DumpReplicationQueues extends Configured implements Tool {
|
|||
// Loops each peer on each RS and dumps the queues
|
||||
try {
|
||||
List<String> regionservers = queuesClient.getListOfReplicators();
|
||||
if (regionservers == null || regionservers.isEmpty()) {
|
||||
return sb.toString();
|
||||
}
|
||||
for (String regionserver : regionservers) {
|
||||
List<String> queueIds = queuesClient.getAllQueues(regionserver);
|
||||
replicationQueues.init(regionserver);
|
||||
|
|
Loading…
Reference in New Issue