kevinrr888 commented on code in PR #4524:
URL: https://github.com/apache/accumulo/pull/4524#discussion_r1700585605


##########
core/src/main/java/org/apache/accumulo/core/fate/MetaFateStore.java:
##########
@@ -363,13 +498,23 @@ protected Stream<FateIdStatus> 
getTransactions(Set<TStatus> statuses) {
       Stream<FateIdStatus> stream = zk.getChildren(path).stream().map(strTxid 
-> {
         String txUUIDStr = strTxid.split("_")[1];
         FateId fateId = FateId.from(fateInstanceType, txUUIDStr);
-        // Memoizing for two reasons. First the status may never be requested, 
so in that case avoid
-        // the lookup. Second, if its requested multiple times the result will 
always be consistent.
-        Supplier<TStatus> statusSupplier = Suppliers.memoize(() -> 
_getStatus(fateId));
+        // Memoizing for two reasons. First the status or reservation may 
never be requested, so
+        // in that case avoid the lookup. Second, if it's requested multiple 
times the result will
+        // always be consistent.
+        Supplier<Pair<TStatus,Optional<FateReservation>>> statusAndResSupplier 
=
+            Suppliers.memoize(() -> {
+              NodeValue zkNode = getNode(fateId);
+              return new Pair<>(zkNode.status, zkNode.reservation);
+            });

Review Comment:
   Simplified



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