Class RouterBackedSchemaReader
java.lang.Object
com.linkedin.venice.client.schema.RouterBackedSchemaReader
- All Implemented Interfaces:
SchemaReader,Closeable,AutoCloseable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRouterBackedSchemaReader(InternalAvroStoreClient storeClient, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter, Duration valueSchemaRefreshPeriod, ICProvider icProvider) RouterBackedSchemaReader(Supplier<InternalAvroStoreClient> clientSupplier, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter) RouterBackedSchemaReader(Supplier<InternalAvroStoreClient> clientSupplier, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter, ICProvider icProvider) RouterBackedSchemaReader(Supplier<InternalAvroStoreClient> clientSupplier, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter, Duration valueSchemaRefreshPeriod) RouterBackedSchemaReader(Supplier<InternalAvroStoreClient> clientSupplier, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter, Duration valueSchemaRefreshPeriod, ICProvider icProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.avro.Schemaorg.apache.avro.SchemaGet the latest value schema id.getLatestValueSchemaId(boolean forceRefresh) org.apache.avro.SchemagetUpdateSchema(int valueSchemaId) org.apache.avro.SchemagetValueSchema(int id) intgetValueSchemaId(org.apache.avro.Schema schema) Return the schema ID of any schema that has the same parsing canonical form as the schema provided.
-
Field Details
-
TYPE_KEY_SCHEMA
- See Also:
-
TYPE_VALUE_SCHEMA
- See Also:
-
TYPE_ALL_VALUE_SCHEMA_IDS
- See Also:
-
TYPE_UPDATE_SCHEMA
- See Also:
-
-
Constructor Details
-
RouterBackedSchemaReader
public RouterBackedSchemaReader(Supplier<InternalAvroStoreClient> clientSupplier, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter) -
RouterBackedSchemaReader
public RouterBackedSchemaReader(Supplier<InternalAvroStoreClient> clientSupplier, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter, ICProvider icProvider) -
RouterBackedSchemaReader
-
RouterBackedSchemaReader
public RouterBackedSchemaReader(Supplier<InternalAvroStoreClient> clientSupplier, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter, Duration valueSchemaRefreshPeriod, ICProvider icProvider) -
RouterBackedSchemaReader
public RouterBackedSchemaReader(InternalAvroStoreClient storeClient, Optional<org.apache.avro.Schema> readerSchema, Optional<Predicate<org.apache.avro.Schema>> preferredSchemaFilter, Duration valueSchemaRefreshPeriod, ICProvider icProvider)
-
-
Method Details
-
getKeySchema
public org.apache.avro.Schema getKeySchema()- Specified by:
getKeySchemain interfaceSchemaReader
-
getValueSchema
public org.apache.avro.Schema getValueSchema(int id) - Specified by:
getValueSchemain interfaceSchemaReader
-
getLatestValueSchema
- Specified by:
getLatestValueSchemain interfaceSchemaReader- Throws:
VeniceClientException
-
getLatestValueSchemaId
- Specified by:
getLatestValueSchemaIdin interfaceSchemaReader- Throws:
VeniceClientException
-
getLatestValueSchemaId
Description copied from interface:SchemaReaderGet the latest value schema id. This may be different from the value schema with the largest id if the superset schema is not the value schema with the largest id- Specified by:
getLatestValueSchemaIdin interfaceSchemaReader
-
getValueSchemaId
public int getValueSchemaId(org.apache.avro.Schema schema) Description copied from interface:SchemaReaderReturn the schema ID of any schema that has the same parsing canonical form as the schema provided. If multiple schemas have the same parsing canonical form, return the one with the largest ID.- Specified by:
getValueSchemaIdin interfaceSchemaReader- Parameters:
schema- The schema for which the schema ID is needed- Returns:
- The ID of the schema that has the same parsing canonical form as the schema provided
-
getUpdateSchema
public org.apache.avro.Schema getUpdateSchema(int valueSchemaId) - Specified by:
getUpdateSchemain interfaceSchemaReader
-
getLatestUpdateSchema
- Specified by:
getLatestUpdateSchemain interfaceSchemaReader
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-