Class SchemaPresenceChecker
- java.lang.Object
-
- com.linkedin.venice.serialization.avro.SchemaPresenceChecker
-
public class SchemaPresenceChecker extends java.lang.Object
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
Constructors Constructor Description SchemaPresenceChecker(SchemaReader schemaReader, AvroProtocolDefinition avroProtocolDefinition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
verifySchemaVersionPresentOrExit()
void
verifySchemaVersionPresentOrExit(java.util.Optional<java.lang.Integer> protocolVersion, boolean retry)
When schema is present this returns nothing, otherwise it throws an exception and exits the JVM.
-
-
-
Constructor Detail
-
SchemaPresenceChecker
public SchemaPresenceChecker(SchemaReader schemaReader, AvroProtocolDefinition avroProtocolDefinition)
-
-
Method Detail
-
verifySchemaVersionPresentOrExit
public void verifySchemaVersionPresentOrExit(java.util.Optional<java.lang.Integer> protocolVersion, boolean retry)
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()
-
-