HBASE-27758 Inconsistent synchronization in MetricsUserSourceImpl (#5149)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
cc57d676cd
commit
dedf1f9fbe
|
@ -135,15 +135,13 @@ public class MetricsUserSourceImpl implements MetricsUserSource {
|
|||
|
||||
@Override
|
||||
public void register() {
|
||||
synchronized (this) {
|
||||
getHisto = registry.newTimeHistogram(userGetKey);
|
||||
scanTimeHisto = registry.newTimeHistogram(userScanTimeKey);
|
||||
putHisto = registry.newTimeHistogram(userPutKey);
|
||||
deleteHisto = registry.newTimeHistogram(userDeleteKey);
|
||||
incrementHisto = registry.newTimeHistogram(userIncrementKey);
|
||||
appendHisto = registry.newTimeHistogram(userAppendKey);
|
||||
replayHisto = registry.newTimeHistogram(userReplayKey);
|
||||
}
|
||||
getHisto = registry.newTimeHistogram(userGetKey);
|
||||
scanTimeHisto = registry.newTimeHistogram(userScanTimeKey);
|
||||
putHisto = registry.newTimeHistogram(userPutKey);
|
||||
deleteHisto = registry.newTimeHistogram(userDeleteKey);
|
||||
incrementHisto = registry.newTimeHistogram(userIncrementKey);
|
||||
appendHisto = registry.newTimeHistogram(userAppendKey);
|
||||
replayHisto = registry.newTimeHistogram(userReplayKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -159,15 +157,13 @@ public class MetricsUserSourceImpl implements MetricsUserSource {
|
|||
LOG.debug("Removing user Metrics for user: " + user);
|
||||
}
|
||||
|
||||
synchronized (this) {
|
||||
registry.removeMetric(userGetKey);
|
||||
registry.removeMetric(userScanTimeKey);
|
||||
registry.removeMetric(userPutKey);
|
||||
registry.removeMetric(userDeleteKey);
|
||||
registry.removeMetric(userIncrementKey);
|
||||
registry.removeMetric(userAppendKey);
|
||||
registry.removeMetric(userReplayKey);
|
||||
}
|
||||
registry.removeMetric(userGetKey);
|
||||
registry.removeMetric(userScanTimeKey);
|
||||
registry.removeMetric(userPutKey);
|
||||
registry.removeMetric(userDeleteKey);
|
||||
registry.removeMetric(userIncrementKey);
|
||||
registry.removeMetric(userAppendKey);
|
||||
registry.removeMetric(userReplayKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue