org.apache.lens.server.metastore
Class JAXBUtils

java.lang.Object
  extended by org.apache.lens.server.metastore.JAXBUtils

public class JAXBUtils
extends Object

Utilities for converting to and from JAXB types to hive.ql.metadata.cube types


Field Summary
static org.apache.log4j.Logger LOG
           
 
Constructor Summary
JAXBUtils()
           
 
Method Summary
static org.apache.lens.api.metastore.XColumn columnFromFieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema fs)
           
static List<org.apache.lens.api.metastore.XColumn> columnsFromFieldSchemaList(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fslist)
           
static CubeDimensionTable cubeDimTableFromDimTable(org.apache.lens.api.metastore.XDimensionTable dimensionTable)
           
static CubeFactTable cubeFactFromFactTable(org.apache.lens.api.metastore.XFactTable fact)
           
static Dimension dimensionFromXDimension(org.apache.lens.api.metastore.XDimension dimension)
           
static List<? extends org.apache.lens.api.metastore.XTableReference> dimRefListFromTabRefList(List<TableReference> tabRefs)
           
static org.apache.lens.api.metastore.XDimensionTable dimTableFromCubeDimTable(CubeDimensionTable cubeDimTable)
           
static Map<String,UpdatePeriod> dumpPeriodsFromStorageTables(org.apache.lens.api.metastore.XStorageTables storageTables)
           
static org.apache.lens.api.metastore.XFactTable factTableFromCubeFactTable(CubeFactTable cFact)
           
static org.apache.hadoop.hive.metastore.api.FieldSchema fieldSchemaFromColumn(org.apache.lens.api.metastore.XColumn c)
           
static ArrayList<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemaListFromColumns(org.apache.lens.api.metastore.XColumns columns)
           
static Date getDateFromXML(XMLGregorianCalendar cal)
           
static Map<String,Set<UpdatePeriod>> getFactUpdatePeriodsFromStorageTables(org.apache.lens.api.metastore.XStorageTables storageTables)
           
static org.apache.lens.api.metastore.XStorageTableDesc getStorageTableDescFromHiveTable(org.apache.hadoop.hive.ql.metadata.Table tbl)
           
static XMLGregorianCalendar getXMLGregorianCalendar(Date d)
           
static org.apache.lens.api.metastore.XStorageTableElement getXStorageTableFromHiveTable(org.apache.hadoop.hive.ql.metadata.Table tbl)
           
static CubeInterface hiveCubeFromXCube(org.apache.lens.api.metastore.XCube cube, Cube parent)
          Create a hive ql cube obejct from corresponding JAXB object
static CubeDimAttribute hiveDimAttrFromXDimAttr(org.apache.lens.api.metastore.XDimAttribute xd)
          Create a hive ql CubeDimension from JAXB counterpart
static ExprColumn hiveExprColumnFromXExprColumn(org.apache.lens.api.metastore.XExprColumn xe)
           
static CubeMeasure hiveMeasureFromXMeasure(org.apache.lens.api.metastore.XMeasure xm)
          Create hive ql CubeMeasure from JAXB counterpart
static JoinChain joinChainFromXJoinChain(org.apache.lens.api.metastore.XJoinChain xj)
          Create cube's JoinChain from JAXB counterpart
static Map<String,String> mapFromXProperties(org.apache.lens.api.metastore.XProperties xProperties)
          Convert JAXB properties to Map
static org.apache.lens.api.metastore.XNativeTable nativeTableFromMetaTable(org.apache.hadoop.hive.ql.metadata.Table table)
           
static Map<String,String> nonTimePartSpecfromXNonTimePartSpec(org.apache.lens.api.metastore.XPartSpec xnonTimePartSpec)
           
static Storage storageFromXStorage(org.apache.lens.api.metastore.XStorage xs)
           
static StoragePartitionDesc storagePartSpecFromXPartition(org.apache.lens.api.metastore.XPartition xpart)
           
static StorageTableDesc storageTableDescFromXStorageTableDesc(org.apache.lens.api.metastore.XStorageTableDesc xtableDesc)
           
static StorageTableDesc storageTableDescFromXStorageTableElement(org.apache.lens.api.metastore.XStorageTableElement storageTableElement)
           
static Map<String,StorageTableDesc> storageTableMapFromXStorageTables(org.apache.lens.api.metastore.XStorageTables storageTables)
           
static Map<String,Date> timePartSpecfromXTimePartSpec(org.apache.lens.api.metastore.XTimePartSpec xtimePartSpec)
           
static org.apache.lens.api.metastore.XCube xCubeFromHiveCube(CubeInterface c)
          Get XCube from hive.ql.metadata.Cube
