TDiskInfo.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 TDiskInfo implements org.apache.thrift.TBase<TDiskInfo, TDiskInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TDiskInfo> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDiskInfo");
private static final org.apache.thrift.protocol.TField DIR_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dirType", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField DIR_FIELD_DESC = new org.apache.thrift.protocol.TField("dir", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField FILESYSTEM_FIELD_DESC = new org.apache.thrift.protocol.TField("filesystem", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("blocks", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField USED_FIELD_DESC = new org.apache.thrift.protocol.TField("used", org.apache.thrift.protocol.TType.I64, (short)5);
private static final org.apache.thrift.protocol.TField AVAILABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("available", org.apache.thrift.protocol.TType.I64, (short)6);
private static final org.apache.thrift.protocol.TField USE_RATE_FIELD_DESC = new org.apache.thrift.protocol.TField("useRate", org.apache.thrift.protocol.TType.I32, (short)7);
private static final org.apache.thrift.protocol.TField MOUNTED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("mountedOn", org.apache.thrift.protocol.TType.STRING, (short)8);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDiskInfoStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDiskInfoTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String dirType; // required
public @org.apache.thrift.annotation.Nullable java.lang.String dir; // required
public @org.apache.thrift.annotation.Nullable java.lang.String filesystem; // required
public long blocks; // required
public long used; // required
public long available; // required
public int useRate; // required
public @org.apache.thrift.annotation.Nullable java.lang.String mountedOn; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
DIR_TYPE((short)1, "dirType"),
DIR((short)2, "dir"),
FILESYSTEM((short)3, "filesystem"),
BLOCKS((short)4, "blocks"),
USED((short)5, "used"),
AVAILABLE((short)6, "available"),
USE_RATE((short)7, "useRate"),
MOUNTED_ON((short)8, "mountedOn");
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: // DIR_TYPE
return DIR_TYPE;
case 2: // DIR
return DIR;
case 3: // FILESYSTEM
return FILESYSTEM;
case 4: // BLOCKS
return BLOCKS;
case 5: // USED
return USED;
case 6: // AVAILABLE
return AVAILABLE;
case 7: // USE_RATE
return USE_RATE;
case 8: // MOUNTED_ON
return MOUNTED_ON;
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 __BLOCKS_ISSET_ID = 0;
private static final int __USED_ISSET_ID = 1;
private static final int __AVAILABLE_ISSET_ID = 2;
private static final int __USERATE_ISSET_ID = 3;
private byte __isset_bitfield = 0;
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.DIR_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dirType", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DIR, new org.apache.thrift.meta_data.FieldMetaData("dir", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FILESYSTEM, new org.apache.thrift.meta_data.FieldMetaData("filesystem", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("blocks", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
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.I64)));
tmpMap.put(_Fields.AVAILABLE, new org.apache.thrift.meta_data.FieldMetaData("available", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.USE_RATE, new org.apache.thrift.meta_data.FieldMetaData("useRate", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.MOUNTED_ON, new org.apache.thrift.meta_data.FieldMetaData("mountedOn", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDiskInfo.class, metaDataMap);
}
public TDiskInfo() {
}
public TDiskInfo(
java.lang.String dirType,
java.lang.String dir,
java.lang.String filesystem,
long blocks,
long used,
long available,
int useRate,
java.lang.String mountedOn)
{
this();
this.dirType = dirType;
this.dir = dir;
this.filesystem = filesystem;
this.blocks = blocks;
setBlocksIsSet(true);
this.used = used;
setUsedIsSet(true);
this.available = available;
setAvailableIsSet(true);
this.useRate = useRate;
setUseRateIsSet(true);
this.mountedOn = mountedOn;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TDiskInfo(TDiskInfo other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetDirType()) {
this.dirType = other.dirType;
}
if (other.isSetDir()) {
this.dir = other.dir;
}
if (other.isSetFilesystem()) {
this.filesystem = other.filesystem;
}
this.blocks = other.blocks;
this.used = other.used;
this.available = other.available;
this.useRate = other.useRate;
if (other.isSetMountedOn()) {
this.mountedOn = other.mountedOn;
}
}
public TDiskInfo deepCopy() {
return new TDiskInfo(this);
}
@Override
public void clear() {
this.dirType = null;
this.dir = null;
this.filesystem = null;
setBlocksIsSet(false);
this.blocks = 0;
setUsedIsSet(false);
this.used = 0;
setAvailableIsSet(false);
this.available = 0;
setUseRateIsSet(false);
this.useRate = 0;
this.mountedOn = null;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getDirType() {
return this.dirType;
}
public TDiskInfo setDirType(@org.apache.thrift.annotation.Nullable java.lang.String dirType) {
this.dirType = dirType;
return this;
}
public void unsetDirType() {
this.dirType = null;
}
/** Returns true if field dirType is set (has been assigned a value) and false otherwise */
public boolean isSetDirType() {
return this.dirType != null;
}
public void setDirTypeIsSet(boolean value) {
if (!value) {
this.dirType = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getDir() {
return this.dir;
}
public TDiskInfo setDir(@org.apache.thrift.annotation.Nullable java.lang.String dir) {
this.dir = dir;
return this;
}
public void unsetDir() {
this.dir = null;
}
/** Returns true if field dir is set (has been assigned a value) and false otherwise */
public boolean isSetDir() {
return this.dir != null;
}
public void setDirIsSet(boolean value) {
if (!value) {
this.dir = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getFilesystem() {
return this.filesystem;
}
public TDiskInfo setFilesystem(@org.apache.thrift.annotation.Nullable java.lang.String filesystem) {
this.filesystem = filesystem;
return this;
}
public void unsetFilesystem() {
this.filesystem = null;
}
/** Returns true if field filesystem is set (has been assigned a value) and false otherwise */
public boolean isSetFilesystem() {
return this.filesystem != null;
}
public void setFilesystemIsSet(boolean value) {
if (!value) {
this.filesystem = null;
}
}
public long getBlocks() {
return this.blocks;
}
public TDiskInfo setBlocks(long blocks) {
this.blocks = blocks;
setBlocksIsSet(true);
return this;
}
public void unsetBlocks() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BLOCKS_ISSET_ID);
}
/** Returns true if field blocks is set (has been assigned a value) and false otherwise */
public boolean isSetBlocks() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BLOCKS_ISSET_ID);
}
public void setBlocksIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BLOCKS_ISSET_ID, value);
}
public long getUsed() {
return this.used;
}
public TDiskInfo setUsed(long 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 getAvailable() {
return this.available;
}
public TDiskInfo setAvailable(long available) {
this.available = available;
setAvailableIsSet(true);
return this;
}
public void unsetAvailable() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __AVAILABLE_ISSET_ID);
}
/** Returns true if field available is set (has been assigned a value) and false otherwise */
public boolean isSetAvailable() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __AVAILABLE_ISSET_ID);
}
public void setAvailableIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __AVAILABLE_ISSET_ID, value);
}
public int getUseRate() {
return this.useRate;
}
public TDiskInfo setUseRate(int useRate) {
this.useRate = useRate;
setUseRateIsSet(true);
return this;
}
public void unsetUseRate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __USERATE_ISSET_ID);
}
/** Returns true if field useRate is set (has been assigned a value) and false otherwise */
public boolean isSetUseRate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __USERATE_ISSET_ID);
}
public void setUseRateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __USERATE_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getMountedOn() {
return this.mountedOn;
}
public TDiskInfo setMountedOn(@org.apache.thrift.annotation.Nullable java.lang.String mountedOn) {
this.mountedOn = mountedOn;
return this;
}
public void unsetMountedOn() {
this.mountedOn = null;
}
/** Returns true if field mountedOn is set (has been assigned a value) and false otherwise */
public boolean isSetMountedOn() {
return this.mountedOn != null;
}
public void setMountedOnIsSet(boolean value) {
if (!value) {
this.mountedOn = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case DIR_TYPE:
if (value == null) {
unsetDirType();
} else {
setDirType((java.lang.String)value);
}
break;
case DIR:
if (value == null) {
unsetDir();
} else {
setDir((java.lang.String)value);
}
break;
case FILESYSTEM:
if (value == null) {
unsetFilesystem();
} else {
setFilesystem((java.lang.String)value);
}
break;
case BLOCKS:
if (value == null) {
unsetBlocks();
} else {
setBlocks((java.lang.Long)value);
}
break;
case USED:
if (value == null) {
unsetUsed();
} else {
setUsed((java.lang.Long)value);
}
break;
case AVAILABLE:
if (value == null) {
unsetAvailable();
} else {
setAvailable((java.lang.Long)value);
}
break;
case USE_RATE:
if (value == null) {
unsetUseRate();
} else {
setUseRate((java.lang.Integer)value);
}
break;
case MOUNTED_ON:
if (value == null) {
unsetMountedOn();
} else {
setMountedOn((java.lang.String)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case DIR_TYPE:
return getDirType();
case DIR:
return getDir();
case FILESYSTEM:
return getFilesystem();
case BLOCKS:
return getBlocks();
case USED:
return getUsed();
case AVAILABLE:
return getAvailable();
case USE_RATE:
return getUseRate();
case MOUNTED_ON:
return getMountedOn();
}
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 DIR_TYPE:
return isSetDirType();
case DIR:
return isSetDir();
case FILESYSTEM:
return isSetFilesystem();
case BLOCKS:
return isSetBlocks();
case USED:
return isSetUsed();
case AVAILABLE:
return isSetAvailable();
case USE_RATE:
return isSetUseRate();
case MOUNTED_ON:
return isSetMountedOn();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TDiskInfo)
return this.equals((TDiskInfo)that);
return false;
}
public boolean equals(TDiskInfo that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_dirType = true && this.isSetDirType();
boolean that_present_dirType = true && that.isSetDirType();
if (this_present_dirType || that_present_dirType) {
if (!(this_present_dirType && that_present_dirType))
return false;
if (!this.dirType.equals(that.dirType))
return false;
}
boolean this_present_dir = true && this.isSetDir();
boolean that_present_dir = true && that.isSetDir();
if (this_present_dir || that_present_dir) {
if (!(this_present_dir && that_present_dir))
return false;
if (!this.dir.equals(that.dir))
return false;
}
boolean this_present_filesystem = true && this.isSetFilesystem();
boolean that_present_filesystem = true && that.isSetFilesystem();
if (this_present_filesystem || that_present_filesystem) {
if (!(this_present_filesystem && that_present_filesystem))
return false;
if (!this.filesystem.equals(that.filesystem))
return false;
}
boolean this_present_blocks = true;
boolean that_present_blocks = true;
if (this_present_blocks || that_present_blocks) {
if (!(this_present_blocks && that_present_blocks))
return false;
if (this.blocks != that.blocks)
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_available = true;
boolean that_present_available = true;
if (this_present_available || that_present_available) {
if (!(this_present_available && that_present_available))
return false;
if (this.available != that.available)
return false;
}
boolean this_present_useRate = true;
boolean that_present_useRate = true;
if (this_present_useRate || that_present_useRate) {
if (!(this_present_useRate && that_present_useRate))
return false;
if (this.useRate != that.useRate)
return false;
}
boolean this_present_mountedOn = true && this.isSetMountedOn();
boolean that_present_mountedOn = true && that.isSetMountedOn();
if (this_present_mountedOn || that_present_mountedOn) {
if (!(this_present_mountedOn && that_present_mountedOn))
return false;
if (!this.mountedOn.equals(that.mountedOn))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetDirType()) ? 131071 : 524287);
if (isSetDirType())
hashCode = hashCode * 8191 + dirType.hashCode();
hashCode = hashCode * 8191 + ((isSetDir()) ? 131071 : 524287);
if (isSetDir())
hashCode = hashCode * 8191 + dir.hashCode();
hashCode = hashCode * 8191 + ((isSetFilesystem()) ? 131071 : 524287);
if (isSetFilesystem())
hashCode = hashCode * 8191 + filesystem.hashCode();
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(blocks);
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(used);
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(available);
hashCode = hashCode * 8191 + useRate;
hashCode = hashCode * 8191 + ((isSetMountedOn()) ? 131071 : 524287);
if (isSetMountedOn())
hashCode = hashCode * 8191 + mountedOn.hashCode();
return hashCode;
}
@Override
public int compareTo(TDiskInfo other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetDirType(), other.isSetDirType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDirType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dirType, other.dirType);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetDir(), other.isSetDir());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDir()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dir, other.dir);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetFilesystem(), other.isSetFilesystem());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFilesystem()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesystem, other.filesystem);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetBlocks(), other.isSetBlocks());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlocks()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blocks, other.blocks);
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(isSetAvailable(), other.isSetAvailable());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAvailable()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.available, other.available);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetUseRate(), other.isSetUseRate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUseRate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.useRate, other.useRate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetMountedOn(), other.isSetMountedOn());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMountedOn()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mountedOn, other.mountedOn);
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("TDiskInfo(");
boolean first = true;
sb.append("dirType:");
if (this.dirType == null) {
sb.append("null");
} else {
sb.append(this.dirType);
}
first = false;
if (!first) sb.append(", ");
sb.append("dir:");
if (this.dir == null) {
sb.append("null");
} else {
sb.append(this.dir);
}
first = false;
if (!first) sb.append(", ");
sb.append("filesystem:");
if (this.filesystem == null) {
sb.append("null");
} else {
sb.append(this.filesystem);
}
first = false;
if (!first) sb.append(", ");
sb.append("blocks:");
sb.append(this.blocks);
first = false;
if (!first) sb.append(", ");
sb.append("used:");
sb.append(this.used);
first = false;
if (!first) sb.append(", ");
sb.append("available:");
sb.append(this.available);
first = false;
if (!first) sb.append(", ");
sb.append("useRate:");
sb.append(this.useRate);
first = false;
if (!first) sb.append(", ");
sb.append("mountedOn:");
if (this.mountedOn == null) {
sb.append("null");
} else {
sb.append(this.mountedOn);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (dirType == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dirType' was not present! Struct: " + toString());
}
if (dir == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dir' was not present! Struct: " + toString());
}
if (filesystem == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'filesystem' was not present! Struct: " + toString());
}
// alas, we cannot check 'blocks' 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.
// alas, we cannot check 'available' because it's a primitive and you chose the non-beans generator.
// alas, we cannot check 'useRate' because it's a primitive and you chose the non-beans generator.
if (mountedOn == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'mountedOn' was not present! Struct: " + toString());
}
// 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 TDiskInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TDiskInfoStandardScheme getScheme() {
return new TDiskInfoStandardScheme();
}
}
private static class TDiskInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDiskInfo> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TDiskInfo 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: // DIR_TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.dirType = iprot.readString();
struct.setDirTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // DIR
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.dir = iprot.readString();
struct.setDirIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // FILESYSTEM
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.filesystem = iprot.readString();
struct.setFilesystemIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // BLOCKS
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blocks = iprot.readI64();
struct.setBlocksIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // USED
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.used = iprot.readI64();
struct.setUsedIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // AVAILABLE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.available = iprot.readI64();
struct.setAvailableIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // USE_RATE
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.useRate = iprot.readI32();
struct.setUseRateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // MOUNTED_ON
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.mountedOn = iprot.readString();
struct.setMountedOnIsSet(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.isSetBlocks()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'blocks' 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());
}
if (!struct.isSetAvailable()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'available' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetUseRate()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'useRate' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TDiskInfo struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.dirType != null) {
oprot.writeFieldBegin(DIR_TYPE_FIELD_DESC);
oprot.writeString(struct.dirType);
oprot.writeFieldEnd();
}
if (struct.dir != null) {
oprot.writeFieldBegin(DIR_FIELD_DESC);
oprot.writeString(struct.dir);
oprot.writeFieldEnd();
}
if (struct.filesystem != null) {
oprot.writeFieldBegin(FILESYSTEM_FIELD_DESC);
oprot.writeString(struct.filesystem);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(BLOCKS_FIELD_DESC);
oprot.writeI64(struct.blocks);
oprot.writeFieldEnd();
oprot.writeFieldBegin(USED_FIELD_DESC);
oprot.writeI64(struct.used);
oprot.writeFieldEnd();
oprot.writeFieldBegin(AVAILABLE_FIELD_DESC);
oprot.writeI64(struct.available);
oprot.writeFieldEnd();
oprot.writeFieldBegin(USE_RATE_FIELD_DESC);
oprot.writeI32(struct.useRate);
oprot.writeFieldEnd();
if (struct.mountedOn != null) {
oprot.writeFieldBegin(MOUNTED_ON_FIELD_DESC);
oprot.writeString(struct.mountedOn);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TDiskInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TDiskInfoTupleScheme getScheme() {
return new TDiskInfoTupleScheme();
}
}
private static class TDiskInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDiskInfo> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TDiskInfo struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.dirType);
oprot.writeString(struct.dir);
oprot.writeString(struct.filesystem);
oprot.writeI64(struct.blocks);
oprot.writeI64(struct.used);
oprot.writeI64(struct.available);
oprot.writeI32(struct.useRate);
oprot.writeString(struct.mountedOn);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TDiskInfo struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.dirType = iprot.readString();
struct.setDirTypeIsSet(true);
struct.dir = iprot.readString();
struct.setDirIsSet(true);
struct.filesystem = iprot.readString();
struct.setFilesystemIsSet(true);
struct.blocks = iprot.readI64();
struct.setBlocksIsSet(true);
struct.used = iprot.readI64();
struct.setUsedIsSet(true);
struct.available = iprot.readI64();
struct.setAvailableIsSet(true);
struct.useRate = iprot.readI32();
struct.setUseRateIsSet(true);
struct.mountedOn = iprot.readString();
struct.setMountedOnIsSet(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();
}
}