HDDS-10745. Do not use BitSet for OzoneAcl.aclBitSet.#6581
HDDS-10745. Do not use BitSet for OzoneAcl.aclBitSet.#6581szetszwo merged 7 commits intoapache:masterfrom
Conversation
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @szetszwo for the patch.
| public List<String> getAclStringList() { | ||
| return getAclList(aclBits, ACLType::name); |
There was a problem hiding this comment.
To fix test failure:
| public List<String> getAclStringList() { | |
| return getAclList(aclBits, ACLType::name); | |
| @JsonIgnore | |
| public List<String> getAclStringList() { | |
| return getAclList(aclBits, ACLType::name); |
| public static BitSet getACLBitSet(byte[] acls) { | ||
| return BitSet.valueOf(acls); | ||
| } | ||
|
|
||
| public static String getACLString(byte[] acls) { | ||
| return getACLString(BitSet.valueOf(acls)); | ||
| } |
There was a problem hiding this comment.
I suggest moving these to OzoneAcl and making them private. This would make it easier to completely get rid of BitSet in the future by reducing the public interface.
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @szetszwo for updating the patch.
The new Proto2Utils class could be useful for other sub-modules, so I suggest putting it in hadoop-hdds/common instead of hadoop-ozone/common.
| } | ||
|
|
||
| private Proto2Utils() { } | ||
|
|
|
@adoroszlai , thanks for reviewing this! That's a good suggestion. Let move it to |
|
Looks like failure in I think we need |
(cherry picked from commit 383c83f)
What changes were proposed in this pull request?
The BitSet class used by aclBitSet is inefficient. We have to copy it in order to make aclBitSet immutable. BitSet is also inefficient in memory usage.
What is the link to the Apache JIRA
HDDS-10745
How was this patch tested?
Existing unit tests.