Class ReadPointCalculationLock
java.lang.Object
org.apache.hadoop.hbase.regionserver.ReadPointCalculationLock
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.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
lock
(ReadPointCalculationLock.LockType lockType) (package private) void
unlock
(ReadPointCalculationLock.LockType lockType)
-
Field Details
-
useReadWriteLockForReadPoints
-
lock
-
readWriteLock
-
-
Constructor Details
-
ReadPointCalculationLock
ReadPointCalculationLock(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
lock
-
unlock
-