/** * Add current quota usage to counts and return the updated counts * @param counts counts to be added with current quota usage * @return counts that have been added with the current qutoa usage */ QuotaCounts AddCurrentSpaceUsage(QuotaCounts counts) { counts.add(this.usage); return counts; }
/** * Compute quota of striped file. Note that currently EC files do not support * append/hflush/hsync, thus the file length recorded in snapshots should be * the same with the current file length. */ public final QuotaCounts computeQuotaUsageWithStriped( BlockStoragePolicy bsp, QuotaCounts counts) { counts.addNameSpace(1); counts.add(storagespaceConsumed(bsp)); return counts; }
/** Update the space/namespace/type usage of the tree * * @param delta the change of the namespace/space/type usage */ public void addSpaceConsumed2Cache(QuotaCounts delta) { usage.add(delta); }
/** Add quota usage for this inode excluding children. */ public QuotaCounts computeQuotaUsage4CurrentDirectory( BlockStoragePolicySuite bsps, byte storagePolicyId, QuotaCounts counts) { counts.addNameSpace(1); // include the diff list DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature(); if (sf != null) { counts.add(sf.computeQuotaUsage4CurrentDirectory(bsps, storagePolicyId)); } return counts; }
public void add(QuotaCounts update) { counts.add(update); }
final byte childPolicyId = child.getStoragePolicyIDForQuota( blockStoragePolicyId); counts.add(child.computeQuotaUsage(bsps, childPolicyId, useCache, lastSnapshotId));
public void addQuotaDirUpdate(INodeDirectory dir, QuotaCounts update) { Preconditions.checkState(dir.isQuotaSet()); QuotaCounts c = quotaDirMap.get(dir); if (c == null) { quotaDirMap.put(dir, update); } else { c.add(update); } }
public void addUpdatePath(INodeReference inode, QuotaCounts update) { QuotaCounts c = updateMap.get(inode); if (c == null) { c = new QuotaCounts.Builder().build(); updateMap.put(inode, c); } c.add(update); }
public QuotaCounts getCountsCopy() { final QuotaCounts copy = new QuotaCounts.Builder().build(); copy.add(counts); return copy; }
private QuotaCounts computeDirectoryQuotaUsage(BlockStoragePolicySuite bsps, byte blockStoragePolicyId, QuotaCounts counts, boolean useCache, int lastSnapshotId) { if (children != null) { for (INode child : children) { final byte childPolicyId = child.getStoragePolicyIDForQuota( blockStoragePolicyId); counts.add(child.computeQuotaUsage(bsps, childPolicyId, useCache, lastSnapshotId)); } } return computeQuotaUsage4CurrentDirectory(bsps, blockStoragePolicyId, counts); }
public QuotaCounts computeQuotaUsage4CurrentDirectory( BlockStoragePolicySuite bsps, byte storagePolicyId) { final QuotaCounts counts = new QuotaCounts.Builder().build(); for(DirectoryDiff d : diffs) { for(INode deleted : d.getChildrenDiff().getDeletedUnmodifiable()) { final byte childPolicyId = deleted.getStoragePolicyIDForQuota( storagePolicyId); counts.add(deleted.computeQuotaUsage(bsps, childPolicyId, false, Snapshot.CURRENT_STATE_ID)); } } return counts; }
/** * Add current quota usage to counts and return the updated counts * @param counts counts to be added with current quota usage * @return counts that have been added with the current qutoa usage */ QuotaCounts AddCurrentSpaceUsage(QuotaCounts counts) { counts.add(this.usage); return counts; }
/** Update the space/namespace/type usage of the tree * * @param delta the change of the namespace/space/type usage */ public void addSpaceConsumed2Cache(QuotaCounts delta) { usage.add(delta); }
/** * Add current quota usage to counts and return the updated counts * @param counts counts to be added with current quota usage * @return counts that have been added with the current qutoa usage */ QuotaCounts AddCurrentSpaceUsage(QuotaCounts counts) { counts.add(this.usage); return counts; }
/** Update the space/namespace/type usage of the tree * * @param delta the change of the namespace/space/type usage */ public void addSpaceConsumed2Cache(QuotaCounts delta) { usage.add(delta); }
srcChild); oldSrcCounts.add(withCount.getReferredINode().computeQuotaUsage(bsps)); } else if (srcChildIsReference) {
@Override QuotaCounts destroyDiffAndCollectBlocks( BlockStoragePolicySuite bsps, INodeDirectory currentINode, BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes) { // this diff has been deleted QuotaCounts counts = new QuotaCounts.Builder().build(); counts.add(diff.destroyDeletedList(bsps, collectedBlocks, removedINodes)); INodeDirectoryAttributes snapshotINode = getSnapshotINode(); if (snapshotINode != null && snapshotINode.getAclFeature() != null) { AclStorage.removeAclFeature(snapshotINode.getAclFeature()); } return counts; } }
@Override QuotaCounts destroyDiffAndCollectBlocks( BlockStoragePolicySuite bsps, INodeDirectory currentINode, BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes) { // this diff has been deleted QuotaCounts counts = new QuotaCounts.Builder().build(); counts.add(diff.destroyDeletedList(bsps, collectedBlocks, removedINodes)); INodeDirectoryAttributes snapshotINode = getSnapshotINode(); if (snapshotINode != null && snapshotINode.getAclFeature() != null) { AclStorage.removeAclFeature(snapshotINode.getAclFeature()); } return counts; } }