Uh oh!
There was an error while loading. Please reload this page.
HBASE-22459 Expose store reader reference count - #248
Conversation
Apache-HBase
commented
May 23, 2019
💔 -1 overall
This message was automatically generated. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| @Override | ||
| public int getStoreRefCount() { | ||
| return this.storeEngine.getStoreFileManager().getStorefiles().stream() | ||
| .filter(sf -> { return sf.getReader() != null; }) |
There was a problem hiding this comment.
sf -> sf.getReader() != null is enough?
There was a problem hiding this comment.
Ok. This style is new to me
| return this.storeEngine.getStoreFileManager().getStorefiles().stream() | ||
| .filter(sf -> { return sf.getReader() != null; }) | ||
| .filter(HStoreFile::isHFile) | ||
| .mapToInt(sf -> sf.getRefCount()) |
There was a problem hiding this comment.
HStoreFile::getRefCount is better?
| /** | ||
| * @return Reference count over store | ||
| */ | ||
| int getStoreRefCount(); |
There was a problem hiding this comment.
So here we also expose this value to CP, not only through metrics?
There was a problem hiding this comment.
I think it would be good to have this in the interface to avoid some casting but is not required probably
There was a problem hiding this comment.
If you mean this code sniff for (Store store : region.stores.values()) { tempNumStoreFiles += store.getStorefilesCount(); tempStoreRefCount += store.getStoreRefCount(); tempMemstoreSize += store.getMemStoreSize().getDataSize(); tempStoreFileSize += store.getStorefilesSize(); OptionalLong storeMaxStoreFileAge = store.getMaxStoreFileAge();
Actually you can just change the for (Store store : region.stores.values()) { to for (HStore store : region.stores.values()) {, as the region is a HRegion.
apurtell
commented
May 23, 2019
Bah need to fix TestStorageClusterStatusModel and maybe the other one. Back soon |
Apache-HBase
commented
May 24, 2019
💔 -1 overall
This message was automatically generated. |
| /** | ||
| * @return Reference count over store | ||
| */ | ||
| int getStoreRefCount(); |
There was a problem hiding this comment.
If you mean this code sniff for (Store store : region.stores.values()) { tempNumStoreFiles += store.getStorefilesCount(); tempStoreRefCount += store.getStoreRefCount(); tempMemstoreSize += store.getMemStoreSize().getDataSize(); tempStoreFileSize += store.getStorefilesSize(); OptionalLong storeMaxStoreFileAge = store.getMaxStoreFileAge();
Actually you can just change the for (Store store : region.stores.values()) { to for (HStore store : region.stores.values()) {, as the region is a HRegion.
xcangCRM
commented
May 24, 2019
Other than Duo's comment , LGTM. +1 |
apurtell
commented
May 24, 2019
No problem, will remove from Store and leave in HStore only. Back soon. |
apurtell
commented
May 24, 2019
TestMasterReplication issue does not seem related, but will check |
apurtell
commented
May 29, 2019
Updated patch removes changes to Store. |
apurtell
commented
May 29, 2019
Last version of patch got a clean precommit run on the JIRA. No reason to think the interface change in the latest patch would affect that. |
Apache-HBase
commented
May 29, 2019
💔 -1 overall
This message was automatically generated. |
xcangCRM
commented
May 30, 2019
+1 |
Expose the reference count over a region's store file readers as a metric in region metrics and also as a new field in RegionLoad. This will make visible the reader reference count over all stores in the region to both metrics capture and anything that consumes ClusterStatus, like the shell's status command and the master UI.
Coprocessors that wrap scanners might leak them, which will leak readers. We log when this happens but in order to notice the increasing trend of reference counts you have to scrape log output. It would be better if this information is also available as a metric.