HBASE-27758 Inconsistent synchronization in MetricsUserSourceImpl (#5149)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
e5620e26a2
commit
143e9b4ff6
|
@ -137,7 +137,6 @@ public class MetricsUserSourceImpl implements MetricsUserSource {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void register() {
|
public void register() {
|
||||||
synchronized (this) {
|
|
||||||
getHisto = registry.newTimeHistogram(userGetKey);
|
getHisto = registry.newTimeHistogram(userGetKey);
|
||||||
scanTimeHisto = registry.newTimeHistogram(userScanTimeKey);
|
scanTimeHisto = registry.newTimeHistogram(userScanTimeKey);
|
||||||
putHisto = registry.newTimeHistogram(userPutKey);
|
putHisto = registry.newTimeHistogram(userPutKey);
|
||||||
|
@ -147,7 +146,6 @@ public class MetricsUserSourceImpl implements MetricsUserSource {
|
||||||
replayHisto = registry.newTimeHistogram(userReplayKey);
|
replayHisto = registry.newTimeHistogram(userReplayKey);
|
||||||
blockBytesScannedCount = registry.newCounter(userBlockBytesScannedKey, "", 0);
|
blockBytesScannedCount = registry.newCounter(userBlockBytesScannedKey, "", 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deregister() {
|
public void deregister() {
|
||||||
|
@ -162,7 +160,6 @@ public class MetricsUserSourceImpl implements MetricsUserSource {
|
||||||
LOG.debug("Removing user Metrics for user: " + user);
|
LOG.debug("Removing user Metrics for user: " + user);
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (this) {
|
|
||||||
registry.removeMetric(userGetKey);
|
registry.removeMetric(userGetKey);
|
||||||
registry.removeMetric(userScanTimeKey);
|
registry.removeMetric(userScanTimeKey);
|
||||||
registry.removeMetric(userPutKey);
|
registry.removeMetric(userPutKey);
|
||||||
|
@ -172,7 +169,6 @@ public class MetricsUserSourceImpl implements MetricsUserSource {
|
||||||
registry.removeMetric(userReplayKey);
|
registry.removeMetric(userReplayKey);
|
||||||
registry.removeMetric(userBlockBytesScannedKey);
|
registry.removeMetric(userBlockBytesScannedKey);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUser() {
|
public String getUser() {
|
||||||
|
|
Loading…
Reference in New Issue