Class ReadPointCalculationLock

java.lang.Object
org.apache.hadoop.hbase.regionserver.ReadPointCalculationLock

@Private public class ReadPointCalculationLock extends Object
Lock to manage concurrency between RegionScanner and HRegion.getSmallestReadPoint(). We need to ensure that while we are calculating the smallest read point, no new scanners can modify the scannerReadPoints Map. We used to achieve this by synchronizing on the scannerReadPoints object. But this may block the read thread and reduce the read performance. Since the scannerReadPoints object is a ConcurrentHashMap, which is thread-safe, so the RegionScanner can record their read points concurrently, what it needs to do is just acquiring a shared lock. When we calculate the smallest read point, we need to acquire an exclusive lock. This can improve read performance in most scenarios, only not when we have a lot of delta operations, like Append or Increment. So we introduce a flag to enable/disable this feature.