Exemplo n.º 1
0
 public Quota.Counts cleanFile(
     final INodeFile file,
     final int snapshotId,
     int priorSnapshotId,
     final BlocksMapUpdateInfo collectedBlocks,
     final List<INode> removedINodes,
     final boolean countDiffChange)
     throws QuotaExceededException {
   if (snapshotId == Snapshot.CURRENT_STATE_ID) {
     // delete the current file while the file has snapshot feature
     if (!isCurrentFileDeleted()) {
       file.recordModification(priorSnapshotId);
       deleteCurrentFile();
     }
     collectBlocksAndClear(file, collectedBlocks, removedINodes);
     return Quota.Counts.newInstance();
   } else { // delete the snapshot
     priorSnapshotId = getDiffs().updatePrior(snapshotId, priorSnapshotId);
     return diffs.deleteSnapshotDiff(
         snapshotId, priorSnapshotId, file, collectedBlocks, removedINodes, countDiffChange);
   }
 }