@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    ctx.setResFile(ctx.getLocalTmpPath());

    String dbName = stripQuotes(root.getChild(0).getText());
    boolean isExtended = (root.getChildCount() > 1);

    assert txnManager != null : "Transaction manager should be set before calling analyze";
    ShowLocksDesc desc = new ShowLocksDesc(ctx.getResFile(), dbName, isExtended, txnManager.useNewShowLocksFormat());
    Task<DDLWork> task = TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc));
    rootTasks.add(task);

    task.setFetchSource(true);
    setFetchTask(createFetchTask(desc.getSchema()));

    // Need to initialize the lock manager
    ctx.setNeedLockMgr(true);
  }
Analyzer for show DB locks commands.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/lock/show/ShowDbLocksAnalyzer.java