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