This method increments the global, Stream-related and Transaction-related counters of failed commit operations.

@param scope      Scope.
@param streamName Name of the Stream.
@param txnId      Transaction id.
322561
public void commitTransactionFailed(String scope, String streamName, String txnId) {
        DYNAMIC_LOGGER.incCounterValue(globalMetricName(COMMIT_TRANSACTION_FAILED), 1);
        DYNAMIC_LOGGER.incCounterValue(COMMIT_TRANSACTION_FAILED, 1, streamTags(scope, streamName));
        DYNAMIC_LOGGER.incCounterValue(COMMIT_TRANSACTION_FAILED, 1, transactionTags(scope, streamName, txnId));
    }
879879
@Override
    public synchronized void commit(boolean chain) {

//        tempActionHistory.add("commit " + actionTimestamp);
        if (isClosed) {
            return;
        }

        if (!isTransaction) {
            isReadOnly    = isReadOnlyDefault;
            isolationMode = isolationModeDefault;

            return;
        }

        if (!database.txManager.commitTransaction(this)) {

//            tempActionHistory.add("commit aborts " + actionTimestamp);
            rollback(false);

            throw Error.error(ErrorCode.X_40001);
        }

        endTransaction(true);
    }
1231829
public static void addTxn(TransactionImpl txn)
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "addTxn", txn);

        final ByteArray key = new ByteArray(txn.getXid().getGlobalTransactionId());

        synchronized (txnTable)
        {
            if (!txnTable.containsKey(key))
            {
                txnTable.put(key, new JCATranWrapperImpl(txn, true, false)); // @LIDB2110C
            }
        }

        if (tc.isEntryEnabled()) Tr.exit(tc, "addTxn");
    }
454141
public CompletableFuture<TxnStatus> commitTxn(final String scope, final String stream, final UUID txId,
                                                  final OperationContext contextOpt) {
        final OperationContext context = getNonNullOperationContext(scope, stream, contextOpt);
        return withRetriesAsync(() -> sealTxnBody(hostId, scope, stream, true, txId, null, context),
                RETRYABLE_PREDICATE, 3, executor);
    }
404164
public final void commit(final PersistentTransaction transaction) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "commit", "Transaction=" + transaction);

        if (STATE_END_PRECOMMIT == _state)
        {
            // normal processing
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())  SibTr.exit(tc, "commit");
            throw new TaskListException(_state);
        }

        _state = STATE_BEGIN_COMMIT;

        Task task = _firstTask;
        while (null != task)
        {
            task.commitInternal(transaction);
            task = task._nextTask;
        }

        task = _firstTask;
        while (null != task)
        {
            task.commitExternal(transaction);
            task = task._nextTask;
        }

        _state = STATE_END_COMMIT;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())  SibTr.exit(tc, "commit");
    }
1115119
private void performIndexActions(Progress progress, String transactionId) {
    List<IndexAction> indexActions =
        dataService
            .findAll(INDEX_ACTION, createQueryGetAllIndexActions(transactionId), IndexAction.class)
            .collect(toList());
    try {
      boolean success = true;
      int count = 0;
      for (IndexAction indexAction : indexActions) {
        success &= performAction(progress, count++, indexAction);
      }
      if (success) {
        progress.progress(count, "Executed all index actions, cleaning up the actions...");
        dataService.delete(INDEX_ACTION, indexActions.stream());
        dataService.deleteById(INDEX_ACTION_GROUP, transactionId);
        progress.progress(count, "Cleaned up the actions.");
      }
    } catch (Exception ex) {
      LOG.error("Error performing index actions", ex);
      throw ex;
    } finally {
      progress.status("Refresh index start");
      indexService.refreshIndex();
      progress.status("Refresh index done");
    }
  }
131926
public final void commitInternal(final PersistentTransaction transaction)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commitInternal", transaction);

        getLink().internalCommitAdd();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commitInternal");
    }
