TDisk.java

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

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

  private static final org.apache.thrift.protocol.TField ROOT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("root_path", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField DISK_TOTAL_CAPACITY_FIELD_DESC = new org.apache.thrift.protocol.TField("disk_total_capacity", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField DATA_USED_CAPACITY_FIELD_DESC = new org.apache.thrift.protocol.TField("data_used_capacity", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField USED_FIELD_DESC = new org.apache.thrift.protocol.TField("used", org.apache.thrift.protocol.TType.BOOL, (short)4);
  private static final org.apache.thrift.protocol.TField DISK_AVAILABLE_CAPACITY_FIELD_DESC = new org.apache.thrift.protocol.TField("disk_available_capacity", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField PATH_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("path_hash", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField STORAGE_MEDIUM_FIELD_DESC = new org.apache.thrift.protocol.TField("storage_medium", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField REMOTE_USED_CAPACITY_FIELD_DESC = new org.apache.thrift.protocol.TField("remote_used_capacity", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField TRASH_USED_CAPACITY_FIELD_DESC = new org.apache.thrift.protocol.TField("trash_used_capacity", org.apache.thrift.protocol.TType.I64, (short)9);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String root_path; // required
  public long disk_total_capacity; // required
  public long data_used_capacity; // required
  public boolean used; // required
  public long disk_available_capacity; // optional
  public long path_hash; // optional
  /**
   * 
   * @see org.apache.doris.thrift.TStorageMedium
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStorageMedium storage_medium; // optional
  public long remote_used_capacity; // optional
  public long trash_used_capacity; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    ROOT_PATH((short)1, "root_path"),
    DISK_TOTAL_CAPACITY((short)2, "disk_total_capacity"),
    DATA_USED_CAPACITY((short)3, "data_used_capacity"),
    USED((short)4, "used"),
    DISK_AVAILABLE_CAPACITY((short)5, "disk_available_capacity"),
    PATH_HASH((short)6, "path_hash"),
    /**
     * 
     * @see org.apache.doris.thrift.TStorageMedium
     */
    STORAGE_MEDIUM((short)7, "storage_medium"),
    REMOTE_USED_CAPACITY((short)8, "remote_used_capacity"),
    TRASH_USED_CAPACITY((short)9, "trash_used_capacity");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // ROOT_PATH
          return ROOT_PATH;
        case 2: // DISK_TOTAL_CAPACITY
          return DISK_TOTAL_CAPACITY;
        case 3: // DATA_USED_CAPACITY
          return DATA_USED_CAPACITY;
        case 4: // USED
          return USED;
        case 5: // DISK_AVAILABLE_CAPACITY
          return DISK_AVAILABLE_CAPACITY;
        case 6: // PATH_HASH
          return PATH_HASH;
        case 7: // STORAGE_MEDIUM
          return STORAGE_MEDIUM;
        case 8: // REMOTE_USED_CAPACITY
          return REMOTE_USED_CAPACITY;
        case 9: // TRASH_USED_CAPACITY
          return TRASH_USED_CAPACITY;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

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

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

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

    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final int __DISK_TOTAL_CAPACITY_ISSET_ID = 0;
  private static final int __DATA_USED_CAPACITY_ISSET_ID = 1;
  private static final int __USED_ISSET_ID = 2;
  private static final int __DISK_AVAILABLE_CAPACITY_ISSET_ID = 3;
  private static final int __PATH_HASH_ISSET_ID = 4;
  private static final int __REMOTE_USED_CAPACITY_ISSET_ID = 5;
  private static final int __TRASH_USED_CAPACITY_ISSET_ID = 6;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.DISK_AVAILABLE_CAPACITY,_Fields.PATH_HASH,_Fields.STORAGE_MEDIUM,_Fields.REMOTE_USED_CAPACITY,_Fields.TRASH_USED_CAPACITY};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ROOT_PATH, new org.apache.thrift.meta_data.FieldMetaData("root_path", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DISK_TOTAL_CAPACITY, new org.apache.thrift.meta_data.FieldMetaData("disk_total_capacity", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TSize")));
    tmpMap.put(_Fields.DATA_USED_CAPACITY, new org.apache.thrift.meta_data.FieldMetaData("data_used_capacity", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TSize")));
    tmpMap.put(_Fields.USED, new org.apache.thrift.meta_data.FieldMetaData("used", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.DISK_AVAILABLE_CAPACITY, new org.apache.thrift.meta_data.FieldMetaData("disk_available_capacity", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TSize")));
    tmpMap.put(_Fields.PATH_HASH, new org.apache.thrift.meta_data.FieldMetaData("path_hash", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.STORAGE_MEDIUM, new org.apache.thrift.meta_data.FieldMetaData("storage_medium", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TStorageMedium.class)));
    tmpMap.put(_Fields.REMOTE_USED_CAPACITY, new org.apache.thrift.meta_data.FieldMetaData("remote_used_capacity", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TSize")));
    tmpMap.put(_Fields.TRASH_USED_CAPACITY, new org.apache.thrift.meta_data.FieldMetaData("trash_used_capacity", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TSize")));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDisk.class, metaDataMap);
  }

  public TDisk() {
  }

  public TDisk(
    java.lang.String root_path,
    long disk_total_capacity,
    long data_used_capacity,
    boolean used)
  {
    this();
    this.root_path = root_path;
    this.disk_total_capacity = disk_total_capacity;
    setDiskTotalCapacityIsSet(true);
    this.data_used_capacity = data_used_capacity;
    setDataUsedCapacityIsSet(true);
    this.used = used;
    setUsedIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TDisk(TDisk other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetRootPath()) {
      this.root_path = other.root_path;
    }
    this.disk_total_capacity = other.disk_total_capacity;
    this.data_used_capacity = other.data_used_capacity;
    this.used = other.used;
    this.disk_available_capacity = other.disk_available_capacity;
    this.path_hash = other.path_hash;
    if (other.isSetStorageMedium()) {
      this.storage_medium = other.storage_medium;
    }
    this.remote_used_capacity = other.remote_used_capacity;
    this.trash_used_capacity = other.trash_used_capacity;
  }

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

  @Override
  public void clear() {
    this.root_path = null;
    setDiskTotalCapacityIsSet(false);
    this.disk_total_capacity = 0;
    setDataUsedCapacityIsSet(false);
    this.data_used_capacity = 0;
    setUsedIsSet(false);
    this.used = false;
    setDiskAvailableCapacityIsSet(false);
    this.disk_available_capacity = 0;
    setPathHashIsSet(false);
    this.path_hash = 0;
    this.storage_medium = null;
    setRemoteUsedCapacityIsSet(false);
    this.remote_used_capacity = 0;
    setTrashUsedCapacityIsSet(false);
    this.trash_used_capacity = 0;
  }

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

  public TDisk setRootPath(@org.apache.thrift.annotation.Nullable java.lang.String root_path) {
    this.root_path = root_path;
    return this;
  }

  public void unsetRootPath() {
    this.root_path = null;
  }

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

  public void setRootPathIsSet(boolean value) {
    if (!value) {
      this.root_path = null;
    }
  }

  public long getDiskTotalCapacity() {
    return this.disk_total_capacity;
  }

  public TDisk setDiskTotalCapacity(long disk_total_capacity) {
    this.disk_total_capacity = disk_total_capacity;
    setDiskTotalCapacityIsSet(true);
    return this;
  }

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

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

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

  public long getDataUsedCapacity() {
    return this.data_used_capacity;
  }

  public TDisk setDataUsedCapacity(long data_used_capacity) {
    this.data_used_capacity = data_used_capacity;
    setDataUsedCapacityIsSet(true);
    return this;
  }

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

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

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

  public boolean isUsed() {
    return this.used;
  }

  public TDisk setUsed(boolean used) {
    this.used = used;
    setUsedIsSet(true);
    return this;
  }

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

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

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

  public long getDiskAvailableCapacity() {
    return this.disk_available_capacity;
  }

  public TDisk setDiskAvailableCapacity(long disk_available_capacity) {
    this.disk_available_capacity = disk_available_capacity;
    setDiskAvailableCapacityIsSet(true);
    return this;
  }

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

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

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

  public long getPathHash() {
    return this.path_hash;
  }

  public TDisk setPathHash(long path_hash) {
    this.path_hash = path_hash;
    setPathHashIsSet(true);
    return this;
  }

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

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

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

  /**
   * 
   * @see org.apache.doris.thrift.TStorageMedium
   */
  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TStorageMedium getStorageMedium() {
    return this.storage_medium;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TStorageMedium
   */
  public TDisk setStorageMedium(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStorageMedium storage_medium) {
    this.storage_medium = storage_medium;
    return this;
  }

  public void unsetStorageMedium() {
    this.storage_medium = null;
  }

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

  public void setStorageMediumIsSet(boolean value) {
    if (!value) {
      this.storage_medium = null;
    }
  }

  public long getRemoteUsedCapacity() {
    return this.remote_used_capacity;
  }

  public TDisk setRemoteUsedCapacity(long remote_used_capacity) {
    this.remote_used_capacity = remote_used_capacity;
    setRemoteUsedCapacityIsSet(true);
    return this;
  }

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

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

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

  public long getTrashUsedCapacity() {
    return this.trash_used_capacity;
  }

  public TDisk setTrashUsedCapacity(long trash_used_capacity) {
    this.trash_used_capacity = trash_used_capacity;
    setTrashUsedCapacityIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case ROOT_PATH:
      if (value == null) {
        unsetRootPath();
      } else {
        setRootPath((java.lang.String)value);
      }
      break;

    case DISK_TOTAL_CAPACITY:
      if (value == null) {
        unsetDiskTotalCapacity();
      } else {
        setDiskTotalCapacity((java.lang.Long)value);
      }
      break;

    case DATA_USED_CAPACITY:
      if (value == null) {
        unsetDataUsedCapacity();
      } else {
        setDataUsedCapacity((java.lang.Long)value);
      }
      break;

    case USED:
      if (value == null) {
        unsetUsed();
      } else {
        setUsed((java.lang.Boolean)value);
      }
      break;

    case DISK_AVAILABLE_CAPACITY:
      if (value == null) {
        unsetDiskAvailableCapacity();
      } else {
        setDiskAvailableCapacity((java.lang.Long)value);
      }
      break;

    case PATH_HASH:
      if (value == null) {
        unsetPathHash();
      } else {
        setPathHash((java.lang.Long)value);
      }
      break;

    case STORAGE_MEDIUM:
      if (value == null) {
        unsetStorageMedium();
      } else {
        setStorageMedium((org.apache.doris.thrift.TStorageMedium)value);
      }
      break;

    case REMOTE_USED_CAPACITY:
      if (value == null) {
        unsetRemoteUsedCapacity();
      } else {
        setRemoteUsedCapacity((java.lang.Long)value);
      }
      break;

    case TRASH_USED_CAPACITY:
      if (value == null) {
        unsetTrashUsedCapacity();
      } else {
        setTrashUsedCapacity((java.lang.Long)value);
      }
      break;

    }
  }

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

    case DISK_TOTAL_CAPACITY:
      return getDiskTotalCapacity();

    case DATA_USED_CAPACITY:
      return getDataUsedCapacity();

    case USED:
      return isUsed();

    case DISK_AVAILABLE_CAPACITY:
      return getDiskAvailableCapacity();

    case PATH_HASH:
      return getPathHash();

    case STORAGE_MEDIUM:
      return getStorageMedium();

    case REMOTE_USED_CAPACITY:
      return getRemoteUsedCapacity();

    case TRASH_USED_CAPACITY:
      return getTrashUsedCapacity();

    }
    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 ROOT_PATH:
      return isSetRootPath();
    case DISK_TOTAL_CAPACITY:
      return isSetDiskTotalCapacity();
    case DATA_USED_CAPACITY:
      return isSetDataUsedCapacity();
    case USED:
      return isSetUsed();
    case DISK_AVAILABLE_CAPACITY:
      return isSetDiskAvailableCapacity();
    case PATH_HASH:
      return isSetPathHash();
    case STORAGE_MEDIUM:
      return isSetStorageMedium();
    case REMOTE_USED_CAPACITY:
      return isSetRemoteUsedCapacity();
    case TRASH_USED_CAPACITY:
      return isSetTrashUsedCapacity();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_root_path = true && this.isSetRootPath();
    boolean that_present_root_path = true && that.isSetRootPath();
    if (this_present_root_path || that_present_root_path) {
      if (!(this_present_root_path && that_present_root_path))
        return false;
      if (!this.root_path.equals(that.root_path))
        return false;
    }

    boolean this_present_disk_total_capacity = true;
    boolean that_present_disk_total_capacity = true;
    if (this_present_disk_total_capacity || that_present_disk_total_capacity) {
      if (!(this_present_disk_total_capacity && that_present_disk_total_capacity))
        return false;
      if (this.disk_total_capacity != that.disk_total_capacity)
        return false;
    }

    boolean this_present_data_used_capacity = true;
    boolean that_present_data_used_capacity = true;
    if (this_present_data_used_capacity || that_present_data_used_capacity) {
      if (!(this_present_data_used_capacity && that_present_data_used_capacity))
        return false;
      if (this.data_used_capacity != that.data_used_capacity)
        return false;
    }

    boolean this_present_used = true;
    boolean that_present_used = true;
    if (this_present_used || that_present_used) {
      if (!(this_present_used && that_present_used))
        return false;
      if (this.used != that.used)
        return false;
    }

    boolean this_present_disk_available_capacity = true && this.isSetDiskAvailableCapacity();
    boolean that_present_disk_available_capacity = true && that.isSetDiskAvailableCapacity();
    if (this_present_disk_available_capacity || that_present_disk_available_capacity) {
      if (!(this_present_disk_available_capacity && that_present_disk_available_capacity))
        return false;
      if (this.disk_available_capacity != that.disk_available_capacity)
        return false;
    }

    boolean this_present_path_hash = true && this.isSetPathHash();
    boolean that_present_path_hash = true && that.isSetPathHash();
    if (this_present_path_hash || that_present_path_hash) {
      if (!(this_present_path_hash && that_present_path_hash))
        return false;
      if (this.path_hash != that.path_hash)
        return false;
    }

    boolean this_present_storage_medium = true && this.isSetStorageMedium();
    boolean that_present_storage_medium = true && that.isSetStorageMedium();
    if (this_present_storage_medium || that_present_storage_medium) {
      if (!(this_present_storage_medium && that_present_storage_medium))
        return false;
      if (!this.storage_medium.equals(that.storage_medium))
        return false;
    }

    boolean this_present_remote_used_capacity = true && this.isSetRemoteUsedCapacity();
    boolean that_present_remote_used_capacity = true && that.isSetRemoteUsedCapacity();
    if (this_present_remote_used_capacity || that_present_remote_used_capacity) {
      if (!(this_present_remote_used_capacity && that_present_remote_used_capacity))
        return false;
      if (this.remote_used_capacity != that.remote_used_capacity)
        return false;
    }

    boolean this_present_trash_used_capacity = true && this.isSetTrashUsedCapacity();
    boolean that_present_trash_used_capacity = true && that.isSetTrashUsedCapacity();
    if (this_present_trash_used_capacity || that_present_trash_used_capacity) {
      if (!(this_present_trash_used_capacity && that_present_trash_used_capacity))
        return false;
      if (this.trash_used_capacity != that.trash_used_capacity)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetRootPath()) ? 131071 : 524287);
    if (isSetRootPath())
      hashCode = hashCode * 8191 + root_path.hashCode();

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(disk_total_capacity);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(data_used_capacity);

    hashCode = hashCode * 8191 + ((used) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetDiskAvailableCapacity()) ? 131071 : 524287);
    if (isSetDiskAvailableCapacity())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(disk_available_capacity);

    hashCode = hashCode * 8191 + ((isSetPathHash()) ? 131071 : 524287);
    if (isSetPathHash())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(path_hash);

    hashCode = hashCode * 8191 + ((isSetStorageMedium()) ? 131071 : 524287);
    if (isSetStorageMedium())
      hashCode = hashCode * 8191 + storage_medium.getValue();

    hashCode = hashCode * 8191 + ((isSetRemoteUsedCapacity()) ? 131071 : 524287);
    if (isSetRemoteUsedCapacity())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(remote_used_capacity);

    hashCode = hashCode * 8191 + ((isSetTrashUsedCapacity()) ? 131071 : 524287);
    if (isSetTrashUsedCapacity())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(trash_used_capacity);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetRootPath(), other.isSetRootPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRootPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.root_path, other.root_path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDiskTotalCapacity(), other.isSetDiskTotalCapacity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDiskTotalCapacity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.disk_total_capacity, other.disk_total_capacity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDataUsedCapacity(), other.isSetDataUsedCapacity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataUsedCapacity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data_used_capacity, other.data_used_capacity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUsed(), other.isSetUsed());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUsed()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.used, other.used);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDiskAvailableCapacity(), other.isSetDiskAvailableCapacity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDiskAvailableCapacity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.disk_available_capacity, other.disk_available_capacity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPathHash(), other.isSetPathHash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPathHash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path_hash, other.path_hash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStorageMedium(), other.isSetStorageMedium());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStorageMedium()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storage_medium, other.storage_medium);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetRemoteUsedCapacity(), other.isSetRemoteUsedCapacity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRemoteUsedCapacity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.remote_used_capacity, other.remote_used_capacity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTrashUsedCapacity(), other.isSetTrashUsedCapacity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTrashUsedCapacity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.trash_used_capacity, other.trash_used_capacity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

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

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

    sb.append("root_path:");
    if (this.root_path == null) {
      sb.append("null");
    } else {
      sb.append(this.root_path);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("disk_total_capacity:");
    sb.append(this.disk_total_capacity);
    first = false;
    if (!first) sb.append(", ");
    sb.append("data_used_capacity:");
    sb.append(this.data_used_capacity);
    first = false;
    if (!first) sb.append(", ");
    sb.append("used:");
    sb.append(this.used);
    first = false;
    if (isSetDiskAvailableCapacity()) {
      if (!first) sb.append(", ");
      sb.append("disk_available_capacity:");
      sb.append(this.disk_available_capacity);
      first = false;
    }
    if (isSetPathHash()) {
      if (!first) sb.append(", ");
      sb.append("path_hash:");
      sb.append(this.path_hash);
      first = false;
    }
    if (isSetStorageMedium()) {
      if (!first) sb.append(", ");
      sb.append("storage_medium:");
      if (this.storage_medium == null) {
        sb.append("null");
      } else {
        sb.append(this.storage_medium);
      }
      first = false;
    }
    if (isSetRemoteUsedCapacity()) {
      if (!first) sb.append(", ");
      sb.append("remote_used_capacity:");
      sb.append(this.remote_used_capacity);
      first = false;
    }
    if (isSetTrashUsedCapacity()) {
      if (!first) sb.append(", ");
      sb.append("trash_used_capacity:");
      sb.append(this.trash_used_capacity);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (root_path == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'root_path' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'disk_total_capacity' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'data_used_capacity' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'used' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
  }

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

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

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

  private static class TDiskStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDisk> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TDisk struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // ROOT_PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.root_path = iprot.readString();
              struct.setRootPathIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // DISK_TOTAL_CAPACITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.disk_total_capacity = iprot.readI64();
              struct.setDiskTotalCapacityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // DATA_USED_CAPACITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.data_used_capacity = iprot.readI64();
              struct.setDataUsedCapacityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // USED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.used = iprot.readBool();
              struct.setUsedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // DISK_AVAILABLE_CAPACITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.disk_available_capacity = iprot.readI64();
              struct.setDiskAvailableCapacityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // PATH_HASH
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.path_hash = iprot.readI64();
              struct.setPathHashIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // STORAGE_MEDIUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.storage_medium = org.apache.doris.thrift.TStorageMedium.findByValue(iprot.readI32());
              struct.setStorageMediumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // REMOTE_USED_CAPACITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.remote_used_capacity = iprot.readI64();
              struct.setRemoteUsedCapacityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // TRASH_USED_CAPACITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.trash_used_capacity = iprot.readI64();
              struct.setTrashUsedCapacityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetDiskTotalCapacity()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'disk_total_capacity' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetDataUsedCapacity()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'data_used_capacity' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetUsed()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'used' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TDisk struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.root_path != null) {
        oprot.writeFieldBegin(ROOT_PATH_FIELD_DESC);
        oprot.writeString(struct.root_path);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(DISK_TOTAL_CAPACITY_FIELD_DESC);
      oprot.writeI64(struct.disk_total_capacity);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DATA_USED_CAPACITY_FIELD_DESC);
      oprot.writeI64(struct.data_used_capacity);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(USED_FIELD_DESC);
      oprot.writeBool(struct.used);
      oprot.writeFieldEnd();
      if (struct.isSetDiskAvailableCapacity()) {
        oprot.writeFieldBegin(DISK_AVAILABLE_CAPACITY_FIELD_DESC);
        oprot.writeI64(struct.disk_available_capacity);
        oprot.writeFieldEnd();
      }
      if (struct.isSetPathHash()) {
        oprot.writeFieldBegin(PATH_HASH_FIELD_DESC);
        oprot.writeI64(struct.path_hash);
        oprot.writeFieldEnd();
      }
      if (struct.storage_medium != null) {
        if (struct.isSetStorageMedium()) {
          oprot.writeFieldBegin(STORAGE_MEDIUM_FIELD_DESC);
          oprot.writeI32(struct.storage_medium.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetRemoteUsedCapacity()) {
        oprot.writeFieldBegin(REMOTE_USED_CAPACITY_FIELD_DESC);
        oprot.writeI64(struct.remote_used_capacity);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTrashUsedCapacity()) {
        oprot.writeFieldBegin(TRASH_USED_CAPACITY_FIELD_DESC);
        oprot.writeI64(struct.trash_used_capacity);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TDiskTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDisk> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TDisk struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.root_path);
      oprot.writeI64(struct.disk_total_capacity);
      oprot.writeI64(struct.data_used_capacity);
      oprot.writeBool(struct.used);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetDiskAvailableCapacity()) {
        optionals.set(0);
      }
      if (struct.isSetPathHash()) {
        optionals.set(1);
      }
      if (struct.isSetStorageMedium()) {
        optionals.set(2);
      }
      if (struct.isSetRemoteUsedCapacity()) {
        optionals.set(3);
      }
      if (struct.isSetTrashUsedCapacity()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetDiskAvailableCapacity()) {
        oprot.writeI64(struct.disk_available_capacity);
      }
      if (struct.isSetPathHash()) {
        oprot.writeI64(struct.path_hash);
      }
      if (struct.isSetStorageMedium()) {
        oprot.writeI32(struct.storage_medium.getValue());
      }
      if (struct.isSetRemoteUsedCapacity()) {
        oprot.writeI64(struct.remote_used_capacity);
      }
      if (struct.isSetTrashUsedCapacity()) {
        oprot.writeI64(struct.trash_used_capacity);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TDisk struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.root_path = iprot.readString();
      struct.setRootPathIsSet(true);
      struct.disk_total_capacity = iprot.readI64();
      struct.setDiskTotalCapacityIsSet(true);
      struct.data_used_capacity = iprot.readI64();
      struct.setDataUsedCapacityIsSet(true);
      struct.used = iprot.readBool();
      struct.setUsedIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.disk_available_capacity = iprot.readI64();
        struct.setDiskAvailableCapacityIsSet(true);
      }
      if (incoming.get(1)) {
        struct.path_hash = iprot.readI64();
        struct.setPathHashIsSet(true);
      }
      if (incoming.get(2)) {
        struct.storage_medium = org.apache.doris.thrift.TStorageMedium.findByValue(iprot.readI32());
        struct.setStorageMediumIsSet(true);
      }
      if (incoming.get(3)) {
        struct.remote_used_capacity = iprot.readI64();
        struct.setRemoteUsedCapacityIsSet(true);
      }
      if (incoming.get(4)) {
        struct.trash_used_capacity = iprot.readI64();
        struct.setTrashUsedCapacityIsSet(true);
      }
    }
  }

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