Package org.nuxeo.runtime.avro
Class AvroSchemaFactoryContext
- java.lang.Object
-
- org.nuxeo.runtime.avro.AvroSchemaFactoryContext
-
public class AvroSchemaFactoryContext extends Object
An AvroSchemaFactoryContext represents a context in which Avro schemas are cached and reused depending on their qualified name.
Avro does not permit to declare twice a schema with the same qualified name. Thus a schema has to be fully described the first time it appears in the object, and then be referred by name.- Since:
- 10.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,org.apache.avro.Schema>
createdSchemas
protected Map<Class<?>,AvroSchemaFactory<?>>
factories
protected AvroService
service
-
Constructor Summary
Constructors Modifier Constructor Description protected
AvroSchemaFactoryContext(AvroService service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> org.apache.avro.Schema
createSchema(T input)
protected <T> AvroSchemaFactory<T>
getFactory(T input)
AvroService
getService()
protected void
register(Class<?> type, AvroSchemaFactory<?> factory)
<U> List<U>
sort(Collection<U> children)
-
-
-
Field Detail
-
factories
protected final Map<Class<?>,AvroSchemaFactory<?>> factories
-
service
protected final AvroService service
-
-
Constructor Detail
-
AvroSchemaFactoryContext
protected AvroSchemaFactoryContext(AvroService service)
-
-
Method Detail
-
createSchema
public <T> org.apache.avro.Schema createSchema(T input)
-
getService
public AvroService getService()
-
sort
public <U> List<U> sort(Collection<U> children)
-
getFactory
protected <T> AvroSchemaFactory<T> getFactory(T input)
-
register
protected void register(Class<?> type, AvroSchemaFactory<?> factory)
-
-