Search in sources :

Example 1 with HbaseSchema

use of com.navercorp.pinpoint.hbase.schema.definition.xml.HbaseSchema in project pinpoint by naver.

the class XmlHbaseSchemaParser method parseSchema.

XmlHbaseSchemaParseResult parseSchema(InputSource inputSource) {
    try {
        Unmarshaller unmarshaller = JAXB_CONTEXT.createUnmarshaller();
        unmarshaller.setSchema(SCHEMA);
        HbaseSchema hbaseSchema = (HbaseSchema) unmarshaller.unmarshal(inputSource);
        return mapper.map(hbaseSchema);
    } catch (JAXBException e) {
        Throwable linkedException = e.getLinkedException();
        if (linkedException == null) {
            throw new IllegalStateException("JAXB error", e);
        }
        throw new HbaseSchemaParseException(linkedException.getMessage(), linkedException);
    }
}
Also used : HbaseSchemaParseException(com.navercorp.pinpoint.hbase.schema.reader.HbaseSchemaParseException) JAXBException(javax.xml.bind.JAXBException) HbaseSchema(com.navercorp.pinpoint.hbase.schema.definition.xml.HbaseSchema) Unmarshaller(javax.xml.bind.Unmarshaller)

Aggregations

HbaseSchema (com.navercorp.pinpoint.hbase.schema.definition.xml.HbaseSchema)1 HbaseSchemaParseException (com.navercorp.pinpoint.hbase.schema.reader.HbaseSchemaParseException)1 JAXBException (javax.xml.bind.JAXBException)1 Unmarshaller (javax.xml.bind.Unmarshaller)1