Search in sources :

Example 1 with LineageDeletionException

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;
}
Also used : Lineage(alluxio.master.lineage.meta.Lineage) LineageDeletionException(alluxio.exception.LineageDeletionException)

Aggregations

LineageDeletionException (alluxio.exception.LineageDeletionException)1 Lineage (alluxio.master.lineage.meta.Lineage)1