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

  private static final org.apache.thrift.protocol.TField FILE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("file_type", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField EXPORT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("export_path", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField COLUMN_SEPARATOR_FIELD_DESC = new org.apache.thrift.protocol.TField("column_separator", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField LINE_DELIMITER_FIELD_DESC = new org.apache.thrift.protocol.TField("line_delimiter", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField BROKER_ADDRESSES_FIELD_DESC = new org.apache.thrift.protocol.TField("broker_addresses", org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)6);
  private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRING, (short)7);

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

  /**
   * 
   * @see org.apache.doris.thrift.TFileType
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileType file_type; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String export_path; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String column_separator; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String line_delimiter; // required
  public @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TNetworkAddress> broker_addresses; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> properties; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String header; // 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 {
    /**
     * 
     * @see org.apache.doris.thrift.TFileType
     */
    FILE_TYPE((short)1, "file_type"),
    EXPORT_PATH((short)2, "export_path"),
    COLUMN_SEPARATOR((short)3, "column_separator"),
    LINE_DELIMITER((short)4, "line_delimiter"),
    BROKER_ADDRESSES((short)5, "broker_addresses"),
    PROPERTIES((short)6, "properties"),
    HEADER((short)7, "header");

    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: // FILE_TYPE
          return FILE_TYPE;
        case 2: // EXPORT_PATH
          return EXPORT_PATH;
        case 3: // COLUMN_SEPARATOR
          return COLUMN_SEPARATOR;
        case 4: // LINE_DELIMITER
          return LINE_DELIMITER;
        case 5: // BROKER_ADDRESSES
          return BROKER_ADDRESSES;
        case 6: // PROPERTIES
          return PROPERTIES;
        case 7: // HEADER
          return HEADER;
        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 _Fields optionals[] = {_Fields.BROKER_ADDRESSES,_Fields.PROPERTIES,_Fields.HEADER};
  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.FILE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("file_type", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TFileType.class)));
    tmpMap.put(_Fields.EXPORT_PATH, new org.apache.thrift.meta_data.FieldMetaData("export_path", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.COLUMN_SEPARATOR, new org.apache.thrift.meta_data.FieldMetaData("column_separator", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.LINE_DELIMITER, new org.apache.thrift.meta_data.FieldMetaData("line_delimiter", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.BROKER_ADDRESSES, new org.apache.thrift.meta_data.FieldMetaData("broker_addresses", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TNetworkAddress.class))));
    tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExportSink.class, metaDataMap);
  }

  public TExportSink() {
  }

  public TExportSink(
    org.apache.doris.thrift.TFileType file_type,
    java.lang.String export_path,
    java.lang.String column_separator,
    java.lang.String line_delimiter)
  {
    this();
    this.file_type = file_type;
    this.export_path = export_path;
    this.column_separator = column_separator;
    this.line_delimiter = line_delimiter;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TExportSink(TExportSink other) {
    if (other.isSetFileType()) {
      this.file_type = other.file_type;
    }
    if (other.isSetExportPath()) {
      this.export_path = other.export_path;
    }
    if (other.isSetColumnSeparator()) {
      this.column_separator = other.column_separator;
    }
    if (other.isSetLineDelimiter()) {
      this.line_delimiter = other.line_delimiter;
    }
    if (other.isSetBrokerAddresses()) {
      java.util.List<org.apache.doris.thrift.TNetworkAddress> __this__broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(other.broker_addresses.size());
      for (org.apache.doris.thrift.TNetworkAddress other_element : other.broker_addresses) {
        __this__broker_addresses.add(new org.apache.doris.thrift.TNetworkAddress(other_element));
      }
      this.broker_addresses = __this__broker_addresses;
    }
    if (other.isSetProperties()) {
      java.util.Map<java.lang.String,java.lang.String> __this__properties = new java.util.HashMap<java.lang.String,java.lang.String>(other.properties);
      this.properties = __this__properties;
    }
    if (other.isSetHeader()) {
      this.header = other.header;
    }
  }

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

  @Override
  public void clear() {
    this.file_type = null;
    this.export_path = null;
    this.column_separator = null;
    this.line_delimiter = null;
    this.broker_addresses = null;
    this.properties = null;
    this.header = null;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileType
   */
  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TFileType getFileType() {
    return this.file_type;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileType
   */
  public TExportSink setFileType(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileType file_type) {
    this.file_type = file_type;
    return this;
  }

  public void unsetFileType() {
    this.file_type = null;
  }

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

  public void setFileTypeIsSet(boolean value) {
    if (!value) {
      this.file_type = null;
    }
  }

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

  public TExportSink setExportPath(@org.apache.thrift.annotation.Nullable java.lang.String export_path) {
    this.export_path = export_path;
    return this;
  }

  public void unsetExportPath() {
    this.export_path = null;
  }

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

  public void setExportPathIsSet(boolean value) {
    if (!value) {
      this.export_path = null;
    }
  }

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

  public TExportSink setColumnSeparator(@org.apache.thrift.annotation.Nullable java.lang.String column_separator) {
    this.column_separator = column_separator;
    return this;
  }

  public void unsetColumnSeparator() {
    this.column_separator = null;
  }

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

  public void setColumnSeparatorIsSet(boolean value) {
    if (!value) {
      this.column_separator = null;
    }
  }

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

  public TExportSink setLineDelimiter(@org.apache.thrift.annotation.Nullable java.lang.String line_delimiter) {
    this.line_delimiter = line_delimiter;
    return this;
  }

  public void unsetLineDelimiter() {
    this.line_delimiter = null;
  }

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

  public void setLineDelimiterIsSet(boolean value) {
    if (!value) {
      this.line_delimiter = null;
    }
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.util.List<org.apache.doris.thrift.TNetworkAddress> getBrokerAddresses() {
    return this.broker_addresses;
  }

  public TExportSink setBrokerAddresses(@org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TNetworkAddress> broker_addresses) {
    this.broker_addresses = broker_addresses;
    return this;
  }

  public void unsetBrokerAddresses() {
    this.broker_addresses = null;
  }

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

  public void setBrokerAddressesIsSet(boolean value) {
    if (!value) {
      this.broker_addresses = null;
    }
  }

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

  public void putToProperties(java.lang.String key, java.lang.String val) {
    if (this.properties == null) {
      this.properties = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.properties.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.String> getProperties() {
    return this.properties;
  }

  public TExportSink setProperties(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> properties) {
    this.properties = properties;
    return this;
  }

  public void unsetProperties() {
    this.properties = null;
  }

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

  public void setPropertiesIsSet(boolean value) {
    if (!value) {
      this.properties = null;
    }
  }

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

  public TExportSink setHeader(@org.apache.thrift.annotation.Nullable java.lang.String header) {
    this.header = header;
    return this;
  }

  public void unsetHeader() {
    this.header = null;
  }

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

  public void setHeaderIsSet(boolean value) {
    if (!value) {
      this.header = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case FILE_TYPE:
      if (value == null) {
        unsetFileType();
      } else {
        setFileType((org.apache.doris.thrift.TFileType)value);
      }
      break;

    case EXPORT_PATH:
      if (value == null) {
        unsetExportPath();
      } else {
        setExportPath((java.lang.String)value);
      }
      break;

    case COLUMN_SEPARATOR:
      if (value == null) {
        unsetColumnSeparator();
      } else {
        setColumnSeparator((java.lang.String)value);
      }
      break;

    case LINE_DELIMITER:
      if (value == null) {
        unsetLineDelimiter();
      } else {
        setLineDelimiter((java.lang.String)value);
      }
      break;

    case BROKER_ADDRESSES:
      if (value == null) {
        unsetBrokerAddresses();
      } else {
        setBrokerAddresses((java.util.List<org.apache.doris.thrift.TNetworkAddress>)value);
      }
      break;

    case PROPERTIES:
      if (value == null) {
        unsetProperties();
      } else {
        setProperties((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case HEADER:
      if (value == null) {
        unsetHeader();
      } else {
        setHeader((java.lang.String)value);
      }
      break;

    }
  }

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

    case EXPORT_PATH:
      return getExportPath();

    case COLUMN_SEPARATOR:
      return getColumnSeparator();

    case LINE_DELIMITER:
      return getLineDelimiter();

    case BROKER_ADDRESSES:
      return getBrokerAddresses();

    case PROPERTIES:
      return getProperties();

    case HEADER:
      return getHeader();

    }
    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 FILE_TYPE:
      return isSetFileType();
    case EXPORT_PATH:
      return isSetExportPath();
    case COLUMN_SEPARATOR:
      return isSetColumnSeparator();
    case LINE_DELIMITER:
      return isSetLineDelimiter();
    case BROKER_ADDRESSES:
      return isSetBrokerAddresses();
    case PROPERTIES:
      return isSetProperties();
    case HEADER:
      return isSetHeader();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_file_type = true && this.isSetFileType();
    boolean that_present_file_type = true && that.isSetFileType();
    if (this_present_file_type || that_present_file_type) {
      if (!(this_present_file_type && that_present_file_type))
        return false;
      if (!this.file_type.equals(that.file_type))
        return false;
    }

    boolean this_present_export_path = true && this.isSetExportPath();
    boolean that_present_export_path = true && that.isSetExportPath();
    if (this_present_export_path || that_present_export_path) {
      if (!(this_present_export_path && that_present_export_path))
        return false;
      if (!this.export_path.equals(that.export_path))
        return false;
    }

    boolean this_present_column_separator = true && this.isSetColumnSeparator();
    boolean that_present_column_separator = true && that.isSetColumnSeparator();
    if (this_present_column_separator || that_present_column_separator) {
      if (!(this_present_column_separator && that_present_column_separator))
        return false;
      if (!this.column_separator.equals(that.column_separator))
        return false;
    }

    boolean this_present_line_delimiter = true && this.isSetLineDelimiter();
    boolean that_present_line_delimiter = true && that.isSetLineDelimiter();
    if (this_present_line_delimiter || that_present_line_delimiter) {
      if (!(this_present_line_delimiter && that_present_line_delimiter))
        return false;
      if (!this.line_delimiter.equals(that.line_delimiter))
        return false;
    }

    boolean this_present_broker_addresses = true && this.isSetBrokerAddresses();
    boolean that_present_broker_addresses = true && that.isSetBrokerAddresses();
    if (this_present_broker_addresses || that_present_broker_addresses) {
      if (!(this_present_broker_addresses && that_present_broker_addresses))
        return false;
      if (!this.broker_addresses.equals(that.broker_addresses))
        return false;
    }

    boolean this_present_properties = true && this.isSetProperties();
    boolean that_present_properties = true && that.isSetProperties();
    if (this_present_properties || that_present_properties) {
      if (!(this_present_properties && that_present_properties))
        return false;
      if (!this.properties.equals(that.properties))
        return false;
    }

    boolean this_present_header = true && this.isSetHeader();
    boolean that_present_header = true && that.isSetHeader();
    if (this_present_header || that_present_header) {
      if (!(this_present_header && that_present_header))
        return false;
      if (!this.header.equals(that.header))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetFileType()) ? 131071 : 524287);
    if (isSetFileType())
      hashCode = hashCode * 8191 + file_type.getValue();

    hashCode = hashCode * 8191 + ((isSetExportPath()) ? 131071 : 524287);
    if (isSetExportPath())
      hashCode = hashCode * 8191 + export_path.hashCode();

    hashCode = hashCode * 8191 + ((isSetColumnSeparator()) ? 131071 : 524287);
    if (isSetColumnSeparator())
      hashCode = hashCode * 8191 + column_separator.hashCode();

    hashCode = hashCode * 8191 + ((isSetLineDelimiter()) ? 131071 : 524287);
    if (isSetLineDelimiter())
      hashCode = hashCode * 8191 + line_delimiter.hashCode();

    hashCode = hashCode * 8191 + ((isSetBrokerAddresses()) ? 131071 : 524287);
    if (isSetBrokerAddresses())
      hashCode = hashCode * 8191 + broker_addresses.hashCode();

    hashCode = hashCode * 8191 + ((isSetProperties()) ? 131071 : 524287);
    if (isSetProperties())
      hashCode = hashCode * 8191 + properties.hashCode();

    hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
    if (isSetHeader())
      hashCode = hashCode * 8191 + header.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetFileType(), other.isSetFileType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFileType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file_type, other.file_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetExportPath(), other.isSetExportPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExportPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.export_path, other.export_path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumnSeparator(), other.isSetColumnSeparator());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnSeparator()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_separator, other.column_separator);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLineDelimiter(), other.isSetLineDelimiter());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLineDelimiter()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.line_delimiter, other.line_delimiter);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBrokerAddresses(), other.isSetBrokerAddresses());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBrokerAddresses()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.broker_addresses, other.broker_addresses);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetProperties(), other.isSetProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProperties()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHeader()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
      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("TExportSink(");
    boolean first = true;

    sb.append("file_type:");
    if (this.file_type == null) {
      sb.append("null");
    } else {
      sb.append(this.file_type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("export_path:");
    if (this.export_path == null) {
      sb.append("null");
    } else {
      sb.append(this.export_path);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("column_separator:");
    if (this.column_separator == null) {
      sb.append("null");
    } else {
      sb.append(this.column_separator);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("line_delimiter:");
    if (this.line_delimiter == null) {
      sb.append("null");
    } else {
      sb.append(this.line_delimiter);
    }
    first = false;
    if (isSetBrokerAddresses()) {
      if (!first) sb.append(", ");
      sb.append("broker_addresses:");
      if (this.broker_addresses == null) {
        sb.append("null");
      } else {
        sb.append(this.broker_addresses);
      }
      first = false;
    }
    if (isSetProperties()) {
      if (!first) sb.append(", ");
      sb.append("properties:");
      if (this.properties == null) {
        sb.append("null");
      } else {
        sb.append(this.properties);
      }
      first = false;
    }
    if (isSetHeader()) {
      if (!first) sb.append(", ");
      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (file_type == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'file_type' was not present! Struct: " + toString());
    }
    if (export_path == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'export_path' was not present! Struct: " + toString());
    }
    if (column_separator == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_separator' was not present! Struct: " + toString());
    }
    if (line_delimiter == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'line_delimiter' 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 {
      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 TExportSinkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TExportSinkStandardScheme getScheme() {
      return new TExportSinkStandardScheme();
    }
  }

  private static class TExportSinkStandardScheme extends org.apache.thrift.scheme.StandardScheme<TExportSink> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TExportSink 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: // FILE_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.file_type = org.apache.doris.thrift.TFileType.findByValue(iprot.readI32());
              struct.setFileTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // EXPORT_PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.export_path = iprot.readString();
              struct.setExportPathIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // COLUMN_SEPARATOR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.column_separator = iprot.readString();
              struct.setColumnSeparatorIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // LINE_DELIMITER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.line_delimiter = iprot.readString();
              struct.setLineDelimiterIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // BROKER_ADDRESSES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list116 = iprot.readListBegin();
                struct.broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(_list116.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNetworkAddress _elem117;
                for (int _i118 = 0; _i118 < _list116.size; ++_i118)
                {
                  _elem117 = new org.apache.doris.thrift.TNetworkAddress();
                  _elem117.read(iprot);
                  struct.broker_addresses.add(_elem117);
                }
                iprot.readListEnd();
              }
              struct.setBrokerAddressesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // PROPERTIES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map119 = iprot.readMapBegin();
                struct.properties = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map119.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key120;
                @org.apache.thrift.annotation.Nullable java.lang.String _val121;
                for (int _i122 = 0; _i122 < _map119.size; ++_i122)
                {
                  _key120 = iprot.readString();
                  _val121 = iprot.readString();
                  struct.properties.put(_key120, _val121);
                }
                iprot.readMapEnd();
              }
              struct.setPropertiesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // HEADER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.header = iprot.readString();
              struct.setHeaderIsSet(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, TExportSink struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.file_type != null) {
        oprot.writeFieldBegin(FILE_TYPE_FIELD_DESC);
        oprot.writeI32(struct.file_type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.export_path != null) {
        oprot.writeFieldBegin(EXPORT_PATH_FIELD_DESC);
        oprot.writeString(struct.export_path);
        oprot.writeFieldEnd();
      }
      if (struct.column_separator != null) {
        oprot.writeFieldBegin(COLUMN_SEPARATOR_FIELD_DESC);
        oprot.writeString(struct.column_separator);
        oprot.writeFieldEnd();
      }
      if (struct.line_delimiter != null) {
        oprot.writeFieldBegin(LINE_DELIMITER_FIELD_DESC);
        oprot.writeString(struct.line_delimiter);
        oprot.writeFieldEnd();
      }
      if (struct.broker_addresses != null) {
        if (struct.isSetBrokerAddresses()) {
          oprot.writeFieldBegin(BROKER_ADDRESSES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.broker_addresses.size()));
            for (org.apache.doris.thrift.TNetworkAddress _iter123 : struct.broker_addresses)
            {
              _iter123.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.properties != null) {
        if (struct.isSetProperties()) {
          oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter124 : struct.properties.entrySet())
            {
              oprot.writeString(_iter124.getKey());
              oprot.writeString(_iter124.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.header != null) {
        if (struct.isSetHeader()) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          oprot.writeString(struct.header);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TExportSinkTupleScheme extends org.apache.thrift.scheme.TupleScheme<TExportSink> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TExportSink struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI32(struct.file_type.getValue());
      oprot.writeString(struct.export_path);
      oprot.writeString(struct.column_separator);
      oprot.writeString(struct.line_delimiter);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetBrokerAddresses()) {
        optionals.set(0);
      }
      if (struct.isSetProperties()) {
        optionals.set(1);
      }
      if (struct.isSetHeader()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetBrokerAddresses()) {
        {
          oprot.writeI32(struct.broker_addresses.size());
          for (org.apache.doris.thrift.TNetworkAddress _iter125 : struct.broker_addresses)
          {
            _iter125.write(oprot);
          }
        }
      }
      if (struct.isSetProperties()) {
        {
          oprot.writeI32(struct.properties.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter126 : struct.properties.entrySet())
          {
            oprot.writeString(_iter126.getKey());
            oprot.writeString(_iter126.getValue());
          }
        }
      }
      if (struct.isSetHeader()) {
        oprot.writeString(struct.header);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TExportSink struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.file_type = org.apache.doris.thrift.TFileType.findByValue(iprot.readI32());
      struct.setFileTypeIsSet(true);
      struct.export_path = iprot.readString();
      struct.setExportPathIsSet(true);
      struct.column_separator = iprot.readString();
      struct.setColumnSeparatorIsSet(true);
      struct.line_delimiter = iprot.readString();
      struct.setLineDelimiterIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list127 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(_list127.size);
          @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNetworkAddress _elem128;
          for (int _i129 = 0; _i129 < _list127.size; ++_i129)
          {
            _elem128 = new org.apache.doris.thrift.TNetworkAddress();
            _elem128.read(iprot);
            struct.broker_addresses.add(_elem128);
          }
        }
        struct.setBrokerAddressesIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TMap _map130 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.properties = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map130.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key131;
          @org.apache.thrift.annotation.Nullable java.lang.String _val132;
          for (int _i133 = 0; _i133 < _map130.size; ++_i133)
          {
            _key131 = iprot.readString();
            _val132 = iprot.readString();
            struct.properties.put(_key131, _val132);
          }
        }
        struct.setPropertiesIsSet(true);
      }
      if (incoming.get(2)) {
        struct.header = iprot.readString();
        struct.setHeaderIsSet(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();
  }
}