HBASE-23590 : Update maxCompactedStoreFileRef (ADDENDUM)

This commit is contained in:
Viraj Jasani 2020-01-02 19:07:54 +05:30
parent e0c419d76d
commit 19b35d2b19
No known key found for this signature in database
GPG Key ID: E906DFF511D3E5DB
1 changed files with 9 additions and 6 deletions

View File

@ -2878,12 +2878,15 @@ public class HStore implements Store {
*/
public int getMaxCompactedStoreFileRefCount() {
int maxCompactedStoreFileRefCount = 0;
for (StoreFile store : storeEngine.getStoreFileManager().getCompactedfiles()) {
if (store.isHFile()) {
StoreFile.Reader storeReader = store.getReader();
if (storeReader != null) {
maxCompactedStoreFileRefCount = Math.max(maxCompactedStoreFileRefCount,
storeReader.getRefCount());
Collection<StoreFile> compactedFiles = storeEngine.getStoreFileManager().getCompactedfiles();
if (compactedFiles != null) {
for (StoreFile store : compactedFiles) {
if (store.isHFile()) {
StoreFile.Reader storeReader = store.getReader();
if (storeReader != null) {
maxCompactedStoreFileRefCount = Math.max(maxCompactedStoreFileRefCount,
storeReader.getRefCount());
}
}
}
}