HBASE-19810 Fix findbugs and error-prone warnings in hbase-metrics (branch-2)
Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
parent
0561312bc4
commit
4676d4bf4a
|
@ -65,6 +65,7 @@ public class HistogramImpl implements Histogram {
|
||||||
histogram.add(value, 1);
|
histogram.add(value, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getCount() {
|
public long getCount() {
|
||||||
return counter.getCount();
|
return counter.getCount();
|
||||||
}
|
}
|
||||||
|
@ -73,6 +74,7 @@ public class HistogramImpl implements Histogram {
|
||||||
return this.histogram.getMax();
|
return this.histogram.getMax();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Snapshot snapshot() {
|
public Snapshot snapshot() {
|
||||||
return histogram.snapshotAndReset();
|
return histogram.snapshotAndReset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,22 +51,27 @@ public class MetricRegistriesImpl extends MetricRegistries {
|
||||||
return registries.put(info, () -> factory.create(info));
|
return registries.put(info, () -> factory.create(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean remove(MetricRegistryInfo key) {
|
public boolean remove(MetricRegistryInfo key) {
|
||||||
return registries.remove(key) == null;
|
return registries.remove(key) == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Optional<MetricRegistry> get(MetricRegistryInfo info) {
|
public Optional<MetricRegistry> get(MetricRegistryInfo info) {
|
||||||
return Optional.ofNullable(registries.get(info));
|
return Optional.ofNullable(registries.get(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Collection<MetricRegistry> getMetricRegistries() {
|
public Collection<MetricRegistry> getMetricRegistries() {
|
||||||
return Collections.unmodifiableCollection(registries.values());
|
return Collections.unmodifiableCollection(registries.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
registries.clear();
|
registries.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Set<MetricRegistryInfo> getMetricRegistryInfos() {
|
public Set<MetricRegistryInfo> getMetricRegistryInfos() {
|
||||||
return Collections.unmodifiableSet(registries.keySet());
|
return Collections.unmodifiableSet(registries.keySet());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue