|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hive.common.FileUtils
public final class FileUtils
Collection of file manipulation utilities common across Hive.
| Method Summary | |
|---|---|
static String |
escapePathName(String path)
|
static String |
escapePathName(String path,
String defaultPath)
Escapes a path name. |
static org.apache.hadoop.fs.Path |
getPathOrParentThatExists(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Find the parent of path that exists, if path does not exist |
static boolean |
isActionPermittedForFileHierarchy(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
String userName,
org.apache.hadoop.fs.permission.FsAction action)
Check if user userName has permissions to perform the given FsAction action on all files under the file whose FileStatus fileStatus is provided |
static boolean |
isActionPermittedForUser(String userName,
org.apache.hadoop.fs.FileStatus fsStatus,
org.apache.hadoop.fs.permission.FsAction action)
Check if the given FileStatus indicates that the action is allowed for userName. |
static boolean |
isLocalFile(HiveConf conf,
String fileName)
A best effort attempt to determine if if the file is a local file |
static boolean |
isLocalFile(HiveConf conf,
URI fileUri)
A best effort attempt to determine if if the file is a local file |
static boolean |
isOwnerOfFileHierarchy(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
String userName)
|
static void |
listStatusRecursively(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
List<org.apache.hadoop.fs.FileStatus> results)
Recursively lists status for all files starting from a particular directory (or individual file as base case). |
static String |
makeDefaultListBucketingDirName(List<String> skewedCols,
String name)
default directory will have the same depth as number of skewed columns this will make future operation easy like DML merge, concatenate merge |
static String |
makeListBucketingDirName(List<String> lbCols,
List<String> vals)
Makes a valid list bucketing directory name. |
static String |
makePartName(List<String> partCols,
List<String> vals)
|
static String |
makePartName(List<String> partCols,
List<String> vals,
String defaultStr)
Makes a valid partition name. |
static org.apache.hadoop.fs.Path |
makeQualified(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Variant of Path.makeQualified that qualifies the input path against the default file system indicated by the configuration This does not require a FileSystem handle in most cases - only requires the Filesystem URI. |
static String |
unescapePathName(String path)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static org.apache.hadoop.fs.Path makeQualified(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
throws IOException
path - path to be fully qualifiedconf - Configuration file
IOException
public static String makePartName(List<String> partCols,
List<String> vals)
public static String makePartName(List<String> partCols,
List<String> vals,
String defaultStr)
partCols - The partition keys' namesvals - The partition valuesdefaultStr - The default name given to a partition value if the respective value is empty or null.
public static String makeDefaultListBucketingDirName(List<String> skewedCols,
String name)
skewedCols - name -
public static String makeListBucketingDirName(List<String> lbCols,
List<String> vals)
lbCols - The skewed keys' namesvals - The skewed values
public static String escapePathName(String path)
public static String escapePathName(String path,
String defaultPath)
path - The path to escape.defaultPath - The default name for the path, if the given path is empty or null.
public static String unescapePathName(String path)
public static void listStatusRecursively(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
List<org.apache.hadoop.fs.FileStatus> results)
throws IOException
fs - file systemfileStatus - starting point in file systemresults - receives enumeration of all files found
IOException
public static org.apache.hadoop.fs.Path getPathOrParentThatExists(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
throws IOException
fs - file systempath -
IOException
public static boolean isActionPermittedForUser(String userName,
org.apache.hadoop.fs.FileStatus fsStatus,
org.apache.hadoop.fs.permission.FsAction action)
userName - fsStatus - action -
public static boolean isActionPermittedForFileHierarchy(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
String userName,
org.apache.hadoop.fs.permission.FsAction action)
throws IOException
fs - fileStatus - userName - action -
IOException
public static boolean isLocalFile(HiveConf conf,
String fileName)
conf - fileName -
public static boolean isLocalFile(HiveConf conf,
URI fileUri)
conf - fileUri -
public static boolean isOwnerOfFileHierarchy(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
String userName)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||