Class SchemaPresenceChecker
java.lang.Object
com.linkedin.venice.serialization.avro.SchemaPresenceChecker
This class helps checks presence of a schema version in ZK. This can be used to ensure forward compatibility when a
protocol gets upgraded.
-
Constructor Summary
ConstructorDescriptionSchemaPresenceChecker
(SchemaReader schemaReader, AvroProtocolDefinition avroProtocolDefinition) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
verifySchemaVersionPresentOrExit
(Optional<Integer> protocolVersion, boolean retry) When schema is present this returns nothing, otherwise it throws an exception and exits the JVM.
-
Constructor Details
-
SchemaPresenceChecker
public SchemaPresenceChecker(SchemaReader schemaReader, AvroProtocolDefinition avroProtocolDefinition)
-
-
Method Details
-
verifySchemaVersionPresentOrExit
When schema is present this returns nothing, otherwise it throws an exception and exits the JVM. This is added for testing purpose.- Parameters:
protocolVersion
- -- the protocol version to fetch the schema for, if not present then fetch the current version.retry
- -- should retry fetching the schema or not
-
verifySchemaVersionPresentOrExit
public void verifySchemaVersionPresentOrExit()
-