public class Warehouse
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
| Constructor and Description |
|---|
Warehouse(Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeFs(FileSystem fs) |
boolean |
deleteDir(Path f,
boolean recursive) |
Path |
getDatabasePath(Database db) |
Path |
getDefaultDatabasePath(java.lang.String dbName) |
Path |
getDnsPath(Path path)
Hadoop File System reverse lookups paths with raw ip addresses The File
System URI always contains the canonical DNS name of the Namenode.
|
FileSystem |
getFs(Path f)
Helper functions to convert IOException to MetaException
|
Path |
getPartitionPath(Database db,
java.lang.String tableName,
java.util.LinkedHashMap<java.lang.String,java.lang.String> pm) |
Path |
getPartitionPath(Path tblPath,
java.util.LinkedHashMap<java.lang.String,java.lang.String> pm) |
static java.util.List<java.lang.String> |
getPartValuesFromPartName(java.lang.String partName) |
Path |
getTablePath(Database db,
java.lang.String tableName) |
Path |
getTablePath(java.lang.String whRootString,
java.lang.String tableName) |
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(Path f) |
boolean |
isWritable(Path path) |
static java.lang.String |
makeDynamicPartName(java.util.Map<java.lang.String,java.lang.String> spec)
Given a dynamic partition specification, return the path corresponding to the
static part of partition specification.
|
static java.util.Map<java.lang.String,java.lang.String> |
makeEscSpecFromName(java.lang.String name) |
static java.lang.String |
makePartName(java.util.List<FieldSchema> partCols,
java.util.List<java.lang.String> vals) |
static java.lang.String |
makePartName(java.util.List<FieldSchema> partCols,
java.util.List<java.lang.String> vals,
java.lang.String defaultStr)
Makes a valid partition name.
|
static java.lang.String |
makePartName(java.util.Map<java.lang.String,java.lang.String> spec,
boolean addTrailingSeperator)
Makes a partition name from a specification
|
static java.lang.String |
makePartPath(java.util.Map<java.lang.String,java.lang.String> spec)
Given a partition specification, return the path corresponding to the
partition spec.
|
static void |
makeSpecFromName(java.util.Map<java.lang.String,java.lang.String> partSpec,
Path currPath) |
static java.util.LinkedHashMap<java.lang.String,java.lang.String> |
makeSpecFromName(java.lang.String name) |
boolean |
mkdirs(Path f) |
boolean |
renameDir(Path sourcePath,
Path destPath) |
public Warehouse(Configuration conf)
throws MetaException
MetaExceptionpublic FileSystem getFs(Path f)
throws MetaException
MetaExceptionpublic static void closeFs(FileSystem fs)
throws MetaException
MetaExceptionpublic Path getDnsPath(Path path)
throws MetaException
path - Path to be canonicalizedMetaExceptionpublic Path getWhRoot()
throws MetaException
MetaExceptionpublic Path getTablePath(java.lang.String whRootString,
java.lang.String tableName)
throws MetaException
MetaExceptionpublic Path getDatabasePath(Database db) throws MetaException
MetaExceptionpublic Path getDefaultDatabasePath(java.lang.String dbName)
throws MetaException
MetaExceptionpublic Path getTablePath(Database db, java.lang.String tableName) throws MetaException
MetaExceptionpublic boolean mkdirs(Path f)
throws MetaException
MetaExceptionpublic boolean renameDir(Path sourcePath,
Path destPath)
throws MetaException
MetaExceptionpublic boolean deleteDir(Path f,
boolean recursive)
throws MetaException
MetaExceptionpublic boolean isWritable(Path path)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String makePartPath(java.util.Map<java.lang.String,java.lang.String> spec)
throws MetaException
spec - MetaExceptionpublic static java.lang.String makePartName(java.util.Map<java.lang.String,java.lang.String> spec,
boolean addTrailingSeperator)
throws MetaException
spec - addTrailingSeperator - if true, adds a trailing separator e.g. 'ds=1/'MetaExceptionpublic static java.lang.String makeDynamicPartName(java.util.Map<java.lang.String,java.lang.String> spec)
spec - public static java.util.LinkedHashMap<java.lang.String,java.lang.String> makeSpecFromName(java.lang.String name)
throws MetaException
MetaExceptionpublic static void makeSpecFromName(java.util.Map<java.lang.String,java.lang.String> partSpec,
Path currPath)
public static java.util.Map<java.lang.String,java.lang.String> makeEscSpecFromName(java.lang.String name)
throws MetaException
MetaExceptionpublic Path getPartitionPath(Database db, java.lang.String tableName, java.util.LinkedHashMap<java.lang.String,java.lang.String> pm) throws MetaException
MetaExceptionpublic Path getPartitionPath(Path tblPath,
java.util.LinkedHashMap<java.lang.String,java.lang.String> pm)
throws MetaException
MetaExceptionpublic boolean isDir(Path f)
throws MetaException
MetaExceptionpublic static java.lang.String makePartName(java.util.List<FieldSchema> partCols, java.util.List<java.lang.String> vals) throws MetaException
MetaExceptionpublic static java.lang.String makePartName(java.util.List<FieldSchema> partCols, java.util.List<java.lang.String> vals, java.lang.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 java.util.List<java.lang.String> getPartValuesFromPartName(java.lang.String partName)
throws MetaException
MetaExceptionCopyright © 2012 The Apache Software Foundation