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

  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)1);
  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)2);
  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)3);
  private static final org.apache.thrift.protocol.TField PARTITION_VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("partitionValues", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField BE_ENDPOINT_FIELD_DESC = new org.apache.thrift.protocol.TField("be_endpoint", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField WRITE_SINGLE_REPLICA_FIELD_DESC = new org.apache.thrift.protocol.TField("write_single_replica", org.apache.thrift.protocol.TType.BOOL, (short)6);
  private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("query_id", org.apache.thrift.protocol.TType.STRUCT, (short)7);

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

  public long txn_id; // optional
  public long db_id; // optional
  public long table_id; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>> partitionValues; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String be_endpoint; // optional
  public boolean write_single_replica; // optional
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TUniqueId query_id; // 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 {
    TXN_ID((short)1, "txn_id"),
    DB_ID((short)2, "db_id"),
    TABLE_ID((short)3, "table_id"),
    PARTITION_VALUES((short)4, "partitionValues"),
    BE_ENDPOINT((short)5, "be_endpoint"),
    WRITE_SINGLE_REPLICA((short)6, "write_single_replica"),
    QUERY_ID((short)7, "query_id");

    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: // TXN_ID
          return TXN_ID;
        case 2: // DB_ID
          return DB_ID;
        case 3: // TABLE_ID
          return TABLE_ID;
        case 4: // PARTITION_VALUES
          return PARTITION_VALUES;
        case 5: // BE_ENDPOINT
          return BE_ENDPOINT;
        case 6: // WRITE_SINGLE_REPLICA
          return WRITE_SINGLE_REPLICA;
        case 7: // QUERY_ID
          return QUERY_ID;
        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 __DB_ID_ISSET_ID = 1;
  private static final int __TABLE_ID_ISSET_ID = 2;
  private static final int __WRITE_SINGLE_REPLICA_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.TXN_ID,_Fields.DB_ID,_Fields.TABLE_ID,_Fields.PARTITION_VALUES,_Fields.BE_ENDPOINT,_Fields.WRITE_SINGLE_REPLICA,_Fields.QUERY_ID};
  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.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.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.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.PARTITION_VALUES, new org.apache.thrift.meta_data.FieldMetaData("partitionValues", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            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.TNullableStringLiteral.class)))));
    tmpMap.put(_Fields.BE_ENDPOINT, new org.apache.thrift.meta_data.FieldMetaData("be_endpoint", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.WRITE_SINGLE_REPLICA, new org.apache.thrift.meta_data.FieldMetaData("write_single_replica", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("query_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TUniqueId.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCreatePartitionRequest.class, metaDataMap);
  }

  public TCreatePartitionRequest() {
    this.write_single_replica = false;

  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TCreatePartitionRequest(TCreatePartitionRequest other) {
    __isset_bitfield = other.__isset_bitfield;
    this.txn_id = other.txn_id;
    this.db_id = other.db_id;
    this.table_id = other.table_id;
    if (other.isSetPartitionValues()) {
      java.util.List<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>> __this__partitionValues = new java.util.ArrayList<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>>(other.partitionValues.size());
      for (java.util.List<org.apache.doris.thrift.TNullableStringLiteral> other_element : other.partitionValues) {
        java.util.List<org.apache.doris.thrift.TNullableStringLiteral> __this__partitionValues_copy = new java.util.ArrayList<org.apache.doris.thrift.TNullableStringLiteral>(other_element.size());
        for (org.apache.doris.thrift.TNullableStringLiteral other_element_element : other_element) {
          __this__partitionValues_copy.add(new org.apache.doris.thrift.TNullableStringLiteral(other_element_element));
        }
        __this__partitionValues.add(__this__partitionValues_copy);
      }
      this.partitionValues = __this__partitionValues;
    }
    if (other.isSetBeEndpoint()) {
      this.be_endpoint = other.be_endpoint;
    }
    this.write_single_replica = other.write_single_replica;
    if (other.isSetQueryId()) {
      this.query_id = new org.apache.doris.thrift.TUniqueId(other.query_id);
    }
  }

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

  @Override
  public void clear() {
    setTxnIdIsSet(false);
    this.txn_id = 0;
    setDbIdIsSet(false);
    this.db_id = 0;
    setTableIdIsSet(false);
    this.table_id = 0;
    this.partitionValues = null;
    this.be_endpoint = null;
    this.write_single_replica = false;

    this.query_id = null;
  }

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

  public TCreatePartitionRequest 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 long getDbId() {
    return this.db_id;
  }

  public TCreatePartitionRequest 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 long getTableId() {
    return this.table_id;
  }

  public TCreatePartitionRequest 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 getPartitionValuesSize() {
    return (this.partitionValues == null) ? 0 : this.partitionValues.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>> getPartitionValuesIterator() {
    return (this.partitionValues == null) ? null : this.partitionValues.iterator();
  }

  public void addToPartitionValues(java.util.List<org.apache.doris.thrift.TNullableStringLiteral> elem) {
    if (this.partitionValues == null) {
      this.partitionValues = new java.util.ArrayList<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>>();
    }
    this.partitionValues.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>> getPartitionValues() {
    return this.partitionValues;
  }

  public TCreatePartitionRequest setPartitionValues(@org.apache.thrift.annotation.Nullable java.util.List<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>> partitionValues) {
    this.partitionValues = partitionValues;
    return this;
  }

  public void unsetPartitionValues() {
    this.partitionValues = null;
  }

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

  public void setPartitionValuesIsSet(boolean value) {
    if (!value) {
      this.partitionValues = null;
    }
  }

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

  public TCreatePartitionRequest setBeEndpoint(@org.apache.thrift.annotation.Nullable java.lang.String be_endpoint) {
    this.be_endpoint = be_endpoint;
    return this;
  }

  public void unsetBeEndpoint() {
    this.be_endpoint = null;
  }

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

  public void setBeEndpointIsSet(boolean value) {
    if (!value) {
      this.be_endpoint = null;
    }
  }

  public boolean isWriteSingleReplica() {
    return this.write_single_replica;
  }

  public TCreatePartitionRequest setWriteSingleReplica(boolean write_single_replica) {
    this.write_single_replica = write_single_replica;
    setWriteSingleReplicaIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TUniqueId getQueryId() {
    return this.query_id;
  }

  public TCreatePartitionRequest setQueryId(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TUniqueId query_id) {
    this.query_id = query_id;
    return this;
  }

  public void unsetQueryId() {
    this.query_id = null;
  }

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

  public void setQueryIdIsSet(boolean value) {
    if (!value) {
      this.query_id = null;
    }
  }

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

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

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

    case PARTITION_VALUES:
      if (value == null) {
        unsetPartitionValues();
      } else {
        setPartitionValues((java.util.List<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>>)value);
      }
      break;

    case BE_ENDPOINT:
      if (value == null) {
        unsetBeEndpoint();
      } else {
        setBeEndpoint((java.lang.String)value);
      }
      break;

    case WRITE_SINGLE_REPLICA:
      if (value == null) {
        unsetWriteSingleReplica();
      } else {
        setWriteSingleReplica((java.lang.Boolean)value);
      }
      break;

    case QUERY_ID:
      if (value == null) {
        unsetQueryId();
      } else {
        setQueryId((org.apache.doris.thrift.TUniqueId)value);
      }
      break;

    }
  }

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

    case DB_ID:
      return getDbId();

    case TABLE_ID:
      return getTableId();

    case PARTITION_VALUES:
      return getPartitionValues();

    case BE_ENDPOINT:
      return getBeEndpoint();

    case WRITE_SINGLE_REPLICA:
      return isWriteSingleReplica();

    case QUERY_ID:
      return getQueryId();

    }
    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 TXN_ID:
      return isSetTxnId();
    case DB_ID:
      return isSetDbId();
    case TABLE_ID:
      return isSetTableId();
    case PARTITION_VALUES:
      return isSetPartitionValues();
    case BE_ENDPOINT:
      return isSetBeEndpoint();
    case WRITE_SINGLE_REPLICA:
      return isSetWriteSingleReplica();
    case QUERY_ID:
      return isSetQueryId();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    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_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_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_partitionValues = true && this.isSetPartitionValues();
    boolean that_present_partitionValues = true && that.isSetPartitionValues();
    if (this_present_partitionValues || that_present_partitionValues) {
      if (!(this_present_partitionValues && that_present_partitionValues))
        return false;
      if (!this.partitionValues.equals(that.partitionValues))
        return false;
    }

    boolean this_present_be_endpoint = true && this.isSetBeEndpoint();
    boolean that_present_be_endpoint = true && that.isSetBeEndpoint();
    if (this_present_be_endpoint || that_present_be_endpoint) {
      if (!(this_present_be_endpoint && that_present_be_endpoint))
        return false;
      if (!this.be_endpoint.equals(that.be_endpoint))
        return false;
    }

    boolean this_present_write_single_replica = true && this.isSetWriteSingleReplica();
    boolean that_present_write_single_replica = true && that.isSetWriteSingleReplica();
    if (this_present_write_single_replica || that_present_write_single_replica) {
      if (!(this_present_write_single_replica && that_present_write_single_replica))
        return false;
      if (this.write_single_replica != that.write_single_replica)
        return false;
    }

    boolean this_present_query_id = true && this.isSetQueryId();
    boolean that_present_query_id = true && that.isSetQueryId();
    if (this_present_query_id || that_present_query_id) {
      if (!(this_present_query_id && that_present_query_id))
        return false;
      if (!this.query_id.equals(that.query_id))
        return false;
    }

    return true;
  }

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

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

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

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

    hashCode = hashCode * 8191 + ((isSetPartitionValues()) ? 131071 : 524287);
    if (isSetPartitionValues())
      hashCode = hashCode * 8191 + partitionValues.hashCode();

    hashCode = hashCode * 8191 + ((isSetBeEndpoint()) ? 131071 : 524287);
    if (isSetBeEndpoint())
      hashCode = hashCode * 8191 + be_endpoint.hashCode();

    hashCode = hashCode * 8191 + ((isSetWriteSingleReplica()) ? 131071 : 524287);
    if (isSetWriteSingleReplica())
      hashCode = hashCode * 8191 + ((write_single_replica) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetQueryId()) ? 131071 : 524287);
    if (isSetQueryId())
      hashCode = hashCode * 8191 + query_id.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    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(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(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(isSetPartitionValues(), other.isSetPartitionValues());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionValues()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionValues, other.partitionValues);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBeEndpoint(), other.isSetBeEndpoint());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBeEndpoint()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.be_endpoint, other.be_endpoint);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetWriteSingleReplica(), other.isSetWriteSingleReplica());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWriteSingleReplica()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.write_single_replica, other.write_single_replica);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryId(), other.isSetQueryId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_id, other.query_id);
      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("TCreatePartitionRequest(");
    boolean first = true;

    if (isSetTxnId()) {
      sb.append("txn_id:");
      sb.append(this.txn_id);
      first = false;
    }
    if (isSetDbId()) {
      if (!first) sb.append(", ");
      sb.append("db_id:");
      sb.append(this.db_id);
      first = false;
    }
    if (isSetTableId()) {
      if (!first) sb.append(", ");
      sb.append("table_id:");
      sb.append(this.table_id);
      first = false;
    }
    if (isSetPartitionValues()) {
      if (!first) sb.append(", ");
      sb.append("partitionValues:");
      if (this.partitionValues == null) {
        sb.append("null");
      } else {
        sb.append(this.partitionValues);
      }
      first = false;
    }
    if (isSetBeEndpoint()) {
      if (!first) sb.append(", ");
      sb.append("be_endpoint:");
      if (this.be_endpoint == null) {
        sb.append("null");
      } else {
        sb.append(this.be_endpoint);
      }
      first = false;
    }
    if (isSetWriteSingleReplica()) {
      if (!first) sb.append(", ");
      sb.append("write_single_replica:");
      sb.append(this.write_single_replica);
      first = false;
    }
    if (isSetQueryId()) {
      if (!first) sb.append(", ");
      sb.append("query_id:");
      if (this.query_id == null) {
        sb.append("null");
      } else {
        sb.append(this.query_id);
      }
      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 (query_id != null) {
      query_id.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 TCreatePartitionRequestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TCreatePartitionRequestStandardScheme getScheme() {
      return new TCreatePartitionRequestStandardScheme();
    }
  }

  private static class TCreatePartitionRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<TCreatePartitionRequest> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TCreatePartitionRequest 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: // 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 2: // 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 3: // 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 4: // PARTITION_VALUES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list634 = iprot.readListBegin();
                struct.partitionValues = new java.util.ArrayList<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>>(_list634.size);
                @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TNullableStringLiteral> _elem635;
                for (int _i636 = 0; _i636 < _list634.size; ++_i636)
                {
                  {
                    org.apache.thrift.protocol.TList _list637 = iprot.readListBegin();
                    _elem635 = new java.util.ArrayList<org.apache.doris.thrift.TNullableStringLiteral>(_list637.size);
                    @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNullableStringLiteral _elem638;
                    for (int _i639 = 0; _i639 < _list637.size; ++_i639)
                    {
                      _elem638 = new org.apache.doris.thrift.TNullableStringLiteral();
                      _elem638.read(iprot);
                      _elem635.add(_elem638);
                    }
                    iprot.readListEnd();
                  }
                  struct.partitionValues.add(_elem635);
                }
                iprot.readListEnd();
              }
              struct.setPartitionValuesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // BE_ENDPOINT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.be_endpoint = iprot.readString();
              struct.setBeEndpointIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // WRITE_SINGLE_REPLICA
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.write_single_replica = iprot.readBool();
              struct.setWriteSingleReplicaIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // QUERY_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.query_id = new org.apache.doris.thrift.TUniqueId();
              struct.query_id.read(iprot);
              struct.setQueryIdIsSet(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, TCreatePartitionRequest struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetTxnId()) {
        oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
        oprot.writeI64(struct.txn_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDbId()) {
        oprot.writeFieldBegin(DB_ID_FIELD_DESC);
        oprot.writeI64(struct.db_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTableId()) {
        oprot.writeFieldBegin(TABLE_ID_FIELD_DESC);
        oprot.writeI64(struct.table_id);
        oprot.writeFieldEnd();
      }
      if (struct.partitionValues != null) {
        if (struct.isSetPartitionValues()) {
          oprot.writeFieldBegin(PARTITION_VALUES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.partitionValues.size()));
            for (java.util.List<org.apache.doris.thrift.TNullableStringLiteral> _iter640 : struct.partitionValues)
            {
              {
                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter640.size()));
                for (org.apache.doris.thrift.TNullableStringLiteral _iter641 : _iter640)
                {
                  _iter641.write(oprot);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.be_endpoint != null) {
        if (struct.isSetBeEndpoint()) {
          oprot.writeFieldBegin(BE_ENDPOINT_FIELD_DESC);
          oprot.writeString(struct.be_endpoint);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetWriteSingleReplica()) {
        oprot.writeFieldBegin(WRITE_SINGLE_REPLICA_FIELD_DESC);
        oprot.writeBool(struct.write_single_replica);
        oprot.writeFieldEnd();
      }
      if (struct.query_id != null) {
        if (struct.isSetQueryId()) {
          oprot.writeFieldBegin(QUERY_ID_FIELD_DESC);
          struct.query_id.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TCreatePartitionRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<TCreatePartitionRequest> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TCreatePartitionRequest 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.isSetTxnId()) {
        optionals.set(0);
      }
      if (struct.isSetDbId()) {
        optionals.set(1);
      }
      if (struct.isSetTableId()) {
        optionals.set(2);
      }
      if (struct.isSetPartitionValues()) {
        optionals.set(3);
      }
      if (struct.isSetBeEndpoint()) {
        optionals.set(4);
      }
      if (struct.isSetWriteSingleReplica()) {
        optionals.set(5);
      }
      if (struct.isSetQueryId()) {
        optionals.set(6);
      }
      oprot.writeBitSet(optionals, 7);
      if (struct.isSetTxnId()) {
        oprot.writeI64(struct.txn_id);
      }
      if (struct.isSetDbId()) {
        oprot.writeI64(struct.db_id);
      }
      if (struct.isSetTableId()) {
        oprot.writeI64(struct.table_id);
      }
      if (struct.isSetPartitionValues()) {
        {
          oprot.writeI32(struct.partitionValues.size());
          for (java.util.List<org.apache.doris.thrift.TNullableStringLiteral> _iter642 : struct.partitionValues)
          {
            {
              oprot.writeI32(_iter642.size());
              for (org.apache.doris.thrift.TNullableStringLiteral _iter643 : _iter642)
              {
                _iter643.write(oprot);
              }
            }
          }
        }
      }
      if (struct.isSetBeEndpoint()) {
        oprot.writeString(struct.be_endpoint);
      }
      if (struct.isSetWriteSingleReplica()) {
        oprot.writeBool(struct.write_single_replica);
      }
      if (struct.isSetQueryId()) {
        struct.query_id.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TCreatePartitionRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(7);
      if (incoming.get(0)) {
        struct.txn_id = iprot.readI64();
        struct.setTxnIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.db_id = iprot.readI64();
        struct.setDbIdIsSet(true);
      }
      if (incoming.get(2)) {
        struct.table_id = iprot.readI64();
        struct.setTableIdIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list644 = iprot.readListBegin(org.apache.thrift.protocol.TType.LIST);
          struct.partitionValues = new java.util.ArrayList<java.util.List<org.apache.doris.thrift.TNullableStringLiteral>>(_list644.size);
          @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TNullableStringLiteral> _elem645;
          for (int _i646 = 0; _i646 < _list644.size; ++_i646)
          {
            {
              org.apache.thrift.protocol.TList _list647 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
              _elem645 = new java.util.ArrayList<org.apache.doris.thrift.TNullableStringLiteral>(_list647.size);
              @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNullableStringLiteral _elem648;
              for (int _i649 = 0; _i649 < _list647.size; ++_i649)
              {
                _elem648 = new org.apache.doris.thrift.TNullableStringLiteral();
                _elem648.read(iprot);
                _elem645.add(_elem648);
              }
            }
            struct.partitionValues.add(_elem645);
          }
        }
        struct.setPartitionValuesIsSet(true);
      }
      if (incoming.get(4)) {
        struct.be_endpoint = iprot.readString();
        struct.setBeEndpointIsSet(true);
      }
      if (incoming.get(5)) {
        struct.write_single_replica = iprot.readBool();
        struct.setWriteSingleReplicaIsSet(true);
      }
      if (incoming.get(6)) {
        struct.query_id = new org.apache.doris.thrift.TUniqueId();
        struct.query_id.read(iprot);
        struct.setQueryIdIsSet(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();
  }
}