/**
   * @param tx Cache transaction.
   * @param reads Read entries.
   * @param writes Write entries.
   * @param grpLockKey Group lock key.
   * @param partLock {@code True} if preparing group-lock transaction with partition lock.
   * @param txNodes Transaction nodes mapping.
   * @param onePhaseCommit One phase commit flag.
   */
  public GridDistributedTxPrepareRequest(
      IgniteInternalTx tx,
      @Nullable Collection<IgniteTxEntry> reads,
      Collection<IgniteTxEntry> writes,
      IgniteTxKey grpLockKey,
      boolean partLock,
      Map<UUID, Collection<UUID>> txNodes,
      boolean onePhaseCommit) {
    super(tx.xidVersion(), 0);

    writeVer = tx.writeVersion();
    threadId = tx.threadId();
    concurrency = tx.concurrency();
    isolation = tx.isolation();
    timeout = tx.timeout();
    invalidate = tx.isInvalidate();
    txSize = tx.size();
    sys = tx.system();
    plc = tx.ioPolicy();

    this.reads = reads;
    this.writes = writes;
    this.grpLockKey = grpLockKey;
    this.partLock = partLock;
    this.txNodes = txNodes;
    this.onePhaseCommit = onePhaseCommit;
  }