/**
   * @param nodeId Node ID.
   * @param res Response.
   */
  private void processFinishResponse(UUID nodeId, GridNearTxFinishResponse<K, V> res) {
    GridNearTxFinishFuture<K, V> fut =
        (GridNearTxFinishFuture<K, V>)
            ctx.mvcc().<GridCacheTx>future(res.xid().id(), res.futureId());

    if (fut == null) {
      if (log.isDebugEnabled())
        log.debug(
            "Failed to find future for finish response [sender=" + nodeId + ", res=" + res + ']');

      return;
    }

    fut.onResult(nodeId, res);
  }
  /**
   * @param nodeId Sender.
   * @param res Result.
   */
  void onResult(UUID nodeId, GridNearTxFinishResponse<K, V> res) {
    if (!isDone())
      for (GridFuture<GridCacheTx> fut : futures()) {
        if (isMini(fut)) {
          MiniFuture f = (MiniFuture) fut;

          if (f.futureId().equals(res.miniId())) {
            assert f.node().id().equals(nodeId);

            f.onResult(res);
          }
        }
      }
  }
 /** @param res Result callback. */
 void onResult(GridNearTxFinishResponse<K, V> res) {
   if (res.error() != null) onDone(res.error());
   else onDone(tx);
 }