public HiveTxnManager getTxnMgr() { return nestedContext.getHiveTxnManager(); }
public HiveTxnManager getTxnMgr() { return driverContext.getCtx().getHiveTxnManager(); } }
/** * Lock the database * * @param lockDb * the database to be locked along with the mode * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int lockDatabase(Hive db, LockDatabaseDesc lockDb) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.lockDatabase(db, lockDb); }
/** * Lock the table/partition specified * @param db * * @param lockTbl * the table/partition to be locked along with the mode * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int lockTable(Hive db, LockTableDesc lockTbl) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.lockTable(db, lockTbl); }
/** * Unlock the database specified * * @param unlockDb * the database to be unlocked * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int unlockDatabase(Hive db, UnlockDatabaseDesc unlockDb) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.unlockDatabase(db, unlockDb); }
/** * Unlock the table/partition specified * @param db * * @param unlockTbl * the table/partition to be unlocked * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int unlockTable(Hive db, UnlockTableDesc unlockTbl) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.unlockTable(db, unlockTbl); }
/** * Lock the database * * @param lockDb * the database to be locked along with the mode * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int lockDatabase(Hive db, LockDatabaseDesc lockDb) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.lockDatabase(db, lockDb); }
/** * Lock the table/partition specified * @param db * * @param lockTbl * the table/partition to be locked along with the mode * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int lockTable(Hive db, LockTableDesc lockTbl) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.lockTable(db, lockTbl); }
/** * Unlock the table/partition specified * @param db * * @param unlockTbl * the table/partition to be unlocked * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int unlockTable(Hive db, UnlockTableDesc unlockTbl) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.unlockTable(db, unlockTbl); }
/** * Unlock the database specified * * @param unlockDb * the database to be unlocked * @return Returns 0 when execution succeeds and above 0 if it fails. * @throws HiveException * Throws this exception if an unexpected error occurs. */ private int unlockDatabase(Hive db, UnlockDatabaseDesc unlockDb) throws HiveException { Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.unlockDatabase(db, unlockDb); }
if (ctx.getHiveTxnManager().supportsAcid()) { HiveLockManager lockMgr = ctx.getHiveTxnManager().getLockManager(); WriteEntity output = ctx.getLoadTableOutputMap().get(ltd); List<HiveLockObj> lockObjects = ctx.getOutputLockObjects().get(output);
driverContext.getCtx().getHiveTxnManager().getStmtIdAndIncrement()));
HiveTxnManager txnManager = ctx.getHiveTxnManager(); HiveLockManager lockMgr = txnManager.getLockManager();
HiveTxnManager txnManager = ctx.getHiveTxnManager(); HiveLockManager lockMgr = txnManager.getLockManager();
if(ctx.getHiveTxnManager().supportsAcid()) { HiveLockManager lockMgr = ctx.getHiveTxnManager().getLockManager(); WriteEntity output = ctx.getLoadTableOutputMap().get(ltd); List<HiveLockObj> lockObjects = ctx.getOutputLockObjects().get(output);
HiveTxnManager txnManager = driverContext.getCtx().getHiveTxnManager(); String user = UserGroupInformation.getCurrentUser().getUserName(); switch(work.getOperationType()) {
tbd.setStmtId(driverContext.getCtx().getHiveTxnManager().getStmtIdAndIncrement());
HiveTxnManager txnManager = ctx.getHiveTxnManager(); if (!txnManager.supportsExplicitLock()) { throw new HiveException(ErrorMsg.LOCK_REQUEST_UNSUPPORTED,
private void releaseLocks(LoadTableDesc ltd) throws HiveException { // nothing needs to be done if (!conf.getBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY)) { return; } Context ctx = driverContext.getCtx(); HiveLockManager lockMgr = ctx.getHiveTxnManager().getLockManager(); WriteEntity output = ctx.getLoadTableOutputMap().get(ltd); List<HiveLockObj> lockObjects = ctx.getOutputLockObjects().get(output); if (lockObjects == null) { return; } for (HiveLockObj lockObj : lockObjects) { List<HiveLock> locks = lockMgr.getLocks(lockObj.getObj(), false, true); for (HiveLock lock : locks) { if (lock.getHiveLockMode() == lockObj.getMode()) { LOG.info("about to release lock for output: " + output.toString() + " lock: " + lock.getHiveLockObject().getName()); lockMgr.unlock(lock); ctx.getHiveLocks().remove(lock); } } } }
HiveTxnManager txnManager = ctx.getHiveTxnManager(); if (!txnManager.supportsExplicitLock()) { throw new HiveException(ErrorMsg.LOCK_REQUEST_UNSUPPORTED,