-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22459 Expose store reader reference count #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
💔 -1 overall
This message was automatically generated. |
| @Override | ||
| public int getStoreRefCount() { | ||
| return this.storeEngine.getStoreFileManager().getStorefiles().stream() | ||
| .filter(sf -> { return sf.getReader() != null; }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sf -> sf.getReader() != null is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HStoreFile::getRefCount is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
| /** | ||
| * @return Reference count over store | ||
| */ | ||
| int getStoreRefCount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here we also expose this value to CP, not only through metrics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
Bah need to fix TestStorageClusterStatusModel and maybe the other one. Back soon |
|
💔 -1 overall
This message was automatically generated. |
| /** | ||
| * @return Reference count over store | ||
| */ | ||
| int getStoreRefCount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
Other than Duo's comment , LGTM. +1 |
|
No problem, will remove from Store and leave in HStore only. Back soon. |
|
TestMasterReplication issue does not seem related, but will check |
|
Updated patch removes changes to Store. |
|
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. |
|
💔 -1 overall
This message was automatically generated. |
|
+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.