code: private void completeCommittingTransaction(TransactionId transactionId) {
      // Change ownership of the transaction to the local node and then commit it.
      completeTransaction(
          transactionId,
          TransactionState.COMMITTING,
          info -> new TransactionInfo(localMemberId, TransactionState.COMMITTING, info.participants),
          info -> info.state == TransactionState.COMMITTING && info.coordinator.equals(localMemberId),
          (id, transactional) -> transactional.commit(id))
          .whenComplete((result, error) -> {
            if (error != null) {
              error = Throwables.getRootCause(error);
              if (error instanceof TransactionException) {
                LOGGER.warn("Failed to complete transaction", error);
              } else {
                LOGGER.warn("Failed to commit transaction " + transactionId);
              }
            }
          });
    }
docs: Completes a transaction in the {@link TransactionState#PREPARING} state.
  
  @param transactionId the transaction identifier for the transaction to complete