DomGarguilo commented on code in PR #303:
URL: https://github.com/apache/accumulo-testing/pull/303#discussion_r2470731568
##########
src/main/java/org/apache/accumulo/testing/continuous/ContinuousScanner.java:
##########
@@ -62,8 +62,11 @@ public static void main(String[] args) throws Exception {
long t1 = System.currentTimeMillis();
- long count = scanner.stream()
- .peek(entry -> ContinuousWalk.validate(entry.getKey(),
entry.getValue())).count();
+ long count = 0;
+ for (var entry : scanner) {
+ ContinuousWalk.validate(entry.getKey(), entry.getValue());
+ count++;
+ }
Review Comment:
My IDE was warning me that the `.peek` operation could possibly be optimized
out by the compiler so I changed the syntax so that wouldnt happen
##########
src/main/java/org/apache/accumulo/testing/randomwalk/security/WalkingSecurity.java:
##########
@@ -291,19 +291,14 @@ public String getLastKey() {
}
public void increaseAuthMap(String s, int increment) {
- Integer curVal = getAuthsMap().get(s);
- if (curVal == null) {
- curVal = Integer.valueOf(0);
- getAuthsMap().put(s, curVal);
- }
- curVal += increment;
+ getAuthsMap().merge(s, increment, Integer::sum);
Review Comment:
This method was not doing anything. I changed the code so that it actually
updates the values of the map.
--
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]