org.apache.hadoop.hbase.util
Class AbstractFileStatusFilter

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

@InterfaceAudience.Private
@InterfaceStability.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
AbstractFileStatusFilter()
           
 
Method Summary
 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 Detail

AbstractFileStatusFilter

public AbstractFileStatusFilter()
Method Detail

accept

protected abstract boolean accept(org.apache.hadoop.fs.Path p,
                                  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,
                         Boolean isDir,
                         org.apache.hadoop.fs.Path p)
                  throws IOException
Throws:
IOException

isDirectory

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


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.