Package org.nuxeo.lib.stream.codec
Class FileAvroSchemaStore
java.lang.Object
org.nuxeo.lib.stream.codec.FileAvroSchemaStore
- All Implemented Interfaces:
org.apache.avro.message.SchemaStore,AvroSchemaStore
Very simple SchemaStore that uses a file storage to persists its schemas.
- Since:
- 10.3
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.avro.message.SchemaStore
org.apache.avro.message.SchemaStore.Cache -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongaddSchema(org.apache.avro.Schema schema) Adds a schema to the store and returns its fingerprint.org.apache.avro.SchemafindByFingerprint(long fingerprint) protected StringgetFilename(String prefix, long fingerprint) voidloadSchema(Path schemaPath) Load the avro schema from this file.voidloadSchemas(Path directory) Load all avro schema files from this directory.protected voidloadSchemasEndingWith(Path directory, String pattern) Loads all avro schema files from this directory that end with the pattern.
-
Field Details
-
AVRO_SCHEMA_EXT
- See Also:
-
schemaDirectoryPath
-
schemas
-
-
Constructor Details
-
FileAvroSchemaStore
-
-
Method Details
-
loadSchemas
Load all avro schema files from this directory. Files must have the .avsc extention. -
loadSchemasEndingWith
Loads all avro schema files from this directory that end with the pattern.- Since:
- 11.5
-
loadSchema
Load the avro schema from this file. -
addSchema
public long addSchema(org.apache.avro.Schema schema) Description copied from interface:AvroSchemaStoreAdds a schema to the store and returns its fingerprint.- Specified by:
addSchemain interfaceAvroSchemaStore
-
getFilename
-
findByFingerprint
public org.apache.avro.Schema findByFingerprint(long fingerprint) - Specified by:
findByFingerprintin interfaceorg.apache.avro.message.SchemaStore
-