Class LockManager.RemoteLocks
java.lang.Object
org.apache.hadoop.hbase.master.locking.LockManager.RemoteLocks
- Enclosing class:
- LockManager
Locks on namespace/table/regions for remote operations. Since remote operations are unreliable
and the client/RS may die anytime and never release locks, regular heartbeats are required to
keep the lock held.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
lockHeartbeat
(long procId, boolean keepAlive) long
requestNamespaceLock
(String namespace, LockType type, String description, NonceKey nonceKey) long
requestRegionsLock
(RegionInfo[] regionInfos, String description, NonceKey nonceKey) long
requestTableLock
(TableName tableName, LockType type, String description, NonceKey nonceKey)
-
Constructor Details
-
RemoteLocks
public RemoteLocks()
-
-
Method Details
-
requestNamespaceLock
public long requestNamespaceLock(String namespace, LockType type, String description, NonceKey nonceKey) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentException
IOException
-
requestTableLock
public long requestTableLock(TableName tableName, LockType type, String description, NonceKey nonceKey) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentException
IOException
-
requestRegionsLock
public long requestRegionsLock(RegionInfo[] regionInfos, String description, NonceKey nonceKey) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentException
- if all regions are not from same table.IOException
-
lockHeartbeat
- Parameters:
keepAlive
- if false, release the lock.- Returns:
- true, if procedure is found and it has the lock; else false.
- Throws:
IOException
-