Class NamespacePrintVisitor
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.visitor.NamespacePrintVisitor
- All Implemented Interfaces:
NamespaceVisitor
To print the namespace tree recursively for testing.
\- foo (INodeDirectory@33dd2717)
\- sub1 (INodeDirectory@442172)
+- file1 (INodeFile@78392d4)
+- file2 (INodeFile@78392d5)
+- sub11 (INodeDirectory@8400cff)
\- file3 (INodeFile@78392d6)
\- z_file4 (INodeFile@45848712)
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hdfs.server.namenode.visitor.NamespaceVisitor
NamespaceVisitor.Element, NamespaceVisitor.INodeVisitor -
Method Summary
Modifier and TypeMethodDescriptionvoidpostVisitReferred(INode referred) Right after visiting the given referredINode.voidpostVisitSub(NamespaceVisitor.Element sub, int index, boolean isLast) Right after visiting the given subNamespaceVisitor.Element.voidpreVisitReferred(INode referred) Right before visiting the given referredINode.voidpreVisitSub(NamespaceVisitor.Element sub, int index, boolean isLast) Right before visiting the given subNamespaceVisitor.Element.static Stringstatic Stringprint2Sting(INode root) voidvisitDirectory(INodeDirectory dir, int snapshot) Visiting the givenINodeDirectory(non-recursively).voidVisiting the givenINodeFile.voidvisitReference(INodeReference ref, int snapshot) Visiting the givenINodeReference(non-recursively).voidvisitSnapshottable(INodeDirectory dir, DirectorySnapshottableFeature snapshottable) Visiting aDirectorySnapshottableFeature.voidvisitSymlink(INodeSymlink symlink, int snapshot) Visiting the givenINodeSymlink.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hdfs.server.namenode.visitor.NamespaceVisitor
getDefaultVisitor, visitDirectoryRecursively, visitReferenceRecursively, visitSubs
-
Method Details
-
print2Sting
- Returns:
- string of the tree in the given
FSNamesystem.
-
print2Sting
- Returns:
- string of the tree from the given root.
-
visitFile
Description copied from interface:NamespaceVisitorVisiting the givenINodeFile.- Specified by:
visitFilein interfaceNamespaceVisitor
-
visitSymlink
Description copied from interface:NamespaceVisitorVisiting the givenINodeSymlink.- Specified by:
visitSymlinkin interfaceNamespaceVisitor
-
visitReference
Description copied from interface:NamespaceVisitorVisiting the givenINodeReference(non-recursively).- Specified by:
visitReferencein interfaceNamespaceVisitor
-
preVisitReferred
Description copied from interface:NamespaceVisitorRight before visiting the given referredINode.- Specified by:
preVisitReferredin interfaceNamespaceVisitor
-
postVisitReferred
Description copied from interface:NamespaceVisitorRight after visiting the given referredINode.- Specified by:
postVisitReferredin interfaceNamespaceVisitor
-
visitDirectory
Description copied from interface:NamespaceVisitorVisiting the givenINodeDirectory(non-recursively).- Specified by:
visitDirectoryin interfaceNamespaceVisitor
-
visitSnapshottable
Description copied from interface:NamespaceVisitorVisiting aDirectorySnapshottableFeature.- Specified by:
visitSnapshottablein interfaceNamespaceVisitor
-
preVisitSub
Description copied from interface:NamespaceVisitorRight before visiting the given subNamespaceVisitor.Element. The sub element may be a child of anINodeDirectoryor a snapshot inDirectorySnapshottableFeature.- Specified by:
preVisitSubin interfaceNamespaceVisitor- Parameters:
sub- the element to be visited.index- the index of the sub element.isLast- is the sub element the last element?
-
postVisitSub
Description copied from interface:NamespaceVisitorRight after visiting the given subNamespaceVisitor.Element. The sub element may be a child of anINodeDirectoryor a snapshot inDirectorySnapshottableFeature.- Specified by:
postVisitSubin interfaceNamespaceVisitor- Parameters:
sub- the element just visited.index- the index of the sub element.isLast- is the sub element the last element?
-