Class SchemaFetcherBackedStoreSchemaCache

java.lang.Object
com.linkedin.venice.writer.SchemaFetcherBackedStoreSchemaCache

public class SchemaFetcherBackedStoreSchemaCache extends Object
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 Details

    • SchemaFetcherBackedStoreSchemaCache

      public SchemaFetcherBackedStoreSchemaCache(StoreSchemaFetcher schemaFetcher)
  • 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 from StoreSchemaFetcher and update cache information.
    • close

      public void close() throws IOException
      Throws:
      IOException