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

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

/**
 * 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-07")
public class OptimizerDescriptor 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("OptimizerDescriptor");

  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField OPTIMIZER_ID_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("optimizerId", com.netease.arctic.shade.org.apache.thrift.protocol.TType.I32, (short)1);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField GROUP_ID_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("groupId", com.netease.arctic.shade.org.apache.thrift.protocol.TType.I32, (short)2);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField GROUP_NAME_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("groupName", com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField CORE_NUMBER_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("coreNumber", com.netease.arctic.shade.org.apache.thrift.protocol.TType.I32, (short)4);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField MEMORY_SIZE_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("memorySize", com.netease.arctic.shade.org.apache.thrift.protocol.TType.I64, (short)5);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField CONTAINER_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("container", com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("status", com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TField("updateTime", com.netease.arctic.shade.org.apache.thrift.protocol.TType.I64, (short)8);

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

  public int optimizerId; // required
  public int groupId; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String groupName; // required
  public int coreNumber; // required
  public long memorySize; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String container; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String status; // required
  public long updateTime; // required

  /** 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 {
    OPTIMIZER_ID((short)1, "optimizerId"),
    GROUP_ID((short)2, "groupId"),
    GROUP_NAME((short)3, "groupName"),
    CORE_NUMBER((short)4, "coreNumber"),
    MEMORY_SIZE((short)5, "memorySize"),
    CONTAINER((short)6, "container"),
    STATUS((short)7, "status"),
    UPDATE_TIME((short)8, "updateTime");

    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: // OPTIMIZER_ID
          return OPTIMIZER_ID;
        case 2: // GROUP_ID
          return GROUP_ID;
        case 3: // GROUP_NAME
          return GROUP_NAME;
        case 4: // CORE_NUMBER
          return CORE_NUMBER;
        case 5: // MEMORY_SIZE
          return MEMORY_SIZE;
        case 6: // CONTAINER
          return CONTAINER;
        case 7: // STATUS
          return STATUS;
        case 8: // UPDATE_TIME
          return UPDATE_TIME;
        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.
     */
    @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final int __OPTIMIZERID_ISSET_ID = 0;
  private static final int __GROUPID_ISSET_ID = 1;
  private static final int __CORENUMBER_ISSET_ID = 2;
  private static final int __MEMORYSIZE_ISSET_ID = 3;
  private static final int __UPDATETIME_ISSET_ID = 4;
  private byte __isset_bitfield = 0;
  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.OPTIMIZER_ID, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("optimizerId", 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.I32)));
    tmpMap.put(_Fields.GROUP_ID, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("groupId", 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.I32)));
    tmpMap.put(_Fields.GROUP_NAME, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("groupName", 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.STRING)));
    tmpMap.put(_Fields.CORE_NUMBER, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("coreNumber", 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.I32)));
    tmpMap.put(_Fields.MEMORY_SIZE, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("memorySize", 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.I64)));
    tmpMap.put(_Fields.CONTAINER, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("container", 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.STRING)));
    tmpMap.put(_Fields.STATUS, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("status", 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.STRING)));
    tmpMap.put(_Fields.UPDATE_TIME, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("updateTime", 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.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptimizerDescriptor.class, metaDataMap);
  }

  public OptimizerDescriptor() {
  }

  public OptimizerDescriptor(
    int optimizerId,
    int groupId,
    java.lang.String groupName,
    int coreNumber,
    long memorySize,
    java.lang.String container,
    java.lang.String status,
    long updateTime)
  {
    this();
    this.optimizerId = optimizerId;
    setOptimizerIdIsSet(true);
    this.groupId = groupId;
    setGroupIdIsSet(true);
    this.groupName = groupName;
    this.coreNumber = coreNumber;
    setCoreNumberIsSet(true);
    this.memorySize = memorySize;
    setMemorySizeIsSet(true);
    this.container = container;
    this.status = status;
    this.updateTime = updateTime;
    setUpdateTimeIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public OptimizerDescriptor(OptimizerDescriptor other) {
    __isset_bitfield = other.__isset_bitfield;
    this.optimizerId = other.optimizerId;
    this.groupId = other.groupId;
    if (other.isSetGroupName()) {
      this.groupName = other.groupName;
    }
    this.coreNumber = other.coreNumber;
    this.memorySize = other.memorySize;
    if (other.isSetContainer()) {
      this.container = other.container;
    }
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    this.updateTime = other.updateTime;
  }

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

  @Override
  public void clear() {
    setOptimizerIdIsSet(false);
    this.optimizerId = 0;
    setGroupIdIsSet(false);
    this.groupId = 0;
    this.groupName = null;
    setCoreNumberIsSet(false);
    this.coreNumber = 0;
    setMemorySizeIsSet(false);
    this.memorySize = 0;
    this.container = null;
    this.status = null;
    setUpdateTimeIsSet(false);
    this.updateTime = 0;
  }

  public int getOptimizerId() {
    return this.optimizerId;
  }

  public OptimizerDescriptor setOptimizerId(int optimizerId) {
    this.optimizerId = optimizerId;
    setOptimizerIdIsSet(true);
    return this;
  }

  public void unsetOptimizerId() {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPTIMIZERID_ISSET_ID);
  }

  /** Returns true if field optimizerId is set (has been assigned a value) and false otherwise */
  public boolean isSetOptimizerId() {
    return com.netease.arctic.shade.org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPTIMIZERID_ISSET_ID);
  }

  public void setOptimizerIdIsSet(boolean value) {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPTIMIZERID_ISSET_ID, value);
  }

  public int getGroupId() {
    return this.groupId;
  }

  public OptimizerDescriptor setGroupId(int groupId) {
    this.groupId = groupId;
    setGroupIdIsSet(true);
    return this;
  }

  public void unsetGroupId() {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __GROUPID_ISSET_ID);
  }

  /** Returns true if field groupId is set (has been assigned a value) and false otherwise */
  public boolean isSetGroupId() {
    return com.netease.arctic.shade.org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __GROUPID_ISSET_ID);
  }

  public void setGroupIdIsSet(boolean value) {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __GROUPID_ISSET_ID, value);
  }

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

  public OptimizerDescriptor setGroupName(@com.netease.arctic.shade.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 getCoreNumber() {
    return this.coreNumber;
  }

  public OptimizerDescriptor setCoreNumber(int coreNumber) {
    this.coreNumber = coreNumber;
    setCoreNumberIsSet(true);
    return this;
  }

  public void unsetCoreNumber() {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CORENUMBER_ISSET_ID);
  }

  /** Returns true if field coreNumber is set (has been assigned a value) and false otherwise */
  public boolean isSetCoreNumber() {
    return com.netease.arctic.shade.org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CORENUMBER_ISSET_ID);
  }

  public void setCoreNumberIsSet(boolean value) {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CORENUMBER_ISSET_ID, value);
  }

  public long getMemorySize() {
    return this.memorySize;
  }

  public OptimizerDescriptor setMemorySize(long memorySize) {
    this.memorySize = memorySize;
    setMemorySizeIsSet(true);
    return this;
  }

  public void unsetMemorySize() {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MEMORYSIZE_ISSET_ID);
  }

  /** Returns true if field memorySize is set (has been assigned a value) and false otherwise */
  public boolean isSetMemorySize() {
    return com.netease.arctic.shade.org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MEMORYSIZE_ISSET_ID);
  }

  public void setMemorySizeIsSet(boolean value) {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MEMORYSIZE_ISSET_ID, value);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.lang.String getContainer() {
    return this.container;
  }

  public OptimizerDescriptor setContainer(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String container) {
    this.container = container;
    return this;
  }

  public void unsetContainer() {
    this.container = null;
  }

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

  public void setContainerIsSet(boolean value) {
    if (!value) {
      this.container = null;
    }
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.lang.String getStatus() {
    return this.status;
  }

  public OptimizerDescriptor setStatus(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String status) {
    this.status = status;
    return this;
  }

  public void unsetStatus() {
    this.status = null;
  }

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

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

  public long getUpdateTime() {
    return this.updateTime;
  }

  public OptimizerDescriptor setUpdateTime(long updateTime) {
    this.updateTime = updateTime;
    setUpdateTimeIsSet(true);
    return this;
  }

  public void unsetUpdateTime() {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATETIME_ISSET_ID);
  }

  /** Returns true if field updateTime is set (has been assigned a value) and false otherwise */
  public boolean isSetUpdateTime() {
    return com.netease.arctic.shade.org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATETIME_ISSET_ID);
  }

  public void setUpdateTimeIsSet(boolean value) {
    __isset_bitfield = com.netease.arctic.shade.org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATETIME_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case OPTIMIZER_ID:
      if (value == null) {
        unsetOptimizerId();
      } else {
        setOptimizerId((java.lang.Integer)value);
      }
      break;

    case GROUP_ID:
      if (value == null) {
        unsetGroupId();
      } else {
        setGroupId((java.lang.Integer)value);
      }
      break;

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

    case CORE_NUMBER:
      if (value == null) {
        unsetCoreNumber();
      } else {
        setCoreNumber((java.lang.Integer)value);
      }
      break;

    case MEMORY_SIZE:
      if (value == null) {
        unsetMemorySize();
      } else {
        setMemorySize((java.lang.Long)value);
      }
      break;

    case CONTAINER:
      if (value == null) {
        unsetContainer();
      } else {
        setContainer((java.lang.String)value);
      }
      break;

    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((java.lang.String)value);
      }
      break;

    case UPDATE_TIME:
      if (value == null) {
        unsetUpdateTime();
      } else {
        setUpdateTime((java.lang.Long)value);
      }
      break;

    }
  }

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

    case GROUP_ID:
      return getGroupId();

    case GROUP_NAME:
      return getGroupName();

    case CORE_NUMBER:
      return getCoreNumber();

    case MEMORY_SIZE:
      return getMemorySize();

    case CONTAINER:
      return getContainer();

    case STATUS:
      return getStatus();

    case UPDATE_TIME:
      return getUpdateTime();

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

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

    switch (field) {
    case OPTIMIZER_ID:
      return isSetOptimizerId();
    case GROUP_ID:
      return isSetGroupId();
    case GROUP_NAME:
      return isSetGroupName();
    case CORE_NUMBER:
      return isSetCoreNumber();
    case MEMORY_SIZE:
      return isSetMemorySize();
    case CONTAINER:
      return isSetContainer();
    case STATUS:
      return isSetStatus();
    case UPDATE_TIME:
      return isSetUpdateTime();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_optimizerId = true;
    boolean that_present_optimizerId = true;
    if (this_present_optimizerId || that_present_optimizerId) {
      if (!(this_present_optimizerId && that_present_optimizerId))
        return false;
      if (this.optimizerId != that.optimizerId)
        return false;
    }

    boolean this_present_groupId = true;
    boolean that_present_groupId = true;
    if (this_present_groupId || that_present_groupId) {
      if (!(this_present_groupId && that_present_groupId))
        return false;
      if (this.groupId != that.groupId)
        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_coreNumber = true;
    boolean that_present_coreNumber = true;
    if (this_present_coreNumber || that_present_coreNumber) {
      if (!(this_present_coreNumber && that_present_coreNumber))
        return false;
      if (this.coreNumber != that.coreNumber)
        return false;
    }

    boolean this_present_memorySize = true;
    boolean that_present_memorySize = true;
    if (this_present_memorySize || that_present_memorySize) {
      if (!(this_present_memorySize && that_present_memorySize))
        return false;
      if (this.memorySize != that.memorySize)
        return false;
    }

    boolean this_present_container = true && this.isSetContainer();
    boolean that_present_container = true && that.isSetContainer();
    if (this_present_container || that_present_container) {
      if (!(this_present_container && that_present_container))
        return false;
      if (!this.container.equals(that.container))
        return false;
    }

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_updateTime = true;
    boolean that_present_updateTime = true;
    if (this_present_updateTime || that_present_updateTime) {
      if (!(this_present_updateTime && that_present_updateTime))
        return false;
      if (this.updateTime != that.updateTime)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + optimizerId;

    hashCode = hashCode * 8191 + groupId;

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

    hashCode = hashCode * 8191 + coreNumber;

    hashCode = hashCode * 8191 + com.netease.arctic.shade.org.apache.thrift.TBaseHelper.hashCode(memorySize);

    hashCode = hashCode * 8191 + ((isSetContainer()) ? 131071 : 524287);
    if (isSetContainer())
      hashCode = hashCode * 8191 + container.hashCode();

    hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287);
    if (isSetStatus())
      hashCode = hashCode * 8191 + status.hashCode();

    hashCode = hashCode * 8191 + com.netease.arctic.shade.org.apache.thrift.TBaseHelper.hashCode(updateTime);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetOptimizerId()).compareTo(other.isSetOptimizerId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOptimizerId()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.optimizerId, other.optimizerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetGroupId()).compareTo(other.isSetGroupId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGroupId()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.groupId, other.groupId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetGroupName()).compareTo(other.isSetGroupName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGroupName()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.groupName, other.groupName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCoreNumber()).compareTo(other.isSetCoreNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCoreNumber()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.coreNumber, other.coreNumber);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetMemorySize()).compareTo(other.isSetMemorySize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMemorySize()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.memorySize, other.memorySize);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetContainer()).compareTo(other.isSetContainer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContainer()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.container, other.container);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUpdateTime()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime);
      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 java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("OptimizerDescriptor(");
    boolean first = true;

    sb.append("optimizerId:");
    sb.append(this.optimizerId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("groupId:");
    sb.append(this.groupId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("groupName:");
    if (this.groupName == null) {
      sb.append("null");
    } else {
      sb.append(this.groupName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("coreNumber:");
    sb.append(this.coreNumber);
    first = false;
    if (!first) sb.append(", ");
    sb.append("memorySize:");
    sb.append(this.memorySize);
    first = false;
    if (!first) sb.append(", ");
    sb.append("container:");
    if (this.container == null) {
      sb.append("null");
    } else {
      sb.append(this.container);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("updateTime:");
    sb.append(this.updateTime);
    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
  }

  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, 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 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 OptimizerDescriptorStandardSchemeFactory implements com.netease.arctic.shade.org.apache.thrift.scheme.SchemeFactory {
    public OptimizerDescriptorStandardScheme getScheme() {
      return new OptimizerDescriptorStandardScheme();
    }
  }

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

    public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol iprot, OptimizerDescriptor 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: // OPTIMIZER_ID
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.I32) {
              struct.optimizerId = iprot.readI32();
              struct.setOptimizerIdIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // GROUP_ID
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.I32) {
              struct.groupId = iprot.readI32();
              struct.setGroupIdIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // GROUP_NAME
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING) {
              struct.groupName = iprot.readString();
              struct.setGroupNameIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CORE_NUMBER
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.I32) {
              struct.coreNumber = iprot.readI32();
              struct.setCoreNumberIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // MEMORY_SIZE
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.I64) {
              struct.memorySize = iprot.readI64();
              struct.setMemorySizeIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CONTAINER
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING) {
              struct.container = iprot.readString();
              struct.setContainerIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // STATUS
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING) {
              struct.status = iprot.readString();
              struct.setStatusIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // UPDATE_TIME
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.I64) {
              struct.updateTime = iprot.readI64();
              struct.setUpdateTimeIsSet(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, OptimizerDescriptor struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(OPTIMIZER_ID_FIELD_DESC);
      oprot.writeI32(struct.optimizerId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(GROUP_ID_FIELD_DESC);
      oprot.writeI32(struct.groupId);
      oprot.writeFieldEnd();
      if (struct.groupName != null) {
        oprot.writeFieldBegin(GROUP_NAME_FIELD_DESC);
        oprot.writeString(struct.groupName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(CORE_NUMBER_FIELD_DESC);
      oprot.writeI32(struct.coreNumber);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(MEMORY_SIZE_FIELD_DESC);
      oprot.writeI64(struct.memorySize);
      oprot.writeFieldEnd();
      if (struct.container != null) {
        oprot.writeFieldBegin(CONTAINER_FIELD_DESC);
        oprot.writeString(struct.container);
        oprot.writeFieldEnd();
      }
      if (struct.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeString(struct.status);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC);
      oprot.writeI64(struct.updateTime);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol prot, OptimizerDescriptor 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.isSetOptimizerId()) {
        optionals.set(0);
      }
      if (struct.isSetGroupId()) {
        optionals.set(1);
      }
      if (struct.isSetGroupName()) {
        optionals.set(2);
      }
      if (struct.isSetCoreNumber()) {
        optionals.set(3);
      }
      if (struct.isSetMemorySize()) {
        optionals.set(4);
      }
      if (struct.isSetContainer()) {
        optionals.set(5);
      }
      if (struct.isSetStatus()) {
        optionals.set(6);
      }
      if (struct.isSetUpdateTime()) {
        optionals.set(7);
      }
      oprot.writeBitSet(optionals, 8);
      if (struct.isSetOptimizerId()) {
        oprot.writeI32(struct.optimizerId);
      }
      if (struct.isSetGroupId()) {
        oprot.writeI32(struct.groupId);
      }
      if (struct.isSetGroupName()) {
        oprot.writeString(struct.groupName);
      }
      if (struct.isSetCoreNumber()) {
        oprot.writeI32(struct.coreNumber);
      }
      if (struct.isSetMemorySize()) {
        oprot.writeI64(struct.memorySize);
      }
      if (struct.isSetContainer()) {
        oprot.writeString(struct.container);
      }
      if (struct.isSetStatus()) {
        oprot.writeString(struct.status);
      }
      if (struct.isSetUpdateTime()) {
        oprot.writeI64(struct.updateTime);
      }
    }

    @Override
    public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol prot, OptimizerDescriptor 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.optimizerId = iprot.readI32();
        struct.setOptimizerIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.groupId = iprot.readI32();
        struct.setGroupIdIsSet(true);
      }
      if (incoming.get(2)) {
        struct.groupName = iprot.readString();
        struct.setGroupNameIsSet(true);
      }
      if (incoming.get(3)) {
        struct.coreNumber = iprot.readI32();
        struct.setCoreNumberIsSet(true);
      }
      if (incoming.get(4)) {
        struct.memorySize = iprot.readI64();
        struct.setMemorySizeIsSet(true);
      }
      if (incoming.get(5)) {
        struct.container = iprot.readString();
        struct.setContainerIsSet(true);
      }
      if (incoming.get(6)) {
        struct.status = iprot.readString();
        struct.setStatusIsSet(true);
      }
      if (incoming.get(7)) {
        struct.updateTime = iprot.readI64();
        struct.setUpdateTimeIsSet(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