use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameInt64Pair in project hbase by apache.
the class ResponseConverter method getScanMetrics.
public static Map<String, Long> getScanMetrics(ScanResponse response) {
Map<String, Long> metricMap = new HashMap<>();
if (response == null || !response.hasScanMetrics() || response.getScanMetrics() == null) {
return metricMap;
}
ScanMetrics metrics = response.getScanMetrics();
int numberOfMetrics = metrics.getMetricsCount();
for (int i = 0; i < numberOfMetrics; i++) {
NameInt64Pair metricPair = metrics.getMetrics(i);
if (metricPair != null) {
String name = metricPair.getName();
Long value = metricPair.getValue();
if (name != null && value != null) {
metricMap.put(name, value);
}
}
}
return metricMap;
}
Aggregations