public class INodeDirectoryWithQuota extends INodeDirectory
INodeDirectory.SnapshotAndINodeINode.BlocksMapUpdateInfoINodeDirectoryAttributes.CopyWithQuota, INodeDirectoryAttributes.SnapshotCopyDEFAULT_FILES_PER_DIRECTORY| Constructor and Description |
|---|
INodeDirectoryWithQuota(INodeDirectory other,
boolean adopt,
long nsQuota,
long dsQuota)
Convert an existing directory inode to one with the given quota
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSpaceConsumed(long nsDelta,
long dsDelta,
boolean verify)
Check and add namespace/diskspace consumed to itself and the ancestors.
|
protected void |
addSpaceConsumed2Cache(long nsDelta,
long dsDelta)
Update the size of the tree
|
org.apache.hadoop.hdfs.server.namenode.ContentSummaryComputationContext |
computeContentSummary(org.apache.hadoop.hdfs.server.namenode.ContentSummaryComputationContext summary)
Count subtree content summary with a
Content.Counts. |
Quota.Counts |
computeQuotaUsage(Quota.Counts counts,
boolean useCache,
int lastSnapshotId)
Count subtree
Quota.NAMESPACE and Quota.DISKSPACE usages. |
long |
getDiskspace() |
long |
getDsQuota()
Get this directory's diskspace quota
|
long |
getNamespace() |
long |
getNsQuota()
Get this directory's namespace quota
|
void |
setQuota(long nsQuota,
long dsQuota)
Set this directory's quota
|
addChild, addChild, asDirectory, cleanSubtree, cleanSubtreeRecursively, clear, clearChildren, computeQuotaUsage4CurrentDirectory, destroyAndCollectBlocks, dumpTreeRecursively, dumpTreeRecursively, getChild, getChildrenList, getChildrenNum, isDirectory, isSnapshottable, metadataEquals, recordModification, removeChild, removeChild, replaceChild, replaceChildFileInSnapshot, replaceSelf4INodeDirectory, replaceSelf4INodeDirectorySnapshottable, replaceSelf4INodeDirectoryWithSnapshot, saveChild2Snapshot, valueOfgetFsPermissionShort, getId, getLocalNameBytes, getNext, getPermissionLong, setAccessTime, setLocalName, setModificationTime, setNext, updateModificationTimeasFile, asReference, asSymlink, compareTo, computeAndConvertContentSummary, computeContentSummary, computeQuotaUsage, computeQuotaUsage, dumpTreeRecursively, dumpTreeRecursively, equals, getAccessTime, getFsPermission, getFullPathName, getGroupName, getKey, getLocalName, getModificationTime, getObjectString, getParent, getParentReference, getParentString, getSnapshotINode, getUserName, hashCode, isAncestorDirectory, isFile, isInLatestSnapshot, isQuotaSet, isReference, isSymlink, setAccessTime, setModificationTime, setParent, setParentReference, shouldRecordInSrcSnapshot, toDetailString, toStringpublic INodeDirectoryWithQuota(INodeDirectory other, boolean adopt, long nsQuota, long dsQuota)
nsQuota - Namespace quota to be assigned to this inodedsQuota - Diskspace quota to be assigned to this indoeother - The other inode from which all other properties are copiedpublic long getNsQuota()
getNsQuota in interface org.apache.hadoop.hdfs.server.namenode.INodeDirectoryAttributesgetNsQuota in class org.apache.hadoop.hdfs.server.namenode.INodepublic long getDsQuota()
getDsQuota in interface org.apache.hadoop.hdfs.server.namenode.INodeDirectoryAttributesgetDsQuota in class org.apache.hadoop.hdfs.server.namenode.INodepublic void setQuota(long nsQuota, long dsQuota)
nsQuota - Namespace quota to be setdsQuota - diskspace quota to be setpublic Quota.Counts computeQuotaUsage(Quota.Counts counts, boolean useCache, int lastSnapshotId)
org.apache.hadoop.hdfs.server.namenode.INodeQuota.NAMESPACE and Quota.DISKSPACE usages.
With the existence of INodeReference, the same inode and its
subtree may be referred by multiple INodeReference.WithName nodes and a
INodeReference.DstReference node. To avoid circles while quota usage computation,
we have the following rules:
1. For aINodeReference.DstReferencenode, since the node must be in the current tree (or has been deleted as the end point of a series of rename operations), we compute the quota usage of the referred node (and its subtree) in the regular manner, i.e., including every inode in the current tree and in snapshot copies, as well as the size of diff list. 2. For aINodeReference.WithNamenode, since the node must be in a snapshot, we only count the quota usage for those nodes that still existed at the creation time of the snapshot associated with theINodeReference.WithNamenode. We do not count in the size of the diff list.
computeQuotaUsage in class INodeDirectorycounts - The subtree counts for returning.useCache - Whether to use cached quota usage. Note that
INodeReference.WithName node never uses cache for its subtree.lastSnapshotId - Snapshot.INVALID_ID indicates the computation
is in the current tree. Otherwise the id indicates
the computation range for a INodeReference.WithName node.public org.apache.hadoop.hdfs.server.namenode.ContentSummaryComputationContext computeContentSummary(org.apache.hadoop.hdfs.server.namenode.ContentSummaryComputationContext summary)
org.apache.hadoop.hdfs.server.namenode.INodeContent.Counts.computeContentSummary in class INodeDirectorysummary - the context object holding counts for the subtree.public final void addSpaceConsumed(long nsDelta, long dsDelta, boolean verify) throws org.apache.hadoop.hdfs.protocol.QuotaExceededException
org.apache.hadoop.hdfs.server.namenode.INodeaddSpaceConsumed in class org.apache.hadoop.hdfs.server.namenode.INodeorg.apache.hadoop.hdfs.protocol.QuotaExceededException - if quote is violated.protected void addSpaceConsumed2Cache(long nsDelta, long dsDelta)
nsDelta - the change of the tree sizedsDelta - change to disk space occupiedpublic long getNamespace()
public long getDiskspace()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.