public class ThriftData extends GenericData
GenericData.Array<T>, GenericData.EnumSymbol, GenericData.Fixed, GenericData.Record, GenericData.StringType
STRING_PROP, STRING_TYPE_STRING
Modifier | Constructor and Description |
---|---|
protected |
ThriftData() |
Modifier and Type | Method and Description |
---|---|
DatumReader |
createDatumReader(Schema schema)
Returns a
DatumReader for this kind of data. |
DatumWriter |
createDatumWriter(Schema schema)
Returns a
DatumWriter for this kind of data. |
static ThriftData |
get()
Return the singleton instance.
|
protected Schema |
getEnumSchema(Object datum)
Called to obtain the schema of a enum.
|
Object |
getField(Object r,
String name,
int pos)
Called by
GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to retrieve a record
field value from a reused instance. |
protected Object |
getField(Object record,
String name,
int pos,
Object state)
Version of
GenericData.getField(java.lang.Object, java.lang.String, int) that has state. |
protected Schema |
getRecordSchema(Object record)
Called to obtain the schema of a record.
|
protected Object |
getRecordState(Object r,
Schema s)
Produce state for repeated calls to
GenericData.getField(Object,String,int,Object) and GenericData.setField(Object,String,int,Object,Object) on the same record. |
Schema |
getSchema(Class c)
Return a record schema given a thrift generated class.
|
protected String |
getSchemaName(Object datum)
Return the schema full name for a datum.
|
protected boolean |
isBytes(Object datum)
Called by the default implementation of
GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isEnum(Object datum)
Called by the default implementation of
GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object) . |
protected boolean |
isRecord(Object datum)
Called by the default implementation of
GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object) . |
Object |
newRecord(Object old,
Schema schema)
Called to create new record instances.
|
void |
setField(Object r,
String n,
int pos,
Object o)
Called by
GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to set a record fields
value to a record instance. |
protected void |
setField(Object r,
String n,
int pos,
Object v,
Object state)
Version of
GenericData.setField(java.lang.Object, java.lang.String, int, java.lang.Object) that has state. |
addLogicalTypeConversion, compare, compare, createDatumReader, createEnum, createFixed, createFixed, deepCopy, getArrayAsCollection, getClassLoader, getConversionByClass, getConversionByClass, getConversionFor, getDefaultValue, getFixedSchema, hashCode, hashCodeAdd, induce, instanceOf, isArray, isBoolean, isDouble, isFixed, isFloat, isInteger, isLong, isMap, isString, resolveUnion, setStringType, toString, toString, validate
public static ThriftData get()
public DatumReader createDatumReader(Schema schema)
GenericData
DatumReader
for this kind of data.createDatumReader
in class GenericData
public DatumWriter createDatumWriter(Schema schema)
GenericData
DatumWriter
for this kind of data.createDatumWriter
in class GenericData
public void setField(Object r, String n, int pos, Object o)
GenericData
GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to set a record fields
value to a record instance. The default implementation is for IndexedRecord
.setField
in class GenericData
public Object getField(Object r, String name, int pos)
GenericData
GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to retrieve a record
field value from a reused instance. The default implementation is for
IndexedRecord
.getField
in class GenericData
protected void setField(Object r, String n, int pos, Object v, Object state)
GenericData
GenericData.setField(java.lang.Object, java.lang.String, int, java.lang.Object)
that has state.setField
in class GenericData
protected Object getField(Object record, String name, int pos, Object state)
GenericData
GenericData.getField(java.lang.Object, java.lang.String, int)
that has state.getField
in class GenericData
protected Object getRecordState(Object r, Schema s)
GenericData
GenericData.getField(Object,String,int,Object)
and GenericData.setField(Object,String,int,Object,Object)
on the same record.getRecordState
in class GenericData
protected String getSchemaName(Object datum)
GenericData
GenericData.resolveUnion(Schema,Object)
.getSchemaName
in class GenericData
protected boolean isRecord(Object datum)
GenericData
GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object)
.isRecord
in class GenericData
protected boolean isEnum(Object datum)
GenericData
GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object)
.isEnum
in class GenericData
protected Schema getEnumSchema(Object datum)
GenericData
getEnumSchema
in class GenericData
protected boolean isBytes(Object datum)
GenericData
GenericData.instanceOf(org.apache.avro.Schema, java.lang.Object)
.isBytes
in class GenericData
public Object newRecord(Object old, Schema schema)
GenericData
GenericData.Record
.newRecord
in class GenericData
protected Schema getRecordSchema(Object record)
GenericData
getRecordSchema
in class GenericData
Copyright © 2009–2016 The Apache Software Foundation. All rights reserved.