[ 
https://issues.apache.org/jira/browse/AVRO-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13645908#comment-13645908
 ] 

Scott Carey commented on AVRO-1315:
-----------------------------------

This incorporates the following:

* An additional public method on Symbol.java to detect whether a Symbol tree 
has an error in it.  In the case of a Symbol returned by schema resolution, 
this indicates that the schemas are not compatible.
* An interface o.a.a.SchemaValidator that checks a schema against an Iterable 
of other schemas.  The notion of compatibility is left to the implementation.  
Schemas in the Iterable are returned from most recent to oldest, if 
chronological order is applicable.
* An interface o.a.a.SchemaValidationStrategy that validates one schema against 
another.  The notion of compatibility is left to the implementation.
* A concrete SchemaValidator -- ValidateAll.  This takes a 
SchemaValidationStrategy as a constructor parameter and when its validate() 
method is called, uses the strategy for each item in the Iterable, in order.
* A concrete SchemaValidator -- ValidateLatest.  This takes a 
SchemaValidationStrategy as a constructor parameter and when its validate() 
method is called, uses the strategy for only the first item in the Iterable.
* A SchemaValidationBuilder for constructing SchemaValidators, with private 
implementations of SchemaValidationStrategy that can be configured: 
** Validate that the schema can read all others.
** Validate that all others can read the schema.
** Validate that the schema and all others are mutually compatible (can read 
each other).
** Validate that the schema can read the latest.
** Validate that the latest can read the schema.
** Validate that the latest and the schema are mutually compatible.


A few questions for discussion:

I am tempted to hide the concrete implementations and not expose publicly.  In 
the forthcoming patch, all are hidden so that only the interfaces and builder 
are public and need to be supported public APIs.  Alternatively we can expose 
some of the SchemaValidator and SchemaValidationStrategy implementations as 
public.  I am tempted to start private and see how this implementation works 
out.


                
> Java: Schema Validation utilities
> ---------------------------------
>
>                 Key: AVRO-1315
>                 URL: https://issues.apache.org/jira/browse/AVRO-1315
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>            Reporter: Scott Carey
>            Assignee: Scott Carey
>             Fix For: 1.7.5
>
>
> As part of AVRO-1124 we needed Schema Validation utilities.  I have separated 
> those out of that ticket as a stand-alone item.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to