All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netease.arctic.ams.api.OptimizeTask Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Thrift Compiler (0.13.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.netease.arctic.ams.api;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2022-11-24")
public class OptimizeTask implements com.netease.arctic.shade.org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TStruct STRUCT_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TStruct("OptimizeTask");

  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("taskId", com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT, (short)1);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField TABLE_IDENTIFIER_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("tableIdentifier", com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT, (short)2);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField INSERT_FILES_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("insertFiles", com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField DELETE_FILES_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("deleteFiles", com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField BASE_FILES_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("baseFiles", com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField POS_DELETE_FILES_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("posDeleteFiles", com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, (short)6);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField SOURCE_NODES_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("sourceNodes", com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, (short)7);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("properties", com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP, (short)8);

  private static final com.netease.arctic.shade.org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OptimizeTaskStandardSchemeFactory();
  private static final com.netease.arctic.shade.org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OptimizeTaskTupleSchemeFactory();

  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable OptimizeTaskId taskId; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable TableIdentifier tableIdentifier; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List insertFiles; // optional
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List deleteFiles; // optional
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List baseFiles; // optional
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List posDeleteFiles; // optional
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List sourceNodes; // optional
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map properties; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements com.netease.arctic.shade.org.apache.thrift.TFieldIdEnum {
    TASK_ID((short)1, "taskId"),
    TABLE_IDENTIFIER((short)2, "tableIdentifier"),
    INSERT_FILES((short)3, "insertFiles"),
    DELETE_FILES((short)4, "deleteFiles"),
    BASE_FILES((short)5, "baseFiles"),
    POS_DELETE_FILES((short)6, "posDeleteFiles"),
    SOURCE_NODES((short)7, "sourceNodes"),
    PROPERTIES((short)8, "properties");

    private static final java.util.Map byName = new java.util.HashMap();

    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.
     */
    @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // TASK_ID
          return TASK_ID;
        case 2: // TABLE_IDENTIFIER
          return TABLE_IDENTIFIER;
        case 3: // INSERT_FILES
          return INSERT_FILES;
        case 4: // DELETE_FILES
          return DELETE_FILES;
        case 5: // BASE_FILES
          return BASE_FILES;
        case 6: // POS_DELETE_FILES
          return POS_DELETE_FILES;
        case 7: // SOURCE_NODES
          return SOURCE_NODES;
        case 8: // PROPERTIES
          return PROPERTIES;
        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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final _Fields optionals[] = {_Fields.INSERT_FILES,_Fields.DELETE_FILES,_Fields.BASE_FILES,_Fields.POS_DELETE_FILES,_Fields.SOURCE_NODES,_Fields.PROPERTIES};
  public static final java.util.Map<_Fields, com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.TASK_ID, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("taskId", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT        , "OptimizeTaskId")));
    tmpMap.put(_Fields.TABLE_IDENTIFIER, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("tableIdentifier", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.StructMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT, TableIdentifier.class)));
    tmpMap.put(_Fields.INSERT_FILES, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("insertFiles", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.ListMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING            , true))));
    tmpMap.put(_Fields.DELETE_FILES, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("deleteFiles", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.ListMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING            , true))));
    tmpMap.put(_Fields.BASE_FILES, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("baseFiles", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.ListMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING            , true))));
    tmpMap.put(_Fields.POS_DELETE_FILES, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("posDeleteFiles", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.ListMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING            , true))));
    tmpMap.put(_Fields.SOURCE_NODES, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("sourceNodes", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.ListMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.StructMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT, TreeNode.class))));
    tmpMap.put(_Fields.PROPERTIES, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("properties", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.MapMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING), 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptimizeTask.class, metaDataMap);
  }

  public OptimizeTask() {
  }

  public OptimizeTask(
    OptimizeTaskId taskId,
    TableIdentifier tableIdentifier)
  {
    this();
    this.taskId = taskId;
    this.tableIdentifier = tableIdentifier;
  }

  /**
   * Performs a deep copy on other.
   */
  public OptimizeTask(OptimizeTask other) {
    if (other.isSetTaskId()) {
      this.taskId = new OptimizeTaskId(other.taskId);
    }
    if (other.isSetTableIdentifier()) {
      this.tableIdentifier = new TableIdentifier(other.tableIdentifier);
    }
    if (other.isSetInsertFiles()) {
      java.util.List __this__insertFiles = new java.util.ArrayList(other.insertFiles);
      this.insertFiles = __this__insertFiles;
    }
    if (other.isSetDeleteFiles()) {
      java.util.List __this__deleteFiles = new java.util.ArrayList(other.deleteFiles);
      this.deleteFiles = __this__deleteFiles;
    }
    if (other.isSetBaseFiles()) {
      java.util.List __this__baseFiles = new java.util.ArrayList(other.baseFiles);
      this.baseFiles = __this__baseFiles;
    }
    if (other.isSetPosDeleteFiles()) {
      java.util.List __this__posDeleteFiles = new java.util.ArrayList(other.posDeleteFiles);
      this.posDeleteFiles = __this__posDeleteFiles;
    }
    if (other.isSetSourceNodes()) {
      java.util.List __this__sourceNodes = new java.util.ArrayList(other.sourceNodes.size());
      for (TreeNode other_element : other.sourceNodes) {
        __this__sourceNodes.add(new TreeNode(other_element));
      }
      this.sourceNodes = __this__sourceNodes;
    }
    if (other.isSetProperties()) {
      java.util.Map __this__properties = new java.util.HashMap(other.properties);
      this.properties = __this__properties;
    }
  }

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

  @Override
  public void clear() {
    this.taskId = null;
    this.tableIdentifier = null;
    this.insertFiles = null;
    this.deleteFiles = null;
    this.baseFiles = null;
    this.posDeleteFiles = null;
    this.sourceNodes = null;
    this.properties = null;
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public OptimizeTaskId getTaskId() {
    return this.taskId;
  }

  public OptimizeTask setTaskId(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable OptimizeTaskId taskId) {
    this.taskId = taskId;
    return this;
  }

  public void unsetTaskId() {
    this.taskId = null;
  }

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

  public void setTaskIdIsSet(boolean value) {
    if (!value) {
      this.taskId = null;
    }
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public TableIdentifier getTableIdentifier() {
    return this.tableIdentifier;
  }

  public OptimizeTask setTableIdentifier(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable TableIdentifier tableIdentifier) {
    this.tableIdentifier = tableIdentifier;
    return this;
  }

  public void unsetTableIdentifier() {
    this.tableIdentifier = null;
  }

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

  public void setTableIdentifierIsSet(boolean value) {
    if (!value) {
      this.tableIdentifier = null;
    }
  }

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

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Iterator getInsertFilesIterator() {
    return (this.insertFiles == null) ? null : this.insertFiles.iterator();
  }

  public void addToInsertFiles(java.nio.ByteBuffer elem) {
    if (this.insertFiles == null) {
      this.insertFiles = new java.util.ArrayList();
    }
    this.insertFiles.add(elem);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.List getInsertFiles() {
    return this.insertFiles;
  }

  public OptimizeTask setInsertFiles(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List insertFiles) {
    this.insertFiles = insertFiles;
    return this;
  }

  public void unsetInsertFiles() {
    this.insertFiles = null;
  }

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

  public void setInsertFilesIsSet(boolean value) {
    if (!value) {
      this.insertFiles = null;
    }
  }

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

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Iterator getDeleteFilesIterator() {
    return (this.deleteFiles == null) ? null : this.deleteFiles.iterator();
  }

  public void addToDeleteFiles(java.nio.ByteBuffer elem) {
    if (this.deleteFiles == null) {
      this.deleteFiles = new java.util.ArrayList();
    }
    this.deleteFiles.add(elem);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.List getDeleteFiles() {
    return this.deleteFiles;
  }

  public OptimizeTask setDeleteFiles(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List deleteFiles) {
    this.deleteFiles = deleteFiles;
    return this;
  }

  public void unsetDeleteFiles() {
    this.deleteFiles = null;
  }

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

  public void setDeleteFilesIsSet(boolean value) {
    if (!value) {
      this.deleteFiles = null;
    }
  }

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

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Iterator getBaseFilesIterator() {
    return (this.baseFiles == null) ? null : this.baseFiles.iterator();
  }

  public void addToBaseFiles(java.nio.ByteBuffer elem) {
    if (this.baseFiles == null) {
      this.baseFiles = new java.util.ArrayList();
    }
    this.baseFiles.add(elem);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.List getBaseFiles() {
    return this.baseFiles;
  }

  public OptimizeTask setBaseFiles(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List baseFiles) {
    this.baseFiles = baseFiles;
    return this;
  }

  public void unsetBaseFiles() {
    this.baseFiles = null;
  }

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

  public void setBaseFilesIsSet(boolean value) {
    if (!value) {
      this.baseFiles = null;
    }
  }

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

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Iterator getPosDeleteFilesIterator() {
    return (this.posDeleteFiles == null) ? null : this.posDeleteFiles.iterator();
  }

  public void addToPosDeleteFiles(java.nio.ByteBuffer elem) {
    if (this.posDeleteFiles == null) {
      this.posDeleteFiles = new java.util.ArrayList();
    }
    this.posDeleteFiles.add(elem);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.List getPosDeleteFiles() {
    return this.posDeleteFiles;
  }

  public OptimizeTask setPosDeleteFiles(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List posDeleteFiles) {
    this.posDeleteFiles = posDeleteFiles;
    return this;
  }

  public void unsetPosDeleteFiles() {
    this.posDeleteFiles = null;
  }

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

  public void setPosDeleteFilesIsSet(boolean value) {
    if (!value) {
      this.posDeleteFiles = null;
    }
  }

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

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Iterator getSourceNodesIterator() {
    return (this.sourceNodes == null) ? null : this.sourceNodes.iterator();
  }

  public void addToSourceNodes(TreeNode elem) {
    if (this.sourceNodes == null) {
      this.sourceNodes = new java.util.ArrayList();
    }
    this.sourceNodes.add(elem);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.List getSourceNodes() {
    return this.sourceNodes;
  }

  public OptimizeTask setSourceNodes(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.List sourceNodes) {
    this.sourceNodes = sourceNodes;
    return this;
  }

  public void unsetSourceNodes() {
    this.sourceNodes = null;
  }

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

  public void setSourceNodesIsSet(boolean value) {
    if (!value) {
      this.sourceNodes = null;
    }
  }

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

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

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Map getProperties() {
    return this.properties;
  }

  public OptimizeTask setProperties(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map 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;
    }
  }

  public void setFieldValue(_Fields field, @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable Object value) {
    switch (field) {
    case TASK_ID:
      if (value == null) {
        unsetTaskId();
      } else {
        setTaskId((OptimizeTaskId)value);
      }
      break;

    case TABLE_IDENTIFIER:
      if (value == null) {
        unsetTableIdentifier();
      } else {
        setTableIdentifier((TableIdentifier)value);
      }
      break;

    case INSERT_FILES:
      if (value == null) {
        unsetInsertFiles();
      } else {
        setInsertFiles((java.util.List)value);
      }
      break;

    case DELETE_FILES:
      if (value == null) {
        unsetDeleteFiles();
      } else {
        setDeleteFiles((java.util.List)value);
      }
      break;

    case BASE_FILES:
      if (value == null) {
        unsetBaseFiles();
      } else {
        setBaseFiles((java.util.List)value);
      }
      break;

    case POS_DELETE_FILES:
      if (value == null) {
        unsetPosDeleteFiles();
      } else {
        setPosDeleteFiles((java.util.List)value);
      }
      break;

    case SOURCE_NODES:
      if (value == null) {
        unsetSourceNodes();
      } else {
        setSourceNodes((java.util.List)value);
      }
      break;

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

    }
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TASK_ID:
      return getTaskId();

    case TABLE_IDENTIFIER:
      return getTableIdentifier();

    case INSERT_FILES:
      return getInsertFiles();

    case DELETE_FILES:
      return getDeleteFiles();

    case BASE_FILES:
      return getBaseFiles();

    case POS_DELETE_FILES:
      return getPosDeleteFiles();

    case SOURCE_NODES:
      return getSourceNodes();

    case PROPERTIES:
      return getProperties();

    }
    throw new 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 IllegalArgumentException();
    }

    switch (field) {
    case TASK_ID:
      return isSetTaskId();
    case TABLE_IDENTIFIER:
      return isSetTableIdentifier();
    case INSERT_FILES:
      return isSetInsertFiles();
    case DELETE_FILES:
      return isSetDeleteFiles();
    case BASE_FILES:
      return isSetBaseFiles();
    case POS_DELETE_FILES:
      return isSetPosDeleteFiles();
    case SOURCE_NODES:
      return isSetSourceNodes();
    case PROPERTIES:
      return isSetProperties();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof OptimizeTask)
      return this.equals((OptimizeTask)that);
    return false;
  }

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

    boolean this_present_taskId = true && this.isSetTaskId();
    boolean that_present_taskId = true && that.isSetTaskId();
    if (this_present_taskId || that_present_taskId) {
      if (!(this_present_taskId && that_present_taskId))
        return false;
      if (!this.taskId.equals(that.taskId))
        return false;
    }

    boolean this_present_tableIdentifier = true && this.isSetTableIdentifier();
    boolean that_present_tableIdentifier = true && that.isSetTableIdentifier();
    if (this_present_tableIdentifier || that_present_tableIdentifier) {
      if (!(this_present_tableIdentifier && that_present_tableIdentifier))
        return false;
      if (!this.tableIdentifier.equals(that.tableIdentifier))
        return false;
    }

    boolean this_present_insertFiles = true && this.isSetInsertFiles();
    boolean that_present_insertFiles = true && that.isSetInsertFiles();
    if (this_present_insertFiles || that_present_insertFiles) {
      if (!(this_present_insertFiles && that_present_insertFiles))
        return false;
      if (!this.insertFiles.equals(that.insertFiles))
        return false;
    }

    boolean this_present_deleteFiles = true && this.isSetDeleteFiles();
    boolean that_present_deleteFiles = true && that.isSetDeleteFiles();
    if (this_present_deleteFiles || that_present_deleteFiles) {
      if (!(this_present_deleteFiles && that_present_deleteFiles))
        return false;
      if (!this.deleteFiles.equals(that.deleteFiles))
        return false;
    }

    boolean this_present_baseFiles = true && this.isSetBaseFiles();
    boolean that_present_baseFiles = true && that.isSetBaseFiles();
    if (this_present_baseFiles || that_present_baseFiles) {
      if (!(this_present_baseFiles && that_present_baseFiles))
        return false;
      if (!this.baseFiles.equals(that.baseFiles))
        return false;
    }

    boolean this_present_posDeleteFiles = true && this.isSetPosDeleteFiles();
    boolean that_present_posDeleteFiles = true && that.isSetPosDeleteFiles();
    if (this_present_posDeleteFiles || that_present_posDeleteFiles) {
      if (!(this_present_posDeleteFiles && that_present_posDeleteFiles))
        return false;
      if (!this.posDeleteFiles.equals(that.posDeleteFiles))
        return false;
    }

    boolean this_present_sourceNodes = true && this.isSetSourceNodes();
    boolean that_present_sourceNodes = true && that.isSetSourceNodes();
    if (this_present_sourceNodes || that_present_sourceNodes) {
      if (!(this_present_sourceNodes && that_present_sourceNodes))
        return false;
      if (!this.sourceNodes.equals(that.sourceNodes))
        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;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetTaskId()) ? 131071 : 524287);
    if (isSetTaskId())
      hashCode = hashCode * 8191 + taskId.hashCode();

    hashCode = hashCode * 8191 + ((isSetTableIdentifier()) ? 131071 : 524287);
    if (isSetTableIdentifier())
      hashCode = hashCode * 8191 + tableIdentifier.hashCode();

    hashCode = hashCode * 8191 + ((isSetInsertFiles()) ? 131071 : 524287);
    if (isSetInsertFiles())
      hashCode = hashCode * 8191 + insertFiles.hashCode();

    hashCode = hashCode * 8191 + ((isSetDeleteFiles()) ? 131071 : 524287);
    if (isSetDeleteFiles())
      hashCode = hashCode * 8191 + deleteFiles.hashCode();

    hashCode = hashCode * 8191 + ((isSetBaseFiles()) ? 131071 : 524287);
    if (isSetBaseFiles())
      hashCode = hashCode * 8191 + baseFiles.hashCode();

    hashCode = hashCode * 8191 + ((isSetPosDeleteFiles()) ? 131071 : 524287);
    if (isSetPosDeleteFiles())
      hashCode = hashCode * 8191 + posDeleteFiles.hashCode();

    hashCode = hashCode * 8191 + ((isSetSourceNodes()) ? 131071 : 524287);
    if (isSetSourceNodes())
      hashCode = hashCode * 8191 + sourceNodes.hashCode();

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

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetTaskId()).compareTo(other.isSetTaskId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskId()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTableIdentifier()).compareTo(other.isSetTableIdentifier());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableIdentifier()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.tableIdentifier, other.tableIdentifier);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInsertFiles()).compareTo(other.isSetInsertFiles());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInsertFiles()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.insertFiles, other.insertFiles);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDeleteFiles()).compareTo(other.isSetDeleteFiles());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeleteFiles()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.deleteFiles, other.deleteFiles);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBaseFiles()).compareTo(other.isSetBaseFiles());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBaseFiles()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.baseFiles, other.baseFiles);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPosDeleteFiles()).compareTo(other.isSetPosDeleteFiles());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPosDeleteFiles()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.posDeleteFiles, other.posDeleteFiles);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSourceNodes()).compareTo(other.isSetSourceNodes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSourceNodes()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.sourceNodes, other.sourceNodes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProperties()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol iprot) throws com.netease.arctic.shade.org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol oprot) throws com.netease.arctic.shade.org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("OptimizeTask(");
    boolean first = true;

    sb.append("taskId:");
    if (this.taskId == null) {
      sb.append("null");
    } else {
      sb.append(this.taskId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("tableIdentifier:");
    if (this.tableIdentifier == null) {
      sb.append("null");
    } else {
      sb.append(this.tableIdentifier);
    }
    first = false;
    if (isSetInsertFiles()) {
      if (!first) sb.append(", ");
      sb.append("insertFiles:");
      if (this.insertFiles == null) {
        sb.append("null");
      } else {
        com.netease.arctic.shade.org.apache.thrift.TBaseHelper.toString(this.insertFiles, sb);
      }
      first = false;
    }
    if (isSetDeleteFiles()) {
      if (!first) sb.append(", ");
      sb.append("deleteFiles:");
      if (this.deleteFiles == null) {
        sb.append("null");
      } else {
        com.netease.arctic.shade.org.apache.thrift.TBaseHelper.toString(this.deleteFiles, sb);
      }
      first = false;
    }
    if (isSetBaseFiles()) {
      if (!first) sb.append(", ");
      sb.append("baseFiles:");
      if (this.baseFiles == null) {
        sb.append("null");
      } else {
        com.netease.arctic.shade.org.apache.thrift.TBaseHelper.toString(this.baseFiles, sb);
      }
      first = false;
    }
    if (isSetPosDeleteFiles()) {
      if (!first) sb.append(", ");
      sb.append("posDeleteFiles:");
      if (this.posDeleteFiles == null) {
        sb.append("null");
      } else {
        com.netease.arctic.shade.org.apache.thrift.TBaseHelper.toString(this.posDeleteFiles, sb);
      }
      first = false;
    }
    if (isSetSourceNodes()) {
      if (!first) sb.append(", ");
      sb.append("sourceNodes:");
      if (this.sourceNodes == null) {
        sb.append("null");
      } else {
        sb.append(this.sourceNodes);
      }
      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;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws com.netease.arctic.shade.org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (tableIdentifier != null) {
      tableIdentifier.validate();
    }
  }

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

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      read(new com.netease.arctic.shade.org.apache.thrift.protocol.TCompactProtocol(new com.netease.arctic.shade.org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (com.netease.arctic.shade.org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class OptimizeTaskStandardSchemeFactory implements com.netease.arctic.shade.org.apache.thrift.scheme.SchemeFactory {
    public OptimizeTaskStandardScheme getScheme() {
      return new OptimizeTaskStandardScheme();
    }
  }

  private static class OptimizeTaskStandardScheme extends com.netease.arctic.shade.org.apache.thrift.scheme.StandardScheme {

    public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol iprot, OptimizeTask struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      com.netease.arctic.shade.org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // TASK_ID
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT) {
              struct.taskId = new OptimizeTaskId();
              struct.taskId.read(iprot);
              struct.setTaskIdIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TABLE_IDENTIFIER
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT) {
              struct.tableIdentifier = new TableIdentifier();
              struct.tableIdentifier.read(iprot);
              struct.setTableIdentifierIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // INSERT_FILES
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.insertFiles = new java.util.ArrayList(_list0.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = iprot.readBinary();
                  struct.insertFiles.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setInsertFilesIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DELETE_FILES
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
                struct.deleteFiles = new java.util.ArrayList(_list3.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem4;
                for (int _i5 = 0; _i5 < _list3.size; ++_i5)
                {
                  _elem4 = iprot.readBinary();
                  struct.deleteFiles.add(_elem4);
                }
                iprot.readListEnd();
              }
              struct.setDeleteFilesIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // BASE_FILES
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TList _list6 = iprot.readListBegin();
                struct.baseFiles = new java.util.ArrayList(_list6.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem7;
                for (int _i8 = 0; _i8 < _list6.size; ++_i8)
                {
                  _elem7 = iprot.readBinary();
                  struct.baseFiles.add(_elem7);
                }
                iprot.readListEnd();
              }
              struct.setBaseFilesIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // POS_DELETE_FILES
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TList _list9 = iprot.readListBegin();
                struct.posDeleteFiles = new java.util.ArrayList(_list9.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem10;
                for (int _i11 = 0; _i11 < _list9.size; ++_i11)
                {
                  _elem10 = iprot.readBinary();
                  struct.posDeleteFiles.add(_elem10);
                }
                iprot.readListEnd();
              }
              struct.setPosDeleteFilesIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // SOURCE_NODES
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.LIST) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
                struct.sourceNodes = new java.util.ArrayList(_list12.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable TreeNode _elem13;
                for (int _i14 = 0; _i14 < _list12.size; ++_i14)
                {
                  _elem13 = new TreeNode();
                  _elem13.read(iprot);
                  struct.sourceNodes.add(_elem13);
                }
                iprot.readListEnd();
              }
              struct.setSourceNodesIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // PROPERTIES
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map15 = iprot.readMapBegin();
                struct.properties = new java.util.HashMap(2*_map15.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable String _key16;
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable String _val17;
                for (int _i18 = 0; _i18 < _map15.size; ++_i18)
                {
                  _key16 = iprot.readString();
                  _val17 = iprot.readString();
                  struct.properties.put(_key16, _val17);
                }
                iprot.readMapEnd();
              }
              struct.setPropertiesIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            com.netease.arctic.shade.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(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol oprot, OptimizeTask struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.taskId != null) {
        oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
        struct.taskId.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.tableIdentifier != null) {
        oprot.writeFieldBegin(TABLE_IDENTIFIER_FIELD_DESC);
        struct.tableIdentifier.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.insertFiles != null) {
        if (struct.isSetInsertFiles()) {
          oprot.writeFieldBegin(INSERT_FILES_FIELD_DESC);
          {
            oprot.writeListBegin(new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.insertFiles.size()));
            for (java.nio.ByteBuffer _iter19 : struct.insertFiles)
            {
              oprot.writeBinary(_iter19);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.deleteFiles != null) {
        if (struct.isSetDeleteFiles()) {
          oprot.writeFieldBegin(DELETE_FILES_FIELD_DESC);
          {
            oprot.writeListBegin(new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.deleteFiles.size()));
            for (java.nio.ByteBuffer _iter20 : struct.deleteFiles)
            {
              oprot.writeBinary(_iter20);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.baseFiles != null) {
        if (struct.isSetBaseFiles()) {
          oprot.writeFieldBegin(BASE_FILES_FIELD_DESC);
          {
            oprot.writeListBegin(new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.baseFiles.size()));
            for (java.nio.ByteBuffer _iter21 : struct.baseFiles)
            {
              oprot.writeBinary(_iter21);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.posDeleteFiles != null) {
        if (struct.isSetPosDeleteFiles()) {
          oprot.writeFieldBegin(POS_DELETE_FILES_FIELD_DESC);
          {
            oprot.writeListBegin(new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.posDeleteFiles.size()));
            for (java.nio.ByteBuffer _iter22 : struct.posDeleteFiles)
            {
              oprot.writeBinary(_iter22);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.sourceNodes != null) {
        if (struct.isSetSourceNodes()) {
          oprot.writeFieldBegin(SOURCE_NODES_FIELD_DESC);
          {
            oprot.writeListBegin(new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT, struct.sourceNodes.size()));
            for (TreeNode _iter23 : struct.sourceNodes)
            {
              _iter23.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.properties != null) {
        if (struct.isSetProperties()) {
          oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
          {
            oprot.writeMapBegin(new com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.properties.size()));
            for (java.util.Map.Entry _iter24 : struct.properties.entrySet())
            {
              oprot.writeString(_iter24.getKey());
              oprot.writeString(_iter24.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class OptimizeTaskTupleSchemeFactory implements com.netease.arctic.shade.org.apache.thrift.scheme.SchemeFactory {
    public OptimizeTaskTupleScheme getScheme() {
      return new OptimizeTaskTupleScheme();
    }
  }

  private static class OptimizeTaskTupleScheme extends com.netease.arctic.shade.org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol prot, OptimizeTask struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      com.netease.arctic.shade.org.apache.thrift.protocol.TTupleProtocol oprot = (com.netease.arctic.shade.org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetTaskId()) {
        optionals.set(0);
      }
      if (struct.isSetTableIdentifier()) {
        optionals.set(1);
      }
      if (struct.isSetInsertFiles()) {
        optionals.set(2);
      }
      if (struct.isSetDeleteFiles()) {
        optionals.set(3);
      }
      if (struct.isSetBaseFiles()) {
        optionals.set(4);
      }
      if (struct.isSetPosDeleteFiles()) {
        optionals.set(5);
      }
      if (struct.isSetSourceNodes()) {
        optionals.set(6);
      }
      if (struct.isSetProperties()) {
        optionals.set(7);
      }
      oprot.writeBitSet(optionals, 8);
      if (struct.isSetTaskId()) {
        struct.taskId.write(oprot);
      }
      if (struct.isSetTableIdentifier()) {
        struct.tableIdentifier.write(oprot);
      }
      if (struct.isSetInsertFiles()) {
        {
          oprot.writeI32(struct.insertFiles.size());
          for (java.nio.ByteBuffer _iter25 : struct.insertFiles)
          {
            oprot.writeBinary(_iter25);
          }
        }
      }
      if (struct.isSetDeleteFiles()) {
        {
          oprot.writeI32(struct.deleteFiles.size());
          for (java.nio.ByteBuffer _iter26 : struct.deleteFiles)
          {
            oprot.writeBinary(_iter26);
          }
        }
      }
      if (struct.isSetBaseFiles()) {
        {
          oprot.writeI32(struct.baseFiles.size());
          for (java.nio.ByteBuffer _iter27 : struct.baseFiles)
          {
            oprot.writeBinary(_iter27);
          }
        }
      }
      if (struct.isSetPosDeleteFiles()) {
        {
          oprot.writeI32(struct.posDeleteFiles.size());
          for (java.nio.ByteBuffer _iter28 : struct.posDeleteFiles)
          {
            oprot.writeBinary(_iter28);
          }
        }
      }
      if (struct.isSetSourceNodes()) {
        {
          oprot.writeI32(struct.sourceNodes.size());
          for (TreeNode _iter29 : struct.sourceNodes)
          {
            _iter29.write(oprot);
          }
        }
      }
      if (struct.isSetProperties()) {
        {
          oprot.writeI32(struct.properties.size());
          for (java.util.Map.Entry _iter30 : struct.properties.entrySet())
          {
            oprot.writeString(_iter30.getKey());
            oprot.writeString(_iter30.getValue());
          }
        }
      }
    }

    @Override
    public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol prot, OptimizeTask struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      com.netease.arctic.shade.org.apache.thrift.protocol.TTupleProtocol iprot = (com.netease.arctic.shade.org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(8);
      if (incoming.get(0)) {
        struct.taskId = new OptimizeTaskId();
        struct.taskId.read(iprot);
        struct.setTaskIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.tableIdentifier = new TableIdentifier();
        struct.tableIdentifier.read(iprot);
        struct.setTableIdentifierIsSet(true);
      }
      if (incoming.get(2)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TList _list31 = new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.insertFiles = new java.util.ArrayList(_list31.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem32;
          for (int _i33 = 0; _i33 < _list31.size; ++_i33)
          {
            _elem32 = iprot.readBinary();
            struct.insertFiles.add(_elem32);
          }
        }
        struct.setInsertFilesIsSet(true);
      }
      if (incoming.get(3)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TList _list34 = new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.deleteFiles = new java.util.ArrayList(_list34.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem35;
          for (int _i36 = 0; _i36 < _list34.size; ++_i36)
          {
            _elem35 = iprot.readBinary();
            struct.deleteFiles.add(_elem35);
          }
        }
        struct.setDeleteFilesIsSet(true);
      }
      if (incoming.get(4)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TList _list37 = new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.baseFiles = new java.util.ArrayList(_list37.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem38;
          for (int _i39 = 0; _i39 < _list37.size; ++_i39)
          {
            _elem38 = iprot.readBinary();
            struct.baseFiles.add(_elem38);
          }
        }
        struct.setBaseFilesIsSet(true);
      }
      if (incoming.get(5)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TList _list40 = new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.posDeleteFiles = new java.util.ArrayList(_list40.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem41;
          for (int _i42 = 0; _i42 < _list40.size; ++_i42)
          {
            _elem41 = iprot.readBinary();
            struct.posDeleteFiles.add(_elem41);
          }
        }
        struct.setPosDeleteFilesIsSet(true);
      }
      if (incoming.get(6)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TList _list43 = new com.netease.arctic.shade.org.apache.thrift.protocol.TList(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.sourceNodes = new java.util.ArrayList(_list43.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable TreeNode _elem44;
          for (int _i45 = 0; _i45 < _list43.size; ++_i45)
          {
            _elem44 = new TreeNode();
            _elem44.read(iprot);
            struct.sourceNodes.add(_elem44);
          }
        }
        struct.setSourceNodesIsSet(true);
      }
      if (incoming.get(7)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map46 = new com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.properties = new java.util.HashMap(2*_map46.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable String _key47;
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable String _val48;
          for (int _i49 = 0; _i49 < _map46.size; ++_i49)
          {
            _key47 = iprot.readString();
            _val48 = iprot.readString();
            struct.properties.put(_key47, _val48);
          }
        }
        struct.setPropertiesIsSet(true);
      }
    }
  }

  private static  S scheme(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol proto) {
    return (com.netease.arctic.shade.org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy