Package com.linkedin.venice.writer
Class SchemaFetcherBackedStoreSchemaCache
java.lang.Object
com.linkedin.venice.writer.SchemaFetcherBackedStoreSchemaCache
This class uses a
StoreSchemaFetcher
to fetch value / update schema and supserset schema ID and store into
cache for fast retrieval.
Note that it does NOT automatically refresh schema information. Once a new value schema is registered in the backend,
superset schema can also be changed. User of this class can invoke maybeUpdateSupersetSchema(int)
to
explicitly check against an incoming value schema and potentially update schema information if the value schema is not
present in the local cache.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
Return the latest known superset value schema ID for partial update store.org.apache.avro.Schema
org.apache.avro.Schema
Return the latest update schema associated with the superset value schema ID.org.apache.avro.Schema
getValueSchema
(int valueSchemaId) void
maybeUpdateSupersetSchema
(int valueSchemaId) void
Perform a mandatory refresh of the store's schema information fromStoreSchemaFetcher
and update cache information.
-
Constructor Details
-
SchemaFetcherBackedStoreSchemaCache
-
-
Method Details
-
getValueSchema
public org.apache.avro.Schema getValueSchema(int valueSchemaId) -
getSupersetSchema
public org.apache.avro.Schema getSupersetSchema() -
getLatestOrSupersetSchemaId
public int getLatestOrSupersetSchemaId()Return the latest known superset value schema ID for partial update store. For non-partial-update store, this method will return the latest known value schema ID. -
getUpdateSchema
public org.apache.avro.Schema getUpdateSchema()Return the latest update schema associated with the superset value schema ID. -
maybeUpdateSupersetSchema
public void maybeUpdateSupersetSchema(int valueSchemaId) -
refreshSchemaInformation
public void refreshSchemaInformation()Perform a mandatory refresh of the store's schema information fromStoreSchemaFetcher
and update cache information. -
close
- Throws:
IOException
-