keith-turner commented on code in PR #4735:
URL: https://github.com/apache/accumulo/pull/4735#discussion_r1672722056


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

Review Comment:
   ```suggestion
      * Reset the backing array for this byte sequence object. This is useful 
for object re-use.
      * @since 3.1.0
   ```



##########
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) {
+    this.data = data;
+    this.offset = 0;
+    this.length = data.length;

Review Comment:
   Could make this a bit more generic.
   
   ```suggestion
     public void reset(byte[] data. int offset, length) {
       this.data = data;
       this.offset = offset;
       this.length = length;
   ```



##########
core/src/main/java/org/apache/accumulo/core/iterators/user/VisibilityFilter.java:
##########
@@ -100,6 +106,10 @@ public boolean accept(Key k, Value v) {
       try {
         boolean bb = accessEvaluator.canAccess(testVis.toArray());
         cache.put(testVis, bb);

Review Comment:
   Could do the following, would need to move the comment up.
   
   ```suggestion
           cache.put(new ArrayByteSequence(testVis), bb);
   ```



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

Reply via email to