@Override protected void destruct() { try { stopHeartbeat(); if (shutdownRunner != null) { ShutdownHookManager.removeShutdownHook(shutdownRunner); } if (isTxnOpen()) rollbackTxn(); if (lockMgr != null) lockMgr.close(); } catch (Exception e) { LOG.error("Caught exception " + e.getClass().getName() + " with message <" + e.getMessage() + ">, swallowing as there is nothing we can do with it."); // Not much we can do about it here. } }
@Override public void destroy() { lDrvState.stateLock.lock(); try { // in the cancel case where the driver state is INTERRUPTED, destroy will be deferred to // the query process if (lDrvState.driverState == DriverState.DESTROYED) { return; } else { lDrvState.driverState = DriverState.DESTROYED; } } finally { lDrvState.stateLock.unlock(); } if (!hiveLocks.isEmpty()) { try { releaseLocksAndCommitOrRollback(false); } catch (LockException e) { LOG.warn("Exception when releasing locking in destroy: " + e.getMessage()); } } ShutdownHookManager.removeShutdownHook(shutdownRunner); }
public void destroy() { lDrvState.stateLock.lock(); try { // in the cancel case where the driver state is INTERRUPTED, destroy will be deferred to // the query process if (lDrvState.driverState == DriverState.DESTROYED || lDrvState.driverState == DriverState.INTERRUPT) { return; } else { lDrvState.driverState = DriverState.DESTROYED; } } finally { lDrvState.stateLock.unlock(); } if (!hiveLocks.isEmpty()) { try { releaseLocksAndCommitOrRollback(false, null); } catch (LockException e) { LOG.warn("Exception when releasing locking in destroy: " + e.getMessage()); } } ShutdownHookManager.removeShutdownHook(shutdownRunner); }
@Override protected void destruct() { try { stopHeartbeat(); if (shutdownRunner != null) { ShutdownHookManager.removeShutdownHook(shutdownRunner); } if (isTxnOpen()) rollbackTxn(); if (lockMgr != null) lockMgr.close(); } catch (Exception e) { LOG.error("Caught exception " + e.getClass().getName() + " with message <" + e.getMessage() + ">, swallowing as there is nothing we can do with it."); // Not much we can do about it here. } }
/** * Close connection */ @Override public void close() { if (isConnectionClosed.get()) { return; } isConnectionClosed.set(true); try { if (currentTransactionBatch != null) { currentTransactionBatch.close(); } } catch (StreamingException e) { LOG.warn("Unable to close current transaction batch: " + currentTransactionBatch, e); } finally { if (manageTransactions) { getMSC().close(); getHeatbeatMSC().close(); } //remove shutdown hook entry added while creating this connection via HiveStreamingConnection.Builder#connect() if (!ShutdownHookManager.isShutdownInProgress()) { ShutdownHookManager.removeShutdownHook(this.onShutdownRunner); } } if (LOG.isInfoEnabled()) { LOG.info("Closed streaming connection. Agent: {} Stats: {}", getAgentInfo(), getConnectionStats()); } }
private int closeInProcess(boolean destroyed) { releaseDriverContext(); releasePlan(); releaseCachedResult(); releaseFetchTask(); releaseResStream(); releaseContext(); if(destroyed) { if (!hiveLocks.isEmpty()) { try { releaseLocksAndCommitOrRollback(false); } catch (LockException e) { LOG.warn("Exception when releasing locking in destroy: " + e.getMessage()); } } ShutdownHookManager.removeShutdownHook(shutdownRunner); } return 0; }
private int closeInProcess(boolean destroyed) { releaseDriverContext(); releasePlan(); releaseFetchTask(); releaseResStream(); releaseContext(); if (SessionState.get() != null) { SessionState.get().getLineageState().clear(); } if(destroyed) { if (!hiveLocks.isEmpty()) { try { releaseLocksAndCommitOrRollback(false, null); } catch (LockException e) { LOG.warn("Exception when releasing locking in destroy: " + e.getMessage()); } } ShutdownHookManager.removeShutdownHook(shutdownRunner); } return 0; }
ShutdownHookManager.removeShutdownHook(shutdownRunner); shutdownRunner = new Runnable() { @Override
ShutdownHookManager.removeShutdownHook(shutdownRunner); final HiveTxnManager txnMgr = queryTxnMgr; shutdownRunner = new Runnable() {