tsuna / gohbase

Pure-Go HBase client
Apache License 2.0
736 stars 213 forks source link

hrpc: enable ScanMetrics #254

Closed ciacono closed 4 months ago

ciacono commented 5 months ago

Enable tracking scan metrics in the ScanResponse. Clients can access the metrics via calls to scanner.Next() Support for HBase versions < 2.6.0 where ScanMetrics provides ROWS_SCANNED and ROWS_FILTERED metrics.

tsuna commented 5 months ago

I echo Thibault's feedback here that always passing around the scan metrics along with the batch of results makes the code more complex while also making the scan metrics harder to use from the caller's point of view. Not sure we should keep them in a generic map[string]int64 as this would require assuming we can always accumulate all the metrics by summing them up, but either way I do agree we should track the metrics directly in the scan object instead of passing them around all the time separately, so that the caller can consult the cumulative metrics at the end of the scan, which will most likely be the most common use case.