diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java index c8e36ed3696..d7eadecc80d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java @@ -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 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()); + } } } }