public final class ASMDatumWriterFactory extends Object implements DatumWriterFactory
DatumWriter
instance for different data type and schema.
It serves as an in memory cache for generated DatumWriter
Class
using ASM.Constructor and Description |
---|
ASMDatumWriterFactory(FieldAccessorFactory fieldAccessorFactory) |
Modifier and Type | Method and Description |
---|---|
<T> DatumWriter<T> |
create(com.google.common.reflect.TypeToken<T> type,
co.cask.cdap.api.data.schema.Schema schema)
Creates a
DatumWriter that is able to encode given data type with the given Schema . |
@Inject public ASMDatumWriterFactory(FieldAccessorFactory fieldAccessorFactory)
public <T> DatumWriter<T> create(com.google.common.reflect.TypeToken<T> type, co.cask.cdap.api.data.schema.Schema schema)
DatumWriter
that is able to encode given data type with the given Schema
.
The instance created is thread safe and reusable.create
in interface DatumWriterFactory
T
- Type of the data type.type
- Type information of the data type to be encoded.schema
- Schema of the data type.DatumWriter
instance.Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.