- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Way to get a Schema's Metadata without building it?
- Labels:
-
Schema Registry
Created ‎01-15-2017 09:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Satish Duggana --> Thoughts?
Created ‎01-17-2017 03:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fantastic, that did the trick! Thank you
