JyotinderSingh commented on PR #3395: URL: https://github.com/apache/ozone/pull/3395#issuecomment-1121543743
> Yes, ValidationContext is a sort of "parameter object" for the validators to get the info they need, so the info to get bucket layout should be added to that object. However, I do not think we should expose the whole metadata manager here, as it could easily be misused for anything other than a simple read request. I think it may be better to have the ValidationContext be constructed with a MetadataManager, but instead of exposing it as a getter, only expose a method like `ValidationContext#getBucketLayout(bucket)`, which uses the metadata manager internally. Thank you for the explanation and the suggestion @errose28. I have now made the change to instead only expose the `getBucketLayout` method that leverages the `OMMetadataManager` instance passed during the instantiation of the `RequestValidations` object. This should successfully prevent any misuse of the metadata manager. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
