HBASE-1809 NPE thrown in BoundedRangeFileInputStream
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@817910 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
23e790f50b
commit
873bb2b7c3
|
@ -42,6 +42,7 @@ Release 0.21.0 - Unreleased
|
|||
(Lars George via Stack)
|
||||
HBASE-1857 WrongRegionException when setting region online after .META.
|
||||
split (Cosmin Lehane via Stack)
|
||||
HBASE-1809 NPE thrown in BoundedRangeFileInputStream
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-1760 Cleanup TODOs in HTable
|
||||
|
|
|
@ -1406,34 +1406,38 @@ public class Store implements HConstants, HeapSize {
|
|||
// Column matching and version enforcement
|
||||
QueryMatcher matcher = new QueryMatcher(get, this.family.getName(), columns,
|
||||
this.ttl, keyComparator, versionsToReturn(get.getMaxVersions()));
|
||||
|
||||
// Read from memstore
|
||||
if(this.memstore.get(matcher, result)) {
|
||||
// Received early-out from memstore
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we even have storefiles
|
||||
if (this.storefiles.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get storefiles for this store
|
||||
List<HFileScanner> storefileScanners = new ArrayList<HFileScanner>();
|
||||
for (StoreFile sf : this.storefiles.descendingMap().values()) {
|
||||
HFile.Reader r = sf.getReader();
|
||||
if (r == null) {
|
||||
LOG.warn("StoreFile " + sf + " has a null Reader");
|
||||
continue;
|
||||
this.lock.readLock().lock();
|
||||
try {
|
||||
// Read from memstore
|
||||
if(this.memstore.get(matcher, result)) {
|
||||
// Received early-out from memstore
|
||||
return;
|
||||
}
|
||||
storefileScanners.add(r.getScanner());
|
||||
|
||||
// Check if we even have storefiles
|
||||
if (this.storefiles.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get storefiles for this store
|
||||
List<HFileScanner> storefileScanners = new ArrayList<HFileScanner>();
|
||||
for (StoreFile sf : this.storefiles.descendingMap().values()) {
|
||||
HFile.Reader r = sf.getReader();
|
||||
if (r == null) {
|
||||
LOG.warn("StoreFile " + sf + " has a null Reader");
|
||||
continue;
|
||||
}
|
||||
storefileScanners.add(r.getScanner());
|
||||
}
|
||||
|
||||
// StoreFileGetScan will handle reading this store's storefiles
|
||||
StoreFileGetScan scanner = new StoreFileGetScan(storefileScanners, matcher);
|
||||
|
||||
// Run a GET scan and put results into the specified list
|
||||
scanner.get(result);
|
||||
} finally {
|
||||
this.lock.readLock().unlock();
|
||||
}
|
||||
|
||||
// StoreFileGetScan will handle reading this store's storefiles
|
||||
StoreFileGetScan scanner = new StoreFileGetScan(storefileScanners, matcher);
|
||||
|
||||
// Run a GET scan and put results into the specified list
|
||||
scanner.get(result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue