LockedResource getLockResource(LockedResourceType resourceType, String resourceName) {
    LockAndQueue queue;
    switch (resourceType) {
      case SERVER:
        queue = serverLocks.get(ServerName.valueOf(resourceName));
        break;
      case NAMESPACE:
        queue = namespaceLocks.get(resourceName);
        break;
      case TABLE:
        queue = tableLocks.get(TableName.valueOf(resourceName));
        break;
      case REGION:
        queue = regionLocks.get(resourceName);
        break;
      case PEER:
        queue = peerLocks.get(resourceName);
        break;
      case META:
        queue = metaLock;
        break;
      case GLOBAL:
        queue = globalLocks.get(resourceName);
        break;
      default:
        queue = null;
        break;
    }
    return queue != null ? createLockedResource(resourceType, resourceName, queue) : null;
  }
@return {@link LockedResource} for resource of specified type & name. null if resource is not
        locked.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SchemaLocking.java