You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "EdColeman (via GitHub)" <gi...@apache.org> on 2023/10/18 16:09:37 UTC

[I] MetadataSchema convenience Text methods for constants does not enforce strict immutability [accumulo]

EdColeman opened a new issue, #3865:
URL: https://github.com/apache/accumulo/issues/3865

   The convenience definitions that provide a `Text` object for constants in MetadataSchema expose the constants to changes if the Text object is mutated.  For example:
   
   ```
    public static class ServerColumnFamily {
         public static final String STR_NAME = "srv";
         public static final Text NAME = new Text(STR_NAME);
   ...
   ```
   
   Anything that uses `ServerColumnFamily.NAME` and then writes to that object will change the definition for everything using that `ServerColumnFamily.NAME` object,
   
   Options:
   
    - If it is not a significant impact, could those convenience definitions of Text objects be removed? 
    - Subclass the Text object in these cases to enforce immutability?
    - Use a immutable "byte-array" class instead of Text?
   


-- 
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.apache.org

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


Re: [I] MetadataSchema convenience Text methods for constants does not enforce strict immutability [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on issue #3865:
URL: https://github.com/apache/accumulo/issues/3865#issuecomment-1772395251

   > * Use a immutable "byte-array" class instead of Text?
   
   This isn't really an option right now, because the reason these are Text is because they're using our client APIs to write rows and column data to the metadata, and those APIs use Text. So until those APIs support a different kind of immutable byte array type, then it doesn't make sense to consider it for these.


-- 
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