TSubTxnInfo.java

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.doris.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class TSubTxnInfo implements org.apache.thrift.TBase<TSubTxnInfo, TSubTxnInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TSubTxnInfo> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSubTxnInfo");

  private static final org.apache.thrift.protocol.TField SUB_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sub_txn_id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("table_id", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField TABLET_COMMIT_INFOS_FIELD_DESC = new org.apache.thrift.protocol.TField("tablet_commit_infos", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField SUB_TXN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("sub_txn_type", org.apache.thrift.protocol.TType.I32, (short)4);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSubTxnInfoStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSubTxnInfoTupleSchemeFactory();

  public long sub_txn_id; // optional
  public long table_id; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TTabletCommitInfo> tablet_commit_infos; // optional
  /**
   * 
   * @see TSubTxnType
   */
  public @org.apache.thrift.annotation.Nullable TSubTxnType sub_txn_type; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    SUB_TXN_ID((short)1, "sub_txn_id"),
    TABLE_ID((short)2, "table_id"),
    TABLET_COMMIT_INFOS((short)3, "tablet_commit_infos"),
    /**
     * 
     * @see TSubTxnType
     */
    SUB_TXN_TYPE((short)4, "sub_txn_type");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // SUB_TXN_ID
          return SUB_TXN_ID;
        case 2: // TABLE_ID
          return TABLE_ID;
        case 3: // TABLET_COMMIT_INFOS
          return TABLET_COMMIT_INFOS;
        case 4: // SUB_TXN_TYPE
          return SUB_TXN_TYPE;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __SUB_TXN_ID_ISSET_ID = 0;
  private static final int __TABLE_ID_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.SUB_TXN_ID,_Fields.TABLE_ID,_Fields.TABLET_COMMIT_INFOS,_Fields.SUB_TXN_TYPE};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.SUB_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("sub_txn_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("table_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TABLET_COMMIT_INFOS, new org.apache.thrift.meta_data.FieldMetaData("tablet_commit_infos", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TTabletCommitInfo.class))));
    tmpMap.put(_Fields.SUB_TXN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("sub_txn_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TSubTxnType.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSubTxnInfo.class, metaDataMap);
  }

  public TSubTxnInfo() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TSubTxnInfo(TSubTxnInfo other) {
    __isset_bitfield = other.__isset_bitfield;
    this.sub_txn_id = other.sub_txn_id;
    this.table_id = other.table_id;
    if (other.isSetTabletCommitInfos()) {
      java.util.List<org.apache.doris.thrift.TTabletCommitInfo> __this__tablet_commit_infos = new java.util.ArrayList<org.apache.doris.thrift.TTabletCommitInfo>(other.tablet_commit_infos.size());
      for (org.apache.doris.thrift.TTabletCommitInfo other_element : other.tablet_commit_infos) {
        __this__tablet_commit_infos.add(new org.apache.doris.thrift.TTabletCommitInfo(other_element));
      }
      this.tablet_commit_infos = __this__tablet_commit_infos;
    }
    if (other.isSetSubTxnType()) {
      this.sub_txn_type = other.sub_txn_type;
    }
  }

  public TSubTxnInfo deepCopy() {
    return new TSubTxnInfo(this);
  }

  @Override
  public void clear() {
    setSubTxnIdIsSet(false);
    this.sub_txn_id = 0;
    setTableIdIsSet(false);
    this.table_id = 0;
    this.tablet_commit_infos = null;
    this.sub_txn_type = null;
  }

  public long getSubTxnId() {
    return this.sub_txn_id;
  }

  public TSubTxnInfo setSubTxnId(long sub_txn_id) {
    this.sub_txn_id = sub_txn_id;
    setSubTxnIdIsSet(true);
    return this;
  }

  public void unsetSubTxnId() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUB_TXN_ID_ISSET_ID);
  }

  /** Returns true if field sub_txn_id is set (has been assigned a value) and false otherwise */
  public boolean isSetSubTxnId() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUB_TXN_ID_ISSET_ID);
  }

  public void setSubTxnIdIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUB_TXN_ID_ISSET_ID, value);
  }

  public long getTableId() {
    return this.table_id;
  }

  public TSubTxnInfo setTableId(long table_id) {
    this.table_id = table_id;
    setTableIdIsSet(true);
    return this;
  }

  public void unsetTableId() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLE_ID_ISSET_ID);
  }

  /** Returns true if field table_id is set (has been assigned a value) and false otherwise */
  public boolean isSetTableId() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLE_ID_ISSET_ID);
  }

  public void setTableIdIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLE_ID_ISSET_ID, value);
  }

  public int getTabletCommitInfosSize() {
    return (this.tablet_commit_infos == null) ? 0 : this.tablet_commit_infos.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<org.apache.doris.thrift.TTabletCommitInfo> getTabletCommitInfosIterator() {
    return (this.tablet_commit_infos == null) ? null : this.tablet_commit_infos.iterator();
  }

  public void addToTabletCommitInfos(org.apache.doris.thrift.TTabletCommitInfo elem) {
    if (this.tablet_commit_infos == null) {
      this.tablet_commit_infos = new java.util.ArrayList<org.apache.doris.thrift.TTabletCommitInfo>();
    }
    this.tablet_commit_infos.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<org.apache.doris.thrift.TTabletCommitInfo> getTabletCommitInfos() {
    return this.tablet_commit_infos;
  }

  public TSubTxnInfo setTabletCommitInfos(@org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TTabletCommitInfo> tablet_commit_infos) {
    this.tablet_commit_infos = tablet_commit_infos;
    return this;
  }

  public void unsetTabletCommitInfos() {
    this.tablet_commit_infos = null;
  }

  /** Returns true if field tablet_commit_infos is set (has been assigned a value) and false otherwise */
  public boolean isSetTabletCommitInfos() {
    return this.tablet_commit_infos != null;
  }

  public void setTabletCommitInfosIsSet(boolean value) {
    if (!value) {
      this.tablet_commit_infos = null;
    }
  }

  /**
   * 
   * @see TSubTxnType
   */
  @org.apache.thrift.annotation.Nullable
  public TSubTxnType getSubTxnType() {
    return this.sub_txn_type;
  }

  /**
   * 
   * @see TSubTxnType
   */
  public TSubTxnInfo setSubTxnType(@org.apache.thrift.annotation.Nullable TSubTxnType sub_txn_type) {
    this.sub_txn_type = sub_txn_type;
    return this;
  }

  public void unsetSubTxnType() {
    this.sub_txn_type = null;
  }

  /** Returns true if field sub_txn_type is set (has been assigned a value) and false otherwise */
  public boolean isSetSubTxnType() {
    return this.sub_txn_type != null;
  }

  public void setSubTxnTypeIsSet(boolean value) {
    if (!value) {
      this.sub_txn_type = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case SUB_TXN_ID:
      if (value == null) {
        unsetSubTxnId();
      } else {
        setSubTxnId((java.lang.Long)value);
      }
      break;

    case TABLE_ID:
      if (value == null) {
        unsetTableId();
      } else {
        setTableId((java.lang.Long)value);
      }
      break;

    case TABLET_COMMIT_INFOS:
      if (value == null) {
        unsetTabletCommitInfos();
      } else {
        setTabletCommitInfos((java.util.List<org.apache.doris.thrift.TTabletCommitInfo>)value);
      }
      break;

    case SUB_TXN_TYPE:
      if (value == null) {
        unsetSubTxnType();
      } else {
        setSubTxnType((TSubTxnType)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case SUB_TXN_ID:
      return getSubTxnId();

    case TABLE_ID:
      return getTableId();

    case TABLET_COMMIT_INFOS:
      return getTabletCommitInfos();

    case SUB_TXN_TYPE:
      return getSubTxnType();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case SUB_TXN_ID:
      return isSetSubTxnId();
    case TABLE_ID:
      return isSetTableId();
    case TABLET_COMMIT_INFOS:
      return isSetTabletCommitInfos();
    case SUB_TXN_TYPE:
      return isSetSubTxnType();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TSubTxnInfo)
      return this.equals((TSubTxnInfo)that);
    return false;
  }

  public boolean equals(TSubTxnInfo that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_sub_txn_id = true && this.isSetSubTxnId();
    boolean that_present_sub_txn_id = true && that.isSetSubTxnId();
    if (this_present_sub_txn_id || that_present_sub_txn_id) {
      if (!(this_present_sub_txn_id && that_present_sub_txn_id))
        return false;
      if (this.sub_txn_id != that.sub_txn_id)
        return false;
    }

    boolean this_present_table_id = true && this.isSetTableId();
    boolean that_present_table_id = true && that.isSetTableId();
    if (this_present_table_id || that_present_table_id) {
      if (!(this_present_table_id && that_present_table_id))
        return false;
      if (this.table_id != that.table_id)
        return false;
    }

    boolean this_present_tablet_commit_infos = true && this.isSetTabletCommitInfos();
    boolean that_present_tablet_commit_infos = true && that.isSetTabletCommitInfos();
    if (this_present_tablet_commit_infos || that_present_tablet_commit_infos) {
      if (!(this_present_tablet_commit_infos && that_present_tablet_commit_infos))
        return false;
      if (!this.tablet_commit_infos.equals(that.tablet_commit_infos))
        return false;
    }

    boolean this_present_sub_txn_type = true && this.isSetSubTxnType();
    boolean that_present_sub_txn_type = true && that.isSetSubTxnType();
    if (this_present_sub_txn_type || that_present_sub_txn_type) {
      if (!(this_present_sub_txn_type && that_present_sub_txn_type))
        return false;
      if (!this.sub_txn_type.equals(that.sub_txn_type))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetSubTxnId()) ? 131071 : 524287);
    if (isSetSubTxnId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sub_txn_id);

    hashCode = hashCode * 8191 + ((isSetTableId()) ? 131071 : 524287);
    if (isSetTableId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(table_id);

    hashCode = hashCode * 8191 + ((isSetTabletCommitInfos()) ? 131071 : 524287);
    if (isSetTabletCommitInfos())
      hashCode = hashCode * 8191 + tablet_commit_infos.hashCode();

    hashCode = hashCode * 8191 + ((isSetSubTxnType()) ? 131071 : 524287);
    if (isSetSubTxnType())
      hashCode = hashCode * 8191 + sub_txn_type.getValue();

    return hashCode;
  }

  @Override
  public int compareTo(TSubTxnInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetSubTxnId(), other.isSetSubTxnId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSubTxnId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sub_txn_id, other.sub_txn_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTableId(), other.isSetTableId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_id, other.table_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTabletCommitInfos(), other.isSetTabletCommitInfos());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTabletCommitInfos()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tablet_commit_infos, other.tablet_commit_infos);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSubTxnType(), other.isSetSubTxnType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSubTxnType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sub_txn_type, other.sub_txn_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TSubTxnInfo(");
    boolean first = true;

    if (isSetSubTxnId()) {
      sb.append("sub_txn_id:");
      sb.append(this.sub_txn_id);
      first = false;
    }
    if (isSetTableId()) {
      if (!first) sb.append(", ");
      sb.append("table_id:");
      sb.append(this.table_id);
      first = false;
    }
    if (isSetTabletCommitInfos()) {
      if (!first) sb.append(", ");
      sb.append("tablet_commit_infos:");
      if (this.tablet_commit_infos == null) {
        sb.append("null");
      } else {
        sb.append(this.tablet_commit_infos);
      }
      first = false;
    }
    if (isSetSubTxnType()) {
      if (!first) sb.append(", ");
      sb.append("sub_txn_type:");
      if (this.sub_txn_type == null) {
        sb.append("null");
      } else {
        sb.append(this.sub_txn_type);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TSubTxnInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TSubTxnInfoStandardScheme getScheme() {
      return new TSubTxnInfoStandardScheme();
    }
  }

  private static class TSubTxnInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TSubTxnInfo> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TSubTxnInfo struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // SUB_TXN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.sub_txn_id = iprot.readI64();
              struct.setSubTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TABLE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.table_id = iprot.readI64();
              struct.setTableIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TABLET_COMMIT_INFOS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list264 = iprot.readListBegin();
                struct.tablet_commit_infos = new java.util.ArrayList<org.apache.doris.thrift.TTabletCommitInfo>(_list264.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TTabletCommitInfo _elem265;
                for (int _i266 = 0; _i266 < _list264.size; ++_i266)
                {
                  _elem265 = new org.apache.doris.thrift.TTabletCommitInfo();
                  _elem265.read(iprot);
                  struct.tablet_commit_infos.add(_elem265);
                }
                iprot.readListEnd();
              }
              struct.setTabletCommitInfosIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // SUB_TXN_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.sub_txn_type = org.apache.doris.thrift.TSubTxnType.findByValue(iprot.readI32());
              struct.setSubTxnTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TSubTxnInfo struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetSubTxnId()) {
        oprot.writeFieldBegin(SUB_TXN_ID_FIELD_DESC);
        oprot.writeI64(struct.sub_txn_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTableId()) {
        oprot.writeFieldBegin(TABLE_ID_FIELD_DESC);
        oprot.writeI64(struct.table_id);
        oprot.writeFieldEnd();
      }
      if (struct.tablet_commit_infos != null) {
        if (struct.isSetTabletCommitInfos()) {
          oprot.writeFieldBegin(TABLET_COMMIT_INFOS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tablet_commit_infos.size()));
            for (org.apache.doris.thrift.TTabletCommitInfo _iter267 : struct.tablet_commit_infos)
            {
              _iter267.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.sub_txn_type != null) {
        if (struct.isSetSubTxnType()) {
          oprot.writeFieldBegin(SUB_TXN_TYPE_FIELD_DESC);
          oprot.writeI32(struct.sub_txn_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TSubTxnInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TSubTxnInfoTupleScheme getScheme() {
      return new TSubTxnInfoTupleScheme();
    }
  }

  private static class TSubTxnInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TSubTxnInfo> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TSubTxnInfo struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetSubTxnId()) {
        optionals.set(0);
      }
      if (struct.isSetTableId()) {
        optionals.set(1);
      }
      if (struct.isSetTabletCommitInfos()) {
        optionals.set(2);
      }
      if (struct.isSetSubTxnType()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetSubTxnId()) {
        oprot.writeI64(struct.sub_txn_id);
      }
      if (struct.isSetTableId()) {
        oprot.writeI64(struct.table_id);
      }
      if (struct.isSetTabletCommitInfos()) {
        {
          oprot.writeI32(struct.tablet_commit_infos.size());
          for (org.apache.doris.thrift.TTabletCommitInfo _iter268 : struct.tablet_commit_infos)
          {
            _iter268.write(oprot);
          }
        }
      }
      if (struct.isSetSubTxnType()) {
        oprot.writeI32(struct.sub_txn_type.getValue());
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TSubTxnInfo struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.sub_txn_id = iprot.readI64();
        struct.setSubTxnIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.table_id = iprot.readI64();
        struct.setTableIdIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list269 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.tablet_commit_infos = new java.util.ArrayList<org.apache.doris.thrift.TTabletCommitInfo>(_list269.size);
          @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TTabletCommitInfo _elem270;
          for (int _i271 = 0; _i271 < _list269.size; ++_i271)
          {
            _elem270 = new org.apache.doris.thrift.TTabletCommitInfo();
            _elem270.read(iprot);
            struct.tablet_commit_infos.add(_elem270);
          }
        }
        struct.setTabletCommitInfosIsSet(true);
      }
      if (incoming.get(3)) {
        struct.sub_txn_type = org.apache.doris.thrift.TSubTxnType.findByValue(iprot.readI32());
        struct.setSubTxnTypeIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}