Interface StoreSchemaFetcher
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
RouterBasedStoreSchemaFetcher
This class is the public interface for Venice store user to fetch store schemas. It is intended to
replace the old schema fetching APIs in
AvroGenericStoreClient
.
It is expected that each instance of this class is associated with a single Venice store and user can use it to
fetch the Venice store schemas for their logics.-
Method Summary
Modifier and TypeMethodDescriptiondefault Set<org.apache.avro.Schema>
Returns all value schemas of the store.Returns all value schemas of the store as a map with schema id as the key.org.apache.avro.Schema
Returns Key schema of the store.org.apache.avro.Schema
Returns the latest available Value schema of the store.Returns the Venice store name this class is associated with.org.apache.avro.Schema
getUpdateSchema
(org.apache.avro.Schema valueSchema) Returns the Update (Write Compute) schema of the provided Value schema.getUpdateSchemaEntry
(int valueSchemaId) Get the latest derived schema of a value schema.
-
Method Details
-
getKeySchema
org.apache.avro.Schema getKeySchema()Returns Key schema of the store. -
getLatestValueSchema
org.apache.avro.Schema getLatestValueSchema()Returns the latest available Value schema of the store. The latest superset schema is: 1. If a superset schema exists for the store, return the superset schema 2. If no superset schema exists for the store, return the value schema with the largest schema id -
getAllValueSchemas
Returns all value schemas of the store. -
getAllValueSchemasWithId
Returns all value schemas of the store as a map with schema id as the key. -
getUpdateSchema
Returns the Update (Write Compute) schema of the provided Value schema. The returned schema is used to construct aGenericRecord
that partially updates a record value that is associated with this value schema. This method is expected to throwInvalidVeniceSchemaException
when the provided value schema could not be found in the Venice backend. For other unexpected errors like store is not write-compute enabled or corresponding update schema is not found in the Venice backend, this method will throw generalVeniceException
with corresponding error message.- Throws:
VeniceException
-
getStoreName
String getStoreName()Returns the Venice store name this class is associated with. -
getLatestValueSchemaEntry
SchemaEntry getLatestValueSchemaEntry() -
getUpdateSchemaEntry
Get the latest derived schema of a value schema. Return the derived schema inDerivedSchemaEntry
format, which contains Schema and protocol ID.
-