static org.apache.lens.api.metastore.XDimAttribute xDimAttrFromHiveDimAttr(CubeDimAttribute cd, AbstractBaseTable baseTable)
          Create XDimAttribute from CubeDimAttribute
static org.apache.lens.api.metastore.XDimension xdimensionFromDimension(Dimension dimension)
           
static org.apache.lens.api.metastore.XExprColumn xExprColumnFromHiveExprColumn(ExprColumn ec)
          Create XExprColumn from hive ExprColum
static org.apache.lens.api.metastore.XJoinChain XJoinChainFromJoinChain(JoinChain jc)
          Create XJoinChain from cube join chain
static org.apache.lens.api.metastore.XJoinPath xJoinPathFromJoinPath(JoinChain.Path path)
           
static org.apache.lens.api.metastore.XMeasure xMeasureFromHiveMeasure(CubeMeasure cm)
          Create XMeasure from hive ql cube measure
static org.apache.lens.api.metastore.XPartition xpartitionFromPartition(org.apache.hadoop.hive.ql.metadata.Partition p)
           
static List<org.apache.lens.api.metastore.XProperty> xPropertiesFromMap(Map<String,String> map)
          Convert string map to XProperties
static org.apache.lens.api.metastore.XStorage xstorageFromStorage(Storage storage)
           
static List<org.apache.lens.api.metastore.XTableReference> xTabReferencesFromHiveTabReferences(List<TableReference> hiveRefs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Constructor Detail

JAXBUtils

public JAXBUtils()
Method Detail

hiveCubeFromXCube

public static CubeInterface hiveCubeFromXCube(org.apache.lens.api.metastore.XCube cube,
                                              Cube parent)
                                       throws org.apache.hadoop.hive.ql.parse.ParseException
Create a hive ql cube obejct from corresponding JAXB object

Parameters:
cube - JAXB Cube
Returns:
Cube
Throws:
org.apache.hadoop.hive.ql.parse.ParseException

xCubeFromHiveCube

public static org.apache.lens.api.metastore.XCube xCubeFromHiveCube(CubeInterface c)
Get XCube from hive.ql.metadata.Cube

Parameters:
c -
Returns:
XCube

hiveDimAttrFromXDimAttr

public static CubeDimAttribute hiveDimAttrFromXDimAttr(org.apache.lens.api.metastore.XDimAttribute xd)
Create a hive ql CubeDimension from JAXB counterpart

Parameters:
xd -
Returns:
CubeDimAttribute

getXMLGregorianCalendar

public static XMLGregorianCalendar getXMLGregorianCalendar(Date d)

getDateFromXML

public static Date getDateFromXML(XMLGregorianCalendar cal)

xMeasureFromHiveMeasure

public static org.apache.lens.api.metastore.XMeasure xMeasureFromHiveMeasure(CubeMeasure cm)
Create XMeasure from hive ql cube measure


xExprColumnFromHiveExprColumn

public static org.apache.lens.api.metastore.XExprColumn xExprColumnFromHiveExprColumn(ExprColumn ec)
Create XExprColumn from hive ExprColum


xDimAttrFromHiveDimAttr

public static org.apache.lens.api.metastore.XDimAttribute xDimAttrFromHiveDimAttr(CubeDimAttribute cd,
                                                                                  AbstractBaseTable baseTable)
Create XDimAttribute from CubeDimAttribute


XJoinChainFromJoinChain

public static org.apache.lens.api.metastore.XJoinChain XJoinChainFromJoinChain(JoinChain jc)
Create XJoinChain from cube join chain


xJoinPathFromJoinPath

public static org.apache.lens.api.metastore.XJoinPath xJoinPathFromJoinPath(JoinChain.Path path)

xTabReferencesFromHiveTabReferences

public static List<org.apache.lens.api.metastore.XTableReference> xTabReferencesFromHiveTabReferences(List<TableReference> hiveRefs)

hiveMeasureFromXMeasure

public static CubeMeasure hiveMeasureFromXMeasure(org.apache.lens.api.metastore.XMeasure xm)
Create hive ql CubeMeasure from JAXB counterpart

Parameters:
xm -
Returns:
CubeMeasure

joinChainFromXJoinChain

public static JoinChain joinChainFromXJoinChain(org.apache.lens.api.metastore.XJoinChain xj)
Create cube's JoinChain from JAXB counterpart

Parameters:
xj -
Returns:
JoinChain

hiveExprColumnFromXExprColumn

public static ExprColumn hiveExprColumnFromXExprColumn(org.apache.lens.api.metastore.XExprColumn xe)
                                                throws org.apache.hadoop.hive.ql.parse.ParseException
Throws:
org.apache.hadoop.hive.ql.parse.ParseException

mapFromXProperties

public static Map<String,String> mapFromXProperties(org.apache.lens.api.metastore.XProperties xProperties)
Convert JAXB properties to Map

Parameters:
xProperties -
Returns:
Map

xPropertiesFromMap

public static List<org.apache.lens.api.metastore.XProperty> xPropertiesFromMap(Map<String,String> map)
Convert string map to XProperties


fieldSchemaFromColumn

public static org.apache.hadoop.hive.metastore.api.FieldSchema fieldSchemaFromColumn(org.apache.lens.api.metastore.XColumn c)

columnFromFieldSchema

public static org.apache.lens.api.metastore.XColumn columnFromFieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema fs)

