private List<HiveLock> lockPrimitive(List<HiveLockObj> objs, int numRetriesForLock,
      long sleepTime) throws LockException {
    List<HiveLock> locks = new ArrayList<HiveLock>();
    for (HiveLockObj obj : objs) {
      HiveLock lock = lockPrimitive(obj.getObj(), obj.getMode());
      if (lock == null) {
        releaseLocks(locks, numRetriesForLock, sleepTime);
        return null;
      }
      locks.add(lock);
    }
    return locks;
  }
shared lock manager for dedicated hive server. all locks are managed in memory
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/EmbeddedLockManager.java