public boolean unlockResource(String dbName, String tableName, long txnId) {
    final String fullyQualifiedName = Warehouse.getQualifiedName(dbName, tableName);
    final ResourceLock prevResourceLock = locks.get(fullyQualifiedName);
    if (prevResourceLock == null || prevResourceLock.txnId != txnId) {
      return false;
    }
    return locks.remove(fullyQualifiedName, prevResourceLock);
  }
Releases a certain lock.
@param dbName the db name of the materialization
@param tableName the table name of the materialization
@param txnId the transaction id for the rebuild
@return true if the lock could be released properly, false otherwise
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MaterializationsRebuildLockHandler.java