use of org.apache.hadoop.hive.metastore.api.OpenTxnRequest in project hive by apache.
the class TestOpenTxn method testGap.
@Test
public void testGap() throws Exception {
OpenTxnRequest openTxnRequest = new OpenTxnRequest(1, "me", "localhost");
txnHandler.openTxns(openTxnRequest);
long second = txnHandler.openTxns(openTxnRequest).getTxn_ids().get(0);
deleteTransaction(second);
txnHandler.openTxns(openTxnRequest);
GetOpenTxnsResponse openTxns = txnHandler.getOpenTxns();
Assert.assertEquals(3, openTxns.getOpen_txnsSize());
}
use of org.apache.hadoop.hive.metastore.api.OpenTxnRequest in project hive by apache.
the class HMSClient method openTxnsIntr.
private OpenTxnsResponse openTxnsIntr(String user, int numTxns, TxnType txnType) throws TException {
String hostname;
try {
hostname = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
LOG.error("Unable to resolve my host name " + e.getMessage());
throw new RuntimeException(e);
}
OpenTxnRequest rqst = new OpenTxnRequest(numTxns, user, hostname);
if (txnType != null) {
rqst.setTxn_type(txnType);
}
return client.open_txns(rqst);
}
Aggregations