HBASE-20524 Need to clear metrics when ReplicationSourceManager refresh replication sources
This commit is contained in:
parent
e92580e201
commit
eaafdff761
|
@ -149,6 +149,7 @@ public class RecoveredReplicationSource extends ReplicationSource {
|
||||||
Threads.sleep(100);// wait a short while for other worker thread to fully exit
|
Threads.sleep(100);// wait a short while for other worker thread to fully exit
|
||||||
boolean allTasksDone = workerThreads.values().stream().allMatch(w -> w.isFinished());
|
boolean allTasksDone = workerThreads.values().stream().allMatch(w -> w.isFinished());
|
||||||
if (allTasksDone) {
|
if (allTasksDone) {
|
||||||
|
this.getSourceMetrics().clear();
|
||||||
manager.removeRecoveredSource(this);
|
manager.removeRecoveredSource(this);
|
||||||
LOG.info("Finished recovering queue {} with the following stats: {}", queueId, getStats());
|
LOG.info("Finished recovering queue {} with the following stats: {}", queueId, getStats());
|
||||||
}
|
}
|
||||||
|
|
|
@ -519,6 +519,7 @@ public class ReplicationSource implements ReplicationSourceInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.metrics.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -418,7 +418,6 @@ public class ReplicationSourceManager implements ReplicationListener {
|
||||||
*/
|
*/
|
||||||
void removeRecoveredSource(ReplicationSourceInterface src) {
|
void removeRecoveredSource(ReplicationSourceInterface src) {
|
||||||
LOG.info("Done with the recovered queue " + src.getQueueId());
|
LOG.info("Done with the recovered queue " + src.getQueueId());
|
||||||
src.getSourceMetrics().clear();
|
|
||||||
this.oldsources.remove(src);
|
this.oldsources.remove(src);
|
||||||
// Delete queue from storage and memory
|
// Delete queue from storage and memory
|
||||||
deleteQueue(src.getQueueId());
|
deleteQueue(src.getQueueId());
|
||||||
|
@ -431,7 +430,6 @@ public class ReplicationSourceManager implements ReplicationListener {
|
||||||
*/
|
*/
|
||||||
void removeSource(ReplicationSourceInterface src) {
|
void removeSource(ReplicationSourceInterface src) {
|
||||||
LOG.info("Done with the queue " + src.getQueueId());
|
LOG.info("Done with the queue " + src.getQueueId());
|
||||||
src.getSourceMetrics().clear();
|
|
||||||
this.sources.remove(src.getPeerId());
|
this.sources.remove(src.getPeerId());
|
||||||
// Delete queue from storage and memory
|
// Delete queue from storage and memory
|
||||||
deleteQueue(src.getQueueId());
|
deleteQueue(src.getQueueId());
|
||||||
|
|
|
@ -80,12 +80,12 @@ public class ReplicationSourceDummy implements ReplicationSourceInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void terminate(String reason) {
|
public void terminate(String reason) {
|
||||||
|
terminate(reason, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void terminate(String reason, Exception e) {
|
public void terminate(String reason, Exception e) {
|
||||||
|
this.metrics.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue