public static void validateAllAvroSchemas ( SerializerDefinition avroSerDef ) { Map < Integer , String > schemaVersions = avroSerDef . getAllSchemaInfoVersions ( ) ; if ( schemaVersions . size ( ) < 1 ) { throw new VoldemortException ( "No schema specified" ) ; } for ( Map . Entry < Integer , String > entry : schemaVersions . entrySet ( ) ) { Integer schemaVersionNumber = entry . getKey ( ) ; String schemaStr = entry . getValue ( ) ; try { Schema . parse ( schemaStr ) ; } catch ( Exception e ) { throw new VoldemortException ( "Unable to parse Avro schema version :" + schemaVersionNumber + ", schema string :" + schemaStr ) ; } } }
Given an AVRO serializer definition validates if all the avro schemas are valid i . e parseable .