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

  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 BUILD_HASH_TABLE_FOR_BROADCAST_JOIN_FIELD_DESC = new org.apache.thrift.protocol.TField("build_hash_table_for_broadcast_join", org.apache.thrift.protocol.TType.BOOL, (short)2);
  private static final org.apache.thrift.protocol.TField PER_NODE_SCAN_RANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("per_node_scan_ranges", org.apache.thrift.protocol.TType.MAP, (short)3);
  private static final org.apache.thrift.protocol.TField SENDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sender_id", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField RUNTIME_FILTER_PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("runtime_filter_params", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField BACKEND_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("backend_num", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField PER_NODE_SHARED_SCANS_FIELD_DESC = new org.apache.thrift.protocol.TField("per_node_shared_scans", org.apache.thrift.protocol.TType.MAP, (short)7);
  private static final org.apache.thrift.protocol.TField TOPN_FILTER_SOURCE_NODE_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("topn_filter_source_node_ids", org.apache.thrift.protocol.TType.LIST, (short)8);
  private static final org.apache.thrift.protocol.TField TOPN_FILTER_DESCS_FIELD_DESC = new org.apache.thrift.protocol.TField("topn_filter_descs", org.apache.thrift.protocol.TType.LIST, (short)9);

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

  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TUniqueId fragment_instance_id; // required
  public boolean build_hash_table_for_broadcast_join; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,java.util.List<TScanRangeParams>> per_node_scan_ranges; // required
  public int sender_id; // optional
  public @org.apache.thrift.annotation.Nullable TRuntimeFilterParams runtime_filter_params; // optional
  public int backend_num; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,java.lang.Boolean> per_node_shared_scans; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> topn_filter_source_node_ids; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TTopnFilterDesc> topn_filter_descs; // 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"),
    BUILD_HASH_TABLE_FOR_BROADCAST_JOIN((short)2, "build_hash_table_for_broadcast_join"),
    PER_NODE_SCAN_RANGES((short)3, "per_node_scan_ranges"),
    SENDER_ID((short)4, "sender_id"),
    RUNTIME_FILTER_PARAMS((short)5, "runtime_filter_params"),
    BACKEND_NUM((short)6, "backend_num"),
    PER_NODE_SHARED_SCANS((short)7, "per_node_shared_scans"),
    TOPN_FILTER_SOURCE_NODE_IDS((short)8, "topn_filter_source_node_ids"),
    TOPN_FILTER_DESCS((short)9, "topn_filter_descs");

    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: // BUILD_HASH_TABLE_FOR_BROADCAST_JOIN
          return BUILD_HASH_TABLE_FOR_BROADCAST_JOIN;
        case 3: // PER_NODE_SCAN_RANGES
          return PER_NODE_SCAN_RANGES;
        case 4: // SENDER_ID
          return SENDER_ID;
        case 5: // RUNTIME_FILTER_PARAMS
          return RUNTIME_FILTER_PARAMS;
        case 6: // BACKEND_NUM
          return BACKEND_NUM;
        case 7: // PER_NODE_SHARED_SCANS
          return PER_NODE_SHARED_SCANS;
        case 8: // TOPN_FILTER_SOURCE_NODE_IDS
          return TOPN_FILTER_SOURCE_NODE_IDS;
        case 9: // TOPN_FILTER_DESCS
          return TOPN_FILTER_DESCS;
        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 __BUILD_HASH_TABLE_FOR_BROADCAST_JOIN_ISSET_ID = 0;
  private static final int __SENDER_ID_ISSET_ID = 1;
  private static final int __BACKEND_NUM_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.BUILD_HASH_TABLE_FOR_BROADCAST_JOIN,_Fields.SENDER_ID,_Fields.RUNTIME_FILTER_PARAMS,_Fields.BACKEND_NUM,_Fields.PER_NODE_SHARED_SCANS,_Fields.TOPN_FILTER_SOURCE_NODE_IDS,_Fields.TOPN_FILTER_DESCS};
  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.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TUniqueId.class)));
    tmpMap.put(_Fields.BUILD_HASH_TABLE_FOR_BROADCAST_JOIN, new org.apache.thrift.meta_data.FieldMetaData("build_hash_table_for_broadcast_join", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.PER_NODE_SCAN_RANGES, new org.apache.thrift.meta_data.FieldMetaData("per_node_scan_ranges", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        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.I32            , "TPlanNodeId"), 
            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, TScanRangeParams.class)))));
    tmpMap.put(_Fields.SENDER_ID, new org.apache.thrift.meta_data.FieldMetaData("sender_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.RUNTIME_FILTER_PARAMS, new org.apache.thrift.meta_data.FieldMetaData("runtime_filter_params", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRuntimeFilterParams.class)));
    tmpMap.put(_Fields.BACKEND_NUM, new org.apache.thrift.meta_data.FieldMetaData("backend_num", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.PER_NODE_SHARED_SCANS, new org.apache.thrift.meta_data.FieldMetaData("per_node_shared_scans", 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.I32            , "TPlanNodeId"), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))));
    tmpMap.put(_Fields.TOPN_FILTER_SOURCE_NODE_IDS, new org.apache.thrift.meta_data.FieldMetaData("topn_filter_source_node_ids", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
    tmpMap.put(_Fields.TOPN_FILTER_DESCS, new org.apache.thrift.meta_data.FieldMetaData("topn_filter_descs", 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.TTopnFilterDesc.class))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPipelineInstanceParams.class, metaDataMap);
  }

  public TPipelineInstanceParams() {
    this.build_hash_table_for_broadcast_join = false;

  }

  public TPipelineInstanceParams(
    org.apache.doris.thrift.TUniqueId fragment_instance_id,
    java.util.Map<java.lang.Integer,java.util.List<TScanRangeParams>> per_node_scan_ranges)
  {
    this();
    this.fragment_instance_id = fragment_instance_id;
    this.per_node_scan_ranges = per_node_scan_ranges;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TPipelineInstanceParams(TPipelineInstanceParams other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetFragmentInstanceId()) {
      this.fragment_instance_id = new org.apache.doris.thrift.TUniqueId(other.fragment_instance_id);
    }
    this.build_hash_table_for_broadcast_join = other.build_hash_table_for_broadcast_join;
    if (other.isSetPerNodeScanRanges()) {
      java.util.Map<java.lang.Integer,java.util.List<TScanRangeParams>> __this__per_node_scan_ranges = new java.util.HashMap<java.lang.Integer,java.util.List<TScanRangeParams>>(other.per_node_scan_ranges.size());
      for (java.util.Map.Entry<java.lang.Integer, java.util.List<TScanRangeParams>> other_element : other.per_node_scan_ranges.entrySet()) {

        java.lang.Integer other_element_key = other_element.getKey();
        java.util.List<TScanRangeParams> other_element_value = other_element.getValue();

        java.lang.Integer __this__per_node_scan_ranges_copy_key = other_element_key;

        java.util.List<TScanRangeParams> __this__per_node_scan_ranges_copy_value = new java.util.ArrayList<TScanRangeParams>(other_element_value.size());
        for (TScanRangeParams other_element_value_element : other_element_value) {
          __this__per_node_scan_ranges_copy_value.add(new TScanRangeParams(other_element_value_element));
        }

        __this__per_node_scan_ranges.put(__this__per_node_scan_ranges_copy_key, __this__per_node_scan_ranges_copy_value);
      }
      this.per_node_scan_ranges = __this__per_node_scan_ranges;
    }
    this.sender_id = other.sender_id;
    if (other.isSetRuntimeFilterParams()) {
      this.runtime_filter_params = new TRuntimeFilterParams(other.runtime_filter_params);
    }
    this.backend_num = other.backend_num;
    if (other.isSetPerNodeSharedScans()) {
      java.util.Map<java.lang.Integer,java.lang.Boolean> __this__per_node_shared_scans = new java.util.HashMap<java.lang.Integer,java.lang.Boolean>(other.per_node_shared_scans.size());
      for (java.util.Map.Entry<java.lang.Integer, java.lang.Boolean> other_element : other.per_node_shared_scans.entrySet()) {

        java.lang.Integer other_element_key = other_element.getKey();
        java.lang.Boolean other_element_value = other_element.getValue();

        java.lang.Integer __this__per_node_shared_scans_copy_key = other_element_key;

        java.lang.Boolean __this__per_node_shared_scans_copy_value = other_element_value;

        __this__per_node_shared_scans.put(__this__per_node_shared_scans_copy_key, __this__per_node_shared_scans_copy_value);
      }
      this.per_node_shared_scans = __this__per_node_shared_scans;
    }
    if (other.isSetTopnFilterSourceNodeIds()) {
      java.util.List<java.lang.Integer> __this__topn_filter_source_node_ids = new java.util.ArrayList<java.lang.Integer>(other.topn_filter_source_node_ids);
      this.topn_filter_source_node_ids = __this__topn_filter_source_node_ids;
    }
    if (other.isSetTopnFilterDescs()) {
      java.util.List<org.apache.doris.thrift.TTopnFilterDesc> __this__topn_filter_descs = new java.util.ArrayList<org.apache.doris.thrift.TTopnFilterDesc>(other.topn_filter_descs.size());
      for (org.apache.doris.thrift.TTopnFilterDesc other_element : other.topn_filter_descs) {
        __this__topn_filter_descs.add(new org.apache.doris.thrift.TTopnFilterDesc(other_element));
      }
      this.topn_filter_descs = __this__topn_filter_descs;
    }
  }

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

  @Override
  public void clear() {
    this.fragment_instance_id = null;
    this.build_hash_table_for_broadcast_join = false;

    this.per_node_scan_ranges = null;
    setSenderIdIsSet(false);
    this.sender_id = 0;
    this.runtime_filter_params = null;
    setBackendNumIsSet(false);
    this.backend_num = 0;
    this.per_node_shared_scans = null;
    this.topn_filter_source_node_ids = null;
    this.topn_filter_descs = null;
  }

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

  public TPipelineInstanceParams 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 boolean isBuildHashTableForBroadcastJoin() {
    return this.build_hash_table_for_broadcast_join;
  }

  public TPipelineInstanceParams setBuildHashTableForBroadcastJoin(boolean build_hash_table_for_broadcast_join) {
    this.build_hash_table_for_broadcast_join = build_hash_table_for_broadcast_join;
    setBuildHashTableForBroadcastJoinIsSet(true);
    return this;
  }

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

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

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

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

  public void putToPerNodeScanRanges(int key, java.util.List<TScanRangeParams> val) {
    if (this.per_node_scan_ranges == null) {
      this.per_node_scan_ranges = new java.util.HashMap<java.lang.Integer,java.util.List<TScanRangeParams>>();
    }
    this.per_node_scan_ranges.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.Integer,java.util.List<TScanRangeParams>> getPerNodeScanRanges() {
    return this.per_node_scan_ranges;
  }

  public TPipelineInstanceParams setPerNodeScanRanges(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,java.util.List<TScanRangeParams>> per_node_scan_ranges) {
    this.per_node_scan_ranges = per_node_scan_ranges;
    return this;
  }

  public void unsetPerNodeScanRanges() {
    this.per_node_scan_ranges = null;
  }

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

  public void setPerNodeScanRangesIsSet(boolean value) {
    if (!value) {
      this.per_node_scan_ranges = null;
    }
  }

  public int getSenderId() {
    return this.sender_id;
  }

  public TPipelineInstanceParams setSenderId(int sender_id) {
    this.sender_id = sender_id;
    setSenderIdIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public TRuntimeFilterParams getRuntimeFilterParams() {
    return this.runtime_filter_params;
  }

  public TPipelineInstanceParams setRuntimeFilterParams(@org.apache.thrift.annotation.Nullable TRuntimeFilterParams runtime_filter_params) {
    this.runtime_filter_params = runtime_filter_params;
    return this;
  }

  public void unsetRuntimeFilterParams() {
    this.runtime_filter_params = null;
  }

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

  public void setRuntimeFilterParamsIsSet(boolean value) {
    if (!value) {
      this.runtime_filter_params = null;
    }
  }

  public int getBackendNum() {
    return this.backend_num;
  }

  public TPipelineInstanceParams setBackendNum(int backend_num) {
    this.backend_num = backend_num;
    setBackendNumIsSet(true);
    return this;
  }

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

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

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

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

  public void putToPerNodeSharedScans(int key, boolean val) {
    if (this.per_node_shared_scans == null) {
      this.per_node_shared_scans = new java.util.HashMap<java.lang.Integer,java.lang.Boolean>();
    }
    this.per_node_shared_scans.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.Integer,java.lang.Boolean> getPerNodeSharedScans() {
    return this.per_node_shared_scans;
  }

  public TPipelineInstanceParams setPerNodeSharedScans(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,java.lang.Boolean> per_node_shared_scans) {
    this.per_node_shared_scans = per_node_shared_scans;
    return this;
  }

  public void unsetPerNodeSharedScans() {
    this.per_node_shared_scans = null;
  }

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

  public void setPerNodeSharedScansIsSet(boolean value) {
    if (!value) {
      this.per_node_shared_scans = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<java.lang.Integer> getTopnFilterSourceNodeIdsIterator() {
    return (this.topn_filter_source_node_ids == null) ? null : this.topn_filter_source_node_ids.iterator();
  }

  public void addToTopnFilterSourceNodeIds(int elem) {
    if (this.topn_filter_source_node_ids == null) {
      this.topn_filter_source_node_ids = new java.util.ArrayList<java.lang.Integer>();
    }
    this.topn_filter_source_node_ids.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<java.lang.Integer> getTopnFilterSourceNodeIds() {
    return this.topn_filter_source_node_ids;
  }

  public TPipelineInstanceParams setTopnFilterSourceNodeIds(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> topn_filter_source_node_ids) {
    this.topn_filter_source_node_ids = topn_filter_source_node_ids;
    return this;
  }

  public void unsetTopnFilterSourceNodeIds() {
    this.topn_filter_source_node_ids = null;
  }

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

  public void setTopnFilterSourceNodeIdsIsSet(boolean value) {
    if (!value) {
      this.topn_filter_source_node_ids = null;
    }
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.util.List<org.apache.doris.thrift.TTopnFilterDesc> getTopnFilterDescs() {
    return this.topn_filter_descs;
  }

  public TPipelineInstanceParams setTopnFilterDescs(@org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TTopnFilterDesc> topn_filter_descs) {
    this.topn_filter_descs = topn_filter_descs;
    return this;
  }

  public void unsetTopnFilterDescs() {
    this.topn_filter_descs = null;
  }

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

  public void setTopnFilterDescsIsSet(boolean value) {
    if (!value) {
      this.topn_filter_descs = null;
    }
  }

  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 BUILD_HASH_TABLE_FOR_BROADCAST_JOIN:
      if (value == null) {
        unsetBuildHashTableForBroadcastJoin();
      } else {
        setBuildHashTableForBroadcastJoin((java.lang.Boolean)value);
      }
      break;

    case PER_NODE_SCAN_RANGES:
      if (value == null) {
        unsetPerNodeScanRanges();
      } else {
        setPerNodeScanRanges((java.util.Map<java.lang.Integer,java.util.List<TScanRangeParams>>)value);
      }
      break;

    case SENDER_ID:
      if (value == null) {
        unsetSenderId();
      } else {
        setSenderId((java.lang.Integer)value);
      }
      break;

    case RUNTIME_FILTER_PARAMS:
      if (value == null) {
        unsetRuntimeFilterParams();
      } else {
        setRuntimeFilterParams((TRuntimeFilterParams)value);
      }
      break;

    case BACKEND_NUM:
      if (value == null) {
        unsetBackendNum();
      } else {
        setBackendNum((java.lang.Integer)value);
      }
      break;

    case PER_NODE_SHARED_SCANS:
      if (value == null) {
        unsetPerNodeSharedScans();
      } else {
        setPerNodeSharedScans((java.util.Map<java.lang.Integer,java.lang.Boolean>)value);
      }
      break;

    case TOPN_FILTER_SOURCE_NODE_IDS:
      if (value == null) {
        unsetTopnFilterSourceNodeIds();
      } else {
        setTopnFilterSourceNodeIds((java.util.List<java.lang.Integer>)value);
      }
      break;

    case TOPN_FILTER_DESCS:
      if (value == null) {
        unsetTopnFilterDescs();
      } else {
        setTopnFilterDescs((java.util.List<org.apache.doris.thrift.TTopnFilterDesc>)value);
      }
      break;

    }
  }

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

    case BUILD_HASH_TABLE_FOR_BROADCAST_JOIN:
      return isBuildHashTableForBroadcastJoin();

    case PER_NODE_SCAN_RANGES:
      return getPerNodeScanRanges();

    case SENDER_ID:
      return getSenderId();

    case RUNTIME_FILTER_PARAMS:
      return getRuntimeFilterParams();

    case BACKEND_NUM:
      return getBackendNum();

    case PER_NODE_SHARED_SCANS:
      return getPerNodeSharedScans();

    case TOPN_FILTER_SOURCE_NODE_IDS:
      return getTopnFilterSourceNodeIds();

    case TOPN_FILTER_DESCS:
      return getTopnFilterDescs();

    }
    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 BUILD_HASH_TABLE_FOR_BROADCAST_JOIN:
      return isSetBuildHashTableForBroadcastJoin();
    case PER_NODE_SCAN_RANGES:
      return isSetPerNodeScanRanges();
    case SENDER_ID:
      return isSetSenderId();
    case RUNTIME_FILTER_PARAMS:
      return isSetRuntimeFilterParams();
    case BACKEND_NUM:
      return isSetBackendNum();
    case PER_NODE_SHARED_SCANS:
      return isSetPerNodeSharedScans();
    case TOPN_FILTER_SOURCE_NODE_IDS:
      return isSetTopnFilterSourceNodeIds();
    case TOPN_FILTER_DESCS:
      return isSetTopnFilterDescs();
    }
    throw new java.lang.IllegalStateException();
  }

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

  public boolean equals(TPipelineInstanceParams 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_build_hash_table_for_broadcast_join = true && this.isSetBuildHashTableForBroadcastJoin();
    boolean that_present_build_hash_table_for_broadcast_join = true && that.isSetBuildHashTableForBroadcastJoin();
    if (this_present_build_hash_table_for_broadcast_join || that_present_build_hash_table_for_broadcast_join) {
      if (!(this_present_build_hash_table_for_broadcast_join && that_present_build_hash_table_for_broadcast_join))
        return false;
      if (this.build_hash_table_for_broadcast_join != that.build_hash_table_for_broadcast_join)
        return false;
    }

    boolean this_present_per_node_scan_ranges = true && this.isSetPerNodeScanRanges();
    boolean that_present_per_node_scan_ranges = true && that.isSetPerNodeScanRanges();
    if (this_present_per_node_scan_ranges || that_present_per_node_scan_ranges) {
      if (!(this_present_per_node_scan_ranges && that_present_per_node_scan_ranges))
        return false;
      if (!this.per_node_scan_ranges.equals(that.per_node_scan_ranges))
        return false;
    }

    boolean this_present_sender_id = true && this.isSetSenderId();
    boolean that_present_sender_id = true && that.isSetSenderId();
    if (this_present_sender_id || that_present_sender_id) {
      if (!(this_present_sender_id && that_present_sender_id))
        return false;
      if (this.sender_id != that.sender_id)
        return false;
    }

    boolean this_present_runtime_filter_params = true && this.isSetRuntimeFilterParams();
    boolean that_present_runtime_filter_params = true && that.isSetRuntimeFilterParams();
    if (this_present_runtime_filter_params || that_present_runtime_filter_params) {
      if (!(this_present_runtime_filter_params && that_present_runtime_filter_params))
        return false;
      if (!this.runtime_filter_params.equals(that.runtime_filter_params))
        return false;
    }

    boolean this_present_backend_num = true && this.isSetBackendNum();
    boolean that_present_backend_num = true && that.isSetBackendNum();
    if (this_present_backend_num || that_present_backend_num) {
      if (!(this_present_backend_num && that_present_backend_num))
        return false;
      if (this.backend_num != that.backend_num)
        return false;
    }

    boolean this_present_per_node_shared_scans = true && this.isSetPerNodeSharedScans();
    boolean that_present_per_node_shared_scans = true && that.isSetPerNodeSharedScans();
    if (this_present_per_node_shared_scans || that_present_per_node_shared_scans) {
      if (!(this_present_per_node_shared_scans && that_present_per_node_shared_scans))
        return false;
      if (!this.per_node_shared_scans.equals(that.per_node_shared_scans))
        return false;
    }

    boolean this_present_topn_filter_source_node_ids = true && this.isSetTopnFilterSourceNodeIds();
    boolean that_present_topn_filter_source_node_ids = true && that.isSetTopnFilterSourceNodeIds();
    if (this_present_topn_filter_source_node_ids || that_present_topn_filter_source_node_ids) {
      if (!(this_present_topn_filter_source_node_ids && that_present_topn_filter_source_node_ids))
        return false;
      if (!this.topn_filter_source_node_ids.equals(that.topn_filter_source_node_ids))
        return false;
    }

    boolean this_present_topn_filter_descs = true && this.isSetTopnFilterDescs();
    boolean that_present_topn_filter_descs = true && that.isSetTopnFilterDescs();
    if (this_present_topn_filter_descs || that_present_topn_filter_descs) {
      if (!(this_present_topn_filter_descs && that_present_topn_filter_descs))
        return false;
      if (!this.topn_filter_descs.equals(that.topn_filter_descs))
        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 + ((isSetBuildHashTableForBroadcastJoin()) ? 131071 : 524287);
    if (isSetBuildHashTableForBroadcastJoin())
      hashCode = hashCode * 8191 + ((build_hash_table_for_broadcast_join) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetPerNodeScanRanges()) ? 131071 : 524287);
    if (isSetPerNodeScanRanges())
      hashCode = hashCode * 8191 + per_node_scan_ranges.hashCode();

    hashCode = hashCode * 8191 + ((isSetSenderId()) ? 131071 : 524287);
    if (isSetSenderId())
      hashCode = hashCode * 8191 + sender_id;

    hashCode = hashCode * 8191 + ((isSetRuntimeFilterParams()) ? 131071 : 524287);
    if (isSetRuntimeFilterParams())
      hashCode = hashCode * 8191 + runtime_filter_params.hashCode();

    hashCode = hashCode * 8191 + ((isSetBackendNum()) ? 131071 : 524287);
    if (isSetBackendNum())
      hashCode = hashCode * 8191 + backend_num;

    hashCode = hashCode * 8191 + ((isSetPerNodeSharedScans()) ? 131071 : 524287);
    if (isSetPerNodeSharedScans())
      hashCode = hashCode * 8191 + per_node_shared_scans.hashCode();

    hashCode = hashCode * 8191 + ((isSetTopnFilterSourceNodeIds()) ? 131071 : 524287);
    if (isSetTopnFilterSourceNodeIds())
      hashCode = hashCode * 8191 + topn_filter_source_node_ids.hashCode();

    hashCode = hashCode * 8191 + ((isSetTopnFilterDescs()) ? 131071 : 524287);
    if (isSetTopnFilterDescs())
      hashCode = hashCode * 8191 + topn_filter_descs.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(TPipelineInstanceParams 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(isSetBuildHashTableForBroadcastJoin(), other.isSetBuildHashTableForBroadcastJoin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBuildHashTableForBroadcastJoin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.build_hash_table_for_broadcast_join, other.build_hash_table_for_broadcast_join);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPerNodeScanRanges(), other.isSetPerNodeScanRanges());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPerNodeScanRanges()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.per_node_scan_ranges, other.per_node_scan_ranges);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSenderId(), other.isSetSenderId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSenderId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sender_id, other.sender_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetRuntimeFilterParams(), other.isSetRuntimeFilterParams());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRuntimeFilterParams()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runtime_filter_params, other.runtime_filter_params);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBackendNum(), other.isSetBackendNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBackendNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.backend_num, other.backend_num);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPerNodeSharedScans(), other.isSetPerNodeSharedScans());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPerNodeSharedScans()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.per_node_shared_scans, other.per_node_shared_scans);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTopnFilterSourceNodeIds(), other.isSetTopnFilterSourceNodeIds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTopnFilterSourceNodeIds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topn_filter_source_node_ids, other.topn_filter_source_node_ids);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTopnFilterDescs(), other.isSetTopnFilterDescs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTopnFilterDescs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topn_filter_descs, other.topn_filter_descs);
      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("TPipelineInstanceParams(");
    boolean first = true;

    sb.append("fragment_instance_id:");
    if (this.fragment_instance_id == null) {
      sb.append("null");
    } else {
      sb.append(this.fragment_instance_id);
    }
    first = false;
    if (isSetBuildHashTableForBroadcastJoin()) {
      if (!first) sb.append(", ");
      sb.append("build_hash_table_for_broadcast_join:");
      sb.append(this.build_hash_table_for_broadcast_join);
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("per_node_scan_ranges:");
    if (this.per_node_scan_ranges == null) {
      sb.append("null");
    } else {
      sb.append(this.per_node_scan_ranges);
    }
    first = false;
    if (isSetSenderId()) {
      if (!first) sb.append(", ");
      sb.append("sender_id:");
      sb.append(this.sender_id);
      first = false;
    }
    if (isSetRuntimeFilterParams()) {
      if (!first) sb.append(", ");
      sb.append("runtime_filter_params:");
      if (this.runtime_filter_params == null) {
        sb.append("null");
      } else {
        sb.append(this.runtime_filter_params);
      }
      first = false;
    }
    if (isSetBackendNum()) {
      if (!first) sb.append(", ");
      sb.append("backend_num:");
      sb.append(this.backend_num);
      first = false;
    }
    if (isSetPerNodeSharedScans()) {
      if (!first) sb.append(", ");
      sb.append("per_node_shared_scans:");
      if (this.per_node_shared_scans == null) {
        sb.append("null");
      } else {
        sb.append(this.per_node_shared_scans);
      }
      first = false;
    }
    if (isSetTopnFilterSourceNodeIds()) {
      if (!first) sb.append(", ");
      sb.append("topn_filter_source_node_ids:");
      if (this.topn_filter_source_node_ids == null) {
        sb.append("null");
      } else {
        sb.append(this.topn_filter_source_node_ids);
      }
      first = false;
    }
    if (isSetTopnFilterDescs()) {
      if (!first) sb.append(", ");
      sb.append("topn_filter_descs:");
      if (this.topn_filter_descs == null) {
        sb.append("null");
      } else {
        sb.append(this.topn_filter_descs);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (fragment_instance_id == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'fragment_instance_id' was not present! Struct: " + toString());
    }
    if (per_node_scan_ranges == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'per_node_scan_ranges' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
    if (fragment_instance_id != null) {
      fragment_instance_id.validate();
    }
    if (runtime_filter_params != null) {
      runtime_filter_params.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 TPipelineInstanceParamsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TPipelineInstanceParamsStandardScheme getScheme() {
      return new TPipelineInstanceParamsStandardScheme();
    }
  }

  private static class TPipelineInstanceParamsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPipelineInstanceParams> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TPipelineInstanceParams 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: // BUILD_HASH_TABLE_FOR_BROADCAST_JOIN
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.build_hash_table_for_broadcast_join = iprot.readBool();
              struct.setBuildHashTableForBroadcastJoinIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PER_NODE_SCAN_RANGES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map156 = iprot.readMapBegin();
                struct.per_node_scan_ranges = new java.util.HashMap<java.lang.Integer,java.util.List<TScanRangeParams>>(2*_map156.size);
                int _key157;
                @org.apache.thrift.annotation.Nullable java.util.List<TScanRangeParams> _val158;
                for (int _i159 = 0; _i159 < _map156.size; ++_i159)
                {
                  _key157 = iprot.readI32();
                  {
                    org.apache.thrift.protocol.TList _list160 = iprot.readListBegin();
                    _val158 = new java.util.ArrayList<TScanRangeParams>(_list160.size);
                    @org.apache.thrift.annotation.Nullable TScanRangeParams _elem161;
                    for (int _i162 = 0; _i162 < _list160.size; ++_i162)
                    {
                      _elem161 = new TScanRangeParams();
                      _elem161.read(iprot);
                      _val158.add(_elem161);
                    }
                    iprot.readListEnd();
                  }
                  struct.per_node_scan_ranges.put(_key157, _val158);
                }
                iprot.readMapEnd();
              }
              struct.setPerNodeScanRangesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // SENDER_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.sender_id = iprot.readI32();
              struct.setSenderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // RUNTIME_FILTER_PARAMS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.runtime_filter_params = new TRuntimeFilterParams();
              struct.runtime_filter_params.read(iprot);
              struct.setRuntimeFilterParamsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // BACKEND_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.backend_num = iprot.readI32();
              struct.setBackendNumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // PER_NODE_SHARED_SCANS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map163 = iprot.readMapBegin();
                struct.per_node_shared_scans = new java.util.HashMap<java.lang.Integer,java.lang.Boolean>(2*_map163.size);
                int _key164;
                boolean _val165;
                for (int _i166 = 0; _i166 < _map163.size; ++_i166)
                {
                  _key164 = iprot.readI32();
                  _val165 = iprot.readBool();
                  struct.per_node_shared_scans.put(_key164, _val165);
                }
                iprot.readMapEnd();
              }
              struct.setPerNodeSharedScansIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // TOPN_FILTER_SOURCE_NODE_IDS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list167 = iprot.readListBegin();
                struct.topn_filter_source_node_ids = new java.util.ArrayList<java.lang.Integer>(_list167.size);
                int _elem168;
                for (int _i169 = 0; _i169 < _list167.size; ++_i169)
                {
                  _elem168 = iprot.readI32();
                  struct.topn_filter_source_node_ids.add(_elem168);
                }
                iprot.readListEnd();
              }
              struct.setTopnFilterSourceNodeIdsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // TOPN_FILTER_DESCS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list170 = iprot.readListBegin();
                struct.topn_filter_descs = new java.util.ArrayList<org.apache.doris.thrift.TTopnFilterDesc>(_list170.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TTopnFilterDesc _elem171;
                for (int _i172 = 0; _i172 < _list170.size; ++_i172)
                {
                  _elem171 = new org.apache.doris.thrift.TTopnFilterDesc();
                  _elem171.read(iprot);
                  struct.topn_filter_descs.add(_elem171);
                }
                iprot.readListEnd();
              }
              struct.setTopnFilterDescsIsSet(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, TPipelineInstanceParams struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.fragment_instance_id != null) {
        oprot.writeFieldBegin(FRAGMENT_INSTANCE_ID_FIELD_DESC);
        struct.fragment_instance_id.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.isSetBuildHashTableForBroadcastJoin()) {
        oprot.writeFieldBegin(BUILD_HASH_TABLE_FOR_BROADCAST_JOIN_FIELD_DESC);
        oprot.writeBool(struct.build_hash_table_for_broadcast_join);
        oprot.writeFieldEnd();
      }
      if (struct.per_node_scan_ranges != null) {
        oprot.writeFieldBegin(PER_NODE_SCAN_RANGES_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, struct.per_node_scan_ranges.size()));
          for (java.util.Map.Entry<java.lang.Integer, java.util.List<TScanRangeParams>> _iter173 : struct.per_node_scan_ranges.entrySet())
          {
            oprot.writeI32(_iter173.getKey());
            {
              oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter173.getValue().size()));
              for (TScanRangeParams _iter174 : _iter173.getValue())
              {
                _iter174.write(oprot);
              }
              oprot.writeListEnd();
            }
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.isSetSenderId()) {
        oprot.writeFieldBegin(SENDER_ID_FIELD_DESC);
        oprot.writeI32(struct.sender_id);
        oprot.writeFieldEnd();
      }
      if (struct.runtime_filter_params != null) {
        if (struct.isSetRuntimeFilterParams()) {
          oprot.writeFieldBegin(RUNTIME_FILTER_PARAMS_FIELD_DESC);
          struct.runtime_filter_params.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetBackendNum()) {
        oprot.writeFieldBegin(BACKEND_NUM_FIELD_DESC);
        oprot.writeI32(struct.backend_num);
        oprot.writeFieldEnd();
      }
      if (struct.per_node_shared_scans != null) {
        if (struct.isSetPerNodeSharedScans()) {
          oprot.writeFieldBegin(PER_NODE_SHARED_SCANS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, struct.per_node_shared_scans.size()));
            for (java.util.Map.Entry<java.lang.Integer, java.lang.Boolean> _iter175 : struct.per_node_shared_scans.entrySet())
            {
              oprot.writeI32(_iter175.getKey());
              oprot.writeBool(_iter175.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.topn_filter_source_node_ids != null) {
        if (struct.isSetTopnFilterSourceNodeIds()) {
          oprot.writeFieldBegin(TOPN_FILTER_SOURCE_NODE_IDS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.topn_filter_source_node_ids.size()));
            for (int _iter176 : struct.topn_filter_source_node_ids)
            {
              oprot.writeI32(_iter176);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.topn_filter_descs != null) {
        if (struct.isSetTopnFilterDescs()) {
          oprot.writeFieldBegin(TOPN_FILTER_DESCS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.topn_filter_descs.size()));
            for (org.apache.doris.thrift.TTopnFilterDesc _iter177 : struct.topn_filter_descs)
            {
              _iter177.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TPipelineInstanceParamsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPipelineInstanceParams> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TPipelineInstanceParams struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.fragment_instance_id.write(oprot);
      {
        oprot.writeI32(struct.per_node_scan_ranges.size());
        for (java.util.Map.Entry<java.lang.Integer, java.util.List<TScanRangeParams>> _iter178 : struct.per_node_scan_ranges.entrySet())
        {
          oprot.writeI32(_iter178.getKey());
          {
            oprot.writeI32(_iter178.getValue().size());
            for (TScanRangeParams _iter179 : _iter178.getValue())
            {
              _iter179.write(oprot);
            }
          }
        }
      }
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetBuildHashTableForBroadcastJoin()) {
        optionals.set(0);
      }
      if (struct.isSetSenderId()) {
        optionals.set(1);
      }
      if (struct.isSetRuntimeFilterParams()) {
        optionals.set(2);
      }
      if (struct.isSetBackendNum()) {
        optionals.set(3);
      }
      if (struct.isSetPerNodeSharedScans()) {
        optionals.set(4);
      }
      if (struct.isSetTopnFilterSourceNodeIds()) {
        optionals.set(5);
      }
      if (struct.isSetTopnFilterDescs()) {
        optionals.set(6);
      }
      oprot.writeBitSet(optionals, 7);
      if (struct.isSetBuildHashTableForBroadcastJoin()) {
        oprot.writeBool(struct.build_hash_table_for_broadcast_join);
      }
      if (struct.isSetSenderId()) {
        oprot.writeI32(struct.sender_id);
      }
      if (struct.isSetRuntimeFilterParams()) {
        struct.runtime_filter_params.write(oprot);
      }
      if (struct.isSetBackendNum()) {
        oprot.writeI32(struct.backend_num);
      }
      if (struct.isSetPerNodeSharedScans()) {
        {
          oprot.writeI32(struct.per_node_shared_scans.size());
          for (java.util.Map.Entry<java.lang.Integer, java.lang.Boolean> _iter180 : struct.per_node_shared_scans.entrySet())
          {
            oprot.writeI32(_iter180.getKey());
            oprot.writeBool(_iter180.getValue());
          }
        }
      }
      if (struct.isSetTopnFilterSourceNodeIds()) {
        {
          oprot.writeI32(struct.topn_filter_source_node_ids.size());
          for (int _iter181 : struct.topn_filter_source_node_ids)
          {
            oprot.writeI32(_iter181);
          }
        }
      }
      if (struct.isSetTopnFilterDescs()) {
        {
          oprot.writeI32(struct.topn_filter_descs.size());
          for (org.apache.doris.thrift.TTopnFilterDesc _iter182 : struct.topn_filter_descs)
          {
            _iter182.write(oprot);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TPipelineInstanceParams struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.fragment_instance_id = new org.apache.doris.thrift.TUniqueId();
      struct.fragment_instance_id.read(iprot);
      struct.setFragmentInstanceIdIsSet(true);
      {
        org.apache.thrift.protocol.TMap _map183 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST); 
        struct.per_node_scan_ranges = new java.util.HashMap<java.lang.Integer,java.util.List<TScanRangeParams>>(2*_map183.size);
        int _key184;
        @org.apache.thrift.annotation.Nullable java.util.List<TScanRangeParams> _val185;
        for (int _i186 = 0; _i186 < _map183.size; ++_i186)
        {
          _key184 = iprot.readI32();
          {
            org.apache.thrift.protocol.TList _list187 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
            _val185 = new java.util.ArrayList<TScanRangeParams>(_list187.size);
            @org.apache.thrift.annotation.Nullable TScanRangeParams _elem188;
            for (int _i189 = 0; _i189 < _list187.size; ++_i189)
            {
              _elem188 = new TScanRangeParams();
              _elem188.read(iprot);
              _val185.add(_elem188);
            }
          }
          struct.per_node_scan_ranges.put(_key184, _val185);
        }
      }
      struct.setPerNodeScanRangesIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(7);
      if (incoming.get(0)) {
        struct.build_hash_table_for_broadcast_join = iprot.readBool();
        struct.setBuildHashTableForBroadcastJoinIsSet(true);
      }
      if (incoming.get(1)) {
        struct.sender_id = iprot.readI32();
        struct.setSenderIdIsSet(true);
      }
      if (incoming.get(2)) {
        struct.runtime_filter_params = new TRuntimeFilterParams();
        struct.runtime_filter_params.read(iprot);
        struct.setRuntimeFilterParamsIsSet(true);
      }
      if (incoming.get(3)) {
        struct.backend_num = iprot.readI32();
        struct.setBackendNumIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TMap _map190 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL); 
          struct.per_node_shared_scans = new java.util.HashMap<java.lang.Integer,java.lang.Boolean>(2*_map190.size);
          int _key191;
          boolean _val192;
          for (int _i193 = 0; _i193 < _map190.size; ++_i193)
          {
            _key191 = iprot.readI32();
            _val192 = iprot.readBool();
            struct.per_node_shared_scans.put(_key191, _val192);
          }
        }
        struct.setPerNodeSharedScansIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TList _list194 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
          struct.topn_filter_source_node_ids = new java.util.ArrayList<java.lang.Integer>(_list194.size);
          int _elem195;
          for (int _i196 = 0; _i196 < _list194.size; ++_i196)
          {
            _elem195 = iprot.readI32();
            struct.topn_filter_source_node_ids.add(_elem195);
          }
        }
        struct.setTopnFilterSourceNodeIdsIsSet(true);
      }
      if (incoming.get(6)) {
        {
          org.apache.thrift.protocol.TList _list197 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.topn_filter_descs = new java.util.ArrayList<org.apache.doris.thrift.TTopnFilterDesc>(_list197.size);
          @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TTopnFilterDesc _elem198;
          for (int _i199 = 0; _i199 < _list197.size; ++_i199)
          {
            _elem198 = new org.apache.doris.thrift.TTopnFilterDesc();
            _elem198.read(iprot);
            struct.topn_filter_descs.add(_elem198);
          }
        }
        struct.setTopnFilterDescsIsSet(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();
  }
}