public static void clean(HiveConf conf) { Driver drv = mapDrivers.get(conf); if (drv != null) { drv.destroy(); } mapDrivers.remove(conf); }
@Override public void close() throws HiveSQLException { setState(OperationState.CLOSED); if (driver != null) { driver.close(); driver.destroy(); } SessionState session = SessionState.get(); if (session.getTmpOutputFile() != null) { session.getTmpOutputFile().delete(); } }
private void cleanup(OperationState state) throws HiveSQLException { setState(state); if (shouldRunAsync()) { Future<?> backgroundHandle = getBackgroundHandle(); if (backgroundHandle != null) { backgroundHandle.cancel(true); } } if (driver != null) { driver.close(); driver.destroy(); } driver = null; SessionState ss = SessionState.get(); ss.deleteTmpOutputFile(); ss.deleteTmpErrOutputFile(); }