public class AvroBulletRecordConverter extends BulletRecordConverter
String as its
string type.
TypedAvroBulletRecord or
UntypedAvroBulletRecord.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
runStringFixer |
config, schema, shouldTypeCheck| Constructor and Description |
|---|
AvroBulletRecordConverter()
Constructs an AvroBulletRecordConverter without a schema.
|
AvroBulletRecordConverter(com.yahoo.bullet.common.BulletConfig bulletConfig)
Constructs an AvroBulletRecordConverter from a given configuration.
|
AvroBulletRecordConverter(String schema)
Constructs an AvroBulletRecordConverter from a given schema.
|
| Modifier and Type | Method and Description |
|---|---|
protected BulletRecordConverter |
build()
Helper function used to initialize BulletRecordConverter from BulletDSLConfig.
|
com.yahoo.bullet.record.BulletRecord |
convert(Object object,
com.yahoo.bullet.record.BulletRecord record)
Converts an object to a BulletRecord using the given record.
|
protected com.yahoo.bullet.record.BulletRecord |
convertGenericRecord(org.apache.avro.generic.GenericRecord genericRecord,
org.apache.avro.Schema schema,
com.yahoo.bullet.record.BulletRecord record)
Converts a
GenericRecord with a Schema into the provided BulletRecord. |
protected Object |
get(Object object,
String base)
Gets the specified top-level field from the object.
|
protected Object |
getField(Object object,
String field)
Gets the specified inner field from the object.
|
protected void |
setField(BulletRecordField field,
Object value,
com.yahoo.bullet.record.BulletRecord record)
Sets the field in a
BulletRecord. |
convert, flattenMap, from, getTypedObjectpublic AvroBulletRecordConverter()
throws BulletDSLException
BulletDSLException - if there is an error creating the converter.public AvroBulletRecordConverter(String schema) throws BulletDSLException
schema - A schema file that specifies the fields to extract and their types.BulletDSLException - if there is an error creating the converter.public AvroBulletRecordConverter(com.yahoo.bullet.common.BulletConfig bulletConfig)
throws BulletDSLException
bulletConfig - The configuration that specifies the settings for an AvroBulletRecordConverter.BulletDSLException - if there is an error creating the converter.protected BulletRecordConverter build() throws BulletDSLException
BulletRecordConverterBulletRecordProvider, and optionally the BulletRecordSchema, used by the converter.build in class BulletRecordConverterBulletDSLException - if there is an error creating the converter.public com.yahoo.bullet.record.BulletRecord convert(Object object, com.yahoo.bullet.record.BulletRecord record) throws BulletDSLException
BulletRecordConverterconvert in class BulletRecordConverterobject - The object to be converted.record - The record to insert fields into.BulletDSLException - if there is an error converting the object to a BulletRecord.protected com.yahoo.bullet.record.BulletRecord convertGenericRecord(org.apache.avro.generic.GenericRecord genericRecord,
org.apache.avro.Schema schema,
com.yahoo.bullet.record.BulletRecord record)
GenericRecord with a Schema into the provided BulletRecord.genericRecord - The GenericRecord to convert.schema - The Schema of the GenericRecord.record - The BulletRecord to place the fields into.BulletRecord with the added fields.protected void setField(BulletRecordField field, Object value, com.yahoo.bullet.record.BulletRecord record)
BulletRecordConverterBulletRecord.setField in class BulletRecordConverterfield - The field to set.value - The value to set the field to.record - The record to set the field in.protected Object get(Object object, String base)
BulletRecordConverterget in class BulletRecordConverterobject - The object to get from.base - The top-level field to get.protected Object getField(Object object, String field)
BulletRecordConvertergetField in class BulletRecordConverterobject - The object to get from.field - The inner field to get.Copyright © 2021. All rights reserved.