You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "keith-turner (via GitHub)" <gi...@apache.org> on 2025/02/27 23:33:36 UTC

[PR] Adds property validation for instance.volumes property [accumulo]

keith-turner opened a new pull request, #5365:
URL: https://github.com/apache/accumulo/pull/5365

   (no comment)


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2691786360

   @ctubbsii  I think this changes look good.  I added one more test because the code in ConfigurationTypeHelper and VolumeConfigugration work together to handle some of the empty cases.  The added test just covers this case.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2689357313

   This is an initial stab at making the property validation more strict for an important property that currently accepts any string.  There are some other properties that could be made more strict, but would probably require introducing more single use property types.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2689383399

   The test are failing because the default value for `instance.volumes` is empty string which is not a valid value for this property.  The property has no valid default but must be set to something that is valid at runtime. 


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2691410077

   > I think this code could be cleaned up by ... 
   
   Okay, after looking more closely, I can see now why it was being done this way... because it's relying on some of the private methods for normalization of URIs to do some of the validation. This is trickier than I first thought.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "kevinrr888 (via GitHub)" <gi...@apache.org>.
kevinrr888 commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2691371600

   Related thread:
   https://github.com/apache/accumulo/pull/5348#discussion_r1965734455


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2691546144

   > Okay, after looking more closely, I can see now why it was being done this way... because it's relying on some of the private methods for normalization of URIs to do some of the validation. This is trickier than I first thought.
   
   Another reason I structured the code the way it is was to avoid making assumptions about exceptions thrown in another class.  The code calls some private methods in the same class that throw a specific exception that is catches.
   
   I have not figured out a good way to do it, but would like to somehow like to accomplish the following goals.
   
    * Be able to validate volumes independently of creating a server process if possible.  Like validate config in a stand alone utility.
    * Support the concept that there is no default value but to be valid config for a system it must be set to a list of one ore more URIs.
    * If possible have the validation code reside in Property and PropertyType instead of off  at some random place in the code.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2691598780

   I'm about to add a commit to this PR which I think helps some of these things.
   
   > * Be able to validate volumes independently of creating a server process if possible.  Like validate config in a stand alone utility.
   
   I put the parsing code for volumes into ConfigurationTypeHelper and added a unit test to help support anything that needs to parse it, either for use or for validation.
   
   > * Support the concept that there is no default value but to be valid config for a system it must be set to a list of one ore more URIs.
   
   This one is tricky, because the PropertyType validation is tied to the Property enum which is so tightly coupled to our AccumuloConfiguration (including DefaultConfiguration). We have a separate ConfigCheckUtil, and maybe other places in the code that maybe could do validation of the configuration as a whole, like ensuring a property is set because it's a required property. But the PropertyType validation is really supposed to validate the format, *if set*. Making it required to be set is going to need to be done elsewhere, if it's not already done.
   
   > * If possible have the validation code reside in Property and PropertyType instead of off  at some random place in the code.
   
   I moved the validation to PropertyType
   


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on PR #5365:
URL: https://github.com/apache/accumulo/pull/5365#issuecomment-2691355258

   I'm not sure how best to express the "empty is valid if only empty in the DefaultConfiguration, but not anywhere else" criteria that the tests are failing on. Typically, we have validators for the content of the property, based on the property type, and that's independent from the validation of the overall config, which might check several properties, or that some properties are set that are required, etc. So, for the PropertyType validator, it should probably just check that it is of the proper form *or* that it is empty (make empty valid) and then check that it's non-empty elsewhere.


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds property validation for instance.volumes property [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner merged PR #5365:
URL: https://github.com/apache/accumulo/pull/5365


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org