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

  private static final org.apache.thrift.protocol.TField TABLET_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tablet_id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField SCHEMA_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_hash", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField SRC_BACKENDS_FIELD_DESC = new org.apache.thrift.protocol.TField("src_backends", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField STORAGE_MEDIUM_FIELD_DESC = new org.apache.thrift.protocol.TField("storage_medium", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField COMMITTED_VERSION_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("committed_version_hash", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField TASK_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("task_version", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField SRC_PATH_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("src_path_hash", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField DEST_PATH_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("dest_path_hash", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField TIMEOUT_S_FIELD_DESC = new org.apache.thrift.protocol.TField("timeout_s", org.apache.thrift.protocol.TType.I32, (short)10);
  private static final org.apache.thrift.protocol.TField REPLICA_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("replica_id", org.apache.thrift.protocol.TType.I64, (short)11);
  private static final org.apache.thrift.protocol.TField PARTITION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("partition_id", org.apache.thrift.protocol.TType.I64, (short)12);
  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)13);

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

  public long tablet_id; // required
  public int schema_hash; // required
  public @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TBackend> src_backends; // required
  /**
   * 
   * @see org.apache.doris.thrift.TStorageMedium
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStorageMedium storage_medium; // optional
  public long version; // optional
  public long committed_version_hash; // optional
  public int task_version; // optional
  public long src_path_hash; // optional
  public long dest_path_hash; // optional
  public int timeout_s; // optional
  public long replica_id; // optional
  public long partition_id; // optional
  public long table_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 {
    TABLET_ID((short)1, "tablet_id"),
    SCHEMA_HASH((short)2, "schema_hash"),
    SRC_BACKENDS((short)3, "src_backends"),
    /**
     * 
     * @see org.apache.doris.thrift.TStorageMedium
     */
    STORAGE_MEDIUM((short)4, "storage_medium"),
    VERSION((short)5, "version"),
    COMMITTED_VERSION_HASH((short)6, "committed_version_hash"),
    TASK_VERSION((short)7, "task_version"),
    SRC_PATH_HASH((short)8, "src_path_hash"),
    DEST_PATH_HASH((short)9, "dest_path_hash"),
    TIMEOUT_S((short)10, "timeout_s"),
    REPLICA_ID((short)11, "replica_id"),
    PARTITION_ID((short)12, "partition_id"),
    TABLE_ID((short)13, "table_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: // TABLET_ID
          return TABLET_ID;
        case 2: // SCHEMA_HASH
          return SCHEMA_HASH;
        case 3: // SRC_BACKENDS
          return SRC_BACKENDS;
        case 4: // STORAGE_MEDIUM
          return STORAGE_MEDIUM;
        case 5: // VERSION
          return VERSION;
        case 6: // COMMITTED_VERSION_HASH
          return COMMITTED_VERSION_HASH;
        case 7: // TASK_VERSION
          return TASK_VERSION;
        case 8: // SRC_PATH_HASH
          return SRC_PATH_HASH;
        case 9: // DEST_PATH_HASH
          return DEST_PATH_HASH;
        case 10: // TIMEOUT_S
          return TIMEOUT_S;
        case 11: // REPLICA_ID
          return REPLICA_ID;
        case 12: // PARTITION_ID
          return PARTITION_ID;
        case 13: // TABLE_ID
          return TABLE_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 __TABLET_ID_ISSET_ID = 0;
  private static final int __SCHEMA_HASH_ISSET_ID = 1;
  private static final int __VERSION_ISSET_ID = 2;
  private static final int __COMMITTED_VERSION_HASH_ISSET_ID = 3;
  private static final int __TASK_VERSION_ISSET_ID = 4;
  private static final int __SRC_PATH_HASH_ISSET_ID = 5;
  private static final int __DEST_PATH_HASH_ISSET_ID = 6;
  private static final int __TIMEOUT_S_ISSET_ID = 7;
  private static final int __REPLICA_ID_ISSET_ID = 8;
  private static final int __PARTITION_ID_ISSET_ID = 9;
  private static final int __TABLE_ID_ISSET_ID = 10;
  private short __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.STORAGE_MEDIUM,_Fields.VERSION,_Fields.COMMITTED_VERSION_HASH,_Fields.TASK_VERSION,_Fields.SRC_PATH_HASH,_Fields.DEST_PATH_HASH,_Fields.TIMEOUT_S,_Fields.REPLICA_ID,_Fields.PARTITION_ID,_Fields.TABLE_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.TABLET_ID, new org.apache.thrift.meta_data.FieldMetaData("tablet_id", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TTabletId")));
    tmpMap.put(_Fields.SCHEMA_HASH, new org.apache.thrift.meta_data.FieldMetaData("schema_hash", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "TSchemaHash")));
    tmpMap.put(_Fields.SRC_BACKENDS, new org.apache.thrift.meta_data.FieldMetaData("src_backends", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        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.TBackend.class))));
    tmpMap.put(_Fields.STORAGE_MEDIUM, new org.apache.thrift.meta_data.FieldMetaData("storage_medium", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TStorageMedium.class)));
    tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TVersion")));
    tmpMap.put(_Fields.COMMITTED_VERSION_HASH, new org.apache.thrift.meta_data.FieldMetaData("committed_version_hash", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TVersionHash")));
    tmpMap.put(_Fields.TASK_VERSION, new org.apache.thrift.meta_data.FieldMetaData("task_version", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SRC_PATH_HASH, new org.apache.thrift.meta_data.FieldMetaData("src_path_hash", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DEST_PATH_HASH, new org.apache.thrift.meta_data.FieldMetaData("dest_path_hash", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TIMEOUT_S, new org.apache.thrift.meta_data.FieldMetaData("timeout_s", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.REPLICA_ID, new org.apache.thrift.meta_data.FieldMetaData("replica_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TReplicaId")));
    tmpMap.put(_Fields.PARTITION_ID, new org.apache.thrift.meta_data.FieldMetaData("partition_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)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloneReq.class, metaDataMap);
  }

  public TCloneReq() {
    this.replica_id = 0L;

    this.table_id = -1L;

  }

  public TCloneReq(
    long tablet_id,
    int schema_hash,
    java.util.List<org.apache.doris.thrift.TBackend> src_backends)
  {
    this();
    this.tablet_id = tablet_id;
    setTabletIdIsSet(true);
    this.schema_hash = schema_hash;
    setSchemaHashIsSet(true);
    this.src_backends = src_backends;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TCloneReq(TCloneReq other) {
    __isset_bitfield = other.__isset_bitfield;
    this.tablet_id = other.tablet_id;
    this.schema_hash = other.schema_hash;
    if (other.isSetSrcBackends()) {
      java.util.List<org.apache.doris.thrift.TBackend> __this__src_backends = new java.util.ArrayList<org.apache.doris.thrift.TBackend>(other.src_backends.size());
      for (org.apache.doris.thrift.TBackend other_element : other.src_backends) {
        __this__src_backends.add(new org.apache.doris.thrift.TBackend(other_element));
      }
      this.src_backends = __this__src_backends;
    }
    if (other.isSetStorageMedium()) {
      this.storage_medium = other.storage_medium;
    }
    this.version = other.version;
    this.committed_version_hash = other.committed_version_hash;
    this.task_version = other.task_version;
    this.src_path_hash = other.src_path_hash;
    this.dest_path_hash = other.dest_path_hash;
    this.timeout_s = other.timeout_s;
    this.replica_id = other.replica_id;
    this.partition_id = other.partition_id;
    this.table_id = other.table_id;
  }

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

  @Override
  public void clear() {
    setTabletIdIsSet(false);
    this.tablet_id = 0;
    setSchemaHashIsSet(false);
    this.schema_hash = 0;
    this.src_backends = null;
    this.storage_medium = null;
    setVersionIsSet(false);
    this.version = 0;
    setCommittedVersionHashIsSet(false);
    this.committed_version_hash = 0;
    setTaskVersionIsSet(false);
    this.task_version = 0;
    setSrcPathHashIsSet(false);
    this.src_path_hash = 0;
    setDestPathHashIsSet(false);
    this.dest_path_hash = 0;
    setTimeoutSIsSet(false);
    this.timeout_s = 0;
    this.replica_id = 0L;

    setPartitionIdIsSet(false);
    this.partition_id = 0;
    this.table_id = -1L;

  }

  public long getTabletId() {
    return this.tablet_id;
  }

  public TCloneReq setTabletId(long tablet_id) {
    this.tablet_id = tablet_id;
    setTabletIdIsSet(true);
    return this;
  }

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

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

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

  public int getSchemaHash() {
    return this.schema_hash;
  }

  public TCloneReq setSchemaHash(int schema_hash) {
    this.schema_hash = schema_hash;
    setSchemaHashIsSet(true);
    return this;
  }

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

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

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

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.util.List<org.apache.doris.thrift.TBackend> getSrcBackends() {
    return this.src_backends;
  }

  public TCloneReq setSrcBackends(@org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TBackend> src_backends) {
    this.src_backends = src_backends;
    return this;
  }

  public void unsetSrcBackends() {
    this.src_backends = null;
  }

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

  public void setSrcBackendsIsSet(boolean value) {
    if (!value) {
      this.src_backends = null;
    }
  }

  /**
   * 
   * @see org.apache.doris.thrift.TStorageMedium
   */
  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TStorageMedium getStorageMedium() {
    return this.storage_medium;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TStorageMedium
   */
  public TCloneReq setStorageMedium(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStorageMedium storage_medium) {
    this.storage_medium = storage_medium;
    return this;
  }

  public void unsetStorageMedium() {
    this.storage_medium = null;
  }

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

  public void setStorageMediumIsSet(boolean value) {
    if (!value) {
      this.storage_medium = null;
    }
  }

  public long getVersion() {
    return this.version;
  }

  public TCloneReq setVersion(long version) {
    this.version = version;
    setVersionIsSet(true);
    return this;
  }

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

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

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

  public long getCommittedVersionHash() {
    return this.committed_version_hash;
  }

  public TCloneReq setCommittedVersionHash(long committed_version_hash) {
    this.committed_version_hash = committed_version_hash;
    setCommittedVersionHashIsSet(true);
    return this;
  }

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

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

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

  public int getTaskVersion() {
    return this.task_version;
  }

  public TCloneReq setTaskVersion(int task_version) {
    this.task_version = task_version;
    setTaskVersionIsSet(true);
    return this;
  }

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

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

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

  public long getSrcPathHash() {
    return this.src_path_hash;
  }

  public TCloneReq setSrcPathHash(long src_path_hash) {
    this.src_path_hash = src_path_hash;
    setSrcPathHashIsSet(true);
    return this;
  }

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

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

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

  public long getDestPathHash() {
    return this.dest_path_hash;
  }

  public TCloneReq setDestPathHash(long dest_path_hash) {
    this.dest_path_hash = dest_path_hash;
    setDestPathHashIsSet(true);
    return this;
  }

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

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

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

  public int getTimeoutS() {
    return this.timeout_s;
  }

  public TCloneReq setTimeoutS(int timeout_s) {
    this.timeout_s = timeout_s;
    setTimeoutSIsSet(true);
    return this;
  }

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

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

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

  public long getReplicaId() {
    return this.replica_id;
  }

  public TCloneReq setReplicaId(long replica_id) {
    this.replica_id = replica_id;
    setReplicaIdIsSet(true);
    return this;
  }

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

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

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

  public long getPartitionId() {
    return this.partition_id;
  }

  public TCloneReq setPartitionId(long partition_id) {
    this.partition_id = partition_id;
    setPartitionIdIsSet(true);
    return this;
  }

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

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

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

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

  public TCloneReq 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case TABLET_ID:
      if (value == null) {
        unsetTabletId();
      } else {
        setTabletId((java.lang.Long)value);
      }
      break;

    case SCHEMA_HASH:
      if (value == null) {
        unsetSchemaHash();
      } else {
        setSchemaHash((java.lang.Integer)value);
      }
      break;

    case SRC_BACKENDS:
      if (value == null) {
        unsetSrcBackends();
      } else {
        setSrcBackends((java.util.List<org.apache.doris.thrift.TBackend>)value);
      }
      break;

    case STORAGE_MEDIUM:
      if (value == null) {
        unsetStorageMedium();
      } else {
        setStorageMedium((org.apache.doris.thrift.TStorageMedium)value);
      }
      break;

    case VERSION:
      if (value == null) {
        unsetVersion();
      } else {
        setVersion((java.lang.Long)value);
      }
      break;

    case COMMITTED_VERSION_HASH:
      if (value == null) {
        unsetCommittedVersionHash();
      } else {
        setCommittedVersionHash((java.lang.Long)value);
      }
      break;

    case TASK_VERSION:
      if (value == null) {
        unsetTaskVersion();
      } else {
        setTaskVersion((java.lang.Integer)value);
      }
      break;

    case SRC_PATH_HASH:
      if (value == null) {
        unsetSrcPathHash();
      } else {
        setSrcPathHash((java.lang.Long)value);
      }
      break;

    case DEST_PATH_HASH:
      if (value == null) {
        unsetDestPathHash();
      } else {
        setDestPathHash((java.lang.Long)value);
      }
      break;

    case TIMEOUT_S:
      if (value == null) {
        unsetTimeoutS();
      } else {
        setTimeoutS((java.lang.Integer)value);
      }
      break;

    case REPLICA_ID:
      if (value == null) {
        unsetReplicaId();
      } else {
        setReplicaId((java.lang.Long)value);
      }
      break;

    case PARTITION_ID:
      if (value == null) {
        unsetPartitionId();
      } else {
        setPartitionId((java.lang.Long)value);
      }
      break;

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

    }
  }

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

    case SCHEMA_HASH:
      return getSchemaHash();

    case SRC_BACKENDS:
      return getSrcBackends();

    case STORAGE_MEDIUM:
      return getStorageMedium();

    case VERSION:
      return getVersion();

    case COMMITTED_VERSION_HASH:
      return getCommittedVersionHash();

    case TASK_VERSION:
      return getTaskVersion();

    case SRC_PATH_HASH:
      return getSrcPathHash();

    case DEST_PATH_HASH:
      return getDestPathHash();

    case TIMEOUT_S:
      return getTimeoutS();

    case REPLICA_ID:
      return getReplicaId();

    case PARTITION_ID:
      return getPartitionId();

    case TABLE_ID:
      return getTableId();

    }
    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 TABLET_ID:
      return isSetTabletId();
    case SCHEMA_HASH:
      return isSetSchemaHash();
    case SRC_BACKENDS:
      return isSetSrcBackends();
    case STORAGE_MEDIUM:
      return isSetStorageMedium();
    case VERSION:
      return isSetVersion();
    case COMMITTED_VERSION_HASH:
      return isSetCommittedVersionHash();
    case TASK_VERSION:
      return isSetTaskVersion();
    case SRC_PATH_HASH:
      return isSetSrcPathHash();
    case DEST_PATH_HASH:
      return isSetDestPathHash();
    case TIMEOUT_S:
      return isSetTimeoutS();
    case REPLICA_ID:
      return isSetReplicaId();
    case PARTITION_ID:
      return isSetPartitionId();
    case TABLE_ID:
      return isSetTableId();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_tablet_id = true;
    boolean that_present_tablet_id = true;
    if (this_present_tablet_id || that_present_tablet_id) {
      if (!(this_present_tablet_id && that_present_tablet_id))
        return false;
      if (this.tablet_id != that.tablet_id)
        return false;
    }

    boolean this_present_schema_hash = true;
    boolean that_present_schema_hash = true;
    if (this_present_schema_hash || that_present_schema_hash) {
      if (!(this_present_schema_hash && that_present_schema_hash))
        return false;
      if (this.schema_hash != that.schema_hash)
        return false;
    }

    boolean this_present_src_backends = true && this.isSetSrcBackends();
    boolean that_present_src_backends = true && that.isSetSrcBackends();
    if (this_present_src_backends || that_present_src_backends) {
      if (!(this_present_src_backends && that_present_src_backends))
        return false;
      if (!this.src_backends.equals(that.src_backends))
        return false;
    }

    boolean this_present_storage_medium = true && this.isSetStorageMedium();
    boolean that_present_storage_medium = true && that.isSetStorageMedium();
    if (this_present_storage_medium || that_present_storage_medium) {
      if (!(this_present_storage_medium && that_present_storage_medium))
        return false;
      if (!this.storage_medium.equals(that.storage_medium))
        return false;
    }

    boolean this_present_version = true && this.isSetVersion();
    boolean that_present_version = true && that.isSetVersion();
    if (this_present_version || that_present_version) {
      if (!(this_present_version && that_present_version))
        return false;
      if (this.version != that.version)
        return false;
    }

    boolean this_present_committed_version_hash = true && this.isSetCommittedVersionHash();
    boolean that_present_committed_version_hash = true && that.isSetCommittedVersionHash();
    if (this_present_committed_version_hash || that_present_committed_version_hash) {
      if (!(this_present_committed_version_hash && that_present_committed_version_hash))
        return false;
      if (this.committed_version_hash != that.committed_version_hash)
        return false;
    }

    boolean this_present_task_version = true && this.isSetTaskVersion();
    boolean that_present_task_version = true && that.isSetTaskVersion();
    if (this_present_task_version || that_present_task_version) {
      if (!(this_present_task_version && that_present_task_version))
        return false;
      if (this.task_version != that.task_version)
        return false;
    }

    boolean this_present_src_path_hash = true && this.isSetSrcPathHash();
    boolean that_present_src_path_hash = true && that.isSetSrcPathHash();
    if (this_present_src_path_hash || that_present_src_path_hash) {
      if (!(this_present_src_path_hash && that_present_src_path_hash))
        return false;
      if (this.src_path_hash != that.src_path_hash)
        return false;
    }

    boolean this_present_dest_path_hash = true && this.isSetDestPathHash();
    boolean that_present_dest_path_hash = true && that.isSetDestPathHash();
    if (this_present_dest_path_hash || that_present_dest_path_hash) {
      if (!(this_present_dest_path_hash && that_present_dest_path_hash))
        return false;
      if (this.dest_path_hash != that.dest_path_hash)
        return false;
    }

    boolean this_present_timeout_s = true && this.isSetTimeoutS();
    boolean that_present_timeout_s = true && that.isSetTimeoutS();
    if (this_present_timeout_s || that_present_timeout_s) {
      if (!(this_present_timeout_s && that_present_timeout_s))
        return false;
      if (this.timeout_s != that.timeout_s)
        return false;
    }

    boolean this_present_replica_id = true && this.isSetReplicaId();
    boolean that_present_replica_id = true && that.isSetReplicaId();
    if (this_present_replica_id || that_present_replica_id) {
      if (!(this_present_replica_id && that_present_replica_id))
        return false;
      if (this.replica_id != that.replica_id)
        return false;
    }

    boolean this_present_partition_id = true && this.isSetPartitionId();
    boolean that_present_partition_id = true && that.isSetPartitionId();
    if (this_present_partition_id || that_present_partition_id) {
      if (!(this_present_partition_id && that_present_partition_id))
        return false;
      if (this.partition_id != that.partition_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;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(tablet_id);

    hashCode = hashCode * 8191 + schema_hash;

    hashCode = hashCode * 8191 + ((isSetSrcBackends()) ? 131071 : 524287);
    if (isSetSrcBackends())
      hashCode = hashCode * 8191 + src_backends.hashCode();

    hashCode = hashCode * 8191 + ((isSetStorageMedium()) ? 131071 : 524287);
    if (isSetStorageMedium())
      hashCode = hashCode * 8191 + storage_medium.getValue();

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

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

    hashCode = hashCode * 8191 + ((isSetTaskVersion()) ? 131071 : 524287);
    if (isSetTaskVersion())
      hashCode = hashCode * 8191 + task_version;

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

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

    hashCode = hashCode * 8191 + ((isSetTimeoutS()) ? 131071 : 524287);
    if (isSetTimeoutS())
      hashCode = hashCode * 8191 + timeout_s;

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

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

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

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetTabletId(), other.isSetTabletId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTabletId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tablet_id, other.tablet_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSchemaHash(), other.isSetSchemaHash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaHash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_hash, other.schema_hash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSrcBackends(), other.isSetSrcBackends());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSrcBackends()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.src_backends, other.src_backends);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStorageMedium(), other.isSetStorageMedium());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStorageMedium()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storage_medium, other.storage_medium);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetVersion(), other.isSetVersion());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetVersion()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCommittedVersionHash(), other.isSetCommittedVersionHash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCommittedVersionHash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.committed_version_hash, other.committed_version_hash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTaskVersion(), other.isSetTaskVersion());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskVersion()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.task_version, other.task_version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSrcPathHash(), other.isSetSrcPathHash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSrcPathHash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.src_path_hash, other.src_path_hash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDestPathHash(), other.isSetDestPathHash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDestPathHash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dest_path_hash, other.dest_path_hash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTimeoutS(), other.isSetTimeoutS());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimeoutS()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeout_s, other.timeout_s);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetReplicaId(), other.isSetReplicaId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReplicaId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replica_id, other.replica_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPartitionId(), other.isSetPartitionId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partition_id, other.partition_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;
      }
    }
    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("TCloneReq(");
    boolean first = true;

    sb.append("tablet_id:");
    sb.append(this.tablet_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("schema_hash:");
    sb.append(this.schema_hash);
    first = false;
    if (!first) sb.append(", ");
    sb.append("src_backends:");
    if (this.src_backends == null) {
      sb.append("null");
    } else {
      sb.append(this.src_backends);
    }
    first = false;
    if (isSetStorageMedium()) {
      if (!first) sb.append(", ");
      sb.append("storage_medium:");
      if (this.storage_medium == null) {
        sb.append("null");
      } else {
        sb.append(this.storage_medium);
      }
      first = false;
    }
    if (isSetVersion()) {
      if (!first) sb.append(", ");
      sb.append("version:");
      sb.append(this.version);
      first = false;
    }
    if (isSetCommittedVersionHash()) {
      if (!first) sb.append(", ");
      sb.append("committed_version_hash:");
      sb.append(this.committed_version_hash);
      first = false;
    }
    if (isSetTaskVersion()) {
      if (!first) sb.append(", ");
      sb.append("task_version:");
      sb.append(this.task_version);
      first = false;
    }
    if (isSetSrcPathHash()) {
      if (!first) sb.append(", ");
      sb.append("src_path_hash:");
      sb.append(this.src_path_hash);
      first = false;
    }
    if (isSetDestPathHash()) {
      if (!first) sb.append(", ");
      sb.append("dest_path_hash:");
      sb.append(this.dest_path_hash);
      first = false;
    }
    if (isSetTimeoutS()) {
      if (!first) sb.append(", ");
      sb.append("timeout_s:");
      sb.append(this.timeout_s);
      first = false;
    }
    if (isSetReplicaId()) {
      if (!first) sb.append(", ");
      sb.append("replica_id:");
      sb.append(this.replica_id);
      first = false;
    }
    if (isSetPartitionId()) {
      if (!first) sb.append(", ");
      sb.append("partition_id:");
      sb.append(this.partition_id);
      first = false;
    }
    if (isSetTableId()) {
      if (!first) sb.append(", ");
      sb.append("table_id:");
      sb.append(this.table_id);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'tablet_id' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'schema_hash' because it's a primitive and you chose the non-beans generator.
    if (src_backends == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'src_backends' was not present! Struct: " + toString());
    }
    // 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 TCloneReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TCloneReqStandardScheme getScheme() {
      return new TCloneReqStandardScheme();
    }
  }

  private static class TCloneReqStandardScheme extends org.apache.thrift.scheme.StandardScheme<TCloneReq> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TCloneReq 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: // TABLET_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.tablet_id = iprot.readI64();
              struct.setTabletIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SCHEMA_HASH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.schema_hash = iprot.readI32();
              struct.setSchemaHashIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SRC_BACKENDS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list154 = iprot.readListBegin();
                struct.src_backends = new java.util.ArrayList<org.apache.doris.thrift.TBackend>(_list154.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TBackend _elem155;
                for (int _i156 = 0; _i156 < _list154.size; ++_i156)
                {
                  _elem155 = new org.apache.doris.thrift.TBackend();
                  _elem155.read(iprot);
                  struct.src_backends.add(_elem155);
                }
                iprot.readListEnd();
              }
              struct.setSrcBackendsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STORAGE_MEDIUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.storage_medium = org.apache.doris.thrift.TStorageMedium.findByValue(iprot.readI32());
              struct.setStorageMediumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // VERSION
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.version = iprot.readI64();
              struct.setVersionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // COMMITTED_VERSION_HASH
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.committed_version_hash = iprot.readI64();
              struct.setCommittedVersionHashIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // TASK_VERSION
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.task_version = iprot.readI32();
              struct.setTaskVersionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // SRC_PATH_HASH
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.src_path_hash = iprot.readI64();
              struct.setSrcPathHashIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // DEST_PATH_HASH
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.dest_path_hash = iprot.readI64();
              struct.setDestPathHashIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // TIMEOUT_S
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.timeout_s = iprot.readI32();
              struct.setTimeoutSIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // REPLICA_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.replica_id = iprot.readI64();
              struct.setReplicaIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // PARTITION_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.partition_id = iprot.readI64();
              struct.setPartitionIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // 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;
          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
      if (!struct.isSetTabletId()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'tablet_id' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetSchemaHash()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'schema_hash' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TABLET_ID_FIELD_DESC);
      oprot.writeI64(struct.tablet_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SCHEMA_HASH_FIELD_DESC);
      oprot.writeI32(struct.schema_hash);
      oprot.writeFieldEnd();
      if (struct.src_backends != null) {
        oprot.writeFieldBegin(SRC_BACKENDS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.src_backends.size()));
          for (org.apache.doris.thrift.TBackend _iter157 : struct.src_backends)
          {
            _iter157.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.storage_medium != null) {
        if (struct.isSetStorageMedium()) {
          oprot.writeFieldBegin(STORAGE_MEDIUM_FIELD_DESC);
          oprot.writeI32(struct.storage_medium.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetVersion()) {
        oprot.writeFieldBegin(VERSION_FIELD_DESC);
        oprot.writeI64(struct.version);
        oprot.writeFieldEnd();
      }
      if (struct.isSetCommittedVersionHash()) {
        oprot.writeFieldBegin(COMMITTED_VERSION_HASH_FIELD_DESC);
        oprot.writeI64(struct.committed_version_hash);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTaskVersion()) {
        oprot.writeFieldBegin(TASK_VERSION_FIELD_DESC);
        oprot.writeI32(struct.task_version);
        oprot.writeFieldEnd();
      }
      if (struct.isSetSrcPathHash()) {
        oprot.writeFieldBegin(SRC_PATH_HASH_FIELD_DESC);
        oprot.writeI64(struct.src_path_hash);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDestPathHash()) {
        oprot.writeFieldBegin(DEST_PATH_HASH_FIELD_DESC);
        oprot.writeI64(struct.dest_path_hash);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTimeoutS()) {
        oprot.writeFieldBegin(TIMEOUT_S_FIELD_DESC);
        oprot.writeI32(struct.timeout_s);
        oprot.writeFieldEnd();
      }
      if (struct.isSetReplicaId()) {
        oprot.writeFieldBegin(REPLICA_ID_FIELD_DESC);
        oprot.writeI64(struct.replica_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetPartitionId()) {
        oprot.writeFieldBegin(PARTITION_ID_FIELD_DESC);
        oprot.writeI64(struct.partition_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTableId()) {
        oprot.writeFieldBegin(TABLE_ID_FIELD_DESC);
        oprot.writeI64(struct.table_id);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TCloneReqTupleScheme extends org.apache.thrift.scheme.TupleScheme<TCloneReq> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TCloneReq struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.tablet_id);
      oprot.writeI32(struct.schema_hash);
      {
        oprot.writeI32(struct.src_backends.size());
        for (org.apache.doris.thrift.TBackend _iter158 : struct.src_backends)
        {
          _iter158.write(oprot);
        }
      }
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetStorageMedium()) {
        optionals.set(0);
      }
      if (struct.isSetVersion()) {
        optionals.set(1);
      }
      if (struct.isSetCommittedVersionHash()) {
        optionals.set(2);
      }
      if (struct.isSetTaskVersion()) {
        optionals.set(3);
      }
      if (struct.isSetSrcPathHash()) {
        optionals.set(4);
      }
      if (struct.isSetDestPathHash()) {
        optionals.set(5);
      }
      if (struct.isSetTimeoutS()) {
        optionals.set(6);
      }
      if (struct.isSetReplicaId()) {
        optionals.set(7);
      }
      if (struct.isSetPartitionId()) {
        optionals.set(8);
      }
      if (struct.isSetTableId()) {
        optionals.set(9);
      }
      oprot.writeBitSet(optionals, 10);
      if (struct.isSetStorageMedium()) {
        oprot.writeI32(struct.storage_medium.getValue());
      }
      if (struct.isSetVersion()) {
        oprot.writeI64(struct.version);
      }
      if (struct.isSetCommittedVersionHash()) {
        oprot.writeI64(struct.committed_version_hash);
      }
      if (struct.isSetTaskVersion()) {
        oprot.writeI32(struct.task_version);
      }
      if (struct.isSetSrcPathHash()) {
        oprot.writeI64(struct.src_path_hash);
      }
      if (struct.isSetDestPathHash()) {
        oprot.writeI64(struct.dest_path_hash);
      }
      if (struct.isSetTimeoutS()) {
        oprot.writeI32(struct.timeout_s);
      }
      if (struct.isSetReplicaId()) {
        oprot.writeI64(struct.replica_id);
      }
      if (struct.isSetPartitionId()) {
        oprot.writeI64(struct.partition_id);
      }
      if (struct.isSetTableId()) {
        oprot.writeI64(struct.table_id);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TCloneReq struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.tablet_id = iprot.readI64();
      struct.setTabletIdIsSet(true);
      struct.schema_hash = iprot.readI32();
      struct.setSchemaHashIsSet(true);
      {
        org.apache.thrift.protocol.TList _list159 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
        struct.src_backends = new java.util.ArrayList<org.apache.doris.thrift.TBackend>(_list159.size);
        @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TBackend _elem160;
        for (int _i161 = 0; _i161 < _list159.size; ++_i161)
        {
          _elem160 = new org.apache.doris.thrift.TBackend();
          _elem160.read(iprot);
          struct.src_backends.add(_elem160);
        }
      }
      struct.setSrcBackendsIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(10);
      if (incoming.get(0)) {
        struct.storage_medium = org.apache.doris.thrift.TStorageMedium.findByValue(iprot.readI32());
        struct.setStorageMediumIsSet(true);
      }
      if (incoming.get(1)) {
        struct.version = iprot.readI64();
        struct.setVersionIsSet(true);
      }
      if (incoming.get(2)) {
        struct.committed_version_hash = iprot.readI64();
        struct.setCommittedVersionHashIsSet(true);
      }
      if (incoming.get(3)) {
        struct.task_version = iprot.readI32();
        struct.setTaskVersionIsSet(true);
      }
      if (incoming.get(4)) {
        struct.src_path_hash = iprot.readI64();
        struct.setSrcPathHashIsSet(true);
      }
      if (incoming.get(5)) {
        struct.dest_path_hash = iprot.readI64();
        struct.setDestPathHashIsSet(true);
      }
      if (incoming.get(6)) {
        struct.timeout_s = iprot.readI32();
        struct.setTimeoutSIsSet(true);
      }
      if (incoming.get(7)) {
        struct.replica_id = iprot.readI64();
        struct.setReplicaIdIsSet(true);
      }
      if (incoming.get(8)) {
        struct.partition_id = iprot.readI64();
        struct.setPartitionIdIsSet(true);
      }
      if (incoming.get(9)) {
        struct.table_id = iprot.readI64();
        struct.setTableIdIsSet(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();
  }
}