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

  private static final org.apache.thrift.protocol.TField DB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dbId", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField TABLE_VERSION_INFOS_FIELD_DESC = new org.apache.thrift.protocol.TField("tableVersionInfos", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField PARTITION_VERSION_INFOS_FIELD_DESC = new org.apache.thrift.protocol.TField("partitionVersionInfos", org.apache.thrift.protocol.TType.LIST, (short)3);

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

  public long dbId; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TCloudVersionInfo> tableVersionInfos; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TCloudVersionInfo> partitionVersionInfos; // 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 {
    DB_ID((short)1, "dbId"),
    TABLE_VERSION_INFOS((short)2, "tableVersionInfos"),
    PARTITION_VERSION_INFOS((short)3, "partitionVersionInfos");

    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: // DB_ID
          return DB_ID;
        case 2: // TABLE_VERSION_INFOS
          return TABLE_VERSION_INFOS;
        case 3: // PARTITION_VERSION_INFOS
          return PARTITION_VERSION_INFOS;
        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 __DBID_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.DB_ID,_Fields.TABLE_VERSION_INFOS,_Fields.PARTITION_VERSION_INFOS};
  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.DB_ID, new org.apache.thrift.meta_data.FieldMetaData("dbId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TABLE_VERSION_INFOS, new org.apache.thrift.meta_data.FieldMetaData("tableVersionInfos", 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, TCloudVersionInfo.class))));
    tmpMap.put(_Fields.PARTITION_VERSION_INFOS, new org.apache.thrift.meta_data.FieldMetaData("partitionVersionInfos", 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, TCloudVersionInfo.class))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFrontendSyncCloudVersionRequest.class, metaDataMap);
  }

  public TFrontendSyncCloudVersionRequest() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TFrontendSyncCloudVersionRequest(TFrontendSyncCloudVersionRequest other) {
    __isset_bitfield = other.__isset_bitfield;
    this.dbId = other.dbId;
    if (other.isSetTableVersionInfos()) {
      java.util.List<TCloudVersionInfo> __this__tableVersionInfos = new java.util.ArrayList<TCloudVersionInfo>(other.tableVersionInfos.size());
      for (TCloudVersionInfo other_element : other.tableVersionInfos) {
        __this__tableVersionInfos.add(new TCloudVersionInfo(other_element));
      }
      this.tableVersionInfos = __this__tableVersionInfos;
    }
    if (other.isSetPartitionVersionInfos()) {
      java.util.List<TCloudVersionInfo> __this__partitionVersionInfos = new java.util.ArrayList<TCloudVersionInfo>(other.partitionVersionInfos.size());
      for (TCloudVersionInfo other_element : other.partitionVersionInfos) {
        __this__partitionVersionInfos.add(new TCloudVersionInfo(other_element));
      }
      this.partitionVersionInfos = __this__partitionVersionInfos;
    }
  }

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

  @Override
  public void clear() {
    setDbIdIsSet(false);
    this.dbId = 0;
    this.tableVersionInfos = null;
    this.partitionVersionInfos = null;
  }

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

  public TFrontendSyncCloudVersionRequest setDbId(long dbId) {
    this.dbId = dbId;
    setDbIdIsSet(true);
    return this;
  }

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

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

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

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

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

  public void addToTableVersionInfos(TCloudVersionInfo elem) {
    if (this.tableVersionInfos == null) {
      this.tableVersionInfos = new java.util.ArrayList<TCloudVersionInfo>();
    }
    this.tableVersionInfos.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TCloudVersionInfo> getTableVersionInfos() {
    return this.tableVersionInfos;
  }

  public TFrontendSyncCloudVersionRequest setTableVersionInfos(@org.apache.thrift.annotation.Nullable java.util.List<TCloudVersionInfo> tableVersionInfos) {
    this.tableVersionInfos = tableVersionInfos;
    return this;
  }

  public void unsetTableVersionInfos() {
    this.tableVersionInfos = null;
  }

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

  public void setTableVersionInfosIsSet(boolean value) {
    if (!value) {
      this.tableVersionInfos = null;
    }
  }

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

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

  public void addToPartitionVersionInfos(TCloudVersionInfo elem) {
    if (this.partitionVersionInfos == null) {
      this.partitionVersionInfos = new java.util.ArrayList<TCloudVersionInfo>();
    }
    this.partitionVersionInfos.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TCloudVersionInfo> getPartitionVersionInfos() {
    return this.partitionVersionInfos;
  }

  public TFrontendSyncCloudVersionRequest setPartitionVersionInfos(@org.apache.thrift.annotation.Nullable java.util.List<TCloudVersionInfo> partitionVersionInfos) {
    this.partitionVersionInfos = partitionVersionInfos;
    return this;
  }

  public void unsetPartitionVersionInfos() {
    this.partitionVersionInfos = null;
  }

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

  public void setPartitionVersionInfosIsSet(boolean value) {
    if (!value) {
      this.partitionVersionInfos = null;
    }
  }

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

    case TABLE_VERSION_INFOS:
      if (value == null) {
        unsetTableVersionInfos();
      } else {
        setTableVersionInfos((java.util.List<TCloudVersionInfo>)value);
      }
      break;

    case PARTITION_VERSION_INFOS:
      if (value == null) {
        unsetPartitionVersionInfos();
      } else {
        setPartitionVersionInfos((java.util.List<TCloudVersionInfo>)value);
      }
      break;

    }
  }

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

    case TABLE_VERSION_INFOS:
      return getTableVersionInfos();

    case PARTITION_VERSION_INFOS:
      return getPartitionVersionInfos();

    }
    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 DB_ID:
      return isSetDbId();
    case TABLE_VERSION_INFOS:
      return isSetTableVersionInfos();
    case PARTITION_VERSION_INFOS:
      return isSetPartitionVersionInfos();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_dbId = true && this.isSetDbId();
    boolean that_present_dbId = true && that.isSetDbId();
    if (this_present_dbId || that_present_dbId) {
      if (!(this_present_dbId && that_present_dbId))
        return false;
      if (this.dbId != that.dbId)
        return false;
    }

    boolean this_present_tableVersionInfos = true && this.isSetTableVersionInfos();
    boolean that_present_tableVersionInfos = true && that.isSetTableVersionInfos();
    if (this_present_tableVersionInfos || that_present_tableVersionInfos) {
      if (!(this_present_tableVersionInfos && that_present_tableVersionInfos))
        return false;
      if (!this.tableVersionInfos.equals(that.tableVersionInfos))
        return false;
    }

    boolean this_present_partitionVersionInfos = true && this.isSetPartitionVersionInfos();
    boolean that_present_partitionVersionInfos = true && that.isSetPartitionVersionInfos();
    if (this_present_partitionVersionInfos || that_present_partitionVersionInfos) {
      if (!(this_present_partitionVersionInfos && that_present_partitionVersionInfos))
        return false;
      if (!this.partitionVersionInfos.equals(that.partitionVersionInfos))
        return false;
    }

    return true;
  }

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

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

    hashCode = hashCode * 8191 + ((isSetTableVersionInfos()) ? 131071 : 524287);
    if (isSetTableVersionInfos())
      hashCode = hashCode * 8191 + tableVersionInfos.hashCode();

    hashCode = hashCode * 8191 + ((isSetPartitionVersionInfos()) ? 131071 : 524287);
    if (isSetPartitionVersionInfos())
      hashCode = hashCode * 8191 + partitionVersionInfos.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetDbId(), other.isSetDbId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDbId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dbId, other.dbId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTableVersionInfos(), other.isSetTableVersionInfos());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableVersionInfos()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableVersionInfos, other.tableVersionInfos);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPartitionVersionInfos(), other.isSetPartitionVersionInfos());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionVersionInfos()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionVersionInfos, other.partitionVersionInfos);
      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("TFrontendSyncCloudVersionRequest(");
    boolean first = true;

    if (isSetDbId()) {
      sb.append("dbId:");
      sb.append(this.dbId);
      first = false;
    }
    if (isSetTableVersionInfos()) {
      if (!first) sb.append(", ");
      sb.append("tableVersionInfos:");
      if (this.tableVersionInfos == null) {
        sb.append("null");
      } else {
        sb.append(this.tableVersionInfos);
      }
      first = false;
    }
    if (isSetPartitionVersionInfos()) {
      if (!first) sb.append(", ");
      sb.append("partitionVersionInfos:");
      if (this.partitionVersionInfos == null) {
        sb.append("null");
      } else {
        sb.append(this.partitionVersionInfos);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

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

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

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

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

  private static class TFrontendSyncCloudVersionRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<TFrontendSyncCloudVersionRequest> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TFrontendSyncCloudVersionRequest 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: // DB_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.dbId = iprot.readI64();
              struct.setDbIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TABLE_VERSION_INFOS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list434 = iprot.readListBegin();
                struct.tableVersionInfos = new java.util.ArrayList<TCloudVersionInfo>(_list434.size);
                @org.apache.thrift.annotation.Nullable TCloudVersionInfo _elem435;
                for (int _i436 = 0; _i436 < _list434.size; ++_i436)
                {
                  _elem435 = new TCloudVersionInfo();
                  _elem435.read(iprot);
                  struct.tableVersionInfos.add(_elem435);
                }
                iprot.readListEnd();
              }
              struct.setTableVersionInfosIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PARTITION_VERSION_INFOS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list437 = iprot.readListBegin();
                struct.partitionVersionInfos = new java.util.ArrayList<TCloudVersionInfo>(_list437.size);
                @org.apache.thrift.annotation.Nullable TCloudVersionInfo _elem438;
                for (int _i439 = 0; _i439 < _list437.size; ++_i439)
                {
                  _elem438 = new TCloudVersionInfo();
                  _elem438.read(iprot);
                  struct.partitionVersionInfos.add(_elem438);
                }
                iprot.readListEnd();
              }
              struct.setPartitionVersionInfosIsSet(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, TFrontendSyncCloudVersionRequest struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetDbId()) {
        oprot.writeFieldBegin(DB_ID_FIELD_DESC);
        oprot.writeI64(struct.dbId);
        oprot.writeFieldEnd();
      }
      if (struct.tableVersionInfos != null) {
        if (struct.isSetTableVersionInfos()) {
          oprot.writeFieldBegin(TABLE_VERSION_INFOS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tableVersionInfos.size()));
            for (TCloudVersionInfo _iter440 : struct.tableVersionInfos)
            {
              _iter440.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.partitionVersionInfos != null) {
        if (struct.isSetPartitionVersionInfos()) {
          oprot.writeFieldBegin(PARTITION_VERSION_INFOS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.partitionVersionInfos.size()));
            for (TCloudVersionInfo _iter441 : struct.partitionVersionInfos)
            {
              _iter441.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TFrontendSyncCloudVersionRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<TFrontendSyncCloudVersionRequest> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TFrontendSyncCloudVersionRequest 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.isSetDbId()) {
        optionals.set(0);
      }
      if (struct.isSetTableVersionInfos()) {
        optionals.set(1);
      }
      if (struct.isSetPartitionVersionInfos()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetDbId()) {
        oprot.writeI64(struct.dbId);
      }
      if (struct.isSetTableVersionInfos()) {
        {
          oprot.writeI32(struct.tableVersionInfos.size());
          for (TCloudVersionInfo _iter442 : struct.tableVersionInfos)
          {
            _iter442.write(oprot);
          }
        }
      }
      if (struct.isSetPartitionVersionInfos()) {
        {
          oprot.writeI32(struct.partitionVersionInfos.size());
          for (TCloudVersionInfo _iter443 : struct.partitionVersionInfos)
          {
            _iter443.write(oprot);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TFrontendSyncCloudVersionRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        struct.dbId = iprot.readI64();
        struct.setDbIdIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list444 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.tableVersionInfos = new java.util.ArrayList<TCloudVersionInfo>(_list444.size);
          @org.apache.thrift.annotation.Nullable TCloudVersionInfo _elem445;
          for (int _i446 = 0; _i446 < _list444.size; ++_i446)
          {
            _elem445 = new TCloudVersionInfo();
            _elem445.read(iprot);
            struct.tableVersionInfos.add(_elem445);
          }
        }
        struct.setTableVersionInfosIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list447 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.partitionVersionInfos = new java.util.ArrayList<TCloudVersionInfo>(_list447.size);
          @org.apache.thrift.annotation.Nullable TCloudVersionInfo _elem448;
          for (int _i449 = 0; _i449 < _list447.size; ++_i449)
          {
            _elem448 = new TCloudVersionInfo();
            _elem448.read(iprot);
            struct.partitionVersionInfos.add(_elem448);
          }
        }
        struct.setPartitionVersionInfosIsSet(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();
  }
}