735725
void writeTransactionIdFile(StorageDirectory sd, long txid) throws IOException {
    if (txid < -1) {
      // -1 is valid when formatting
      throw new IOException("Bad txid: " + txid);
    }
    File txIdFile = getStorageFile(sd, NameNodeFile.SEEN_TXID);
    OutputStream fos = new AtomicFileOutputStream(txIdFile);
    try {
      fos.write(String.valueOf(txid).getBytes());
      fos.write('\n');
      fos.close();
      fos = null;
    } finally {
      IOUtils.cleanup(LOG, fos);
    }
  }
638606
public void incrementConnectionWindowUpdateLimit(int x) throws FlowControlException {
        if (!checkIfGoAwaySendingOrClosing()) {
            writeQ.incrementConnectionWindowUpdateLimit(x);
            H2StreamProcessor stream;
            for (Integer i : streamTable.keySet()) {
                stream = streamTable.get(i);
                if (stream != null) {
                    stream.connectionWindowSizeUpdated();
                }
            }
        }
    }
1052420
private void setupCurrentEditStream(long txid) throws IOException {
    // get new stream
    currentEditLogInputStream = JournalSet.getInputStream(remoteJournalManager,
        txid);
    // we just started a new log segment
    currentSegmentTxId = txid;
    // indicate that we successfully reopened the stream
    mostRecentlyReadTransactionTime = now();
  }
823292
@Managed(description = "Commit locally spooled events for flushing")
    @Override
    public synchronized void forceCommit() throws IOException
    {
        log.debug("Performing commit on delegate EventWriter [{}]", delegate.getClass());
        delegate.commit();

        uncommittedWriteCount = 0;
        lastCommitNanos = getNow();
    }
77189
@Override
	public void commit() throws RemoteException {
		tx.commit();
		try {
			tx = VanillaDb.txMgr().newTransaction(isolationLevel, readOnly);
		} catch (Exception e) {
			throw new RemoteException("error creating transaction ", e);
		}
	}
807180
public CompletableFuture<TxnStatus> abortTxn(final String scope,
                                                 final String stream,
                                                 final UUID txId,
                                                 final Version version,
                                                 final OperationContext contextOpt) {
        final OperationContext context = getNonNullOperationContext(scope, stream, contextOpt);
        return withRetriesAsync(() -> sealTxnBody(hostId, scope, stream, false, txId, version, context),
                RETRYABLE_PREDICATE, 3, executor);
    }
502548
private void sendNSFailed(IConnection conn, String errorCode, String description, String name, Number streamId) {
        StreamService.sendNetStreamStatus(conn, errorCode, description, name, Status.ERROR, streamId);
    }
1061297
public void deleteStream(String scope, String streamName, Duration latency) {
        DYNAMIC_LOGGER.incCounterValue(DELETE_STREAM, 1);
        deleteStreamLatency.reportSuccessValue(latency.toMillis());
    }
8312
private static void renameCheckpointInDir(StorageDirectory sd, long txid)
      throws IOException {
    File ckpt = NNStorage.getStorageFile(sd, NameNodeFile.IMAGE_NEW, txid);
    File curFile = NNStorage.getStorageFile(sd, NameNodeFile.IMAGE, txid);
    // renameTo fails on Windows if the destination file 
    // already exists.
    LOG.info("Renaming  " + ckpt.getAbsolutePath() + " to "
        + curFile.getAbsolutePath());
    if (!ckpt.renameTo(curFile)) {
      if (!curFile.delete() || !ckpt.renameTo(curFile)) {
        throw new IOException("renaming  " + ckpt.getAbsolutePath() + " to "  + 
            curFile.getAbsolutePath() + " FAILED");
      }
    }    
  }
937408
public static void reportOpenTransactions(String scope, String streamName, int ongoingTransactions) {
        DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, ongoingTransactions, streamTags(scope, streamName));
    }