public List commit()

in lagerta-core/src/main/java/com/epam/lagerta/subscriber/ParallelCommitStrategy.java [79:105]


        public List<Long> commit(List<Long> txIdsToCommit) {
            txIdsToCommit
                    .stream()
                    .map(txId -> relation(txId, buffer))
                    .peek(relation -> relationMap.put(relation.id, relation))
                    .filter(TransactionRelation::isFree)
                    .forEach(tasks::add);

            relationMap.values().forEach(relation -> relation.fillRelations(relationMap));

            count.set(relationMap.size());
            IntStream
                    .range(0, Math.min(POOL_COUNT, relationMap.size()))
                    .boxed()
                    .map(i -> (Runnable) this::execute)
                    .map(executor::submit)
                    .collect(Collectors.toList())
                    .forEach(this::join);

            return deadHasRisen
                    ? txIdsToCommit.stream()
                    .map(relationMap::get)
                    .filter(TransactionRelation::isAlive)
                    .map(TransactionRelation::getId)
                    .collect(Collectors.toList())
                    : txIdsToCommit;
        }