Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
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