HBASE-18330 NPE in ReplicationZKLockCleanerChore
This commit is contained in:
parent
2da5b432a1
commit
cfd5b6b59f
|
@ -528,6 +528,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) {
|
||||
|
|
|
@ -76,7 +76,9 @@ public class ReplicationZKLockCleanerChore extends ScheduledChore {
|
|||
}
|
||||
Set<String> rsSet = new HashSet<String>(regionServers);
|
||||
List<String> replicators = queues.getListOfReplicators();
|
||||
|
||||
if (replicators == null || replicators.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (String replicator: replicators) {
|
||||
try {
|
||||
String lockNode = queues.getLockZNode(replicator);
|
||||
|
|
|
@ -80,6 +80,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) {
|
||||
|
|
|
@ -98,7 +98,7 @@ public class ReplicationLogCleaner extends BaseLogCleanerDelegate {
|
|||
for (int retry = 0; ; retry++) {
|
||||
int v0 = replicationQueues.getQueuesZNodeCversion();
|
||||
List<String> rss = replicationQueues.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();
|
||||
}
|
||||
|
|
|
@ -307,6 +307,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);
|
||||
|
|
|
@ -254,7 +254,7 @@ public class ReplicationSourceManager implements ReplicationListener {
|
|||
}
|
||||
}
|
||||
List<String> currentReplicators = this.replicationQueues.getListOfReplicators();
|
||||
if (currentReplicators == null || currentReplicators.size() == 0) {
|
||||
if (currentReplicators == null || currentReplicators.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<String> otherRegionServers = replicationTracker.getListOfRegionServers();
|
||||
|
|
Loading…
Reference in New Issue