NamespaceVisitor (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.namenode.visitor, interface: NamespaceVisitor

Package org.apache.hadoop.hdfs.server.namenode.visitor

# Interface NamespaceVisitor

All Known Implementing Classes:
  `INodeCountVisitor`, `NamespacePrintVisitor`

public interface NamespaceVisitor
For visiting namespace trees.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static class`
  `NamespaceVisitor.Element`
  Snapshot and INode.
  `static interface`
  `NamespaceVisitor.INodeVisitor`
  For visiting any `INode`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Iterable<NamespaceVisitor.Element>`
  `getChildren(INodeDirectory dir, int snapshot)`
  `default NamespaceVisitor.INodeVisitor`
  `getDefaultVisitor()`
  `static Iterable<NamespaceVisitor.Element>`
  `getSnapshots(DirectorySnapshottableFeature snapshottable)`
  `default void`
  `postVisitReferred(INode referred)`
  Right after visiting the given referred `INode`.
  `default void`
  `postVisitSub(NamespaceVisitor.Element sub, int index, boolean isLast)`
  Right after visiting the given sub `NamespaceVisitor.Element`.
  `default void`
  `preVisitReferred(INode referred)`
  Right before visiting the given referred `INode`.
  `default void`
  `preVisitSub(NamespaceVisitor.Element sub, int index, boolean isLast)`
  Right before visiting the given sub `NamespaceVisitor.Element`.
  `default void`
  `visitDirectory(INodeDirectory dir, int snapshot)`
  Visiting the given `INodeDirectory` (non-recursively).
  `default void`
  `visitDirectoryRecursively(INodeDirectory dir, int snapshot)`
  First visit the given `INodeDirectory`; then the children; and then, if snapshottable, the snapshots.
  `default void`
  `visitFile(INodeFile file, int snapshot)`
  Visiting the given `INodeFile`.
  `default void`
  `visitReference(INodeReference ref, int snapshot)`
  Visiting the given `INodeReference` (non-recursively).
  `default void`
  `visitReferenceRecursively(INodeReference ref, int snapshot)`
  First visit the given `INodeReference` and then the referred.
  `default void`
  `visitSnapshottable(INodeDirectory dir, DirectorySnapshottableFeature snapshottable)`
  Visiting a `DirectorySnapshottableFeature`.
  `default void`
  `visitSubs(Iterable<NamespaceVisitor.Element> subs)`
  Visiting the sub `NamespaceVisitor.Element`s recursively.
  `default void`
  `visitSymlink(INodeSymlink symlink, int snapshot)`
  Visiting the given `INodeSymlink`.

- ## Method Details

  - ### getDefaultVisitor

    default NamespaceVisitor.INodeVisitor getDefaultVisitor()
    Returns:
      the default (non-recursive) `NamespaceVisitor.INodeVisitor`.

  - ### visitFile

    default void visitFile(INodeFile file, int snapshot)
    Visiting the given `INodeFile`.

  - ### visitSymlink

    default void visitSymlink(INodeSymlink symlink, int snapshot)
    Visiting the given `INodeSymlink`.

  - ### visitReference

    default void visitReference(INodeReference ref, int snapshot)
    Visiting the given `INodeReference` (non-recursively).

  - ### visitReferenceRecursively

    default void visitReferenceRecursively(INodeReference ref, int snapshot)
    First visit the given `INodeReference` and then the referred.

  - ### preVisitReferred

    default void preVisitReferred(INode referred)
    Right before visiting the given referred `INode`.

  - ### postVisitReferred

    default void postVisitReferred(INode referred)
    Right after visiting the given referred `INode`.

  - ### visitDirectory

    default void visitDirectory(INodeDirectory dir, int snapshot)
    Visiting the given `INodeDirectory` (non-recursively).

  - ### visitDirectoryRecursively

    default void visitDirectoryRecursively(INodeDirectory dir, int snapshot)
    First visit the given `INodeDirectory`; then the children; and then, if snapshottable, the snapshots.

  - ### preVisitSub

    default void preVisitSub(NamespaceVisitor.Element sub, int index, boolean isLast)
    Right before visiting the given sub `NamespaceVisitor.Element`. The sub element may be a child of an `INodeDirectory` or a snapshot in `DirectorySnapshottableFeature`.
    Parameters:
      `sub` - the element to be visited.
      `index` - the index of the sub element.
      `isLast` - is the sub element the last element?

  - ### postVisitSub

    default void postVisitSub(NamespaceVisitor.Element sub, int index, boolean isLast)
    Right after visiting the given sub `NamespaceVisitor.Element`. The sub element may be a child of an `INodeDirectory` or a snapshot in `DirectorySnapshottableFeature`.
    Parameters:
      `sub` - the element just visited.
      `index` - the index of the sub element.
      `isLast` - is the sub element the last element?

  - ### visitSnapshottable

    default void visitSnapshottable(INodeDirectory dir, DirectorySnapshottableFeature snapshottable)
    Visiting a `DirectorySnapshottableFeature`.

  - ### visitSubs

    default void visitSubs(Iterable<NamespaceVisitor.Element> subs)
    Visiting the sub `NamespaceVisitor.Element`s recursively.
    Parameters:
      `subs` - the children of an `INodeDirectory` or the snapshots in `DirectorySnapshottableFeature`.

  - ### getChildren

    static Iterable<NamespaceVisitor.Element> getChildren(INodeDirectory dir, int snapshot)
    Returns:
      the children as `NamespaceVisitor.Element`s.

  - ### getSnapshots

    static Iterable<NamespaceVisitor.Element> getSnapshots(DirectorySnapshottableFeature snapshottable)
    Returns:
      the snapshots as `NamespaceVisitor.Element`s.