/** * Close the file systems for the session and remove it from the FileSystem cache. * Cancel the session's delegation token and close the metastore connection */ @Override public void close() throws HiveSQLException { try { acquire(true, false); cancelDelegationToken(); } finally { release(true, false); try { super.close(); } finally { try { FileSystem.closeAllForUGI(sessionUgi); } catch (IOException ioe) { throw new HiveSQLException("Could not clean up file-system handles for UGI: " + sessionUgi, ioe); } } } }
@Override public void close() throws HiveSQLException { ClassLoader nonDBClassLoader = getSessionState().getConf().getClassLoader(); super.close(); // Release class loader resources JavaUtils.closeClassLoadersTo(nonDBClassLoader, getClass().getClassLoader()); synchronized (sessionDbClassLoaders) { for (Map.Entry<String, SessionClassLoader> entry : sessionDbClassLoaders.entrySet()) { try { // Closing session level classloaders up untill the db class loader if present, or null. // When db class loader is null, the class loader in the session is a single class loader // which stays as it is on database switch -- provided the new db doesn't have db jars. // The following line will close class loaders made on top of db class loaders and will close // only one classloader without closing the parents. In case of no db class loader, the session // classloader will already have been closed by either super.close() or before this for loop. JavaUtils.closeClassLoadersTo(entry.getValue(), getDbResService().getClassLoader(entry.getKey())); } catch (Exception e) { log.error("Error closing session classloader for session: {}", getSessionHandle().getSessionId(), e); } } sessionDbClassLoaders.clear(); } // reset classloader in close Thread.currentThread().setContextClassLoader(LensSessionImpl.class.getClassLoader()); }
/** * Close the file systems for the session and remove it from the FileSystem cache. * Cancel the session's delegation token and close the metastore connection */ @Override public void close() throws HiveSQLException { try { acquire(true); cancelDelegationToken(); } finally { try { super.close(); } finally { try { FileSystem.closeAllForUGI(sessionUgi); } catch (IOException ioe) { throw new HiveSQLException("Could not clean up file-system handles for UGI: " + sessionUgi, ioe); } } } }
/** * Close the file systems for the session and remove it from the FileSystem cache. * Cancel the session's delegation token and close the metastore connection */ @Override public void close() throws HiveSQLException { try { acquire(true); cancelDelegationToken(); } finally { try { super.close(); } finally { try { FileSystem.closeAllForUGI(sessionUgi); } catch (IOException ioe) { throw new HiveSQLException("Could not clean up file-system handles for UGI: " + sessionUgi, ioe); } } } }
/** * Close the file systems for the session and remove it from the FileSystem cache. * Cancel the session's delegation token and close the metastore connection */ @Override public void close() throws HiveSQLException { try { acquire(true); cancelDelegationToken(); } finally { try { super.close(); } finally { try { FileSystem.closeAllForUGI(sessionUgi); } catch (IOException ioe) { throw new HiveSQLException("Could not clean up file-system handles for UGI: " + sessionUgi, ioe); } } } }
/** * Close the file systems for the session and remove it from the FileSystem cache. * Cancel the session's delegation token and close the metastore connection */ @Override public void close() throws HiveSQLException { try { acquire(true); cancelDelegationToken(); } finally { try { super.close(); } finally { try { FileSystem.closeAllForUGI(sessionUgi); } catch (IOException ioe) { throw new HiveSQLException("Could not clean up file-system handles for UGI: " + sessionUgi, ioe); } } } }
/** * Close the file systems for the session and remove it from the FileSystem cache. * Cancel the session's delegation token and close the metastore connection */ @Override public void close() throws HiveSQLException { try { acquire(true, false); cancelDelegationToken(); } finally { release(true, false); try { super.close(); } finally { try { FileSystem.closeAllForUGI(sessionUgi); } catch (IOException ioe) { throw new HiveSQLException("Could not clean up file-system handles for UGI: " + sessionUgi, ioe); } } } }