private void showLocks() throws Exception {
    ShowLocksRequest request = new ShowLocksRequest();
    request.setDbname(MUTEX.getDb());
    request.setTablename(MUTEX.getTable());
    ShowLocksResponse response = TxnUtils.getTxnStore(configuration).showLocks(request);
    if (response.getLocks() != null) {
      System.out.println("The host which holds the mutex is running the metadata summary task");
      response.getLocks().forEach(lock -> {
        StringBuilder builder = new StringBuilder("Mutex: ").append(MUTEX).append(", host: ")
            .append(lock.getHostname()).append(", agent: ").append(lock.getAgentInfo()).append(", state: ")
            .append(lock.getState()).append(", user: ").append(lock.getUser()).append(", acquired at: ")
            .append(lock.getAcquiredat());
        System.out.println(builder.toString());
      });
    }
  }
Helper method of exportInJson.

@param jsonOutput A string, JSON formatted string about metadataSummary.
@param filename   Path of a file in String where the summary needs to be output to.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/metatool/MetaToolTaskMetadataSummary.java