org.apache.lens.cube.metadata
Class CubeFactTable

java.lang.Object
  extended by org.apache.lens.cube.metadata.AbstractCubeTable
      extended by org.apache.lens.cube.metadata.CubeFactTable
All Implemented Interfaces:
Named

public final class CubeFactTable
extends AbstractCubeTable


Field Summary
 
Fields inherited from class org.apache.lens.cube.metadata.AbstractCubeTable
LOG
 
Constructor Summary
CubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageUpdatePeriods)
           
CubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageUpdatePeriods, double weight)
           
CubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageUpdatePeriods, double weight, Map<String,String> properties)
           
CubeFactTable(org.apache.hadoop.hive.ql.metadata.Table hiveTable)
           
 
Method Summary
 void addColumns(Collection<org.apache.hadoop.hive.metastore.api.FieldSchema> columns)
          Adds or alters the columns passed
 void addUpdatePeriod(String storage, UpdatePeriod period)
          Add update period to storage
 void alterColumn(org.apache.hadoop.hive.metastore.api.FieldSchema column)
          Alters the column if already existing or just adds it if it is new column
 void alterCubeName(String cubeName)
          Alter the cubeName to which this fact belongs
 void alterStorage(String storage, Set<UpdatePeriod> updatePeriods)
          Alter a storage with specified update periods
 boolean equals(Object obj)
           
 String getCubeName()
           
 List<String> getPartitions(Date fromDate, Date toDate, UpdatePeriod interval)
          Get partition value strings for given range, for the specified updateInterval
 Set<String> getStorages()
           
 CubeTableType getTableType()
           
 Map<String,Set<UpdatePeriod>> getUpdatePeriods()
           
 List<String> getValidColumns()
          Return valid columns of the fact, which can be specified by the property MetastoreUtil.getValidColumnsKey(getName())
 int hashCode()
           
 boolean isAggregated()
           
static UpdatePeriod maxIntervalInRange(Date from, Date to, Set<UpdatePeriod> updatePeriods)
          Get the max update period for the given range and available update periods
 void removeUpdatePeriod(String storage, UpdatePeriod period)
          Remove update period from storage
 void setAggregated(boolean isAggregated)
           
 
Methods inherited from class org.apache.lens.cube.metadata.AbstractCubeTable
addProperties, alterWeight, getAllFieldNames, getColumns, getName, getProperties, getWeight, removeProperty, toString, weight
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CubeFactTable

public CubeFactTable(org.apache.hadoop.hive.ql.metadata.Table hiveTable)

CubeFactTable

public CubeFactTable(String cubeName,
                     String factName,
                     List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
                     Map<String,Set<UpdatePeriod>> storageUpdatePeriods)

CubeFactTable

public CubeFactTable(String cubeName,
                     String factName,
                     List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
                     Map<String,Set<UpdatePeriod>> storageUpdatePeriods,
                     double weight)

CubeFactTable

public CubeFactTable(String cubeName,
                     String factName,
                     List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
                     Map<String,Set<UpdatePeriod>> storageUpdatePeriods,
                     double weight,
                     Map<String,String> properties)
Method Detail

getUpdatePeriods

public Map<String,Set<UpdatePeriod>> getUpdatePeriods()

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractCubeTable

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractCubeTable

getTableType

public CubeTableType getTableType()
Specified by:
getTableType in class AbstractCubeTable

getPartitions

public List<String> getPartitions(Date fromDate,
                                  Date toDate,
                                  UpdatePeriod interval)
Get partition value strings for given range, for the specified updateInterval

Parameters:
fromDate -
toDate -
interval -
Returns:

maxIntervalInRange

public static UpdatePeriod maxIntervalInRange(Date from,
                                              Date to,
                                              Set<UpdatePeriod> updatePeriods)
Get the max update period for the given range and available update periods

Parameters:
from -
to -
updatePeriods -
Returns:

getStorages

public Set<String> getStorages()
Specified by:
getStorages in class AbstractCubeTable

getCubeName

public String getCubeName()

getValidColumns

public List<String> getValidColumns()
Return valid columns of the fact, which can be specified by the property MetastoreUtil.getValidColumnsKey(getName())

Returns:

addUpdatePeriod

public void addUpdatePeriod(String storage,
                            UpdatePeriod period)
Add update period to storage

Parameters:
storage -
period -

removeUpdatePeriod

public void removeUpdatePeriod(String storage,
                               UpdatePeriod period)
Remove update period from storage

Parameters:
storage -
period -

alterStorage

public void alterStorage(String storage,
                         Set<UpdatePeriod> updatePeriods)
                  throws org.apache.hadoop.hive.ql.metadata.HiveException
Alter a storage with specified update periods

Parameters:
storage -
updatePeriods -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

alterColumn

public void alterColumn(org.apache.hadoop.hive.metastore.api.FieldSchema column)
                 throws org.apache.hadoop.hive.ql.metadata.HiveException
Description copied from class: AbstractCubeTable
Alters the column if already existing or just adds it if it is new column

Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

addColumns

public void addColumns(Collection<org.apache.hadoop.hive.metastore.api.FieldSchema> columns)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Description copied from class: AbstractCubeTable
Adds or alters the columns passed

Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

alterCubeName

public void alterCubeName(String cubeName)
Alter the cubeName to which this fact belongs

Parameters:
cubeName -

isAggregated

public boolean isAggregated()

setAggregated

public void setAggregated(boolean isAggregated)


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.