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


##########
server/base/src/main/java/org/apache/accumulo/server/util/checkCommand/SystemConfigCheckRunner.java:
##########
@@ -195,10 +194,10 @@ private static boolean checkZKWALsMetadata(ServerContext 
context) throws Excepti
     return status;
   }
 
-  private static Map<TServerInstance,Set<Pair<WalStateManager.WalState,Path>>>
-      gatherWalsFromZK(ServerContext context, ZooReaderWriter zrw) throws 
Exception {
+  private static Map<TServerInstance,Set<WalStatePath>> 
gatherWalsFromZK(ServerContext context,
+      ZooReaderWriter zrw) throws Exception {
     final var rootWalsDir = WalStateManager.ZWALS;
-    Map<TServerInstance,Set<Pair<WalStateManager.WalState,Path>>> wals = new 
HashMap<>();
+    Map<TServerInstance,Set<WalStatePath>> wals = new HashMap<>();

Review Comment:
   If this line was moved down one, then could initialize the map with 
`tserverInstances.size()`



##########
server/base/src/main/java/org/apache/accumulo/server/log/WalStateManager.java:
##########
@@ -213,15 +217,15 @@ public Pair<WalState,Path> state(TServerInstance 
instance, UUID uuid) throws Wal
     }
   }
 
-  // utility combination of getAllMarkers and state
-  public Map<Path,WalState> getAllState() throws WalMarkerException {
-    Map<Path,WalState> result = new HashMap<>();
+  /**
+   * @return the state and path for all WAL markers.
+   */
+  public Set<WalStatePath> getAllState() throws WalMarkerException {
+    Set<WalStatePath> result = new HashSet<>();

Review Comment:
   you could initialize this with `getAllMarkers.size()`. It may not be 
correct, but will likely be a closer approximation to the required size and 
should reduce the time spent extending the set.



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