public class MapBulletRecordConverter extends BulletRecordConverter
Map<String, Object>
to BulletRecord
.
config, schema, shouldTypeCheck
Constructor and Description |
---|
MapBulletRecordConverter()
Constructs a MapBulletRecordConverter without a schema.
|
MapBulletRecordConverter(com.yahoo.bullet.common.BulletConfig bulletConfig)
Constructs a MapBulletRecordConverter from a given configuration.
|
MapBulletRecordConverter(String schema)
Constructs a MapBulletRecordConverter from a given schema.
|
Modifier and Type | Method and Description |
---|---|
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 Object |
get(Object object,
String base)
Gets the specified top-level field from the object.
|
build, convert, flattenMap, from, getField, getTypedObject, setField
public MapBulletRecordConverter() throws BulletDSLException
BulletDSLException
- if there is an error creating the converter.public MapBulletRecordConverter(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 MapBulletRecordConverter(com.yahoo.bullet.common.BulletConfig bulletConfig) throws BulletDSLException
bulletConfig
- The configuration that specifies the settings for a MapBulletRecordConverter.BulletDSLException
- 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
BulletRecordConverter
convert
in class BulletRecordConverter
object
- 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 Object get(Object object, String base)
BulletRecordConverter
get
in class BulletRecordConverter
object
- The object to get from.base
- The top-level field to get.Copyright © 2021. All rights reserved.