HBASE-14788 Splitting a region does not support the hbase.rs.evictblocksonclose config when closing source region
This commit is contained in:
parent
f782cab421
commit
37815cac9e
|
@ -608,7 +608,7 @@ public class HRegionFileSystem {
|
|||
}
|
||||
}
|
||||
} finally {
|
||||
f.closeReader(true);
|
||||
f.closeReader(f.getCacheConf() != null ? f.getCacheConf().shouldEvictOnClose() : true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -550,9 +550,11 @@ public class HStore implements Store {
|
|||
}
|
||||
if (ioe != null) {
|
||||
// close StoreFile readers
|
||||
boolean evictOnClose =
|
||||
cacheConf != null? cacheConf.shouldEvictOnClose(): true;
|
||||
for (StoreFile file : results) {
|
||||
try {
|
||||
if (file != null) file.closeReader(true);
|
||||
if (file != null) file.closeReader(evictOnClose);
|
||||
} catch (IOException e) {
|
||||
LOG.warn(e.getMessage());
|
||||
}
|
||||
|
@ -1224,10 +1226,12 @@ public class HStore implements Store {
|
|||
if (!this.conf.getBoolean("hbase.hstore.compaction.complete", true)) {
|
||||
LOG.warn("hbase.hstore.compaction.complete is set to false");
|
||||
sfs = new ArrayList<StoreFile>(newFiles.size());
|
||||
final boolean evictOnClose =
|
||||
cacheConf != null? cacheConf.shouldEvictOnClose(): true;
|
||||
for (Path newFile : newFiles) {
|
||||
// Create storefile around what we wrote with a reader on it.
|
||||
StoreFile sf = createStoreFileAndReader(newFile);
|
||||
sf.closeReader(true);
|
||||
sf.closeReader(evictOnClose);
|
||||
sfs.add(sf);
|
||||
}
|
||||
return sfs;
|
||||
|
@ -1777,8 +1781,10 @@ public class HStore implements Store {
|
|||
|
||||
// let the archive util decide if we should archive or delete the files
|
||||
LOG.debug("Removing store files after compaction...");
|
||||
boolean evictOnClose =
|
||||
cacheConf != null? cacheConf.shouldEvictOnClose(): true;
|
||||
for (StoreFile compactedFile : compactedFiles) {
|
||||
compactedFile.closeReader(true);
|
||||
compactedFile.closeReader(evictOnClose);
|
||||
}
|
||||
if (removeFiles) {
|
||||
this.fs.removeStoreFiles(this.getColumnFamilyName(), compactedFiles);
|
||||
|
|
|
@ -133,6 +133,10 @@ public class StoreFile {
|
|||
|
||||
private KVComparator comparator;
|
||||
|
||||
CacheConfig getCacheConf() {
|
||||
return cacheConf;
|
||||
}
|
||||
|
||||
public byte[] getFirstKey() {
|
||||
return firstKey;
|
||||
}
|
||||
|
@ -499,7 +503,9 @@ public class StoreFile {
|
|||
this.reader = open(canUseDropBehind);
|
||||
} catch (IOException e) {
|
||||
try {
|
||||
this.closeReader(true);
|
||||
boolean evictOnClose =
|
||||
cacheConf != null? cacheConf.shouldEvictOnClose(): true;
|
||||
this.closeReader(evictOnClose);
|
||||
} catch (IOException ee) {
|
||||
}
|
||||
throw e;
|
||||
|
@ -534,7 +540,9 @@ public class StoreFile {
|
|||
* @throws IOException
|
||||
*/
|
||||
public void deleteReader() throws IOException {
|
||||
closeReader(true);
|
||||
boolean evictOnClose =
|
||||
cacheConf != null? cacheConf.shouldEvictOnClose(): true;
|
||||
closeReader(evictOnClose);
|
||||
this.fs.delete(getPath(), true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue