public class FileSelection extends Object implements DrillTableSelection
Modifier and Type | Field and Description |
---|---|
org.apache.hadoop.fs.Path |
cacheFileRoot
root path for the metadata cache file (if any)
|
List<org.apache.hadoop.fs.Path> |
files |
org.apache.hadoop.fs.Path |
selectionRoot
root path for the selections
|
Modifier | Constructor and Description |
---|---|
protected |
FileSelection(FileSelection selection)
Copy constructor for convenience.
|
|
FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses,
List<org.apache.hadoop.fs.Path> files,
org.apache.hadoop.fs.Path selectionRoot)
Creates a
selection out of given file statuses/files and selection root. |
|
FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses,
List<org.apache.hadoop.fs.Path> files,
org.apache.hadoop.fs.Path selectionRoot,
org.apache.hadoop.fs.Path cacheFileRoot,
boolean wasAllPartitionsPruned) |
|
FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses,
List<org.apache.hadoop.fs.Path> files,
org.apache.hadoop.fs.Path selectionRoot,
org.apache.hadoop.fs.Path cacheFileRoot,
boolean wasAllPartitionsPruned,
org.apache.drill.exec.store.dfs.FileSelection.StatusType dirStatus) |
Modifier and Type | Method and Description |
---|---|
static void |
checkBackPaths(String parent,
String combinedPath,
String subpath)
Check if the path is a valid sub path under the parent after removing backpaths.
|
boolean |
containsDirectories(DrillFileSystem fs) |
static FileSelection |
create(DrillFileSystem fs,
String parent,
String path,
boolean allowAccessOutsideWorkspace) |
static FileSelection |
create(List<org.apache.hadoop.fs.FileStatus> statuses,
List<org.apache.hadoop.fs.Path> files,
org.apache.hadoop.fs.Path root) |
static FileSelection |
create(List<org.apache.hadoop.fs.FileStatus> statuses,
List<org.apache.hadoop.fs.Path> files,
org.apache.hadoop.fs.Path root,
org.apache.hadoop.fs.Path cacheFileRoot,
boolean wasAllPartitionsPruned)
Creates a
selection with the given file statuses/files and selection root. |
static FileSelection |
createFromDirectories(List<org.apache.hadoop.fs.Path> dirPaths,
FileSelection selection,
org.apache.hadoop.fs.Path cacheFileRoot) |
String |
digest()
The digest of the selection represented by the implementation.
|
org.apache.hadoop.fs.Path |
getCacheFileRoot() |
org.apache.drill.exec.store.dfs.FileSelection.StatusType |
getDirStatus() |
List<org.apache.hadoop.fs.Path> |
getFiles() |
List<org.apache.hadoop.fs.FileStatus> |
getFileStatuses() |
org.apache.hadoop.fs.FileStatus |
getFirstPath(DrillFileSystem fs) |
MetadataContext |
getMetaContext() |
org.apache.hadoop.fs.Path |
getSelectionRoot() |
List<org.apache.hadoop.fs.FileStatus> |
getStatuses(DrillFileSystem fs) |
boolean |
hadWildcard() |
boolean |
isEmptyDirectory() |
boolean |
isExpandedFully() |
boolean |
isExpandedPartial() |
FileSelection |
minusDirectories(DrillFileSystem fs) |
void |
setEmptyDirectoryStatus()
Setting
emptyDirectory as true allows to identify this selectionRoot
as an empty directory |
void |
setExpandedFully() |
void |
setExpandedPartial() |
void |
setHadWildcard(boolean wc) |
void |
setMetaContext(MetadataContext context) |
boolean |
supportsDirPruning() |
String |
toString() |
boolean |
wasAllPartitionsPruned() |
public List<org.apache.hadoop.fs.Path> files
public final org.apache.hadoop.fs.Path selectionRoot
public final org.apache.hadoop.fs.Path cacheFileRoot
public FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses, List<org.apache.hadoop.fs.Path> files, org.apache.hadoop.fs.Path selectionRoot)
selection
out of given file statuses/files and selection root.statuses
- list of file statusesfiles
- list of filesselectionRoot
- root path for selectionspublic FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses, List<org.apache.hadoop.fs.Path> files, org.apache.hadoop.fs.Path selectionRoot, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned)
public FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses, List<org.apache.hadoop.fs.Path> files, org.apache.hadoop.fs.Path selectionRoot, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned, org.apache.drill.exec.store.dfs.FileSelection.StatusType dirStatus)
protected FileSelection(FileSelection selection)
public org.apache.hadoop.fs.Path getSelectionRoot()
public List<org.apache.hadoop.fs.FileStatus> getStatuses(DrillFileSystem fs) throws IOException
IOException
public List<org.apache.hadoop.fs.Path> getFiles()
public boolean containsDirectories(DrillFileSystem fs) throws IOException
IOException
public FileSelection minusDirectories(DrillFileSystem fs) throws IOException
IOException
public org.apache.hadoop.fs.FileStatus getFirstPath(DrillFileSystem fs) throws IOException
IOException
public void setExpandedFully()
public boolean isExpandedFully()
public void setExpandedPartial()
public boolean isExpandedPartial()
public org.apache.drill.exec.store.dfs.FileSelection.StatusType getDirStatus()
public boolean wasAllPartitionsPruned()
public static FileSelection create(DrillFileSystem fs, String parent, String path, boolean allowAccessOutsideWorkspace) throws IOException
IOException
public static FileSelection create(List<org.apache.hadoop.fs.FileStatus> statuses, List<org.apache.hadoop.fs.Path> files, org.apache.hadoop.fs.Path root, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned)
selection
with the given file statuses/files and selection root.statuses
- list of file statusesfiles
- list of filesroot
- root path for selectionscacheFileRoot
- root path for metadata cache (null for no metadata cache)FileSelection
fails with an IllegalArgumentException
otherwise a new selection.FileSelection(List, List, Path)
public static FileSelection create(List<org.apache.hadoop.fs.FileStatus> statuses, List<org.apache.hadoop.fs.Path> files, org.apache.hadoop.fs.Path root)
public static FileSelection createFromDirectories(List<org.apache.hadoop.fs.Path> dirPaths, FileSelection selection, org.apache.hadoop.fs.Path cacheFileRoot)
public static void checkBackPaths(String parent, String combinedPath, String subpath)
parent
- The parent path (the workspace directory).combinedPath
- The workspace directory and (relative) subpath path combined.subpath
- For error message only, the subpathpublic List<org.apache.hadoop.fs.FileStatus> getFileStatuses()
public boolean supportsDirPruning()
public void setHadWildcard(boolean wc)
public boolean hadWildcard()
public org.apache.hadoop.fs.Path getCacheFileRoot()
public void setMetaContext(MetadataContext context)
public MetadataContext getMetaContext()
public boolean isEmptyDirectory()
selectionRoot
points to an empty directory, false otherwisepublic void setEmptyDirectoryStatus()
emptyDirectory
as true allows to identify this selectionRoot
as an empty directorypublic String digest()
DrillTableSelection
digest
in interface DrillTableSelection
Copyright © 1970 The Apache Software Foundation. All rights reserved.