public class FileSelection extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
cacheFileRoot
root path for the metadata cache file (if any)
|
List<String> |
files |
String |
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<String> files,
String selectionRoot)
Creates a
selection out of given file statuses/files and selection root. |
|
FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses,
List<String> files,
String selectionRoot,
String cacheFileRoot,
boolean wasAllPartitionsPruned) |
|
FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses,
List<String> files,
String selectionRoot,
String 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<String> files,
String root) |
static FileSelection |
create(List<org.apache.hadoop.fs.FileStatus> statuses,
List<String> files,
String root,
String cacheFileRoot,
boolean wasAllPartitionsPruned)
Creates a
selection with the given file statuses/files and selection root. |
static FileSelection |
createFromDirectories(List<String> dirPaths,
FileSelection selection,
String cacheFileRoot) |
String |
getCacheFileRoot() |
org.apache.drill.exec.store.dfs.FileSelection.StatusType |
getDirStatus() |
List<String> |
getFiles() |
List<org.apache.hadoop.fs.FileStatus> |
getFileStatuses() |
org.apache.hadoop.fs.FileStatus |
getFirstPath(DrillFileSystem fs) |
MetadataContext |
getMetaContext() |
String |
getSelectionRoot() |
List<org.apache.hadoop.fs.FileStatus> |
getStatuses(DrillFileSystem fs) |
boolean |
hadWildcard() |
boolean |
isExpandedFully() |
boolean |
isExpandedPartial() |
FileSelection |
minusDirectories(DrillFileSystem fs) |
static String |
removeLeadingSlash(String path) |
void |
setExpandedFully() |
void |
setExpandedPartial() |
void |
setHadWildcard(boolean wc) |
void |
setMetaContext(MetadataContext context) |
boolean |
supportDirPrunig() |
String |
toString() |
boolean |
wasAllPartitionsPruned() |
public final String selectionRoot
public final String cacheFileRoot
public FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses, List<String> files, String 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<String> files, String selectionRoot, String cacheFileRoot, boolean wasAllPartitionsPruned)
public FileSelection(List<org.apache.hadoop.fs.FileStatus> statuses, List<String> files, String selectionRoot, String cacheFileRoot, boolean wasAllPartitionsPruned, org.apache.drill.exec.store.dfs.FileSelection.StatusType dirStatus)
protected FileSelection(FileSelection selection)
public String getSelectionRoot()
public List<org.apache.hadoop.fs.FileStatus> getStatuses(DrillFileSystem fs) throws IOException
IOExceptionpublic boolean containsDirectories(DrillFileSystem fs) throws IOException
IOExceptionpublic FileSelection minusDirectories(DrillFileSystem fs) throws IOException
IOExceptionpublic org.apache.hadoop.fs.FileStatus getFirstPath(DrillFileSystem fs) throws IOException
IOExceptionpublic 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
IOExceptionpublic static FileSelection create(List<org.apache.hadoop.fs.FileStatus> statuses, List<String> files, String root, String 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, String)public static FileSelection create(List<org.apache.hadoop.fs.FileStatus> statuses, List<String> files, String root)
public static FileSelection createFromDirectories(List<String> dirPaths, FileSelection selection, String 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 supportDirPrunig()
public void setHadWildcard(boolean wc)
public boolean hadWildcard()
public String getCacheFileRoot()
public void setMetaContext(MetadataContext context)
public MetadataContext getMetaContext()
Copyright © 2017 The Apache Software Foundation. All rights reserved.