|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectHCatUtil
public class HCatUtil
Constructor Summary | |
---|---|
HCatUtil()
|
Method Summary | |
---|---|
static boolean |
checkJobContextIfRunningFromBackend(JobContext j)
|
static void |
closeHiveClientQuietly(HiveMetaStoreClient client)
|
static void |
configureOutputStorageHandler(HCatStorageHandler storageHandler,
Configuration conf,
OutputJobInfo outputJobInfo)
|
static void |
copyConf(Configuration src,
Configuration dest)
Replace the contents of dest with the contents of src |
static void |
copyJobPropertiesToJobConf(Map<String,String> jobProperties,
JobConf jobConf)
|
static byte[] |
decodeBytes(String str)
|
static Object |
deserialize(String str)
|
static String |
encodeBytes(byte[] bytes)
|
static HCatSchema |
extractSchema(Partition partition)
|
static HCatSchema |
extractSchema(Table table)
|
static Token<? extends AbstractDelegationTokenIdentifier> |
extractThriftToken(String tokenStrForm,
String tokenSignature)
|
static Pair<String,String> |
getDbAndTableName(String tableName)
|
static List<FieldSchema> |
getFieldSchemaList(List<HCatFieldSchema> hcatFields)
|
static List<HCatFieldSchema> |
getHCatFieldSchemaList(FieldSchema... fields)
|
static List<HCatFieldSchema> |
getHCatFieldSchemaList(List<FieldSchema> fields)
|
static HiveMetaStoreClient |
getHiveClient(HiveConf hiveConf)
Get or create a hive client depending on whether it exits in cache or not |
static HiveConf |
getHiveConf(Configuration conf)
|
static Map<String,String> |
getInputJobProperties(HCatStorageHandler storageHandler,
InputJobInfo inputJobInfo)
|
static JobConf |
getJobConfFromContext(JobContext jobContext)
|
static Token<DelegationTokenIdentifier> |
getJobTrackerDelegationToken(Configuration conf,
String userName)
|
static HCatSchema |
getPartitionColumns(Table table)
return the partition columns from a table instance |
static HCatStorageHandler |
getStorageHandler(Configuration conf,
PartInfo partitionInfo)
|
static HCatStorageHandler |
getStorageHandler(Configuration conf,
StorerInfo storerInfo)
Create an instance of a storage handler defined in storerInfo. |
static HCatStorageHandler |
getStorageHandler(Configuration conf,
String storageHandler,
String serDe,
String inputFormat,
String outputFormat)
Create an instance of a storage handler. |
static Table |
getTable(HiveMetaStoreClient client,
String dbName,
String tableName)
|
static HCatSchema |
getTableSchemaWithPtnCols(Table table)
|
static String |
serialize(Serializable obj)
|
static boolean |
validateExecuteBitPresentIfReadOrWrite(FsAction perms)
Ensure that read or write permissions are not granted without also granting execute permissions. |
static boolean |
validateMorePermissive(FsAction first,
FsAction second)
Test if the first FsAction is more permissive than the second. |
static List<FieldSchema> |
validatePartitionSchema(Table table,
HCatSchema partitionSchema)
Validate partition schema, checks if the column types match between the partition and the existing table schema. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HCatUtil()
Method Detail |
---|
public static boolean checkJobContextIfRunningFromBackend(JobContext j)
public static String serialize(Serializable obj) throws IOException
IOException
public static Object deserialize(String str) throws IOException
IOException
public static String encodeBytes(byte[] bytes)
public static byte[] decodeBytes(String str)
public static List<HCatFieldSchema> getHCatFieldSchemaList(FieldSchema... fields) throws HCatException
HCatException
public static List<HCatFieldSchema> getHCatFieldSchemaList(List<FieldSchema> fields) throws HCatException
HCatException
public static HCatSchema extractSchema(Table table) throws HCatException
HCatException
public static HCatSchema extractSchema(Partition partition) throws HCatException
HCatException
public static List<FieldSchema> getFieldSchemaList(List<HCatFieldSchema> hcatFields)
public static Table getTable(HiveMetaStoreClient client, String dbName, String tableName) throws NoSuchObjectException, TException, MetaException
NoSuchObjectException
TException
MetaException
public static HCatSchema getTableSchemaWithPtnCols(Table table) throws IOException
IOException
public static HCatSchema getPartitionColumns(Table table) throws IOException
table
- the instance to extract partition columns from
IOException
public static List<FieldSchema> validatePartitionSchema(Table table, HCatSchema partitionSchema) throws IOException
table
- the tablepartitionSchema
- the partition schema
IOException
- Signals that an I/O exception has occurred.public static boolean validateMorePermissive(FsAction first, FsAction second)
public static boolean validateExecuteBitPresentIfReadOrWrite(FsAction perms)
perms
- The FsAction to verify
public static Token<DelegationTokenIdentifier> getJobTrackerDelegationToken(Configuration conf, String userName) throws Exception
Exception
public static Token<? extends AbstractDelegationTokenIdentifier> extractThriftToken(String tokenStrForm, String tokenSignature) throws MetaException, TException, IOException
MetaException
TException
IOException
public static HCatStorageHandler getStorageHandler(Configuration conf, StorerInfo storerInfo) throws IOException
conf
- job's configuration will be used to configure the Configurable StorageHandlerstorerInfo
- StorerInfo to definining the StorageHandler and InputFormat, OutputFormat and SerDe
IOException
public static HCatStorageHandler getStorageHandler(Configuration conf, PartInfo partitionInfo) throws IOException
IOException
public static HCatStorageHandler getStorageHandler(Configuration conf, String storageHandler, String serDe, String inputFormat, String outputFormat) throws IOException
conf
- job's configuration will be used to configure the Configurable StorageHandlerstorageHandler
- fully qualified class name of the desired StorageHandle instanceserDe
- fully qualified class name of the desired SerDe instanceinputFormat
- fully qualified class name of the desired InputFormat instanceoutputFormat
- fully qualified class name of the desired outputFormat instance
IOException
public static Pair<String,String> getDbAndTableName(String tableName) throws IOException
IOException
public static Map<String,String> getInputJobProperties(HCatStorageHandler storageHandler, InputJobInfo inputJobInfo)
@InterfaceAudience.Private @InterfaceStability.Evolving public static void configureOutputStorageHandler(HCatStorageHandler storageHandler, Configuration conf, OutputJobInfo outputJobInfo)
public static void copyConf(Configuration src, Configuration dest)
src
- dest
- public static HiveMetaStoreClient getHiveClient(HiveConf hiveConf) throws MetaException, IOException
hiveConf
- The hive configuration
MetaException
- When HiveMetaStoreClient couldn't be created
IOException
public static void closeHiveClientQuietly(HiveMetaStoreClient client)
public static HiveConf getHiveConf(Configuration conf) throws IOException
IOException
public static JobConf getJobConfFromContext(JobContext jobContext)
public static void copyJobPropertiesToJobConf(Map<String,String> jobProperties, JobConf jobConf)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |