if(path.getFileSystem(conf).rename(path, newPath)) {
break;
}
} while(++count < 50) ;
if(count >= 50) {
throw new MetaException("Rename failed due to maxing out retries");
}
} else {
// directly delete it
path.getFileSystem(conf).delete(path, true);
}
} catch(IOException e) {
LOG.error("Got exception trying to delete data dir: " + e);
throw new MetaException(e.getMessage());
} catch(MetaException e) {
LOG.error("Got exception trying to delete data dir: " + e);
throw e;
}
}