fieldSchemaListFromColumns

public static ArrayList<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemaListFromColumns(org.apache.lens.api.metastore.XColumns columns)

columnsFromFieldSchemaList

public static List<org.apache.lens.api.metastore.XColumn> columnsFromFieldSchemaList(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fslist)

getFactUpdatePeriodsFromStorageTables

public static Map<String,Set<UpdatePeriod>> getFactUpdatePeriodsFromStorageTables(org.apache.lens.api.metastore.XStorageTables storageTables)

dumpPeriodsFromStorageTables

public static Map<String,UpdatePeriod> dumpPeriodsFromStorageTables(org.apache.lens.api.metastore.XStorageTables storageTables)

storageFromXStorage

public static Storage storageFromXStorage(org.apache.lens.api.metastore.XStorage xs)

xstorageFromStorage

public static org.apache.lens.api.metastore.XStorage xstorageFromStorage(Storage storage)

dimTableFromCubeDimTable

public static org.apache.lens.api.metastore.XDimensionTable dimTableFromCubeDimTable(CubeDimensionTable cubeDimTable)

dimRefListFromTabRefList

public static List<? extends org.apache.lens.api.metastore.XTableReference> dimRefListFromTabRefList(List<TableReference> tabRefs)

cubeDimTableFromDimTable

public static CubeDimensionTable cubeDimTableFromDimTable(org.apache.lens.api.metastore.XDimensionTable dimensionTable)

cubeFactFromFactTable

public static CubeFactTable cubeFactFromFactTable(org.apache.lens.api.metastore.XFactTable fact)

factTableFromCubeFactTable

public static org.apache.lens.api.metastore.XFactTable factTableFromCubeFactTable(CubeFactTable cFact)

storageTableDescFromXStorageTableDesc

public static StorageTableDesc storageTableDescFromXStorageTableDesc(org.apache.lens.api.metastore.XStorageTableDesc xtableDesc)

storageTableDescFromXStorageTableElement

public static StorageTableDesc storageTableDescFromXStorageTableElement(org.apache.lens.api.metastore.XStorageTableElement storageTableElement)

getXStorageTableFromHiveTable

public static org.apache.lens.api.metastore.XStorageTableElement getXStorageTableFromHiveTable(org.apache.hadoop.hive.ql.metadata.Table tbl)

getStorageTableDescFromHiveTable

public static org.apache.lens.api.metastore.XStorageTableDesc getStorageTableDescFromHiveTable(org.apache.hadoop.hive.ql.metadata.Table tbl)

storageTableMapFromXStorageTables

public static Map<String,StorageTableDesc> storageTableMapFromXStorageTables(org.apache.lens.api.metastore.XStorageTables storageTables)

timePartSpecfromXTimePartSpec

public static Map<String,Date> timePartSpecfromXTimePartSpec(org.apache.lens.api.metastore.XTimePartSpec xtimePartSpec)

nonTimePartSpecfromXNonTimePartSpec

public static Map<String,String> nonTimePartSpecfromXNonTimePartSpec(org.apache.lens.api.metastore.XPartSpec xnonTimePartSpec)

xpartitionFromPartition

public static org.apache.lens.api.metastore.XPartition xpartitionFromPartition(org.apache.hadoop.hive.ql.metadata.Partition p)
                                                                        throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

storagePartSpecFromXPartition

public static StoragePartitionDesc storagePartSpecFromXPartition(org.apache.lens.api.metastore.XPartition xpart)

dimensionFromXDimension

public static Dimension dimensionFromXDimension(org.apache.lens.api.metastore.XDimension dimension)
                                         throws org.apache.hadoop.hive.ql.parse.ParseException
Throws:
org.apache.hadoop.hive.ql.parse.ParseException

xdimensionFromDimension

public static org.apache.lens.api.metastore.XDimension xdimensionFromDimension(Dimension dimension)

nativeTableFromMetaTable

public static org.apache.lens.api.metastore.XNativeTable nativeTableFromMetaTable(org.apache.hadoop.hive.ql.metadata.Table table)


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