HBASE-24423 No need to get lock in canSplit because hasReferences will get lock too

Signed-off-by: Bharath Vissapragada <bharathv@apache.org>
This commit is contained in:
Zheng Wang 2020-05-24 20:10:17 +08:00 committed by Bharath Vissapragada
parent 3ef44a4dcf
commit 1e16d385f8

View File

@ -2075,17 +2075,12 @@ public class HStore implements Store, HeapSize, StoreConfigInformation,
@Override
public boolean canSplit() {
this.lock.readLock().lock();
try {
// Not split-able if we find a reference store file present in the store.
boolean result = !hasReferences();
if (!result) {
LOG.trace("Not splittable; has references: {}", this);
}
return result;
} finally {
this.lock.readLock().unlock();
// Not split-able if we find a reference store file present in the store.
boolean result = !hasReferences();
if (!result) {
LOG.trace("Not splittable; has references: {}", this);
}
return result;
}
/**