public abstract class Storage extends AbstractCubeTable implements PartitionMetahook
Modifier and Type | Class and Description |
---|---|
static class |
Storage.LatestInfo |
static class |
Storage.LatestPartColumnInfo |
Constructor and Description |
---|
Storage(org.apache.hadoop.hive.ql.metadata.Table hiveTable) |
Modifier and Type | Method and Description |
---|---|
List<org.apache.hadoop.hive.ql.metadata.Partition> |
addPartition(org.apache.hadoop.hive.ql.metadata.Hive client,
StoragePartitionDesc addPartitionDesc,
Storage.LatestInfo latestInfo)
Add single partition to storage.
|
List<org.apache.hadoop.hive.ql.metadata.Partition> |
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() |
void |
updatePartition(org.apache.hadoop.hive.ql.metadata.Hive client,
String fact,
org.apache.hadoop.hive.ql.metadata.Partition partition)
Update existing partition
|
void |
updatePartitions(org.apache.hadoop.hive.ql.metadata.Hive client,
String fact,
List<org.apache.hadoop.hive.ql.metadata.Partition> partitions)
Update existing partitions
|
addProperties, alterWeight, equals, getAllFieldNames, getColumns, getName, getProperties, getWeight, hashCode, removeProperty, toString, weight
commitAddPartitions, commitDropPartition, commitUpdatePartition, preAddPartitions, preDropPartition, preUpdatePartition, rollbackAddPartitions, rollbackDropPartition, rollbackUpdatePartition
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 List<org.apache.hadoop.hive.ql.metadata.Partition> 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 List<org.apache.hadoop.hive.ql.metadata.Partition> 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 updatePartition(org.apache.hadoop.hive.ql.metadata.Hive client, String fact, org.apache.hadoop.hive.ql.metadata.Partition partition) throws org.apache.hadoop.hive.metastore.api.InvalidOperationException, org.apache.hadoop.hive.ql.metadata.HiveException
client
- hive client instancefact
- fact namepartition
- partition to be updatedorg.apache.hadoop.hive.metastore.api.InvalidOperationException
org.apache.hadoop.hive.ql.metadata.HiveException
public void updatePartitions(org.apache.hadoop.hive.ql.metadata.Hive client, String fact, List<org.apache.hadoop.hive.ql.metadata.Partition> partitions) throws org.apache.hadoop.hive.metastore.api.InvalidOperationException, org.apache.hadoop.hive.ql.metadata.HiveException
client
- hive client instancefact
- fact namepartitions
- partitions to be updatedorg.apache.hadoop.hive.metastore.api.InvalidOperationException
org.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.