class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
    /** */
    private static final long serialVersionUID = 0L;

    /** Future ID. */
    private IgniteUuid futId;

    /** Mini future ID. */
    private IgniteUuid miniId;

    /** Near transaction ID. */
    private GridCacheVersion nearXidVer;

    /** Expected number of transactions on node. */
    private int txNum;

    /** System transaction flag. */
    private boolean sys;

    /** {@code True} if should check only tx on near node. */
    private boolean nearTxCheck;

    /**
     * Empty constructor required by {@link Externalizable}
     */
    public GridCacheTxRecoveryRequest() {
        // No-op.
    }

    /**
     * @param tx Transaction.
     * @param txNum Expected number of transactions on remote node.
     * @param nearTxCheck {@code True} if should check only tx on near node.
     * @param futId Future ID.
     * @param miniId Mini future ID.
     * @param addDepInfo Deployment info flag.
     */
    public GridCacheTxRecoveryRequest(IgniteInternalTx tx,
        int txNum,
        boolean nearTxCheck,
        IgniteUuid futId,
        IgniteUuid miniId,
        boolean addDepInfo
    ) {
        super(tx.xidVersion(), 0, addDepInfo);

        nearXidVer = tx.nearXidVersion();
        sys = tx.system();

        this.futId = futId;
        this.miniId = miniId;
        this.txNum = txNum;
        this.nearTxCheck = nearTxCheck;
    }

    /**
     * @return {@code True} if should check only tx on near node.
     */
    public boolean nearTxCheck() {
        return nearTxCheck;
    }

    /**
     * @return Near version.
     */
    public GridCacheVersion nearXidVersion() {
        return nearXidVer;
    }

    /**
     * @return Future ID.
     */
    public IgniteUuid futureId() {
        return futId;
    }

    /**
     * @return Mini future ID.
     */
    public IgniteUuid miniId() {
        return miniId;
    }

    /**
     * @return Expected number of transactions on node.
     */
    public int transactions() {
        return txNum;
    }

    /**
     * @return System transaction flag.
     */
    public boolean system() {
        return sys;
    }

    /** {@inheritDoc} */
    @Override public IgniteLogger messageLogger(GridCacheSharedContext ctx) {
        return ctx.txRecoveryMessageLogger();
    }

    /** {@inheritDoc} */
    @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
        writer.setBuffer(buf);

        if (!super.writeTo(buf, writer))
            return false;

        if (!writer.isHeaderWritten()) {
            if (!writer.writeHeader(directType(), fieldsCount()))
                return false;

            writer.onHeaderWritten();
        }

        switch (writer.state()) {
            case 8:
                if (!writer.writeIgniteUuid("futId", futId))
                    return false;

                writer.incrementState();

            case 9:
                if (!writer.writeIgniteUuid("miniId", miniId))
                    return false;

                writer.incrementState();

            case 10:
                if (!writer.writeBoolean("nearTxCheck", nearTxCheck))
                    return false;

                writer.incrementState();

            case 11:
                if (!writer.writeMessage("nearXidVer", nearXidVer))
                    return false;

                writer.incrementState();

            case 12:
                if (!writer.writeBoolean("sys", sys))
                    return false;

                writer.incrementState();

            case 13:
                if (!writer.writeInt("txNum", txNum))
                    return false;

                writer.incrementState();

        }

        return true;
    }

    /** {@inheritDoc} */
    @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public short directType() {
        return 16;
    }

    /** {@inheritDoc} */
    @Override public byte fieldsCount() {
        return 14;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return S.toString(GridCacheTxRecoveryRequest.class, this, "super", super.toString());
    }
}

        reader.setBuffer(buf);

        if (!reader.beforeMessageRead())
            return false;

        if (!super.readFrom(buf, reader))
            return false;

        switch (reader.state()) {
            case 8:
                futId = reader.readIgniteUuid("futId");

                if (!reader.isLastRead())
                    return false;

                reader.incrementState();

            case 9:
                miniId = reader.readIgniteUuid("miniId");

                if (!reader.isLastRead())
                    return false;

                reader.incrementState();

            case 10:
                nearTxCheck = reader.readBoolean("nearTxCheck");

                if (!reader.isLastRead())
                    return false;

                reader.incrementState();

            case 11:
                nearXidVer = reader.readMessage("nearXidVer");

                if (!reader.isLastRead())
                    return false;

                reader.incrementState();

            case 12:
                sys = reader.readBoolean("sys");

                if (!reader.isLastRead())
                    return false;

                reader.incrementState();

            case 13:
                txNum = reader.readInt("txNum");

                if (!reader.isLastRead())
                    return false;

                reader.incrementState();

        }

        return reader.afterMessageRead(GridCacheTxRecoveryRequest.class);
    
<methods>public boolean addDeploymentInfo() ,public Collection<org.apache.ignite.internal.processors.cache.version.GridCacheVersion> committedVersions() ,public void completedVersions(Collection<org.apache.ignite.internal.processors.cache.version.GridCacheVersion>, Collection<org.apache.ignite.internal.processors.cache.version.GridCacheVersion>) ,public boolean readFrom(java.nio.ByteBuffer, org.apache.ignite.plugin.extensions.communication.MessageReader) ,public Collection<org.apache.ignite.internal.processors.cache.version.GridCacheVersion> rolledbackVersions() ,public java.lang.String toString() ,public org.apache.ignite.internal.processors.cache.version.GridCacheVersion version() ,public void version(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) ,public boolean writeTo(java.nio.ByteBuffer, org.apache.ignite.plugin.extensions.communication.MessageWriter) <variables>private byte[] candsByIdxBytes,private int cnt,private Collection<org.apache.ignite.internal.processors.cache.version.GridCacheVersion> committedVers,private Collection<org.apache.ignite.internal.processors.cache.version.GridCacheVersion> rolledbackVers,private static final long serialVersionUID,protected org.apache.ignite.internal.processors.cache.version.GridCacheVersion ver