use of alluxio.exception.LineageDeletionException in project alluxio by Alluxio.
the class LineageMaster method deleteLineageInternal.
private boolean deleteLineageInternal(long lineageId, boolean cascade) throws LineageDoesNotExistException, LineageDeletionException {
Lineage lineage = mLineageStore.getLineage(lineageId);
LineageDoesNotExistException.check(lineage != null, ExceptionMessage.LINEAGE_DOES_NOT_EXIST, lineageId);
// there should not be child lineage if not cascade
if (!cascade && !mLineageStore.getChildren(lineage).isEmpty()) {
throw new LineageDeletionException(ExceptionMessage.DELETE_LINEAGE_WITH_CHILDREN.getMessage(lineageId));
}
LOG.info("Delete lineage {}", lineageId);
mLineageStore.deleteLineage(lineageId);
return true;
}
Aggregations