TCommitTxnRequest.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 TCommitTxnRequest implements org.apache.thrift.TBase<TCommitTxnRequest, TCommitTxnRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TCommitTxnRequest> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCommitTxnRequest");

  private static final org.apache.thrift.protocol.TField CLUSTER_FIELD_DESC = new org.apache.thrift.protocol.TField("cluster", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField PASSWD_FIELD_DESC = new org.apache.thrift.protocol.TField("passwd", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField DB_FIELD_DESC = new org.apache.thrift.protocol.TField("db", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField USER_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("user_ip", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txn_id", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField COMMIT_INFOS_FIELD_DESC = new org.apache.thrift.protocol.TField("commit_infos", org.apache.thrift.protocol.TType.LIST, (short)7);
  private static final org.apache.thrift.protocol.TField AUTH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("auth_code", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField TXN_COMMIT_ATTACHMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("txn_commit_attachment", org.apache.thrift.protocol.TType.STRUCT, (short)9);
  private static final org.apache.thrift.protocol.TField THRIFT_RPC_TIMEOUT_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("thrift_rpc_timeout_ms", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)11);
  private static final org.apache.thrift.protocol.TField DB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("db_id", org.apache.thrift.protocol.TType.I64, (short)12);
  private static final org.apache.thrift.protocol.TField TXN_INSERT_FIELD_DESC = new org.apache.thrift.protocol.TField("txn_insert", org.apache.thrift.protocol.TType.BOOL, (short)13);
  private static final org.apache.thrift.protocol.TField SUB_TXN_INFOS_FIELD_DESC = new org.apache.thrift.protocol.TField("sub_txn_infos", org.apache.thrift.protocol.TType.LIST, (short)14);
  private static final org.apache.thrift.protocol.TField ONLY_COMMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("only_commit", org.apache.thrift.protocol.TType.BOOL, (short)15);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String cluster; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String user; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String passwd; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String db; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String user_ip; // optional
  public long txn_id; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TTabletCommitInfo> commit_infos; // optional
  public long auth_code; // optional
  public @org.apache.thrift.annotation.Nullable TTxnCommitAttachment txn_commit_attachment; // optional
  public long thrift_rpc_timeout_ms; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String token; // optional
  public long db_id; // optional
  public boolean txn_insert; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TSubTxnInfo> sub_txn_infos; // optional
  public boolean only_commit; // 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 {
    CLUSTER((short)1, "cluster"),
    USER((short)2, "user"),
    PASSWD((short)3, "passwd"),
    DB((short)4, "db"),
    USER_IP((short)5, "user_ip"),
    TXN_ID((short)6, "txn_id"),
    COMMIT_INFOS((short)7, "commit_infos"),
    AUTH_CODE((short)8, "auth_code"),
    TXN_COMMIT_ATTACHMENT((short)9, "txn_commit_attachment"),
    THRIFT_RPC_TIMEOUT_MS((short)10, "thrift_rpc_timeout_ms"),
    TOKEN((short)11, "token"),
    DB_ID((short)12, "db_id"),
    TXN_INSERT((short)13, "txn_insert"),
    SUB_TXN_INFOS((short)14, "sub_txn_infos"),
    ONLY_COMMIT((short)15, "only_commit");

    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: // CLUSTER
          return CLUSTER;
        case 2: // USER
          return USER;
        case 3: // PASSWD
          return PASSWD;
        case 4: // DB
          return DB;
        case 5: // USER_IP
          return USER_IP;
        case 6: // TXN_ID
          return TXN_ID;
        case 7: // COMMIT_INFOS
          return COMMIT_INFOS;
        case 8: // AUTH_CODE
          return AUTH_CODE;
        case 9: // TXN_COMMIT_ATTACHMENT
          return TXN_COMMIT_ATTACHMENT;
        case 10: // THRIFT_RPC_TIMEOUT_MS
          return THRIFT_RPC_TIMEOUT_MS;
        case 11: // TOKEN
          return TOKEN;
        case 12: // DB_ID
          return DB_ID;
        case 13: // TXN_INSERT
          return TXN_INSERT;
        case 14: // SUB_TXN_INFOS
          return SUB_TXN_INFOS;
        case 15: // ONLY_COMMIT
          return ONLY_COMMIT;
        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 __TXN_ID_ISSET_ID = 0;
  private static final int __AUTH_CODE_ISSET_ID = 1;
  private static final int __THRIFT_RPC_TIMEOUT_MS_ISSET_ID = 2;
  private static final int __DB_ID_ISSET_ID = 3;
  private static final int __TXN_INSERT_ISSET_ID = 4;
  private static final int __ONLY_COMMIT_ISSET_ID = 5;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.CLUSTER,_Fields.USER,_Fields.PASSWD,_Fields.DB,_Fields.USER_IP,_Fields.TXN_ID,_Fields.COMMIT_INFOS,_Fields.AUTH_CODE,_Fields.TXN_COMMIT_ATTACHMENT,_Fields.THRIFT_RPC_TIMEOUT_MS,_Fields.TOKEN,_Fields.DB_ID,_Fields.TXN_INSERT,_Fields.SUB_TXN_INFOS,_Fields.ONLY_COMMIT};
  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.CLUSTER, new org.apache.thrift.meta_data.FieldMetaData("cluster", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PASSWD, new org.apache.thrift.meta_data.FieldMetaData("passwd", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DB, new org.apache.thrift.meta_data.FieldMetaData("db", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.USER_IP, new org.apache.thrift.meta_data.FieldMetaData("user_ip", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("txn_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.COMMIT_INFOS, new org.apache.thrift.meta_data.FieldMetaData("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.AUTH_CODE, new org.apache.thrift.meta_data.FieldMetaData("auth_code", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TXN_COMMIT_ATTACHMENT, new org.apache.thrift.meta_data.FieldMetaData("txn_commit_attachment", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTxnCommitAttachment.class)));
    tmpMap.put(_Fields.THRIFT_RPC_TIMEOUT_MS, new org.apache.thrift.meta_data.FieldMetaData("thrift_rpc_timeout_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DB_ID, new org.apache.thrift.meta_data.FieldMetaData("db_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TXN_INSERT, new org.apache.thrift.meta_data.FieldMetaData("txn_insert", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.SUB_TXN_INFOS, new org.apache.thrift.meta_data.FieldMetaData("sub_txn_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, TSubTxnInfo.class))));
    tmpMap.put(_Fields.ONLY_COMMIT, new org.apache.thrift.meta_data.FieldMetaData("only_commit", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCommitTxnRequest.class, metaDataMap);
  }

  public TCommitTxnRequest() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TCommitTxnRequest(TCommitTxnRequest other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetCluster()) {
      this.cluster = other.cluster;
    }
    if (other.isSetUser()) {
      this.user = other.user;
    }
    if (other.isSetPasswd()) {
      this.passwd = other.passwd;
    }
    if (other.isSetDb()) {
      this.db = other.db;
    }
    if (other.isSetUserIp()) {
      this.user_ip = other.user_ip;
    }
    this.txn_id = other.txn_id;
    if (other.isSetCommitInfos()) {
      java.util.List<org.apache.doris.thrift.TTabletCommitInfo> __this__commit_infos = new java.util.ArrayList<org.apache.doris.thrift.TTabletCommitInfo>(other.commit_infos.size());
      for (org.apache.doris.thrift.TTabletCommitInfo other_element : other.commit_infos) {
        __this__commit_infos.add(new org.apache.doris.thrift.TTabletCommitInfo(other_element));
      }
      this.commit_infos = __this__commit_infos;
    }
    this.auth_code = other.auth_code;
    if (other.isSetTxnCommitAttachment()) {
      this.txn_commit_attachment = new TTxnCommitAttachment(other.txn_commit_attachment);
    }
    this.thrift_rpc_timeout_ms = other.thrift_rpc_timeout_ms;
    if (other.isSetToken()) {
      this.token = other.token;
    }
    this.db_id = other.db_id;
    this.txn_insert = other.txn_insert;
    if (other.isSetSubTxnInfos()) {
      java.util.List<TSubTxnInfo> __this__sub_txn_infos = new java.util.ArrayList<TSubTxnInfo>(other.sub_txn_infos.size());
      for (TSubTxnInfo other_element : other.sub_txn_infos) {
        __this__sub_txn_infos.add(new TSubTxnInfo(other_element));
      }
      this.sub_txn_infos = __this__sub_txn_infos;
    }
    this.only_commit = other.only_commit;
  }

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

  @Override
  public void clear() {
    this.cluster = null;
    this.user = null;
    this.passwd = null;
    this.db = null;
    this.user_ip = null;
    setTxnIdIsSet(false);
    this.txn_id = 0;
    this.commit_infos = null;
    setAuthCodeIsSet(false);
    this.auth_code = 0;
    this.txn_commit_attachment = null;
    setThriftRpcTimeoutMsIsSet(false);
    this.thrift_rpc_timeout_ms = 0;
    this.token = null;
    setDbIdIsSet(false);
    this.db_id = 0;
    setTxnInsertIsSet(false);
    this.txn_insert = false;
    this.sub_txn_infos = null;
    setOnlyCommitIsSet(false);
    this.only_commit = false;
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getCluster() {
    return this.cluster;
  }

  public TCommitTxnRequest setCluster(@org.apache.thrift.annotation.Nullable java.lang.String cluster) {
    this.cluster = cluster;
    return this;
  }

  public void unsetCluster() {
    this.cluster = null;
  }

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

  public void setClusterIsSet(boolean value) {
    if (!value) {
      this.cluster = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getUser() {
    return this.user;
  }

  public TCommitTxnRequest setUser(@org.apache.thrift.annotation.Nullable java.lang.String user) {
    this.user = user;
    return this;
  }

  public void unsetUser() {
    this.user = null;
  }

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

  public void setUserIsSet(boolean value) {
    if (!value) {
      this.user = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getPasswd() {
    return this.passwd;
  }

  public TCommitTxnRequest setPasswd(@org.apache.thrift.annotation.Nullable java.lang.String passwd) {
    this.passwd = passwd;
    return this;
  }

  public void unsetPasswd() {
    this.passwd = null;
  }

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

  public void setPasswdIsSet(boolean value) {
    if (!value) {
      this.passwd = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getDb() {
    return this.db;
  }

  public TCommitTxnRequest setDb(@org.apache.thrift.annotation.Nullable java.lang.String db) {
    this.db = db;
    return this;
  }

  public void unsetDb() {
    this.db = null;
  }

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

  public void setDbIsSet(boolean value) {
    if (!value) {
      this.db = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getUserIp() {
    return this.user_ip;
  }

  public TCommitTxnRequest setUserIp(@org.apache.thrift.annotation.Nullable java.lang.String user_ip) {
    this.user_ip = user_ip;
    return this;
  }

  public void unsetUserIp() {
    this.user_ip = null;
  }

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

  public void setUserIpIsSet(boolean value) {
    if (!value) {
      this.user_ip = null;
    }
  }

  public long getTxnId() {
    return this.txn_id;
  }

  public TCommitTxnRequest setTxnId(long txn_id) {
    this.txn_id = txn_id;
    setTxnIdIsSet(true);
    return this;
  }

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

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

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

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

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

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

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

  public TCommitTxnRequest setCommitInfos(@org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TTabletCommitInfo> commit_infos) {
    this.commit_infos = commit_infos;
    return this;
  }

  public void unsetCommitInfos() {
    this.commit_infos = null;
  }

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

  public void setCommitInfosIsSet(boolean value) {
    if (!value) {
      this.commit_infos = null;
    }
  }

  public long getAuthCode() {
    return this.auth_code;
  }

  public TCommitTxnRequest setAuthCode(long auth_code) {
    this.auth_code = auth_code;
    setAuthCodeIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public TTxnCommitAttachment getTxnCommitAttachment() {
    return this.txn_commit_attachment;
  }

  public TCommitTxnRequest setTxnCommitAttachment(@org.apache.thrift.annotation.Nullable TTxnCommitAttachment txn_commit_attachment) {
    this.txn_commit_attachment = txn_commit_attachment;
    return this;
  }

  public void unsetTxnCommitAttachment() {
    this.txn_commit_attachment = null;
  }

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

  public void setTxnCommitAttachmentIsSet(boolean value) {
    if (!value) {
      this.txn_commit_attachment = null;
    }
  }

  public long getThriftRpcTimeoutMs() {
    return this.thrift_rpc_timeout_ms;
  }

  public TCommitTxnRequest setThriftRpcTimeoutMs(long thrift_rpc_timeout_ms) {
    this.thrift_rpc_timeout_ms = thrift_rpc_timeout_ms;
    setThriftRpcTimeoutMsIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getToken() {
    return this.token;
  }

  public TCommitTxnRequest setToken(@org.apache.thrift.annotation.Nullable java.lang.String token) {
    this.token = token;
    return this;
  }

  public void unsetToken() {
    this.token = null;
  }

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

  public void setTokenIsSet(boolean value) {
    if (!value) {
      this.token = null;
    }
  }

  public long getDbId() {
    return this.db_id;
  }

  public TCommitTxnRequest setDbId(long db_id) {
    this.db_id = db_id;
    setDbIdIsSet(true);
    return this;
  }

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

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

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

  public boolean isTxnInsert() {
    return this.txn_insert;
  }

  public TCommitTxnRequest setTxnInsert(boolean txn_insert) {
    this.txn_insert = txn_insert;
    setTxnInsertIsSet(true);
    return this;
  }

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

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<TSubTxnInfo> getSubTxnInfosIterator() {
    return (this.sub_txn_infos == null) ? null : this.sub_txn_infos.iterator();
  }

  public void addToSubTxnInfos(TSubTxnInfo elem) {
    if (this.sub_txn_infos == null) {
      this.sub_txn_infos = new java.util.ArrayList<TSubTxnInfo>();
    }
    this.sub_txn_infos.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TSubTxnInfo> getSubTxnInfos() {
    return this.sub_txn_infos;
  }

  public TCommitTxnRequest setSubTxnInfos(@org.apache.thrift.annotation.Nullable java.util.List<TSubTxnInfo> sub_txn_infos) {
    this.sub_txn_infos = sub_txn_infos;
    return this;
  }

  public void unsetSubTxnInfos() {
    this.sub_txn_infos = null;
  }

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

  public void setSubTxnInfosIsSet(boolean value) {
    if (!value) {
      this.sub_txn_infos = null;
    }
  }

  public boolean isOnlyCommit() {
    return this.only_commit;
  }

  public TCommitTxnRequest setOnlyCommit(boolean only_commit) {
    this.only_commit = only_commit;
    setOnlyCommitIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case CLUSTER:
      if (value == null) {
        unsetCluster();
      } else {
        setCluster((java.lang.String)value);
      }
      break;

    case USER:
      if (value == null) {
        unsetUser();
      } else {
        setUser((java.lang.String)value);
      }
      break;

    case PASSWD:
      if (value == null) {
        unsetPasswd();
      } else {
        setPasswd((java.lang.String)value);
      }
      break;

    case DB:
      if (value == null) {
        unsetDb();
      } else {
        setDb((java.lang.String)value);
      }
      break;

    case USER_IP:
      if (value == null) {
        unsetUserIp();
      } else {
        setUserIp((java.lang.String)value);
      }
      break;

    case TXN_ID:
      if (value == null) {
        unsetTxnId();
      } else {
        setTxnId((java.lang.Long)value);
      }
      break;

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

    case AUTH_CODE:
      if (value == null) {
        unsetAuthCode();
      } else {
        setAuthCode((java.lang.Long)value);
      }
      break;

    case TXN_COMMIT_ATTACHMENT:
      if (value == null) {
        unsetTxnCommitAttachment();
      } else {
        setTxnCommitAttachment((TTxnCommitAttachment)value);
      }
      break;

    case THRIFT_RPC_TIMEOUT_MS:
      if (value == null) {
        unsetThriftRpcTimeoutMs();
      } else {
        setThriftRpcTimeoutMs((java.lang.Long)value);
      }
      break;

    case TOKEN:
      if (value == null) {
        unsetToken();
      } else {
        setToken((java.lang.String)value);
      }
      break;

    case DB_ID:
      if (value == null) {
        unsetDbId();
      } else {
        setDbId((java.lang.Long)value);
      }
      break;

    case TXN_INSERT:
      if (value == null) {
        unsetTxnInsert();
      } else {
        setTxnInsert((java.lang.Boolean)value);
      }
      break;

    case SUB_TXN_INFOS:
      if (value == null) {
        unsetSubTxnInfos();
      } else {
        setSubTxnInfos((java.util.List<TSubTxnInfo>)value);
      }
      break;

    case ONLY_COMMIT:
      if (value == null) {
        unsetOnlyCommit();
      } else {
        setOnlyCommit((java.lang.Boolean)value);
      }
      break;

    }
  }

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

    case USER:
      return getUser();

    case PASSWD:
      return getPasswd();

    case DB:
      return getDb();

    case USER_IP:
      return getUserIp();

    case TXN_ID:
      return getTxnId();

    case COMMIT_INFOS:
      return getCommitInfos();

    case AUTH_CODE:
      return getAuthCode();

    case TXN_COMMIT_ATTACHMENT:
      return getTxnCommitAttachment();

    case THRIFT_RPC_TIMEOUT_MS:
      return getThriftRpcTimeoutMs();

    case TOKEN:
      return getToken();

    case DB_ID:
      return getDbId();

    case TXN_INSERT:
      return isTxnInsert();

    case SUB_TXN_INFOS:
      return getSubTxnInfos();

    case ONLY_COMMIT:
      return isOnlyCommit();

    }
    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 CLUSTER:
      return isSetCluster();
    case USER:
      return isSetUser();
    case PASSWD:
      return isSetPasswd();
    case DB:
      return isSetDb();
    case USER_IP:
      return isSetUserIp();
    case TXN_ID:
      return isSetTxnId();
    case COMMIT_INFOS:
      return isSetCommitInfos();
    case AUTH_CODE:
      return isSetAuthCode();
    case TXN_COMMIT_ATTACHMENT:
      return isSetTxnCommitAttachment();
    case THRIFT_RPC_TIMEOUT_MS:
      return isSetThriftRpcTimeoutMs();
    case TOKEN:
      return isSetToken();
    case DB_ID:
      return isSetDbId();
    case TXN_INSERT:
      return isSetTxnInsert();
    case SUB_TXN_INFOS:
      return isSetSubTxnInfos();
    case ONLY_COMMIT:
      return isSetOnlyCommit();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_cluster = true && this.isSetCluster();
    boolean that_present_cluster = true && that.isSetCluster();
    if (this_present_cluster || that_present_cluster) {
      if (!(this_present_cluster && that_present_cluster))
        return false;
      if (!this.cluster.equals(that.cluster))
        return false;
    }

    boolean this_present_user = true && this.isSetUser();
    boolean that_present_user = true && that.isSetUser();
    if (this_present_user || that_present_user) {
      if (!(this_present_user && that_present_user))
        return false;
      if (!this.user.equals(that.user))
        return false;
    }

    boolean this_present_passwd = true && this.isSetPasswd();
    boolean that_present_passwd = true && that.isSetPasswd();
    if (this_present_passwd || that_present_passwd) {
      if (!(this_present_passwd && that_present_passwd))
        return false;
      if (!this.passwd.equals(that.passwd))
        return false;
    }

    boolean this_present_db = true && this.isSetDb();
    boolean that_present_db = true && that.isSetDb();
    if (this_present_db || that_present_db) {
      if (!(this_present_db && that_present_db))
        return false;
      if (!this.db.equals(that.db))
        return false;
    }

    boolean this_present_user_ip = true && this.isSetUserIp();
    boolean that_present_user_ip = true && that.isSetUserIp();
    if (this_present_user_ip || that_present_user_ip) {
      if (!(this_present_user_ip && that_present_user_ip))
        return false;
      if (!this.user_ip.equals(that.user_ip))
        return false;
    }

    boolean this_present_txn_id = true && this.isSetTxnId();
    boolean that_present_txn_id = true && that.isSetTxnId();
    if (this_present_txn_id || that_present_txn_id) {
      if (!(this_present_txn_id && that_present_txn_id))
        return false;
      if (this.txn_id != that.txn_id)
        return false;
    }

    boolean this_present_commit_infos = true && this.isSetCommitInfos();
    boolean that_present_commit_infos = true && that.isSetCommitInfos();
    if (this_present_commit_infos || that_present_commit_infos) {
      if (!(this_present_commit_infos && that_present_commit_infos))
        return false;
      if (!this.commit_infos.equals(that.commit_infos))
        return false;
    }

    boolean this_present_auth_code = true && this.isSetAuthCode();
    boolean that_present_auth_code = true && that.isSetAuthCode();
    if (this_present_auth_code || that_present_auth_code) {
      if (!(this_present_auth_code && that_present_auth_code))
        return false;
      if (this.auth_code != that.auth_code)
        return false;
    }

    boolean this_present_txn_commit_attachment = true && this.isSetTxnCommitAttachment();
    boolean that_present_txn_commit_attachment = true && that.isSetTxnCommitAttachment();
    if (this_present_txn_commit_attachment || that_present_txn_commit_attachment) {
      if (!(this_present_txn_commit_attachment && that_present_txn_commit_attachment))
        return false;
      if (!this.txn_commit_attachment.equals(that.txn_commit_attachment))
        return false;
    }

    boolean this_present_thrift_rpc_timeout_ms = true && this.isSetThriftRpcTimeoutMs();
    boolean that_present_thrift_rpc_timeout_ms = true && that.isSetThriftRpcTimeoutMs();
    if (this_present_thrift_rpc_timeout_ms || that_present_thrift_rpc_timeout_ms) {
      if (!(this_present_thrift_rpc_timeout_ms && that_present_thrift_rpc_timeout_ms))
        return false;
      if (this.thrift_rpc_timeout_ms != that.thrift_rpc_timeout_ms)
        return false;
    }

    boolean this_present_token = true && this.isSetToken();
    boolean that_present_token = true && that.isSetToken();
    if (this_present_token || that_present_token) {
      if (!(this_present_token && that_present_token))
        return false;
      if (!this.token.equals(that.token))
        return false;
    }

    boolean this_present_db_id = true && this.isSetDbId();
    boolean that_present_db_id = true && that.isSetDbId();
    if (this_present_db_id || that_present_db_id) {
      if (!(this_present_db_id && that_present_db_id))
        return false;
      if (this.db_id != that.db_id)
        return false;
    }

    boolean this_present_txn_insert = true && this.isSetTxnInsert();
    boolean that_present_txn_insert = true && that.isSetTxnInsert();
    if (this_present_txn_insert || that_present_txn_insert) {
      if (!(this_present_txn_insert && that_present_txn_insert))
        return false;
      if (this.txn_insert != that.txn_insert)
        return false;
    }

    boolean this_present_sub_txn_infos = true && this.isSetSubTxnInfos();
    boolean that_present_sub_txn_infos = true && that.isSetSubTxnInfos();
    if (this_present_sub_txn_infos || that_present_sub_txn_infos) {
      if (!(this_present_sub_txn_infos && that_present_sub_txn_infos))
        return false;
      if (!this.sub_txn_infos.equals(that.sub_txn_infos))
        return false;
    }

    boolean this_present_only_commit = true && this.isSetOnlyCommit();
    boolean that_present_only_commit = true && that.isSetOnlyCommit();
    if (this_present_only_commit || that_present_only_commit) {
      if (!(this_present_only_commit && that_present_only_commit))
        return false;
      if (this.only_commit != that.only_commit)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetCluster()) ? 131071 : 524287);
    if (isSetCluster())
      hashCode = hashCode * 8191 + cluster.hashCode();

    hashCode = hashCode * 8191 + ((isSetUser()) ? 131071 : 524287);
    if (isSetUser())
      hashCode = hashCode * 8191 + user.hashCode();

    hashCode = hashCode * 8191 + ((isSetPasswd()) ? 131071 : 524287);
    if (isSetPasswd())
      hashCode = hashCode * 8191 + passwd.hashCode();

    hashCode = hashCode * 8191 + ((isSetDb()) ? 131071 : 524287);
    if (isSetDb())
      hashCode = hashCode * 8191 + db.hashCode();

    hashCode = hashCode * 8191 + ((isSetUserIp()) ? 131071 : 524287);
    if (isSetUserIp())
      hashCode = hashCode * 8191 + user_ip.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetCommitInfos()) ? 131071 : 524287);
    if (isSetCommitInfos())
      hashCode = hashCode * 8191 + commit_infos.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetTxnCommitAttachment()) ? 131071 : 524287);
    if (isSetTxnCommitAttachment())
      hashCode = hashCode * 8191 + txn_commit_attachment.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287);
    if (isSetToken())
      hashCode = hashCode * 8191 + token.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetTxnInsert()) ? 131071 : 524287);
    if (isSetTxnInsert())
      hashCode = hashCode * 8191 + ((txn_insert) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetSubTxnInfos()) ? 131071 : 524287);
    if (isSetSubTxnInfos())
      hashCode = hashCode * 8191 + sub_txn_infos.hashCode();

    hashCode = hashCode * 8191 + ((isSetOnlyCommit()) ? 131071 : 524287);
    if (isSetOnlyCommit())
      hashCode = hashCode * 8191 + ((only_commit) ? 131071 : 524287);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetCluster(), other.isSetCluster());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCluster()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cluster, other.cluster);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUser(), other.isSetUser());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUser()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPasswd(), other.isSetPasswd());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPasswd()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passwd, other.passwd);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDb(), other.isSetDb());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDb()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db, other.db);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUserIp(), other.isSetUserIp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserIp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user_ip, other.user_ip);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTxnId(), other.isSetTxnId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTxnId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txn_id, other.txn_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCommitInfos(), other.isSetCommitInfos());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCommitInfos()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commit_infos, other.commit_infos);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetAuthCode(), other.isSetAuthCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAuthCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.auth_code, other.auth_code);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTxnCommitAttachment(), other.isSetTxnCommitAttachment());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTxnCommitAttachment()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txn_commit_attachment, other.txn_commit_attachment);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetThriftRpcTimeoutMs(), other.isSetThriftRpcTimeoutMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetThriftRpcTimeoutMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.thrift_rpc_timeout_ms, other.thrift_rpc_timeout_ms);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetToken(), other.isSetToken());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetToken()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDbId(), other.isSetDbId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDbId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_id, other.db_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTxnInsert(), other.isSetTxnInsert());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTxnInsert()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txn_insert, other.txn_insert);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSubTxnInfos(), other.isSetSubTxnInfos());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSubTxnInfos()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sub_txn_infos, other.sub_txn_infos);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOnlyCommit(), other.isSetOnlyCommit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOnlyCommit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.only_commit, other.only_commit);
      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("TCommitTxnRequest(");
    boolean first = true;

    if (isSetCluster()) {
      sb.append("cluster:");
      if (this.cluster == null) {
        sb.append("null");
      } else {
        sb.append(this.cluster);
      }
      first = false;
    }
    if (isSetUser()) {
      if (!first) sb.append(", ");
      sb.append("user:");
      if (this.user == null) {
        sb.append("null");
      } else {
        sb.append(this.user);
      }
      first = false;
    }
    if (isSetPasswd()) {
      if (!first) sb.append(", ");
      sb.append("passwd:");
      if (this.passwd == null) {
        sb.append("null");
      } else {
        sb.append(this.passwd);
      }
      first = false;
    }
    if (isSetDb()) {
      if (!first) sb.append(", ");
      sb.append("db:");
      if (this.db == null) {
        sb.append("null");
      } else {
        sb.append(this.db);
      }
      first = false;
    }
    if (isSetUserIp()) {
      if (!first) sb.append(", ");
      sb.append("user_ip:");
      if (this.user_ip == null) {
        sb.append("null");
      } else {
        sb.append(this.user_ip);
      }
      first = false;
    }
    if (isSetTxnId()) {
      if (!first) sb.append(", ");
      sb.append("txn_id:");
      sb.append(this.txn_id);
      first = false;
    }
    if (isSetCommitInfos()) {
      if (!first) sb.append(", ");
      sb.append("commit_infos:");
      if (this.commit_infos == null) {
        sb.append("null");
      } else {
        sb.append(this.commit_infos);
      }
      first = false;
    }
    if (isSetAuthCode()) {
      if (!first) sb.append(", ");
      sb.append("auth_code:");
      sb.append(this.auth_code);
      first = false;
    }
    if (isSetTxnCommitAttachment()) {
      if (!first) sb.append(", ");
      sb.append("txn_commit_attachment:");
      if (this.txn_commit_attachment == null) {
        sb.append("null");
      } else {
        sb.append(this.txn_commit_attachment);
      }
      first = false;
    }
    if (isSetThriftRpcTimeoutMs()) {
      if (!first) sb.append(", ");
      sb.append("thrift_rpc_timeout_ms:");
      sb.append(this.thrift_rpc_timeout_ms);
      first = false;
    }
    if (isSetToken()) {
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        sb.append(this.token);
      }
      first = false;
    }
    if (isSetDbId()) {
      if (!first) sb.append(", ");
      sb.append("db_id:");
      sb.append(this.db_id);
      first = false;
    }
    if (isSetTxnInsert()) {
      if (!first) sb.append(", ");
      sb.append("txn_insert:");
      sb.append(this.txn_insert);
      first = false;
    }
    if (isSetSubTxnInfos()) {
      if (!first) sb.append(", ");
      sb.append("sub_txn_infos:");
      if (this.sub_txn_infos == null) {
        sb.append("null");
      } else {
        sb.append(this.sub_txn_infos);
      }
      first = false;
    }
    if (isSetOnlyCommit()) {
      if (!first) sb.append(", ");
      sb.append("only_commit:");
      sb.append(this.only_commit);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (txn_commit_attachment != null) {
      txn_commit_attachment.validate();
    }
  }

  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 TCommitTxnRequestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TCommitTxnRequestStandardScheme getScheme() {
      return new TCommitTxnRequestStandardScheme();
    }
  }

  private static class TCommitTxnRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<TCommitTxnRequest> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TCommitTxnRequest 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: // CLUSTER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cluster = iprot.readString();
              struct.setClusterIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // USER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.user = iprot.readString();
              struct.setUserIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PASSWD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.passwd = iprot.readString();
              struct.setPasswdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DB
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.db = iprot.readString();
              struct.setDbIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // USER_IP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.user_ip = iprot.readString();
              struct.setUserIpIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // TXN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.txn_id = iprot.readI64();
              struct.setTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // COMMIT_INFOS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list410 = iprot.readListBegin();
                struct.commit_infos = new java.util.ArrayList<org.apache.doris.thrift.TTabletCommitInfo>(_list410.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TTabletCommitInfo _elem411;
                for (int _i412 = 0; _i412 < _list410.size; ++_i412)
                {
                  _elem411 = new org.apache.doris.thrift.TTabletCommitInfo();
                  _elem411.read(iprot);
                  struct.commit_infos.add(_elem411);
                }
                iprot.readListEnd();
              }
              struct.setCommitInfosIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // AUTH_CODE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.auth_code = iprot.readI64();
              struct.setAuthCodeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // TXN_COMMIT_ATTACHMENT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.txn_commit_attachment = new TTxnCommitAttachment();
              struct.txn_commit_attachment.read(iprot);
              struct.setTxnCommitAttachmentIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // THRIFT_RPC_TIMEOUT_MS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.thrift_rpc_timeout_ms = iprot.readI64();
              struct.setThriftRpcTimeoutMsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // TOKEN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.token = iprot.readString();
              struct.setTokenIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // DB_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.db_id = iprot.readI64();
              struct.setDbIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // TXN_INSERT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.txn_insert = iprot.readBool();
              struct.setTxnInsertIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // SUB_TXN_INFOS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list413 = iprot.readListBegin();
                struct.sub_txn_infos = new java.util.ArrayList<TSubTxnInfo>(_list413.size);
                @org.apache.thrift.annotation.Nullable TSubTxnInfo _elem414;
                for (int _i415 = 0; _i415 < _list413.size; ++_i415)
                {
                  _elem414 = new TSubTxnInfo();
                  _elem414.read(iprot);
                  struct.sub_txn_infos.add(_elem414);
                }
                iprot.readListEnd();
              }
              struct.setSubTxnInfosIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 15: // ONLY_COMMIT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.only_commit = iprot.readBool();
              struct.setOnlyCommitIsSet(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, TCommitTxnRequest struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.cluster != null) {
        if (struct.isSetCluster()) {
          oprot.writeFieldBegin(CLUSTER_FIELD_DESC);
          oprot.writeString(struct.cluster);
          oprot.writeFieldEnd();
        }
      }
      if (struct.user != null) {
        if (struct.isSetUser()) {
          oprot.writeFieldBegin(USER_FIELD_DESC);
          oprot.writeString(struct.user);
          oprot.writeFieldEnd();
        }
      }
      if (struct.passwd != null) {
        if (struct.isSetPasswd()) {
          oprot.writeFieldBegin(PASSWD_FIELD_DESC);
          oprot.writeString(struct.passwd);
          oprot.writeFieldEnd();
        }
      }
      if (struct.db != null) {
        if (struct.isSetDb()) {
          oprot.writeFieldBegin(DB_FIELD_DESC);
          oprot.writeString(struct.db);
          oprot.writeFieldEnd();
        }
      }
      if (struct.user_ip != null) {
        if (struct.isSetUserIp()) {
          oprot.writeFieldBegin(USER_IP_FIELD_DESC);
          oprot.writeString(struct.user_ip);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetTxnId()) {
        oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
        oprot.writeI64(struct.txn_id);
        oprot.writeFieldEnd();
      }
      if (struct.commit_infos != null) {
        if (struct.isSetCommitInfos()) {
          oprot.writeFieldBegin(COMMIT_INFOS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.commit_infos.size()));
            for (org.apache.doris.thrift.TTabletCommitInfo _iter416 : struct.commit_infos)
            {
              _iter416.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetAuthCode()) {
        oprot.writeFieldBegin(AUTH_CODE_FIELD_DESC);
        oprot.writeI64(struct.auth_code);
        oprot.writeFieldEnd();
      }
      if (struct.txn_commit_attachment != null) {
        if (struct.isSetTxnCommitAttachment()) {
          oprot.writeFieldBegin(TXN_COMMIT_ATTACHMENT_FIELD_DESC);
          struct.txn_commit_attachment.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetThriftRpcTimeoutMs()) {
        oprot.writeFieldBegin(THRIFT_RPC_TIMEOUT_MS_FIELD_DESC);
        oprot.writeI64(struct.thrift_rpc_timeout_ms);
        oprot.writeFieldEnd();
      }
      if (struct.token != null) {
        if (struct.isSetToken()) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeString(struct.token);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetDbId()) {
        oprot.writeFieldBegin(DB_ID_FIELD_DESC);
        oprot.writeI64(struct.db_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTxnInsert()) {
        oprot.writeFieldBegin(TXN_INSERT_FIELD_DESC);
        oprot.writeBool(struct.txn_insert);
        oprot.writeFieldEnd();
      }
      if (struct.sub_txn_infos != null) {
        if (struct.isSetSubTxnInfos()) {
          oprot.writeFieldBegin(SUB_TXN_INFOS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.sub_txn_infos.size()));
            for (TSubTxnInfo _iter417 : struct.sub_txn_infos)
            {
              _iter417.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetOnlyCommit()) {
        oprot.writeFieldBegin(ONLY_COMMIT_FIELD_DESC);
        oprot.writeBool(struct.only_commit);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TCommitTxnRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<TCommitTxnRequest> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TCommitTxnRequest 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.isSetCluster()) {
        optionals.set(0);
      }
      if (struct.isSetUser()) {
        optionals.set(1);
      }
      if (struct.isSetPasswd()) {
        optionals.set(2);
      }
      if (struct.isSetDb()) {
        optionals.set(3);
      }
      if (struct.isSetUserIp()) {
        optionals.set(4);
      }
      if (struct.isSetTxnId()) {
        optionals.set(5);
      }
      if (struct.isSetCommitInfos()) {
        optionals.set(6);
      }
      if (struct.isSetAuthCode()) {
        optionals.set(7);
      }
      if (struct.isSetTxnCommitAttachment()) {
        optionals.set(8);
      }
      if (struct.isSetThriftRpcTimeoutMs()) {
        optionals.set(9);
      }
      if (struct.isSetToken()) {
        optionals.set(10);
      }
      if (struct.isSetDbId()) {
        optionals.set(11);
      }
      if (struct.isSetTxnInsert()) {
        optionals.set(12);
      }
      if (struct.isSetSubTxnInfos()) {
        optionals.set(13);
      }
      if (struct.isSetOnlyCommit()) {
        optionals.set(14);
      }
      oprot.writeBitSet(optionals, 15);
      if (struct.isSetCluster()) {
        oprot.writeString(struct.cluster);
      }
      if (struct.isSetUser()) {
        oprot.writeString(struct.user);
      }
      if (struct.isSetPasswd()) {
        oprot.writeString(struct.passwd);
      }
      if (struct.isSetDb()) {
        oprot.writeString(struct.db);
      }
      if (struct.isSetUserIp()) {
        oprot.writeString(struct.user_ip);
      }
      if (struct.isSetTxnId()) {
        oprot.writeI64(struct.txn_id);
      }
      if (struct.isSetCommitInfos()) {
        {
          oprot.writeI32(struct.commit_infos.size());
          for (org.apache.doris.thrift.TTabletCommitInfo _iter418 : struct.commit_infos)
          {
            _iter418.write(oprot);
          }
        }
      }
      if (struct.isSetAuthCode()) {
        oprot.writeI64(struct.auth_code);
      }
      if (struct.isSetTxnCommitAttachment()) {
        struct.txn_commit_attachment.write(oprot);
      }
      if (struct.isSetThriftRpcTimeoutMs()) {
        oprot.writeI64(struct.thrift_rpc_timeout_ms);
      }
      if (struct.isSetToken()) {
        oprot.writeString(struct.token);
      }
      if (struct.isSetDbId()) {
        oprot.writeI64(struct.db_id);
      }
      if (struct.isSetTxnInsert()) {
        oprot.writeBool(struct.txn_insert);
      }
      if (struct.isSetSubTxnInfos()) {
        {
          oprot.writeI32(struct.sub_txn_infos.size());
          for (TSubTxnInfo _iter419 : struct.sub_txn_infos)
          {
            _iter419.write(oprot);
          }
        }
      }
      if (struct.isSetOnlyCommit()) {
        oprot.writeBool(struct.only_commit);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TCommitTxnRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(15);
      if (incoming.get(0)) {
        struct.cluster = iprot.readString();
        struct.setClusterIsSet(true);
      }
      if (incoming.get(1)) {
        struct.user = iprot.readString();
        struct.setUserIsSet(true);
      }
      if (incoming.get(2)) {
        struct.passwd = iprot.readString();
        struct.setPasswdIsSet(true);
      }
      if (incoming.get(3)) {
        struct.db = iprot.readString();
        struct.setDbIsSet(true);
      }
      if (incoming.get(4)) {
        struct.user_ip = iprot.readString();
        struct.setUserIpIsSet(true);
      }
      if (incoming.get(5)) {
        struct.txn_id = iprot.readI64();
        struct.setTxnIdIsSet(true);
      }
      if (incoming.get(6)) {
        {
          org.apache.thrift.protocol.TList _list420 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.commit_infos = new java.util.ArrayList<org.apache.doris.thrift.TTabletCommitInfo>(_list420.size);
          @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TTabletCommitInfo _elem421;
          for (int _i422 = 0; _i422 < _list420.size; ++_i422)
          {
            _elem421 = new org.apache.doris.thrift.TTabletCommitInfo();
            _elem421.read(iprot);
            struct.commit_infos.add(_elem421);
          }
        }
        struct.setCommitInfosIsSet(true);
      }
      if (incoming.get(7)) {
        struct.auth_code = iprot.readI64();
        struct.setAuthCodeIsSet(true);
      }
      if (incoming.get(8)) {
        struct.txn_commit_attachment = new TTxnCommitAttachment();
        struct.txn_commit_attachment.read(iprot);
        struct.setTxnCommitAttachmentIsSet(true);
      }
      if (incoming.get(9)) {
        struct.thrift_rpc_timeout_ms = iprot.readI64();
        struct.setThriftRpcTimeoutMsIsSet(true);
      }
      if (incoming.get(10)) {
        struct.token = iprot.readString();
        struct.setTokenIsSet(true);
      }
      if (incoming.get(11)) {
        struct.db_id = iprot.readI64();
        struct.setDbIdIsSet(true);
      }
      if (incoming.get(12)) {
        struct.txn_insert = iprot.readBool();
        struct.setTxnInsertIsSet(true);
      }
      if (incoming.get(13)) {
        {
          org.apache.thrift.protocol.TList _list423 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.sub_txn_infos = new java.util.ArrayList<TSubTxnInfo>(_list423.size);
          @org.apache.thrift.annotation.Nullable TSubTxnInfo _elem424;
          for (int _i425 = 0; _i425 < _list423.size; ++_i425)
          {
            _elem424 = new TSubTxnInfo();
            _elem424.read(iprot);
            struct.sub_txn_infos.add(_elem424);
          }
        }
        struct.setSubTxnInfosIsSet(true);
      }
      if (incoming.get(14)) {
        struct.only_commit = iprot.readBool();
        struct.setOnlyCommitIsSet(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();
  }
}