ddanielr commented on code in PR #5293:
URL: https://github.com/apache/accumulo/pull/5293#discussion_r1934449754
##########
core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java:
##########
@@ -505,6 +524,31 @@ public ColumnVisibility(byte[] expression) {
validate(expression);
}
+ /**
+ * Creates a column visibility for a Mutation from an AccessExpression.
+ *
+ * @param expression visibility expression, encoded as UTF-8 bytes
+ * @see #ColumnVisibility(String)
+ * @since 2.1.4
+ */
+ public ColumnVisibility(AccessExpression expression) {
+ // AccessExpression is a validated immutable object, so no need to re
validate
+ this.expression = expression.getExpression().getBytes(UTF_8);
Review Comment:
This is an optimization to avoid calling `validate` for performance reasons.
If an AccessExpression is passed in then it has already performed a `validate`
operation previous and does not need to parse the expression.
--
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]