voldemort.serialization.avro.versioned
Class SchemaEvolutionValidator
java.lang.Object
voldemort.serialization.avro.versioned.SchemaEvolutionValidator
public class SchemaEvolutionValidator
- extends java.lang.Object
Provides methods to compare schemas for schema evolution and indicate any
potential problems.
- Version:
- $Revision$
- Author:
- Jemiah Westerman
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SchemaEvolutionValidator
public SchemaEvolutionValidator()
main
public static void main(java.lang.String[] args)
- This main method provides an easy command line tool to compare two
schemas.
checkBackwardCompatability
public static java.util.List<SchemaEvolutionValidator.Message> checkBackwardCompatability(org.apache.avro.Schema oldSchema,
org.apache.avro.Schema newSchema,
java.lang.String name)
- Compare two schemas to see if they are backward compatible. Returns a
list of validation messages.
- ERROR messages indicate the schemas are
not backward compatible and the new schema should not be allowed. If an
ERROR schema is uploaded, clients will not be able to read existing data.
- WARN messages indicate that the new schemas may cause problems for
existing clients. However, once all clients are updated to this version
of the schema they should be able to read new and existing data.
- INFO
messages note changes to the schema, basically providing a friendly list
of what has changed from one version to the next. This includes changes
like the addition of fields, changes to default values, etc.
- Parameters:
oldSchema
- the original schemanewSchema
- the new schemaname
- the schema name
- Returns:
- list of messages about the schema evolution
validateAllAvroSchemas
public static void validateAllAvroSchemas(SerializerDefinition avroSerDef)
- Given an AVRO serializer definition, validates if all the avro schemas
are valid i.e parseable.
- Parameters:
avroSerDef
-
checkSchemaCompatibility
public static void checkSchemaCompatibility(SerializerDefinition serDef)
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu