HBASE-14632 Region server aborts due to unguarded dereference of Reader

This commit is contained in:
tedyu 2015-11-06 12:06:19 -08:00
parent bfa3689190
commit 6ec4a96814
1 changed files with 8 additions and 1 deletions

View File

@ -1998,7 +1998,11 @@ public class HStore implements Store {
public long getTotalStaticIndexSize() {
long size = 0;
for (StoreFile s : this.storeEngine.getStoreFileManager().getStorefiles()) {
size += s.getReader().getUncompressedDataIndexSize();
StoreFile.Reader r = s.getReader();
if (r == null) {
continue;
}
size += r.getUncompressedDataIndexSize();
}
return size;
}
@ -2008,6 +2012,9 @@ public class HStore implements Store {
long size = 0;
for (StoreFile s : this.storeEngine.getStoreFileManager().getStorefiles()) {
StoreFile.Reader r = s.getReader();
if (r == null) {
continue;
}
size += r.getTotalBloomSize();
}
return size;