ctubbsii commented on code in PR #4735:
URL: https://github.com/apache/accumulo/pull/4735#discussion_r1673264259
##########
core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java:
##########
@@ -154,6 +154,15 @@ public int offset() {
return offset;
}
+ /**
+ * Reset the backing array for this byte sequence object. This is useful for
object re-use.
+ */
+ public void reset(byte[] data) {
Review Comment:
While it's not technically immutable, I thought the intent was that it was
pretty much expected to be used in immutable ways (assuming the backing array
didn't change). Isn't that why it's used instead of Text, after all? Otherwise,
why not just use Text?
EDIT: I'm a little confused about the history of this. I guess there was a
push to remove Text from the API at some point, and that's where this came
from? I think there was a similar push to remove mutable objects from some
APIs, and I think these goals overlapped a bit, but I guess this particular
addition was really just about having a Text replacement, not an immutable
version, since it already has a method to explicitly expose the backing array.
--
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]