return 0;
}
private int showTxns(ShowTxnsDesc desc) throws HiveException {
// Call the metastore to get the currently queued and running compactions.
GetOpenTxnsInfoResponse rsp = db.showTransactions();
// Write the results into the file
DataOutputStream os = null;
try {
Path resFile = new Path(desc.getResFile());
FileSystem fs = resFile.getFileSystem(conf);
os = fs.create(resFile);
// Write a header
os.writeBytes("Transaction ID");
os.write(separator);
os.writeBytes("Transaction State");
os.write(separator);
os.writeBytes("User");
os.write(separator);
os.writeBytes("Hostname");
os.write(terminator);
for (TxnInfo txn : rsp.getOpen_txns()) {
os.writeBytes(Long.toString(txn.getId()));
os.write(separator);
os.writeBytes(txn.getState().toString());
os.write(separator);
os.writeBytes(txn.getUser());