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

  private static final org.apache.thrift.protocol.TField FRAGMENT_INSTANCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fragment_instance_id", org.apache.thrift.protocol.TType.STRUCT, (short)1);
  private static final org.apache.thrift.protocol.TField NUM_FINISHED_RANGE_FIELD_DESC = new org.apache.thrift.protocol.TField("num_finished_range", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField LOADED_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("loaded_rows", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField LOADED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("loaded_bytes", org.apache.thrift.protocol.TType.I64, (short)4);

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

  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TUniqueId fragment_instance_id; // optional
  public int num_finished_range; // optional
  public long loaded_rows; // optional
  public long loaded_bytes; // 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 {
    FRAGMENT_INSTANCE_ID((short)1, "fragment_instance_id"),
    NUM_FINISHED_RANGE((short)2, "num_finished_range"),
    LOADED_ROWS((short)3, "loaded_rows"),
    LOADED_BYTES((short)4, "loaded_bytes");

    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: // FRAGMENT_INSTANCE_ID
          return FRAGMENT_INSTANCE_ID;
        case 2: // NUM_FINISHED_RANGE
          return NUM_FINISHED_RANGE;
        case 3: // LOADED_ROWS
          return LOADED_ROWS;
        case 4: // LOADED_BYTES
          return LOADED_BYTES;
        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 __NUM_FINISHED_RANGE_ISSET_ID = 0;
  private static final int __LOADED_ROWS_ISSET_ID = 1;
  private static final int __LOADED_BYTES_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.FRAGMENT_INSTANCE_ID,_Fields.NUM_FINISHED_RANGE,_Fields.LOADED_ROWS,_Fields.LOADED_BYTES};
  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.FRAGMENT_INSTANCE_ID, new org.apache.thrift.meta_data.FieldMetaData("fragment_instance_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)));
    tmpMap.put(_Fields.NUM_FINISHED_RANGE, new org.apache.thrift.meta_data.FieldMetaData("num_finished_range", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.LOADED_ROWS, new org.apache.thrift.meta_data.FieldMetaData("loaded_rows", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LOADED_BYTES, new org.apache.thrift.meta_data.FieldMetaData("loaded_bytes", 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(TFragmentInstanceReport.class, metaDataMap);
  }

  public TFragmentInstanceReport() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TFragmentInstanceReport(TFragmentInstanceReport other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetFragmentInstanceId()) {
      this.fragment_instance_id = new org.apache.doris.thrift.TUniqueId(other.fragment_instance_id);
    }
    this.num_finished_range = other.num_finished_range;
    this.loaded_rows = other.loaded_rows;
    this.loaded_bytes = other.loaded_bytes;
  }

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

  @Override
  public void clear() {
    this.fragment_instance_id = null;
    setNumFinishedRangeIsSet(false);
    this.num_finished_range = 0;
    setLoadedRowsIsSet(false);
    this.loaded_rows = 0;
    setLoadedBytesIsSet(false);
    this.loaded_bytes = 0;
  }

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

  public TFragmentInstanceReport setFragmentInstanceId(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TUniqueId fragment_instance_id) {
    this.fragment_instance_id = fragment_instance_id;
    return this;
  }

  public void unsetFragmentInstanceId() {
    this.fragment_instance_id = null;
  }

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

  public void setFragmentInstanceIdIsSet(boolean value) {
    if (!value) {
      this.fragment_instance_id = null;
    }
  }

  public int getNumFinishedRange() {
    return this.num_finished_range;
  }

  public TFragmentInstanceReport setNumFinishedRange(int num_finished_range) {
    this.num_finished_range = num_finished_range;
    setNumFinishedRangeIsSet(true);
    return this;
  }

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

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

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

  public long getLoadedRows() {
    return this.loaded_rows;
  }

  public TFragmentInstanceReport setLoadedRows(long loaded_rows) {
    this.loaded_rows = loaded_rows;
    setLoadedRowsIsSet(true);
    return this;
  }

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

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

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

  public long getLoadedBytes() {
    return this.loaded_bytes;
  }

  public TFragmentInstanceReport setLoadedBytes(long loaded_bytes) {
    this.loaded_bytes = loaded_bytes;
    setLoadedBytesIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case FRAGMENT_INSTANCE_ID:
      if (value == null) {
        unsetFragmentInstanceId();
      } else {
        setFragmentInstanceId((org.apache.doris.thrift.TUniqueId)value);
      }
      break;

    case NUM_FINISHED_RANGE:
      if (value == null) {
        unsetNumFinishedRange();
      } else {
        setNumFinishedRange((java.lang.Integer)value);
      }
      break;

    case LOADED_ROWS:
      if (value == null) {
        unsetLoadedRows();
      } else {
        setLoadedRows((java.lang.Long)value);
      }
      break;

    case LOADED_BYTES:
      if (value == null) {
        unsetLoadedBytes();
      } else {
        setLoadedBytes((java.lang.Long)value);
      }
      break;

    }
  }

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

    case NUM_FINISHED_RANGE:
      return getNumFinishedRange();

    case LOADED_ROWS:
      return getLoadedRows();

    case LOADED_BYTES:
      return getLoadedBytes();

    }
    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 FRAGMENT_INSTANCE_ID:
      return isSetFragmentInstanceId();
    case NUM_FINISHED_RANGE:
      return isSetNumFinishedRange();
    case LOADED_ROWS:
      return isSetLoadedRows();
    case LOADED_BYTES:
      return isSetLoadedBytes();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_fragment_instance_id = true && this.isSetFragmentInstanceId();
    boolean that_present_fragment_instance_id = true && that.isSetFragmentInstanceId();
    if (this_present_fragment_instance_id || that_present_fragment_instance_id) {
      if (!(this_present_fragment_instance_id && that_present_fragment_instance_id))
        return false;
      if (!this.fragment_instance_id.equals(that.fragment_instance_id))
        return false;
    }

    boolean this_present_num_finished_range = true && this.isSetNumFinishedRange();
    boolean that_present_num_finished_range = true && that.isSetNumFinishedRange();
    if (this_present_num_finished_range || that_present_num_finished_range) {
      if (!(this_present_num_finished_range && that_present_num_finished_range))
        return false;
      if (this.num_finished_range != that.num_finished_range)
        return false;
    }

    boolean this_present_loaded_rows = true && this.isSetLoadedRows();
    boolean that_present_loaded_rows = true && that.isSetLoadedRows();
    if (this_present_loaded_rows || that_present_loaded_rows) {
      if (!(this_present_loaded_rows && that_present_loaded_rows))
        return false;
      if (this.loaded_rows != that.loaded_rows)
        return false;
    }

    boolean this_present_loaded_bytes = true && this.isSetLoadedBytes();
    boolean that_present_loaded_bytes = true && that.isSetLoadedBytes();
    if (this_present_loaded_bytes || that_present_loaded_bytes) {
      if (!(this_present_loaded_bytes && that_present_loaded_bytes))
        return false;
      if (this.loaded_bytes != that.loaded_bytes)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetFragmentInstanceId()) ? 131071 : 524287);
    if (isSetFragmentInstanceId())
      hashCode = hashCode * 8191 + fragment_instance_id.hashCode();

    hashCode = hashCode * 8191 + ((isSetNumFinishedRange()) ? 131071 : 524287);
    if (isSetNumFinishedRange())
      hashCode = hashCode * 8191 + num_finished_range;

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

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

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetFragmentInstanceId(), other.isSetFragmentInstanceId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFragmentInstanceId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fragment_instance_id, other.fragment_instance_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetNumFinishedRange(), other.isSetNumFinishedRange());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNumFinishedRange()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_finished_range, other.num_finished_range);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLoadedRows(), other.isSetLoadedRows());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLoadedRows()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loaded_rows, other.loaded_rows);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLoadedBytes(), other.isSetLoadedBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLoadedBytes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loaded_bytes, other.loaded_bytes);
      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("TFragmentInstanceReport(");
    boolean first = true;

    if (isSetFragmentInstanceId()) {
      sb.append("fragment_instance_id:");
      if (this.fragment_instance_id == null) {
        sb.append("null");
      } else {
        sb.append(this.fragment_instance_id);
      }
      first = false;
    }
    if (isSetNumFinishedRange()) {
      if (!first) sb.append(", ");
      sb.append("num_finished_range:");
      sb.append(this.num_finished_range);
      first = false;
    }
    if (isSetLoadedRows()) {
      if (!first) sb.append(", ");
      sb.append("loaded_rows:");
      sb.append(this.loaded_rows);
      first = false;
    }
    if (isSetLoadedBytes()) {
      if (!first) sb.append(", ");
      sb.append("loaded_bytes:");
      sb.append(this.loaded_bytes);
      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 (fragment_instance_id != null) {
      fragment_instance_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 TFragmentInstanceReportStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TFragmentInstanceReportStandardScheme getScheme() {
      return new TFragmentInstanceReportStandardScheme();
    }
  }

  private static class TFragmentInstanceReportStandardScheme extends org.apache.thrift.scheme.StandardScheme<TFragmentInstanceReport> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TFragmentInstanceReport 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: // FRAGMENT_INSTANCE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.fragment_instance_id = new org.apache.doris.thrift.TUniqueId();
              struct.fragment_instance_id.read(iprot);
              struct.setFragmentInstanceIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NUM_FINISHED_RANGE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.num_finished_range = iprot.readI32();
              struct.setNumFinishedRangeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LOADED_ROWS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.loaded_rows = iprot.readI64();
              struct.setLoadedRowsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // LOADED_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.loaded_bytes = iprot.readI64();
              struct.setLoadedBytesIsSet(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, TFragmentInstanceReport struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.fragment_instance_id != null) {
        if (struct.isSetFragmentInstanceId()) {
          oprot.writeFieldBegin(FRAGMENT_INSTANCE_ID_FIELD_DESC);
          struct.fragment_instance_id.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetNumFinishedRange()) {
        oprot.writeFieldBegin(NUM_FINISHED_RANGE_FIELD_DESC);
        oprot.writeI32(struct.num_finished_range);
        oprot.writeFieldEnd();
      }
      if (struct.isSetLoadedRows()) {
        oprot.writeFieldBegin(LOADED_ROWS_FIELD_DESC);
        oprot.writeI64(struct.loaded_rows);
        oprot.writeFieldEnd();
      }
      if (struct.isSetLoadedBytes()) {
        oprot.writeFieldBegin(LOADED_BYTES_FIELD_DESC);
        oprot.writeI64(struct.loaded_bytes);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TFragmentInstanceReportTupleScheme extends org.apache.thrift.scheme.TupleScheme<TFragmentInstanceReport> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TFragmentInstanceReport 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.isSetFragmentInstanceId()) {
        optionals.set(0);
      }
      if (struct.isSetNumFinishedRange()) {
        optionals.set(1);
      }
      if (struct.isSetLoadedRows()) {
        optionals.set(2);
      }
      if (struct.isSetLoadedBytes()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetFragmentInstanceId()) {
        struct.fragment_instance_id.write(oprot);
      }
      if (struct.isSetNumFinishedRange()) {
        oprot.writeI32(struct.num_finished_range);
      }
      if (struct.isSetLoadedRows()) {
        oprot.writeI64(struct.loaded_rows);
      }
      if (struct.isSetLoadedBytes()) {
        oprot.writeI64(struct.loaded_bytes);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TFragmentInstanceReport struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.fragment_instance_id = new org.apache.doris.thrift.TUniqueId();
        struct.fragment_instance_id.read(iprot);
        struct.setFragmentInstanceIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.num_finished_range = iprot.readI32();
        struct.setNumFinishedRangeIsSet(true);
      }
      if (incoming.get(2)) {
        struct.loaded_rows = iprot.readI64();
        struct.setLoadedRowsIsSet(true);
      }
      if (incoming.get(3)) {
        struct.loaded_bytes = iprot.readI64();
        struct.setLoadedBytesIsSet(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();
  }
}