Search in sources :

Example 1 with HeartbeatTxnRangeRequest

use of org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest in project hive by apache.

the class TestTxnHandler method heartbeatTxnRangeOneCommitted.

@Test
public void heartbeatTxnRangeOneCommitted() throws Exception {
    long txnid = openTxn();
    assertEquals(1, txnid);
    txnHandler.commitTxn(new CommitTxnRequest(1));
    txnid = openTxn();
    txnid = openTxn();
    HeartbeatTxnRangeResponse rsp = txnHandler.heartbeatTxnRange(new HeartbeatTxnRangeRequest(1, 3));
    assertEquals(1, rsp.getNosuchSize());
    Long txn = rsp.getNosuch().iterator().next();
    assertEquals(1L, (long) txn);
    assertEquals(0, rsp.getAborted().size());
}
Also used : CommitTxnRequest(org.apache.hadoop.hive.metastore.api.CommitTxnRequest) HeartbeatTxnRangeResponse(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeResponse) HeartbeatTxnRangeRequest(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest) Test(org.junit.Test)

Example 2 with HeartbeatTxnRangeRequest

use of org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest in project hive by apache.

the class TestTxnHandler method heartbeatTxnRange.

@Test
public void heartbeatTxnRange() throws Exception {
    long txnid = openTxn();
    assertEquals(1, txnid);
    txnid = openTxn();
    txnid = openTxn();
    HeartbeatTxnRangeResponse rsp = txnHandler.heartbeatTxnRange(new HeartbeatTxnRangeRequest(1, 3));
    assertEquals(0, rsp.getAborted().size());
    assertEquals(0, rsp.getNosuch().size());
}
Also used : HeartbeatTxnRangeResponse(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeResponse) HeartbeatTxnRangeRequest(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest) Test(org.junit.Test)

Example 3 with HeartbeatTxnRangeRequest

use of org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest in project hive by apache.

the class TestTxnHandler method heartbeatTxnRangeOneAborted.

@Test
public void heartbeatTxnRangeOneAborted() throws Exception {
    long txnid = openTxn();
    assertEquals(1, txnid);
    txnid = openTxn();
    txnid = openTxn();
    txnHandler.abortTxn(new AbortTxnRequest(3));
    HeartbeatTxnRangeResponse rsp = txnHandler.heartbeatTxnRange(new HeartbeatTxnRangeRequest(1, 3));
    assertEquals(1, rsp.getAbortedSize());
    Long txn = rsp.getAborted().iterator().next();
    assertEquals(3L, (long) txn);
    assertEquals(0, rsp.getNosuch().size());
}
Also used : HeartbeatTxnRangeResponse(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeResponse) HeartbeatTxnRangeRequest(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest) AbortTxnRequest(org.apache.hadoop.hive.metastore.api.AbortTxnRequest) Test(org.junit.Test)

Aggregations

HeartbeatTxnRangeRequest (org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest)3 HeartbeatTxnRangeResponse (org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeResponse)3 Test (org.junit.Test)3 AbortTxnRequest (org.apache.hadoop.hive.metastore.api.AbortTxnRequest)1 CommitTxnRequest (org.apache.hadoop.hive.metastore.api.CommitTxnRequest)1