Class RegionStateNodeLock

java.lang.Object
org.apache.hadoop.hbase.master.assignment.RegionStateNodeLock

@Private class RegionStateNodeLock extends Object
A lock implementation which supports unlock by another thread.

This is because we need to hold region state node lock while updating region state to meta(for keeping consistency), so it is better to yield the procedure to release the procedure worker. But after waking up the procedure, we may use another procedure worker to execute the procedure, which means we need to unlock by another thread.

For locking by procedure, we will also suspend the procedure if the lock is not ready, and schedule it again when lock is ready. This is very important to not block the PEWorker as we may hold the lock when updating meta, which could take a lot of time.

Please see HBASE-28196 for more details.