private Lazy findToCommitPerNode()

in core/src/main/java/org/apache/ignite/activestore/impl/subscriber/lead/LeadPlanner.java [102:128]


    private Lazy<UUID, MutableLongList> findToCommitPerNode() {
        JointTxScope globallyBlockedScope = new JointTxScope();
        Lazy<UUID, JointTxScope> ownedScopePerNode = new Lazy<>(TX_SCOPE);
        Lazy<UUID, MutableLongList> toCommit = new Lazy<>(ARRAY_LIST);

        for (TxInfo txInfo : state.txInfos()) {
            long id = txInfo.id();

            if (id > state.lastDenseRead()) {
                break;
            }
            else if (state.orphanTransactions().contains(id) || state.inProgressTransactions().contains(id)) {
                globallyBlockedScope.addAll(txInfo.scopeIterator());
            }
            else {
                boolean globallyAvailable = !globallyBlockedScope.intersects(txInfo.scopeIterator());
                if (globallyAvailable && isTxAvailableToCommitOnOwnNode(txInfo, ownedScopePerNode)) {
                    toCommit.get(txInfo.consumerId()).add(id);
                    ownedScopePerNode.get(txInfo.consumerId()).addAll(txInfo.scopeIterator());
                }
                else {
                    globallyBlockedScope.addAll(txInfo.scopeIterator());
                }
            }
        }
        return toCommit;
    }