|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hdfs.server.namenode.INode
org.apache.hadoop.hdfs.server.namenode.INodeWithAdditionalFields
org.apache.hadoop.hdfs.server.namenode.INodeDirectory
org.apache.hadoop.hdfs.server.namenode.INodeDirectoryWithQuota
public class INodeDirectoryWithQuota
Directory INode class that has a quota restriction
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.namenode.INodeDirectory |
|---|
INodeDirectory.SnapshotAndINode |
| Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.namenode.INode |
|---|
INode.BlocksMapUpdateInfo |
| Nested classes/interfaces inherited from interface org.apache.hadoop.hdfs.server.namenode.INodeDirectoryAttributes |
|---|
INodeDirectoryAttributes.CopyWithQuota, INodeDirectoryAttributes.SnapshotCopy |
| Field Summary |
|---|
| Fields inherited from class org.apache.hadoop.hdfs.server.namenode.INodeDirectory |
|---|
DEFAULT_FILES_PER_DIRECTORY |
| Fields inherited from class org.apache.hadoop.hdfs.server.namenode.INode |
|---|
LOG |
| Constructor Summary | |
|---|---|
INodeDirectoryWithQuota(INodeDirectory other,
boolean adopt,
long nsQuota,
long dsQuota)
Convert an existing directory inode to one with the given quota |
|
| Method Summary | |
|---|---|
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 |
Content.Counts |
computeContentSummary(Content.Counts counts)
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 |
| Methods inherited from class org.apache.hadoop.hdfs.server.namenode.INodeDirectory |
|---|
addChild, addChild, asDirectory, cleanSubtree, cleanSubtreeRecursively, clear, clearChildren, computeQuotaUsage4CurrentDirectory, destroyAndCollectBlocks, dumpTreeRecursively, dumpTreeRecursively, getChild, getChildrenList, getChildrenNum, isDirectory, isSnapshottable, metadataEquals, recordModification, removeChild, removeChild, replaceChild, replaceSelf4INodeDirectory, replaceSelf4INodeDirectorySnapshottable, replaceSelf4INodeDirectoryWithSnapshot, saveChild2Snapshot, valueOf |
| Methods inherited from class org.apache.hadoop.hdfs.server.namenode.INodeWithAdditionalFields |
|---|
getFsPermissionShort, getId, getLocalNameBytes, getNext, getPermissionLong, setAccessTime, setLocalName, setModificationTime, setNext, updateModificationTime |
| Methods inherited from class org.apache.hadoop.hdfs.server.namenode.INode |
|---|
asFile, asReference, asSymlink, compareTo, 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, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.hadoop.hdfs.server.namenode.INodeAttributes |
|---|
getAccessTime, getFsPermission, getFsPermissionShort, getGroupName, getLocalNameBytes, getModificationTime, getPermissionLong, getUserName |
| Constructor Detail |
|---|
public 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 copied| Method Detail |
|---|
public 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.INode
public void setQuota(long nsQuota,
long dsQuota)
nsQuota - Namespace quota to be setdsQuota - diskspace quota to be set
public 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 Content.Counts computeContentSummary(Content.Counts counts)
org.apache.hadoop.hdfs.server.namenode.INodeContent.Counts.
computeContentSummary in class INodeDirectorycounts - The subtree counts for returning.
public final void addSpaceConsumed(long nsDelta,
long dsDelta,
boolean verify)
throws org.apache.hadoop.hdfs.protocol.QuotaExceededException
org.apache.hadoop.hdfs.server.namenode.INode
addSpaceConsumed 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||