Class AbstractFileStatusFilter

java.lang.Object
org.apache.hadoop.hbase.util.AbstractFileStatusFilter
All Implemented Interfaces:
org.apache.hadoop.fs.PathFilter, FileStatusFilter
Direct Known Subclasses:
FSUtils.BlackListDirFilter, FSUtils.FamilyDirFilter, FSUtils.FileFilter, FSUtils.HFileFilter, FSUtils.ReferenceFileFilter, FSUtils.RegionDirFilter

@Private @Evolving public abstract class AbstractFileStatusFilter extends Object implements org.apache.hadoop.fs.PathFilter, FileStatusFilter
Typical base class for file status filter. Works more efficiently when filtering file statuses, otherwise implementation will need to lookup filestatus for the path which will be expensive.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(org.apache.hadoop.fs.FileStatus f)
    Tests whether or not the specified filestatus should be included in a filestatus list.
    boolean
    accept(org.apache.hadoop.fs.Path p)
     
    protected abstract boolean
    accept(org.apache.hadoop.fs.Path p, Boolean isDir)
    Filters out a path.
    protected boolean
    isDirectory(org.apache.hadoop.fs.FileSystem fs, Boolean isDir, org.apache.hadoop.fs.Path p)
     
    protected boolean
    isFile(org.apache.hadoop.fs.FileSystem fs, Boolean isDir, org.apache.hadoop.fs.Path p)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • accept

      protected abstract boolean accept(org.apache.hadoop.fs.Path p, @CheckForNull Boolean isDir)
      Filters out a path. Can be given an optional directory hint to avoid filestatus lookup.
      Parameters:
      p - A filesystem path
      isDir - An optional boolean indicating whether the path is a directory or not
      Returns:
      true if the path is accepted, false if the path is filtered out
    • accept

      public boolean accept(org.apache.hadoop.fs.FileStatus f)
      Description copied from interface: FileStatusFilter
      Tests whether or not the specified filestatus should be included in a filestatus list.
      Specified by:
      accept in interface FileStatusFilter
      Parameters:
      f - The filestatus to be tested
      Returns:
      true if and only if the filestatus should be included
    • accept

      public boolean accept(org.apache.hadoop.fs.Path p)
      Specified by:
      accept in interface org.apache.hadoop.fs.PathFilter
    • isFile

      protected boolean isFile(org.apache.hadoop.fs.FileSystem fs, @CheckForNull Boolean isDir, org.apache.hadoop.fs.Path p) throws IOException
      Throws:
      IOException
    • isDirectory

      protected boolean isDirectory(org.apache.hadoop.fs.FileSystem fs, @CheckForNull Boolean isDir, org.apache.hadoop.fs.Path p) throws IOException
      Throws:
      IOException