return 0;
}
private int showCompactions(ShowCompactionsDesc desc) throws HiveException {
// Call the metastore to get the currently queued and running compactions.
ShowCompactResponse rsp = db.showCompactions();
// 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("Database");
os.write(separator);
os.writeBytes("Table");
os.write(separator);
os.writeBytes("Partition");
os.write(separator);
os.writeBytes("Type");
os.write(separator);
os.writeBytes("State");
os.write(separator);
os.writeBytes("Worker");
os.write(separator);
os.writeBytes("Start Time");
os.write(terminator);
if (rsp.getCompacts() != null) {
for (ShowCompactResponseElement e : rsp.getCompacts()) {
os.writeBytes(e.getDbname());
os.write(separator);
os.writeBytes(e.getTablename());
os.write(separator);
String part = e.getPartitionname();