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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
addSchema
(org.apache.avro.Schema schema) Adds a schema to the store and returns its fingerprint.org.apache.avro.Schema
findByFingerprint
(long fingerprint) protected String
getFilename
(String prefix, long fingerprint) void
loadSchema
(Path schemaPath) Load the avro schema from this file.void
loadSchemas
(Path directory) Load all avro schema files from this directory.protected void
loadSchemasEndingWith
(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:AvroSchemaStore
Adds a schema to the store and returns its fingerprint.- Specified by:
addSchema
in interfaceAvroSchemaStore
-
getFilename
-
findByFingerprint
public org.apache.avro.Schema findByFingerprint(long fingerprint) - Specified by:
findByFingerprint
in interfaceorg.apache.avro.message.SchemaStore
-