This project has retired. For details please refer to its Attic page.
JAXBUtils (Lens 2.0.1-beta-incubating API)

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

Parameters:
c -
Returns:
XCube

hiveDimAttrFromXDimAttr

public static CubeDimAttribute hiveDimAttrFromXDimAttr(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 XMeasure xMeasureFromHiveMeasure(CubeMeasure cm)
Create XMeasure from hive ql cube measure


xExprColumnFromHiveExprColumn

public static XExprColumn xExprColumnFromHiveExprColumn(ExprColumn ec)
Create XExprColumn from hive ExprColum


xDimAttrFromHiveDimAttr

public static XDimAttribute xDimAttrFromHiveDimAttr(CubeDimAttribute cd,
                                                    AbstractBaseTable baseTable)
Create XDimAttribute from CubeDimAttribute


XJoinChainFromJoinChain

public static XJoinChain XJoinChainFromJoinChain(JoinChain jc)
Create XJoinChain from cube join chain


xJoinPathFromJoinPath

public static XJoinPath xJoinPathFromJoinPath(JoinChain.Path path)

xTabReferencesFromHiveTabReferences

public static List<XTableReference> xTabReferencesFromHiveTabReferences(List<TableReference> hiveRefs)

hiveMeasureFromXMeasure

public static CubeMeasure hiveMeasureFromXMeasure(XMeasure xm)
Create hive ql CubeMeasure from JAXB counterpart

Parameters:
xm -
Returns:
CubeMeasure

joinChainFromXJoinChain

public static JoinChain joinChainFromXJoinChain(XJoinChain xj)
Create cube's JoinChain from JAXB counterpart

Parameters:
xj -
Returns:
JoinChain

hiveExprColumnFromXExprColumn

public static ExprColumn hiveExprColumnFromXExprColumn(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(XProperties xProperties)
Convert JAXB properties to Map

Parameters:
xProperties -
Returns:
Map

xPropertiesFromMap

public static List<XProperty> xPropertiesFromMap(Map<String,String> map)
Convert string map to XProperties


fieldSchemaFromColumn

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

columnFromFieldSchema

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

fieldSchemaListFromColumns

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

columnsFromFieldSchemaList

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

getFactUpdatePeriodsFromStorageTables

public static Map<String,Set<UpdatePeriod>> getFactUpdatePeriodsFromStorageTables(XStorageTables storageTables)

dumpPeriodsFromStorageTables

public static Map<String,UpdatePeriod> dumpPeriodsFromStorageTables(XStorageTables storageTables)

storageFromXStorage

public static Storage storageFromXStorage(XStorage xs)

xstorageFromStorage

public static XStorage xstorageFromStorage(Storage storage)

dimTableFromCubeDimTable

public static XDimensionTable dimTableFromCubeDimTable(CubeDimensionTable cubeDimTable)

dimRefListFromTabRefList

public static List<? extends XTableReference> dimRefListFromTabRefList(List<TableReference> tabRefs)

cubeDimTableFromDimTable

public static CubeDimensionTable cubeDimTableFromDimTable(XDimensionTable dimensionTable)

cubeFactFromFactTable

public static CubeFactTable cubeFactFromFactTable(XFactTable fact)

factTableFromCubeFactTable

public static XFactTable factTableFromCubeFactTable(CubeFactTable cFact)

storageTableDescFromXStorageTableDesc

public static StorageTableDesc storageTableDescFromXStorageTableDesc(XStorageTableDesc xtableDesc)

storageTableDescFromXStorageTableElement

public static StorageTableDesc storageTableDescFromXStorageTableElement(XStorageTableElement storageTableElement)

getXStorageTableFromHiveTable

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

getStorageTableDescFromHiveTable

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

storageTableMapFromXStorageTables

public static Map<String,StorageTableDesc> storageTableMapFromXStorageTables(XStorageTables storageTables)

timePartSpecfromXTimePartSpec

public static Map<String,Date> timePartSpecfromXTimePartSpec(XTimePartSpec xtimePartSpec)

nonTimePartSpecfromXNonTimePartSpec

public static Map<String,String> nonTimePartSpecfromXNonTimePartSpec(XPartSpec xnonTimePartSpec)

xpartitionFromPartition

public static 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(XPartition xpart)

dimensionFromXDimension

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

xdimensionFromDimension

public static XDimension xdimensionFromDimension(Dimension dimension)

nativeTableFromMetaTable

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


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