Package org.apache.hadoop.hive.metastore.api

Examples of org.apache.hadoop.hive.metastore.api.LockResponse


        .setDbName("yourdb")
        .setShared()
        .build());
    rqstBuilder.setUser("fred");

    LockResponse res = client.lock(rqstBuilder.build());
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    res = client.checkLock(1);
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    client.heartbeat(0, 1);

    client.unlock(1);
  }
View Full Code Here


        .setDbName("yourdb")
        .setShared()
        .build())
      .setUser("fred");

    LockResponse res = client.lock(rqstBuilder.build());
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    res = client.checkLock(1);
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    client.heartbeat(txnid, 1);

    client.commitTxn(txnid);
  }
View Full Code Here

          if (ci.partName != nullcomp.setPartitionname(ci.partName);
          List<LockComponent> components = new ArrayList<LockComponent>(1);
          components.add(comp);
          LockRequest rqst = new LockRequest(components, System.getProperty("user.name"),
              Worker.hostname());
          LockResponse rsp = txnHandler.lockNoWait(rqst);
          try {
            if (rsp.getState() == LockState.ACQUIRED) {
              clean(ci);
            }
          } finally {
            if (rsp.getState() == LockState.ACQUIRED) {
              txnHandler.unlock(new UnlockRequest(rsp.getLockid()));
            }
          }
        }

        // Now, go back to bed until it's time to do this again
View Full Code Here

        .setDbName("yourdb")
        .setShared()
        .build());
    rqstBuilder.setUser("fred");

    LockResponse res = client.lock(rqstBuilder.build());
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    res = client.checkLock(1);
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    client.heartbeat(0, 1);

    client.unlock(1);
  }
View Full Code Here

        .setDbName("yourdb")
        .setShared()
        .build())
      .setUser("fred");

    LockResponse res = client.lock(rqstBuilder.build());
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    res = client.checkLock(1);
    Assert.assertEquals(1L, res.getLockid());
    Assert.assertEquals(LockState.ACQUIRED, res.getState());

    client.heartbeat(txnid, 1);

    client.commitTxn(txnid);
  }
View Full Code Here

        throw new InvalidTrasactionState("No more transactions available in" +
                " current batch for end point : " + endPt);
      ++currentTxnIndex;
      lockRequest = createLockRequest(endPt, partNameForLock, username, getCurrentTxnId());
      try {
        LockResponse res = msClient.lock(lockRequest);
        if (res.getState() != LockState.ACQUIRED) {
          throw new TransactionError("Unable to acquire lock on " + endPt);
        }
      } catch (TException e) {
        throw new TransactionError("Unable to acquire lock on " + endPt, e);
      }
View Full Code Here

          if (ci.partName != nullcomp.setPartitionname(ci.partName);
          List<LockComponent> components = new ArrayList<LockComponent>(1);
          components.add(comp);
          LockRequest rqst = new LockRequest(components, System.getProperty("user.name"),
              Worker.hostname());
          LockResponse rsp = txnHandler.lockNoWait(rqst);
          try {
            if (rsp.getState() == LockState.ACQUIRED) {
              clean(ci);
            }
          } finally {
            if (rsp.getState() == LockState.ACQUIRED) {
              txnHandler.unlock(new UnlockRequest(rsp.getLockid()));
            }
          }
        }

        // Now, go back to bed until it's time to do this again
View Full Code Here

        throw new InvalidTrasactionState("No more transactions available in" +
                " current batch for end point : " + endPt);
      ++currentTxnIndex;
      lockRequest = createLockRequest(endPt, partNameForLock, proxyUser, getCurrentTxnId());
      try {
        LockResponse res = msClient.lock(lockRequest);
        if (res.getState() != LockState.ACQUIRED) {
          throw new TransactionError("Unable to acquire lock on " + endPt);
        }
      } catch (TException e) {
        throw new TransactionError("Unable to acquire lock on " + endPt, e);
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.metastore.api.LockResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.