ctubbsii commented on code in PR #4745:
URL: https://github.com/apache/accumulo/pull/4745#discussion_r1686897940
##########
core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java:
##########
@@ -993,7 +992,7 @@ private void _seek(Range range) throws IOException {
// causing the build of an index... doing this could slow down some
use cases and
// and speed up others.
- MutableByteSequence valbs = new MutableByteSequence(new byte[64], 0,
0);
+ ArrayByteSequence valbs = new ArrayByteSequence(new byte[64], 0, 0);
Review Comment:
For the lines that changed, you could use `var` to make it slightly cleaner,
since the type is redundant in these declarations.
```suggestion
var valbs = new ArrayByteSequence(new byte[64], 0, 0);
```
##########
core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java:
##########
@@ -180,4 +180,14 @@ public byte[] toArray() {
public String toString() {
return new String(data, offset, length, UTF_8);
}
+
+ public void setArray(byte[] data, int offset, int len) {
+ this.data = data;
+ this.offset = offset;
+ this.length = len;
+ }
+
+ public void setLength(int len) {
+ this.length = len;
+ }
Review Comment:
In the constructor, there are bounds checks to make sure that the length and
offset values make sense. Those same checks should appear here or else there
will be exceptions later.
Similarly, the setLength parameter should be checked to make sure it's a
valid length.
--
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]