Package org.apache.hadoop.hbase.util
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Filters out a path.protected boolean
isDirectory
(org.apache.hadoop.fs.FileSystem fs, Boolean isDir, org.apache.hadoop.fs.Path p) protected boolean
-
Constructor Details
-
AbstractFileStatusFilter
public AbstractFileStatusFilter()
-
-
Method Details
-
accept
Filters out a path. Can be given an optional directory hint to avoid filestatus lookup.- Parameters:
p
- A filesystem pathisDir
- 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
Description copied from interface:FileStatusFilter
Tests whether or not the specified filestatus should be included in a filestatus list.- Specified by:
accept
in interfaceFileStatusFilter
- Parameters:
f
- The filestatus to be tested- Returns:
true
if and only if the filestatus should be included
-
accept
- Specified by:
accept
in interfaceorg.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
-