Class SchemaLocking
java.lang.Object
org.apache.hadoop.hbase.master.procedure.SchemaLocking
Locks on namespaces, tables, and regions.
Since LockAndQueue implementation is NOT thread-safe, schedLock() guards all calls to these locks.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<String,
LockAndQueue> private final LockAndQueue
private final Map<String,
LockAndQueue> private final Map<String,
LockAndQueue> private final Map<String,
LockAndQueue> private final Map<ServerName,
LockAndQueue> private final Map<TableName,
LockAndQueue> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate <T> void
addToLockedResources
(List<LockedResource> lockedResources, Map<T, LockAndQueue> locks, Function<T, String> keyTransformer, LockedResourceType resourcesType) (package private) void
clear()
Removes all locks by clearing the maps.private LockedResource
createLockedResource
(LockedResourceType resourceType, String resourceName, LockAndQueue queue) private String
filterUnlocked
(Map<?, LockAndQueue> locks) (package private) LockAndQueue
getGlobalLock
(String globalId) private <T> LockAndQueue
getLock
(Map<T, LockAndQueue> map, T key) (package private) LockedResource
getLockResource
(LockedResourceType resourceType, String resourceName) (package private) List<LockedResource>
getLocks()
List lock queues.(package private) LockAndQueue
Deprecated.(package private) LockAndQueue
getNamespaceLock
(String namespace) (package private) LockAndQueue
getPeerLock
(String peerId) (package private) LockAndQueue
getRegionLock
(String encodedRegionName) (package private) LockAndQueue
getServerLock
(ServerName serverName) (package private) LockAndQueue
getTableLock
(TableName tableName) (package private) LockAndQueue
removeGlobalLock
(String globalId) (package private) LockAndQueue
removePeerLock
(String peerId) (package private) LockAndQueue
removeRegionLock
(String encodedRegionName) (package private) LockAndQueue
removeServerLock
(ServerName serverName) (package private) LockAndQueue
removeTableLock
(TableName tableName) toString()
-
Field Details
-
procedureRetriever
-
serverLocks
-
namespaceLocks
-
tableLocks
-
regionLocks
-
peerLocks
-
globalLocks
-
metaLock
-
-
Constructor Details
-
SchemaLocking
-
-
Method Details
-
getLock
-
getTableLock
-
removeTableLock
-
getNamespaceLock
-
getRegionLock
-
getMetaLock
Deprecated.only used forRecoverMetaProcedure
. Should be removed along withRecoverMetaProcedure
. -
getGlobalLock
-
removeRegionLock
-
getServerLock
-
removeServerLock
-
getPeerLock
-
removePeerLock
-
removeGlobalLock
-
createLockedResource
private LockedResource createLockedResource(LockedResourceType resourceType, String resourceName, LockAndQueue queue) -
addToLockedResources
private <T> void addToLockedResources(List<LockedResource> lockedResources, Map<T, LockAndQueue> locks, Function<T, String> keyTransformer, LockedResourceType resourcesType) -
getLocks
List lock queues.- Returns:
- the locks
-
getLockResource
- Returns:
LockedResource
for resource of specified type & name. null if resource is not locked.
-
clear
void clear()Removes all locks by clearing the maps. Used when procedure executor is stopped for failure and recovery testing. -
toString
-
filterUnlocked
-
RecoverMetaProcedure
.