List<Long> getOpenTxns() throws TException {
    GetOpenTxnsRequest getOpenTxnsRequest = new GetOpenTxnsRequest();
    getOpenTxnsRequest.setExcludeTxnTypes(Arrays.asList(TxnType.READ_ONLY));
    GetOpenTxnsResponse txns = client.get_open_txns_req(getOpenTxnsRequest);
    List<Long> openTxns = new ArrayList<>();
    BitSet abortedBits = BitSet.valueOf(txns.getAbortedBits());
    int i = 0;
    for(long txnId : txns.getOpen_txns()) {
      if(!abortedBits.get(i)) {
        openTxns.add(txnId);
      }
      ++i;
    }
    return openTxns;
  }
Create database if it doesn't exist

@param name        Database name
@param description Database description
@param location    Database location
@param params      Database params
@throws TException if database exists
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/HMSClient.java