public boolean deleteDir(Path f, boolean recursive, Database db) throws MetaException { return deleteDir(f, recursive, false, db); }
/** * Deletes the data in a table's location, if it fails logs an error * * @param tablePath * @param ifPurge completely purge the table (skipping trash) while removing * data from warehouse * @param db database the table belongs to */ private void deleteTableData(Path tablePath, boolean ifPurge, Database db) { if (tablePath != null) { try { wh.deleteDir(tablePath, true, ifPurge, db); } catch (Exception e) { LOG.error("Failed to delete table directory: " + tablePath + " " + e.getMessage()); } } }
/** * Remove the newly created partition folders. The values in the addedPartitions map indicates * whether or not the location of the partition was newly created. If the value is false, the * partition folder will not be removed. * @param addedPartitions * @throws MetaException * @throws IllegalArgumentException */ private void cleanupPartitionFolders(final Map<PartValEqWrapperLite, Boolean> addedPartitions, Database db) throws MetaException, IllegalArgumentException { for (Map.Entry<PartValEqWrapperLite, Boolean> e : addedPartitions.entrySet()) { if (e.getValue()) { // we just created this directory - it's not a case of pre-creation, so we nuke. wh.deleteDir(new Path(e.getKey().location), true, db); } } }
/** * Give a list of partitions' locations, tries to delete each one * and for each that fails logs an error. * * @param partPaths * @param ifPurge completely purge the partition (skipping trash) while * removing data from warehouse * @param db database the partition belongs to */ private void deletePartitionData(List<Path> partPaths, boolean ifPurge, Database db) { if (partPaths != null && !partPaths.isEmpty()) { for (Path partPath : partPaths) { try { wh.deleteDir(partPath, true, ifPurge, db); } catch (Exception e) { LOG.error("Failed to delete partition directory: " + partPath + " " + e.getMessage()); } } } }
public boolean deleteDir(Path f, boolean recursive, boolean ifPurge, Database db) throws MetaException { return deleteDir(f, recursive, ifPurge, ReplChangeManager.isSourceOfReplication(db)); }
private void deleteDir(Path dir, Database db) throws HiveException { try { Warehouse wh = new Warehouse(conf); wh.deleteDir(dir, true, db); } catch (MetaException e) { throw new HiveException(e); } }
private void deleteDir(Path dir) throws HiveException { try { Warehouse wh = new Warehouse(conf); wh.deleteDir(dir, true); } catch (MetaException e) { throw new HiveException(e); } }
private void deleteParentRecursive(Path parent, int depth, boolean mustPurge, boolean needRecycle) throws IOException, MetaException { if (depth > 0 && parent != null && wh.isWritable(parent)) { if (wh.isDir(parent) && wh.isEmpty(parent)) { wh.deleteDir(parent, true, mustPurge, needRecycle); } deleteParentRecursive(parent.getParent(), depth - 1, mustPurge, needRecycle); } }
new HiveConf(conf, MetaDataExportListener.class)); if (moveMetadataToTrash == true) { wh.deleteDir(metaPath, true, false, false);
FileStatus targetStatus = fs.getFileStatus(location); String targetGroup = targetStatus == null ? null : targetStatus.getGroup(); wh.deleteDir(location, true, isAutopurge, db); fs.mkdirs(location); HdfsUtils.setFullFileStatus(getConf(), status, targetGroup, fs, location, false); wh.deleteDir(status.getPath(), true, isAutopurge, db);
EximUtil.createExportDump(fs, outFile, mTbl, null, null); if (moveMetadataToTrash == true) { wh.deleteDir(metaPath, true);
ifPurge = Boolean.parseBoolean(envContext.getProperties().get("ifPurge")); getWh().deleteDir(tablePath, true, ifPurge, false); } catch (Exception err) { LOG.error("Failed to delete temp table directory: " + tablePath, err);
ifPurge = Boolean.parseBoolean(envContext.getProperties().get("ifPurge")); getWh().deleteDir(tablePath, true, ifPurge); } catch (Exception err) { LOG.error("Failed to delete temp table directory: " + tablePath, err);
} finally { if (success) { wh.deleteDir(wh.getDnsPath(new Path(cat.getLocationUri())), false, false, false); } else { ms.rollbackTransaction();
ms.rollbackTransaction(); if (madeDir) { wh.deleteDir(dbPath, true, db);
} finally { if (!success && madeDir) { wh.deleteDir(new Path(part.getSd().getLocation()), true, ms.getDatabase(tbl.getCatName(), tbl.getDbName()));
ms.rollbackTransaction(); if (madeDir) { wh.deleteDir(catPath, true, false, false);
ms.rollbackTransaction(); if (madeDir) { wh.deleteDir(partLocation, true, db);