xtern commented on code in PR #5207:
URL: https://github.com/apache/ignite-3/pull/5207#discussion_r1950586449


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/views/TransactionsViewProvider.java:
##########
@@ -93,27 +86,20 @@ public SystemView<?> get() {
     static class TxInfoDataSource implements Iterable<TxInfo> {
         private final UUID localNodeId;
 
-        private final Iterable<UUID> roTxIds;
-
         private final Map<UUID, TxStateMeta> rwTxStates;
 
-        TxInfoDataSource(UUID localNodeId, Iterable<UUID> roTxIds, Map<UUID, 
TxStateMeta> rwTxStates) {
+        TxInfoDataSource(UUID localNodeId, Map<UUID, TxStateMeta> rwTxStates) {
             this.localNodeId = localNodeId;
-            this.roTxIds = roTxIds;
             this.rwTxStates = rwTxStates;
         }
 
         @Override
         public Iterator<TxInfo> iterator() {
-            return CollectionUtils.concat(
-                    new TransformingIterator<>(roTxIds.iterator(), 
TxInfo::readOnly),
-                    rwTxStates.entrySet().stream()
+            return rwTxStates.entrySet().stream()
                             .filter(e -> 
localNodeId.equals(e.getValue().txCoordinatorId())
-                                    && e.getValue().tx() != null && 
!e.getValue().tx().isReadOnly()
-                                    && !isFinalState(e.getValue().txState()))
-                            .map(e -> TxInfo.readWrite(e.getKey(), 
e.getValue().txState()))
-                            .iterator()
-            );
+                                    && e.getValue().tx() != null && 
!e.getValue().tx().isFinishingOrFinished())

Review Comment:
   Thanks, this check has been changed because RO tx currently does not change 
state after completion in the state map (it always has state PENDING).
   
   I reworked this code a bit to do separate checks for RW and RO tx, and added 
a comment about the RO state.



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/views/TransactionsViewProvider.java:
##########
@@ -93,27 +86,20 @@ public SystemView<?> get() {
     static class TxInfoDataSource implements Iterable<TxInfo> {
         private final UUID localNodeId;
 
-        private final Iterable<UUID> roTxIds;
-
         private final Map<UUID, TxStateMeta> rwTxStates;

Review Comment:
   Done, thanks



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to