private HiveLock lockPrimitive(HiveLockObject key, HiveLockMode mode) throws LockException {
    if (root.lock(key.getPaths(), key.getData(), mode == HiveLockMode.EXCLUSIVE)) {
      return new SimpleHiveLock(key, mode);
    }
    return null;
  }
shared lock manager for dedicated hive server. all locks are managed in memory
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/EmbeddedLockManager.java