/**
 * Autogenerated by Thrift Compiler (0.20.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.amoro.api;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-11")
public class OptimizerRegisterInfo implements org.apache.amoro.shade.thrift.org.apache.thrift.TBase<OptimizerRegisterInfo, OptimizerRegisterInfo._Fields>, java.io.Serializable, Cloneable, Comparable<OptimizerRegisterInfo> {
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TStruct("OptimizerRegisterInfo");

  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField RESOURCE_ID_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("resourceId", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField THREAD_COUNT_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("threadCount", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField MEMORY_MB_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("memoryMb", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("startTime", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField GROUP_NAME_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("groupName", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("properties", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, (short)6);

  private static final org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OptimizerRegisterInfoStandardSchemeFactory();
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OptimizerRegisterInfoTupleSchemeFactory();

  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String resourceId; // optional
  public int threadCount; // required
  public int memoryMb; // required
  public long startTime; // required
  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String groupName; // required
  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> properties; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.amoro.shade.thrift.org.apache.thrift.TFieldIdEnum {
    RESOURCE_ID((short)1, "resourceId"),
    THREAD_COUNT((short)2, "threadCount"),
    MEMORY_MB((short)3, "memoryMb"),
    START_TIME((short)4, "startTime"),
    GROUP_NAME((short)5, "groupName"),
    PROPERTIES((short)6, "properties");

    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.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // RESOURCE_ID
          return RESOURCE_ID;
        case 2: // THREAD_COUNT
          return THREAD_COUNT;
        case 3: // MEMORY_MB
          return MEMORY_MB;
        case 4: // START_TIME
          return START_TIME;
        case 5: // GROUP_NAME
          return GROUP_NAME;
        case 6: // 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 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.amoro.shade.thrift.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;
    }

    @Override
    public short getThriftFieldId() {
      return _thriftId;
    }

    @Override
    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __THREADCOUNT_ISSET_ID = 0;
  private static final int __MEMORYMB_ISSET_ID = 1;
  private static final int __STARTTIME_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.RESOURCE_ID,_Fields.PROPERTIES};
  public static final java.util.Map<_Fields, org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.RESOURCE_ID, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("resourceId", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.THREAD_COUNT, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("threadCount", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MEMORY_MB, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("memoryMb", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.START_TIME, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.GROUP_NAME, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("groupName", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PROPERTIES, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.MapMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING), 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptimizerRegisterInfo.class, metaDataMap);
  }

  public OptimizerRegisterInfo() {
  }

  public OptimizerRegisterInfo(
    int threadCount,
    int memoryMb,
    long startTime,
    java.lang.String groupName)
  {
    this();
    this.threadCount = threadCount;
    setThreadCountIsSet(true);
    this.memoryMb = memoryMb;
    setMemoryMbIsSet(true);
    this.startTime = startTime;
    setStartTimeIsSet(true);
    this.groupName = groupName;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public OptimizerRegisterInfo(OptimizerRegisterInfo other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetResourceId()) {
      this.resourceId = other.resourceId;
    }
    this.threadCount = other.threadCount;
    this.memoryMb = other.memoryMb;
    this.startTime = other.startTime;
    if (other.isSetGroupName()) {
      this.groupName = other.groupName;
    }
    if (other.isSetProperties()) {
      java.util.Map<java.lang.String,java.lang.String> __this__properties = new java.util.HashMap<java.lang.String,java.lang.String>(other.properties);
      this.properties = __this__properties;
    }
  }

  @Override
  public OptimizerRegisterInfo deepCopy() {
    return new OptimizerRegisterInfo(this);
  }

  @Override
  public void clear() {
    this.resourceId = null;
    setThreadCountIsSet(false);
    this.threadCount = 0;
    setMemoryMbIsSet(false);
    this.memoryMb = 0;
    setStartTimeIsSet(false);
    this.startTime = 0;
    this.groupName = null;
    this.properties = null;
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  public java.lang.String getResourceId() {
    return this.resourceId;
  }

  public OptimizerRegisterInfo setResourceId(@org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String resourceId) {
    this.resourceId = resourceId;
    return this;
  }

  public void unsetResourceId() {
    this.resourceId = null;
  }

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

  public void setResourceIdIsSet(boolean value) {
    if (!value) {
      this.resourceId = null;
    }
  }

  public int getThreadCount() {
    return this.threadCount;
  }

  public OptimizerRegisterInfo setThreadCount(int threadCount) {
    this.threadCount = threadCount;
    setThreadCountIsSet(true);
    return this;
  }

  public void unsetThreadCount() {
    __isset_bitfield = org.apache.amoro.shade.thrift.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __THREADCOUNT_ISSET_ID);
  }

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

  public void setThreadCountIsSet(boolean value) {
    __isset_bitfield = org.apache.amoro.shade.thrift.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __THREADCOUNT_ISSET_ID, value);
  }

  public int getMemoryMb() {
    return this.memoryMb;
  }

  public OptimizerRegisterInfo setMemoryMb(int memoryMb) {
    this.memoryMb = memoryMb;
    setMemoryMbIsSet(true);
    return this;
  }

  public void unsetMemoryMb() {
    __isset_bitfield = org.apache.amoro.shade.thrift.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MEMORYMB_ISSET_ID);
  }

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

  public void setMemoryMbIsSet(boolean value) {
    __isset_bitfield = org.apache.amoro.shade.thrift.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MEMORYMB_ISSET_ID, value);
  }

  public long getStartTime() {
    return this.startTime;
  }

  public OptimizerRegisterInfo setStartTime(long startTime) {
    this.startTime = startTime;
    setStartTimeIsSet(true);
    return this;
  }

  public void unsetStartTime() {
    __isset_bitfield = org.apache.amoro.shade.thrift.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID);
  }

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

  public void setStartTimeIsSet(boolean value) {
    __isset_bitfield = org.apache.amoro.shade.thrift.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value);
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  public java.lang.String getGroupName() {
    return this.groupName;
  }

  public OptimizerRegisterInfo setGroupName(@org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String groupName) {
    this.groupName = groupName;
    return this;
  }

  public void unsetGroupName() {
    this.groupName = null;
  }

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

  public void setGroupNameIsSet(boolean value) {
    if (!value) {
      this.groupName = null;
    }
  }

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

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

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

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

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

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

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

  @Override
  public void setFieldValue(_Fields field, @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case RESOURCE_ID:
      if (value == null) {
        unsetResourceId();
      } else {
        setResourceId((java.lang.String)value);
      }
      break;

    case THREAD_COUNT:
      if (value == null) {
        unsetThreadCount();
      } else {
        setThreadCount((java.lang.Integer)value);
      }
      break;

    case MEMORY_MB:
      if (value == null) {
        unsetMemoryMb();
      } else {
        setMemoryMb((java.lang.Integer)value);
      }
      break;

    case START_TIME:
      if (value == null) {
        unsetStartTime();
      } else {
        setStartTime((java.lang.Long)value);
      }
      break;

    case GROUP_NAME:
      if (value == null) {
        unsetGroupName();
      } else {
        setGroupName((java.lang.String)value);
      }
      break;

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

    }
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  @Override
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case RESOURCE_ID:
      return getResourceId();

    case THREAD_COUNT:
      return getThreadCount();

    case MEMORY_MB:
      return getMemoryMb();

    case START_TIME:
      return getStartTime();

    case GROUP_NAME:
      return getGroupName();

    case PROPERTIES:
      return getProperties();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  @Override
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case RESOURCE_ID:
      return isSetResourceId();
    case THREAD_COUNT:
      return isSetThreadCount();
    case MEMORY_MB:
      return isSetMemoryMb();
    case START_TIME:
      return isSetStartTime();
    case GROUP_NAME:
      return isSetGroupName();
    case PROPERTIES:
      return isSetProperties();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_resourceId = true && this.isSetResourceId();
    boolean that_present_resourceId = true && that.isSetResourceId();
    if (this_present_resourceId || that_present_resourceId) {
      if (!(this_present_resourceId && that_present_resourceId))
        return false;
      if (!this.resourceId.equals(that.resourceId))
        return false;
    }

    boolean this_present_threadCount = true;
    boolean that_present_threadCount = true;
    if (this_present_threadCount || that_present_threadCount) {
      if (!(this_present_threadCount && that_present_threadCount))
        return false;
      if (this.threadCount != that.threadCount)
        return false;
    }

    boolean this_present_memoryMb = true;
    boolean that_present_memoryMb = true;
    if (this_present_memoryMb || that_present_memoryMb) {
      if (!(this_present_memoryMb && that_present_memoryMb))
        return false;
      if (this.memoryMb != that.memoryMb)
        return false;
    }

    boolean this_present_startTime = true;
    boolean that_present_startTime = true;
    if (this_present_startTime || that_present_startTime) {
      if (!(this_present_startTime && that_present_startTime))
        return false;
      if (this.startTime != that.startTime)
        return false;
    }

    boolean this_present_groupName = true && this.isSetGroupName();
    boolean that_present_groupName = true && that.isSetGroupName();
    if (this_present_groupName || that_present_groupName) {
      if (!(this_present_groupName && that_present_groupName))
        return false;
      if (!this.groupName.equals(that.groupName))
        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 + ((isSetResourceId()) ? 131071 : 524287);
    if (isSetResourceId())
      hashCode = hashCode * 8191 + resourceId.hashCode();

    hashCode = hashCode * 8191 + threadCount;

    hashCode = hashCode * 8191 + memoryMb;

    hashCode = hashCode * 8191 + org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.hashCode(startTime);

    hashCode = hashCode * 8191 + ((isSetGroupName()) ? 131071 : 524287);
    if (isSetGroupName())
      hashCode = hashCode * 8191 + groupName.hashCode();

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

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetResourceId(), other.isSetResourceId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResourceId()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.resourceId, other.resourceId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetThreadCount(), other.isSetThreadCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetThreadCount()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.threadCount, other.threadCount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMemoryMb(), other.isSetMemoryMb());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMemoryMb()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.memoryMb, other.memoryMb);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStartTime(), other.isSetStartTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartTime()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetGroupName(), other.isSetGroupName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGroupName()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.groupName, other.groupName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetProperties(), other.isSetProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProperties()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

  @Override
  public void read(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol iprot) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  @Override
  public void write(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol oprot) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("OptimizerRegisterInfo(");
    boolean first = true;

    if (isSetResourceId()) {
      sb.append("resourceId:");
      if (this.resourceId == null) {
        sb.append("null");
      } else {
        sb.append(this.resourceId);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("threadCount:");
    sb.append(this.threadCount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("memoryMb:");
    sb.append(this.memoryMb);
    first = false;
    if (!first) sb.append(", ");
    sb.append("startTime:");
    sb.append(this.startTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("groupName:");
    if (this.groupName == null) {
      sb.append("null");
    } else {
      sb.append(this.groupName);
    }
    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 org.apache.amoro.shade.thrift.org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TCompactProtocol(new org.apache.amoro.shade.thrift.org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.amoro.shade.thrift.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.amoro.shade.thrift.org.apache.thrift.protocol.TCompactProtocol(new org.apache.amoro.shade.thrift.org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.amoro.shade.thrift.org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class OptimizerRegisterInfoStandardSchemeFactory implements org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory {
    @Override
    public OptimizerRegisterInfoStandardScheme getScheme() {
      return new OptimizerRegisterInfoStandardScheme();
    }
  }

  private static class OptimizerRegisterInfoStandardScheme extends org.apache.amoro.shade.thrift.org.apache.thrift.scheme.StandardScheme<OptimizerRegisterInfo> {

    @Override
    public void read(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol iprot, OptimizerRegisterInfo struct) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
      org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // RESOURCE_ID
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING) {
              struct.resourceId = iprot.readString();
              struct.setResourceIdIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // THREAD_COUNT
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I32) {
              struct.threadCount = iprot.readI32();
              struct.setThreadCountIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // MEMORY_MB
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I32) {
              struct.memoryMb = iprot.readI32();
              struct.setMemoryMbIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // START_TIME
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.I64) {
              struct.startTime = iprot.readI64();
              struct.setStartTimeIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // GROUP_NAME
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING) {
              struct.groupName = iprot.readString();
              struct.setGroupNameIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // PROPERTIES
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin();
                struct.properties = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map20.size);
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key21;
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val22;
                for (int _i23 = 0; _i23 < _map20.size; ++_i23)
                {
                  _key21 = iprot.readString();
                  _val22 = iprot.readString();
                  struct.properties.put(_key21, _val22);
                }
                iprot.readMapEnd();
              }
              struct.setPropertiesIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.amoro.shade.thrift.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();
    }

    @Override
    public void write(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol oprot, OptimizerRegisterInfo struct) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.resourceId != null) {
        if (struct.isSetResourceId()) {
          oprot.writeFieldBegin(RESOURCE_ID_FIELD_DESC);
          oprot.writeString(struct.resourceId);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldBegin(THREAD_COUNT_FIELD_DESC);
      oprot.writeI32(struct.threadCount);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(MEMORY_MB_FIELD_DESC);
      oprot.writeI32(struct.memoryMb);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(START_TIME_FIELD_DESC);
      oprot.writeI64(struct.startTime);
      oprot.writeFieldEnd();
      if (struct.groupName != null) {
        oprot.writeFieldBegin(GROUP_NAME_FIELD_DESC);
        oprot.writeString(struct.groupName);
        oprot.writeFieldEnd();
      }
      if (struct.properties != null) {
        if (struct.isSetProperties()) {
          oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, struct.properties.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter24 : struct.properties.entrySet())
            {
              oprot.writeString(_iter24.getKey());
              oprot.writeString(_iter24.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class OptimizerRegisterInfoTupleSchemeFactory implements org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory {
    @Override
    public OptimizerRegisterInfoTupleScheme getScheme() {
      return new OptimizerRegisterInfoTupleScheme();
    }
  }

  private static class OptimizerRegisterInfoTupleScheme extends org.apache.amoro.shade.thrift.org.apache.thrift.scheme.TupleScheme<OptimizerRegisterInfo> {

    @Override
    public void write(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol prot, OptimizerRegisterInfo struct) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
      org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetResourceId()) {
        optionals.set(0);
      }
      if (struct.isSetThreadCount()) {
        optionals.set(1);
      }
      if (struct.isSetMemoryMb()) {
        optionals.set(2);
      }
      if (struct.isSetStartTime()) {
        optionals.set(3);
      }
      if (struct.isSetGroupName()) {
        optionals.set(4);
      }
      if (struct.isSetProperties()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetResourceId()) {
        oprot.writeString(struct.resourceId);
      }
      if (struct.isSetThreadCount()) {
        oprot.writeI32(struct.threadCount);
      }
      if (struct.isSetMemoryMb()) {
        oprot.writeI32(struct.memoryMb);
      }
      if (struct.isSetStartTime()) {
        oprot.writeI64(struct.startTime);
      }
      if (struct.isSetGroupName()) {
        oprot.writeString(struct.groupName);
      }
      if (struct.isSetProperties()) {
        {
          oprot.writeI32(struct.properties.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter25 : struct.properties.entrySet())
          {
            oprot.writeString(_iter25.getKey());
            oprot.writeString(_iter25.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol prot, OptimizerRegisterInfo struct) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
      org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.resourceId = iprot.readString();
        struct.setResourceIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.threadCount = iprot.readI32();
        struct.setThreadCountIsSet(true);
      }
      if (incoming.get(2)) {
        struct.memoryMb = iprot.readI32();
        struct.setMemoryMbIsSet(true);
      }
      if (incoming.get(3)) {
        struct.startTime = iprot.readI64();
        struct.setStartTimeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.groupName = iprot.readString();
        struct.setGroupNameIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map26 = iprot.readMapBegin(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING); 
          struct.properties = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map26.size);
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key27;
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val28;
          for (int _i29 = 0; _i29 < _map26.size; ++_i29)
          {
            _key27 = iprot.readString();
            _val28 = iprot.readString();
            struct.properties.put(_key27, _val28);
          }
        }
        struct.setPropertiesIsSet(true);
      }
    }
  }

  private static <S extends org.apache.amoro.shade.thrift.org.apache.thrift.scheme.IScheme> S scheme(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.amoro.shade.thrift.org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}

