Created 01-15-2017 09:16 AM
I have data that I want to serialize, and I currently have it laid out like so:
val mySerializer: AvroSnapshotSerializer = schemaRegistryClient.getDefaultSerializer(...) val myObj: GenericData.Record = new GenericData.Record(...) val myMetadata: SchemaMetadata = new SchemaMetadata.Builder("NameOfMySchema") .schemaGroup(...) .description(...) .etc. val serializedObj = mySerializer.serializer(myObj, myMetadata)
Assuming that I've already registered my schema (by hand or in another application), is there a way to use the Serializer's serialize() method without having to build the metadata all over again? Can I retrieve the a SchemaMetadata object from, say, the SchemaVersionInfo that I get with the following?
schemaRegistryClient.getLatestSchemaVersionInfo("NameOfMySchema")
Having looked through the reference material and source code, I can't seem to find a way to get a copy of the metadata from without building it anew.
Thanks!
Edgar
Created 01-17-2017 03:19 PM
You can get SchemaMetadata for a given schema name using schemaRegistryClient with the below API.
SchemaMetadata schemaMetadata = getSchemaMetadataInfo(String schemaName).getSchemaMetadata()
Created 01-16-2017 03:23 PM
@Satish Duggana --> Thoughts?
Created 01-17-2017 03:19 PM
You can get SchemaMetadata for a given schema name using schemaRegistryClient with the below API.
SchemaMetadata schemaMetadata = getSchemaMetadataInfo(String schemaName).getSchemaMetadata()
Created 01-17-2017 08:56 PM
Fantastic, that did the trick! Thank you