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:
Peter Somogyi 2018-01-17 10:05:03 +01:00 committed by Michael Stack
parent 0561312bc4
commit 4676d4bf4a
2 changed files with 7 additions and 0 deletions

View File

@ -65,6 +65,7 @@ public class HistogramImpl implements Histogram {
histogram.add(value, 1);
}
@Override
public long getCount() {
return counter.getCount();
}
@ -73,6 +74,7 @@ public class HistogramImpl implements Histogram {
return this.histogram.getMax();
}
@Override
public Snapshot snapshot() {
return histogram.snapshotAndReset();
}

View File

@ -51,22 +51,27 @@ public class MetricRegistriesImpl extends MetricRegistries {
return registries.put(info, () -> factory.create(info));
}
@Override
public boolean remove(MetricRegistryInfo key) {
return registries.remove(key) == null;
}
@Override
public Optional<MetricRegistry> get(MetricRegistryInfo info) {
return Optional.ofNullable(registries.get(info));
}
@Override
public Collection<MetricRegistry> getMetricRegistries() {
return Collections.unmodifiableCollection(registries.values());
}
@Override
public void clear() {
registries.clear();
}
@Override
public Set<MetricRegistryInfo> getMetricRegistryInfos() {
return Collections.unmodifiableSet(registries.keySet());
}