@Override public void close() throws IOException { try { LOG.info("DriverCleanup for LLAP splits: {}", applicationId); driver.releaseLocksAndCommitOrRollback(true); driver.close(); driver.destroy(); txnManager.closeTxnManager(); } catch (Exception err) { LOG.error("Error closing driver resources", err); throw new IOException(err); } }
@After public void tearDown() throws Exception { if (txnMgr != null) { txnMgr.closeTxnManager(); } }
/** * Initialize the transaction manager. This is done lazily to avoid hard wiring one * transaction manager at the beginning of the session. * @param conf Hive configuration to initialize transaction manager * @return transaction manager * @throws LockException */ public synchronized HiveTxnManager initTxnMgr(HiveConf conf) throws LockException { // Only change txnMgr if the setting has changed if (txnMgr != null && !txnMgr.getTxnManagerName().equals(conf.getVar(HiveConf.ConfVars.HIVE_TXN_MANAGER))) { txnMgr.closeTxnManager(); txnMgr = null; } if (txnMgr == null) { txnMgr = TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf); } return txnMgr; }
/** * Initialize the transaction manager. This is done lazily to avoid hard wiring one * transaction manager at the beginning of the session. * @param conf Hive configuration to initialize transaction manager * @return transaction manager * @throws LockException */ public synchronized HiveTxnManager initTxnMgr(HiveConf conf) throws LockException { // Only change txnMgr if the setting has changed if (txnMgr != null && !txnMgr.getTxnManagerName().equals(conf.getVar(HiveConf.ConfVars.HIVE_TXN_MANAGER))) { txnMgr.closeTxnManager(); txnMgr = null; } if (txnMgr == null) { txnMgr = TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf); } return txnMgr; }
txnMgr.closeTxnManager();
@After public void tearDown() throws Exception { if (txnMgr != null) txnMgr.closeTxnManager(); TxnDbUtil.cleanDb(conf); ThreadPool.shutdown(); }
@After public void tearDown() throws Exception { driver.close(); driver2.close(); if (txnMgr != null) { txnMgr.closeTxnManager(); } }
public void close() throws IOException { registry.clear(); if (txnMgr != null) txnMgr.closeTxnManager(); JavaUtils.closeClassLoadersTo(sessionConf.getClassLoader(), parentLoader); File resourceDir =
@Test public void testLockRetryLimit() throws Exception { dropTable(new String[] {"T9"}); conf.setIntVar(HiveConf.ConfVars.HIVE_LOCK_NUMRETRIES, 2); conf.setBoolVar(HiveConf.ConfVars.TXN_MGR_DUMP_LOCK_STATE_ON_ACQUIRE_TIMEOUT, true); CommandProcessorResponse cpr = driver.run("create table T9(a int)"); checkCmdOnDriver(cpr); cpr = driver.compileAndRespond("select * from T9", true); checkCmdOnDriver(cpr); txnMgr.acquireLocks(driver.getPlan(), ctx, "Vincent Vega"); List<ShowLocksResponseElement> locks = getLocks(); Assert.assertEquals("Unexpected lock count", 1, locks.size()); checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "T9", null, locks); HiveTxnManager txnMgr2 = TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf); swapTxnManager(txnMgr2); cpr = driver.compileAndRespond("drop table T9", true); checkCmdOnDriver(cpr); try { txnMgr2.acquireLocks(driver.getPlan(), ctx, "Winston Winnfield"); } catch(LockException ex) { Assert.assertEquals("Got wrong lock exception", ErrorMsg.LOCK_ACQUIRE_TIMEDOUT, ex.getCanonicalErrorMsg()); } locks = getLocks(txnMgr); Assert.assertEquals("Unexpected lock count", 1, locks.size()); checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "T9", null, locks); txnMgr2.closeTxnManager(); }
public void close() throws IOException { registry.clear(); if (txnMgr != null) txnMgr.closeTxnManager(); JavaUtils.closeClassLoadersTo(conf.getClassLoader(), parentLoader); File resourceDir =