public boolean renameDir(Path sourcePath, Path destPath, boolean needCmRecycle) throws MetaException { try { if (needCmRecycle) { // Copy the source files to cmroot. As the client will move the source files to another // location, we should make a copy of the files to cmroot instead of moving it. cm.recycle(sourcePath, RecycleType.COPY, true); } FileSystem srcFs = getFs(sourcePath); FileSystem destFs = getFs(destPath); return FileUtils.rename(srcFs, destFs, sourcePath, destPath); } catch (Exception ex) { MetaStoreUtils.logAndThrowMetaException(ex); } return false; }
public boolean renameDir(Path sourcePath, Path destPath, boolean needCmRecycle) throws MetaException { try { if (needCmRecycle) { // Copy the source files to cmroot. As the client will move the source files to another // location, we should make a copy of the files to cmroot instead of moving it. cm.recycle(sourcePath, RecycleType.COPY, true); } FileSystem srcFs = getFs(sourcePath); FileSystem destFs = getFs(destPath); return FileUtils.rename(srcFs, destFs, sourcePath, destPath); } catch (Exception ex) { MetaStoreUtils.logAndThrowMetaException(ex); } return false; }