public abstract class Storage extends AbstractCubeTable implements PartitionMetahook
Modifier and Type | Class and Description |
---|---|
static class |
Storage.LatestInfo |
static class |
Storage.LatestPartColumnInfo |
LOG
Constructor and Description |
---|
Storage(org.apache.hadoop.hive.ql.metadata.Table hiveTable) |
Modifier and Type | Method and Description |
---|---|
void |
addPartition(org.apache.hadoop.hive.ql.metadata.Hive client,
StoragePartitionDesc addPartitionDesc,
Storage.LatestInfo latestInfo)
Add single partition to storage.
|
void |
addPartitions(org.apache.hadoop.hive.ql.metadata.Hive client,
String factOrDimTable,
UpdatePeriod updatePeriod,
List<StoragePartitionDesc> storagePartitionDescs,
Map<Map<String,String>,Storage.LatestInfo> latestInfos)
Add given partitions in the underlying hive table and update latest partition links
|
void |
dropPartition(org.apache.hadoop.hive.ql.metadata.Hive client,
String storageTableName,
List<String> partVals,
Map<String,Storage.LatestInfo> updateLatestInfo,
Map<String,String> nonTimePartSpec)
Drop the partition in the underlying hive table and update latest partition link
|
String |
getPrefix()
Get the name prefix of the storage
|
static String |
getPrefix(String name)
Get the name prefix of the storage
|
Set<String> |
getStorages() |
org.apache.hadoop.hive.ql.metadata.Table |
getStorageTable(org.apache.hadoop.hive.ql.metadata.Hive client,
org.apache.hadoop.hive.ql.metadata.Table parent,
StorageTableDesc crtTbl)
Get the storage table descriptor for the given parent table.
|
CubeTableType |
getTableType() |
addProperties, alterWeight, equals, getAllFieldNames, getColumns, getName, getProperties, getWeight, hashCode, removeProperty, toString, weight
commitAddPartitions, commitDropPartition, preAddPartitions, preDropPartition, rollbackAddPartitions, rollbackDropPartition
public String getPrefix()
public CubeTableType getTableType()
getTableType
in class AbstractCubeTable
public Set<String> getStorages()
getStorages
in class AbstractCubeTable
public static String getPrefix(String name)
name
- Name of the storagepublic org.apache.hadoop.hive.ql.metadata.Table getStorageTable(org.apache.hadoop.hive.ql.metadata.Hive client, org.apache.hadoop.hive.ql.metadata.Table parent, StorageTableDesc crtTbl) throws org.apache.hadoop.hive.ql.metadata.HiveException
client
- The metastore clientparent
- Is either Fact or Dimension tablecrtTbl
- Create table infoorg.apache.hadoop.hive.ql.metadata.HiveException
public void addPartition(org.apache.hadoop.hive.ql.metadata.Hive client, StoragePartitionDesc addPartitionDesc, Storage.LatestInfo latestInfo) throws org.apache.hadoop.hive.ql.metadata.HiveException
client
- addPartitionDesc
- latestInfo
- org.apache.hadoop.hive.ql.metadata.HiveException
public void addPartitions(org.apache.hadoop.hive.ql.metadata.Hive client, String factOrDimTable, UpdatePeriod updatePeriod, List<StoragePartitionDesc> storagePartitionDescs, Map<Map<String,String>,Storage.LatestInfo> latestInfos) throws org.apache.hadoop.hive.ql.metadata.HiveException
client
- hive client instancefactOrDimTable
- fact or dim nameupdatePeriod
- update period of partitions.storagePartitionDescs
- all partitions to be addedlatestInfos
- new latest info. atleast one partition for the latest value exists for each part
columnorg.apache.hadoop.hive.ql.metadata.HiveException
public void dropPartition(org.apache.hadoop.hive.ql.metadata.Hive client, String storageTableName, List<String> partVals, Map<String,Storage.LatestInfo> updateLatestInfo, Map<String,String> nonTimePartSpec) throws org.apache.hadoop.hive.ql.metadata.HiveException
client
- The metastore clientstorageTableName
- TableNamepartVals
- Partition specificationupdateLatestInfo
- The latest partition info if it needs update, null if latest should not be updatednonTimePartSpec
- org.apache.hadoop.hive.ql.metadata.HiveException
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.