dlmarion commented on code in PR #3219:
URL: https://github.com/apache/accumulo/pull/3219#discussion_r1123374666


##########
core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/SeekableByteArrayInputStream.java:
##########
@@ -42,13 +43,13 @@ public class SeekableByteArrayInputStream extends 
InputStream {
   @SuppressFBWarnings(value = "VO_VOLATILE_REFERENCE_TO_ARRAY",
       justification = "see explanation above")
   private volatile byte[] buffer;
-  private int cur;
-  private int max;
+  private final AtomicInteger cur;
+  private final AtomicInteger max;

Review Comment:
   I think that `max` can be final, which means it doesn't need to be 
`volatile` or `AtomicInteger`.  There are performance impacts with `volatile` 
and `AtomicInteger` so we only want to use them where we need to. I think 
making `cur` either `volatile` or `AtomicInteger` is fine.



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