public abstract class AvroIO<U extends AvroExternalizable> extends Object
| Constructor and Description |
|---|
AvroIO() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.avro.Schema |
createEnumSchema(Class<? extends Enum> clazz,
Enum... enums) |
protected abstract void |
createRecordFields(List<org.apache.avro.Schema.Field> fields)
Create a list containing the Schema.Fields for the fields that this class writes
|
org.apache.avro.Schema |
createSchema()
Creates a schema for this reader or writer
|
org.apache.avro.Schema.Field |
createSchemaField(String name,
org.apache.avro.Schema schema)
Utility method for creating a Field
|
org.apache.avro.Schema |
createUnionSchema(Class recordSuperClass)
Utility method for creating a schema for the union for the recordSuperclass for unions that were registered with
registerUnion
|
protected org.apache.avro.Schema |
createUnionSchema(Class recordSuperClass,
AvroExternalizable... members)
Utility method for creating a schema for the union for the recordSuperclass for unions that were registered with
registerUnion
|
protected String |
getRecordDoc()
Returns the documentation for this record
Default is to have no documentation, subclasses can override this to provide doc
|
protected abstract String |
getRecordName()
Return the name of this record
|
protected abstract String |
getRecordNameSpace()
Return the namespace of this record
|
protected List<U> |
getUnion(Class recordSuperclass)
Return the readers or writers for the union of the recordSuperclass
|
void |
registerUnion(Class recordSuperclass,
U... externalizables)
Register a union
|
protected String |
rewriteNameSpace(Class clazz)
Rewrite the class namespace to the serialization namespace
|
public org.apache.avro.Schema createSchema()
protected abstract void createRecordFields(List<org.apache.avro.Schema.Field> fields)
fields - the list to add the fields toprotected String getRecordDoc()
protected abstract String getRecordName()
protected abstract String getRecordNameSpace()
protected String rewriteNameSpace(Class clazz)
clazz - the classpublic org.apache.avro.Schema createUnionSchema(Class recordSuperClass)
recordSuperClass - the base classprotected org.apache.avro.Schema createUnionSchema(Class recordSuperClass, AvroExternalizable... members)
recordSuperClass - the base classpublic org.apache.avro.Schema.Field createSchemaField(String name, org.apache.avro.Schema schema)
name - the field nameschema - the schema for the fieldprotected org.apache.avro.Schema createEnumSchema(Class<? extends Enum> clazz, Enum... enums)
public void registerUnion(Class recordSuperclass, U... externalizables)
recordSuperclass - the superclass of the classes in the unionexternalizables - the readers or externalizables for the classes in the unionCopyright © 2016. All Rights Reserved.