public class Warehouse extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
| Constructor and Description |
|---|
Warehouse(org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeFs(org.apache.hadoop.fs.FileSystem fs) |
boolean |
deleteDir(org.apache.hadoop.fs.Path f,
boolean recursive) |
boolean |
deleteDir(org.apache.hadoop.fs.Path f,
boolean recursive,
boolean ifPurge) |
org.apache.hadoop.fs.Path |
getDatabasePath(Database db) |
org.apache.hadoop.fs.Path |
getDefaultDatabasePath(String dbName) |
org.apache.hadoop.fs.Path |
getDnsPath(org.apache.hadoop.fs.Path path) |
static org.apache.hadoop.fs.Path |
getDnsPath(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Hadoop File System reverse lookups paths with raw ip addresses The File
System URI always contains the canonical DNS name of the Namenode.
|
org.apache.hadoop.fs.FileStatus[] |
getFileStatusesForLocation(String location) |
org.apache.hadoop.fs.FileStatus[] |
getFileStatusesForSD(StorageDescriptor desc) |
org.apache.hadoop.fs.FileStatus[] |
getFileStatusesForUnpartitionedTable(Database db,
Table table) |
org.apache.hadoop.fs.FileSystem |
getFs(org.apache.hadoop.fs.Path f) |
static org.apache.hadoop.fs.FileSystem |
getFs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.conf.Configuration conf)
Helper functions to convert IOException to MetaException
|
org.apache.hadoop.fs.Path |
getPartitionPath(Database db,
String tableName,
LinkedHashMap<String,String> pm) |
org.apache.hadoop.fs.Path |
getPartitionPath(org.apache.hadoop.fs.Path tblPath,
LinkedHashMap<String,String> pm) |
static List<String> |
getPartValuesFromPartName(String partName) |
static String |
getQualifiedName(Partition partition) |
static String |
getQualifiedName(Table table) |
org.apache.hadoop.fs.Path |
getTablePath(Database db,
String tableName) |
org.apache.hadoop.fs.Path |
getTablePath(String whRootString,
String tableName) |
org.apache.hadoop.fs.Path |
getWhRoot()
Resolve the configured warehouse root dir with respect to the configuration
This involves opening the FileSystem corresponding to the warehouse root
dir (but that should be ok given that this is only called during DDL
statements for non-external tables).
|
boolean |
isDir(org.apache.hadoop.fs.Path f) |
boolean |
isEmpty(org.apache.hadoop.fs.Path path) |
boolean |
isWritable(org.apache.hadoop.fs.Path path) |
static String |
makeDynamicPartName(Map<String,String> spec)
Given a dynamic partition specification, return the path corresponding to the
static part of partition specification.
|
static Map<String,String> |
makeEscSpecFromName(String name) |
static String |
makePartName(List<FieldSchema> partCols,
List<String> vals) |
static String |
makePartName(List<FieldSchema> partCols,
List<String> vals,
String defaultStr)
Makes a valid partition name.
|
static String |
makePartName(Map<String,String> spec,
boolean addTrailingSeperator)
Makes a partition name from a specification
|
static String |
makePartPath(Map<String,String> spec)
Given a partition specification, return the path corresponding to the
partition spec.
|
static void |
makeSpecFromName(Map<String,String> partSpec,
org.apache.hadoop.fs.Path currPath) |
static LinkedHashMap<String,String> |
makeSpecFromName(String name) |
static Map<String,String> |
makeSpecFromValues(List<FieldSchema> partCols,
List<String> values) |
static void |
makeValsFromName(String name,
AbstractList<String> result)
Extracts values from partition name without the column names.
|
boolean |
mkdirs(org.apache.hadoop.fs.Path f,
boolean inheritPermCandidate) |
boolean |
renameDir(org.apache.hadoop.fs.Path sourcePath,
org.apache.hadoop.fs.Path destPath) |
boolean |
renameDir(org.apache.hadoop.fs.Path sourcePath,
org.apache.hadoop.fs.Path destPath,
boolean inheritPerms) |
public Warehouse(org.apache.hadoop.conf.Configuration conf)
throws MetaException
MetaExceptionpublic static org.apache.hadoop.fs.FileSystem getFs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.conf.Configuration conf)
throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.FileSystem getFs(org.apache.hadoop.fs.Path f)
throws MetaException
MetaExceptionpublic static void closeFs(org.apache.hadoop.fs.FileSystem fs)
throws MetaException
MetaExceptionpublic static org.apache.hadoop.fs.Path getDnsPath(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
throws MetaException
path - Path to be canonicalizedMetaExceptionpublic org.apache.hadoop.fs.Path getDnsPath(org.apache.hadoop.fs.Path path)
throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.Path getWhRoot()
throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.Path getTablePath(String whRootString, String tableName) throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.Path getDatabasePath(Database db) throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.Path getDefaultDatabasePath(String dbName) throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.Path getTablePath(Database db, String tableName) throws MetaException
MetaExceptionpublic boolean mkdirs(org.apache.hadoop.fs.Path f,
boolean inheritPermCandidate)
throws MetaException
MetaExceptionpublic boolean renameDir(org.apache.hadoop.fs.Path sourcePath,
org.apache.hadoop.fs.Path destPath)
throws MetaException
MetaExceptionpublic boolean renameDir(org.apache.hadoop.fs.Path sourcePath,
org.apache.hadoop.fs.Path destPath,
boolean inheritPerms)
throws MetaException
MetaExceptionpublic boolean deleteDir(org.apache.hadoop.fs.Path f,
boolean recursive)
throws MetaException
MetaExceptionpublic boolean deleteDir(org.apache.hadoop.fs.Path f,
boolean recursive,
boolean ifPurge)
throws MetaException
MetaExceptionpublic boolean isEmpty(org.apache.hadoop.fs.Path path)
throws IOException,
MetaException
IOExceptionMetaExceptionpublic boolean isWritable(org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionpublic static String makePartPath(Map<String,String> spec) throws MetaException
spec - MetaExceptionpublic static String makePartName(Map<String,String> spec, boolean addTrailingSeperator) throws MetaException
spec - addTrailingSeperator - if true, adds a trailing separator e.g. 'ds=1/'MetaExceptionpublic static String makeDynamicPartName(Map<String,String> spec)
spec - public static void makeValsFromName(String name, AbstractList<String> result) throws MetaException
name - Partition name.result - The result. Must be pre-sized to the expected number of columns.MetaExceptionpublic static LinkedHashMap<String,String> makeSpecFromName(String name) throws MetaException
MetaExceptionpublic static void makeSpecFromName(Map<String,String> partSpec, org.apache.hadoop.fs.Path currPath)
public static Map<String,String> makeEscSpecFromName(String name) throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.Path getPartitionPath(Database db, String tableName, LinkedHashMap<String,String> pm) throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.Path getPartitionPath(org.apache.hadoop.fs.Path tblPath,
LinkedHashMap<String,String> pm)
throws MetaException
MetaExceptionpublic boolean isDir(org.apache.hadoop.fs.Path f)
throws MetaException
MetaExceptionpublic static String makePartName(List<FieldSchema> partCols, List<String> vals) throws MetaException
MetaExceptionpublic org.apache.hadoop.fs.FileStatus[] getFileStatusesForSD(StorageDescriptor desc) throws MetaException
desc - MetaExceptionpublic org.apache.hadoop.fs.FileStatus[] getFileStatusesForLocation(String location) throws MetaException
location - MetaExceptionpublic org.apache.hadoop.fs.FileStatus[] getFileStatusesForUnpartitionedTable(Database db, Table table) throws MetaException
table - MetaExceptionpublic static String makePartName(List<FieldSchema> partCols, List<String> vals, String defaultStr) throws MetaException
partCols - The partition columnsvals - The partition valuesdefaultStr - The default name given to a partition value if the respective value is empty or null.MetaExceptionpublic static List<String> getPartValuesFromPartName(String partName) throws MetaException
MetaExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.