knotenpunkt commented on PR #2053:
URL: https://github.com/apache/avro/pull/2053#issuecomment-1450291411

   > Indeed, I had not taken into account SchemaBuilder (only Schema parser).
   > So, i know put a public setter on static threadlocal Schema NameValidator; 
so, you can use `Schema.setNameValidator(Schema.NameValidator.NO_VALIDATION);`
   > (_May be a better solution would have to add a method 
"SchemaBuilder.builder(NameValidator v)" and then use it, but it would also 
imply a lot of change (in class Name, ...) for only one PR_)
   
   yeah your last commit [AVRO-3704: add setter to static name 
validator](https://github.com/apache/avro/pull/2053/commits/c60a5dc58d2c6571ed7fcfd5a66165947f4b4b6b)
 should do the trick. So but i think we must wait until this pr is merged? What 
do you think when it would happen?
   
   And you are right, a solution by injecting the validation rule into the 
builder direclty would be nicer, but doing this over that static method is also 
ok.
   
   May i ask one other question: Why do you store that validation rule in an 
Threadlocal and not just in a (volatile or normal) variable? -> performance 
reasons?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to