org.apache.lens.cube.metadata
Class Storage
java.lang.Object
org.apache.lens.cube.metadata.AbstractCubeTable
org.apache.lens.cube.metadata.Storage
- All Implemented Interfaces:
- Named, PartitionMetahook
- Direct Known Subclasses:
- DBStorage, HDFSStorage
public abstract class Storage
- extends AbstractCubeTable
- implements PartitionMetahook
Storage is Named Interface which would represent the underlying storage of the data.
|
Constructor Summary |
Storage(org.apache.hadoop.hive.ql.metadata.Table hiveTable)
|
| Methods inherited from class org.apache.lens.cube.metadata.AbstractCubeTable |
addProperties, alterWeight, equals, getAllFieldNames, getColumns, getName, getProperties, getWeight, hashCode, removeProperty, toString, weight |
Storage
public Storage(org.apache.hadoop.hive.ql.metadata.Table hiveTable)
getPrefix
public String getPrefix()
- Get the name prefix of the storage
- Returns:
- Name followed by storage separator
getTableType
public CubeTableType getTableType()
- Specified by:
getTableType in class AbstractCubeTable
getStorages
public Set<String> getStorages()
- Specified by:
getStorages in class AbstractCubeTable
getPrefix
public static String getPrefix(String name)
- Get the name prefix of the storage
- Parameters:
name - Name of the storage
- Returns:
- Name followed by storage separator
getStorageTable
public 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
- Get the storage table descriptor for the given parent table.
- Parameters:
client - The metastore clientparent - Is either Fact or Dimension tablecrtTbl - Create table info
- Returns:
- Table describing the storage table
- Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
addPartition
public void addPartition(org.apache.hadoop.hive.ql.metadata.Hive client,
StoragePartitionDesc addPartitionDesc,
Storage.LatestInfo latestInfo)
throws org.apache.hadoop.hive.ql.metadata.HiveException
- Add a partition in the underlying hive table and update latest partition links
- Parameters:
client - The metastore clientaddPartitionDesc - add Partition specificationlatestInfo - The latest partition info, null if latest should not be created
- Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
dropPartition
public void dropPartition(org.apache.hadoop.hive.ql.metadata.Hive client,
String storageTableName,
List<String> partVals,
Map<String,Storage.LatestInfo> updateLatestInfo)
throws org.apache.hadoop.hive.ql.metadata.HiveException
- Drop the partition in the underlying hive table and update latest partition link
- Parameters:
client - The metastore clientstorageTableName - TableNamepartSpec - Partition specificationlatestInfo - The latest partition info if it needs update, null if latest should not be updated
- Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.