TFetchResourceResult.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 TFetchResourceResult implements org.apache.thrift.TBase<TFetchResourceResult, TFetchResourceResult._Fields>, java.io.Serializable, Cloneable, Comparable<TFetchResourceResult> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResourceResult");
private static final org.apache.thrift.protocol.TField PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("protocolVersion", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField RESOURCE_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceVersion", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField RESOURCE_BY_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceByUser", org.apache.thrift.protocol.TType.MAP, (short)3);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFetchResourceResultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFetchResourceResultTupleSchemeFactory();
/**
*
* @see org.apache.doris.thrift.TAgentServiceVersion
*/
public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TAgentServiceVersion protocolVersion; // required
public long resourceVersion; // required
public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,TUserResource> resourceByUser; // 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 {
/**
*
* @see org.apache.doris.thrift.TAgentServiceVersion
*/
PROTOCOL_VERSION((short)1, "protocolVersion"),
RESOURCE_VERSION((short)2, "resourceVersion"),
RESOURCE_BY_USER((short)3, "resourceByUser");
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: // PROTOCOL_VERSION
return PROTOCOL_VERSION;
case 2: // RESOURCE_VERSION
return RESOURCE_VERSION;
case 3: // RESOURCE_BY_USER
return RESOURCE_BY_USER;
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 __RESOURCEVERSION_ISSET_ID = 0;
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.PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("protocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TAgentServiceVersion.class)));
tmpMap.put(_Fields.RESOURCE_VERSION, new org.apache.thrift.meta_data.FieldMetaData("resourceVersion", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.RESOURCE_BY_USER, new org.apache.thrift.meta_data.FieldMetaData("resourceByUser", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserResource.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResourceResult.class, metaDataMap);
}
public TFetchResourceResult() {
}
public TFetchResourceResult(
org.apache.doris.thrift.TAgentServiceVersion protocolVersion,
long resourceVersion,
java.util.Map<java.lang.String,TUserResource> resourceByUser)
{
this();
this.protocolVersion = protocolVersion;
this.resourceVersion = resourceVersion;
setResourceVersionIsSet(true);
this.resourceByUser = resourceByUser;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TFetchResourceResult(TFetchResourceResult other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetProtocolVersion()) {
this.protocolVersion = other.protocolVersion;
}
this.resourceVersion = other.resourceVersion;
if (other.isSetResourceByUser()) {
java.util.Map<java.lang.String,TUserResource> __this__resourceByUser = new java.util.HashMap<java.lang.String,TUserResource>(other.resourceByUser.size());
for (java.util.Map.Entry<java.lang.String, TUserResource> other_element : other.resourceByUser.entrySet()) {
java.lang.String other_element_key = other_element.getKey();
TUserResource other_element_value = other_element.getValue();
java.lang.String __this__resourceByUser_copy_key = other_element_key;
TUserResource __this__resourceByUser_copy_value = new TUserResource(other_element_value);
__this__resourceByUser.put(__this__resourceByUser_copy_key, __this__resourceByUser_copy_value);
}
this.resourceByUser = __this__resourceByUser;
}
}
public TFetchResourceResult deepCopy() {
return new TFetchResourceResult(this);
}
@Override
public void clear() {
this.protocolVersion = null;
setResourceVersionIsSet(false);
this.resourceVersion = 0;
this.resourceByUser = null;
}
/**
*
* @see org.apache.doris.thrift.TAgentServiceVersion
*/
@org.apache.thrift.annotation.Nullable
public org.apache.doris.thrift.TAgentServiceVersion getProtocolVersion() {
return this.protocolVersion;
}
/**
*
* @see org.apache.doris.thrift.TAgentServiceVersion
*/
public TFetchResourceResult setProtocolVersion(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TAgentServiceVersion protocolVersion) {
this.protocolVersion = protocolVersion;
return this;
}
public void unsetProtocolVersion() {
this.protocolVersion = null;
}
/** Returns true if field protocolVersion is set (has been assigned a value) and false otherwise */
public boolean isSetProtocolVersion() {
return this.protocolVersion != null;
}
public void setProtocolVersionIsSet(boolean value) {
if (!value) {
this.protocolVersion = null;
}
}
public long getResourceVersion() {
return this.resourceVersion;
}
public TFetchResourceResult setResourceVersion(long resourceVersion) {
this.resourceVersion = resourceVersion;
setResourceVersionIsSet(true);
return this;
}
public void unsetResourceVersion() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RESOURCEVERSION_ISSET_ID);
}
/** Returns true if field resourceVersion is set (has been assigned a value) and false otherwise */
public boolean isSetResourceVersion() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RESOURCEVERSION_ISSET_ID);
}
public void setResourceVersionIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RESOURCEVERSION_ISSET_ID, value);
}
public int getResourceByUserSize() {
return (this.resourceByUser == null) ? 0 : this.resourceByUser.size();
}
public void putToResourceByUser(java.lang.String key, TUserResource val) {
if (this.resourceByUser == null) {
this.resourceByUser = new java.util.HashMap<java.lang.String,TUserResource>();
}
this.resourceByUser.put(key, val);
}
@org.apache.thrift.annotation.Nullable
public java.util.Map<java.lang.String,TUserResource> getResourceByUser() {
return this.resourceByUser;
}
public TFetchResourceResult setResourceByUser(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,TUserResource> resourceByUser) {
this.resourceByUser = resourceByUser;
return this;
}
public void unsetResourceByUser() {
this.resourceByUser = null;
}
/** Returns true if field resourceByUser is set (has been assigned a value) and false otherwise */
public boolean isSetResourceByUser() {
return this.resourceByUser != null;
}
public void setResourceByUserIsSet(boolean value) {
if (!value) {
this.resourceByUser = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case PROTOCOL_VERSION:
if (value == null) {
unsetProtocolVersion();
} else {
setProtocolVersion((org.apache.doris.thrift.TAgentServiceVersion)value);
}
break;
case RESOURCE_VERSION:
if (value == null) {
unsetResourceVersion();
} else {
setResourceVersion((java.lang.Long)value);
}
break;
case RESOURCE_BY_USER:
if (value == null) {
unsetResourceByUser();
} else {
setResourceByUser((java.util.Map<java.lang.String,TUserResource>)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROTOCOL_VERSION:
return getProtocolVersion();
case RESOURCE_VERSION:
return getResourceVersion();
case RESOURCE_BY_USER:
return getResourceByUser();
}
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 PROTOCOL_VERSION:
return isSetProtocolVersion();
case RESOURCE_VERSION:
return isSetResourceVersion();
case RESOURCE_BY_USER:
return isSetResourceByUser();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TFetchResourceResult)
return this.equals((TFetchResourceResult)that);
return false;
}
public boolean equals(TFetchResourceResult that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_protocolVersion = true && this.isSetProtocolVersion();
boolean that_present_protocolVersion = true && that.isSetProtocolVersion();
if (this_present_protocolVersion || that_present_protocolVersion) {
if (!(this_present_protocolVersion && that_present_protocolVersion))
return false;
if (!this.protocolVersion.equals(that.protocolVersion))
return false;
}
boolean this_present_resourceVersion = true;
boolean that_present_resourceVersion = true;
if (this_present_resourceVersion || that_present_resourceVersion) {
if (!(this_present_resourceVersion && that_present_resourceVersion))
return false;
if (this.resourceVersion != that.resourceVersion)
return false;
}
boolean this_present_resourceByUser = true && this.isSetResourceByUser();
boolean that_present_resourceByUser = true && that.isSetResourceByUser();
if (this_present_resourceByUser || that_present_resourceByUser) {
if (!(this_present_resourceByUser && that_present_resourceByUser))
return false;
if (!this.resourceByUser.equals(that.resourceByUser))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProtocolVersion()) ? 131071 : 524287);
if (isSetProtocolVersion())
hashCode = hashCode * 8191 + protocolVersion.getValue();
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(resourceVersion);
hashCode = hashCode * 8191 + ((isSetResourceByUser()) ? 131071 : 524287);
if (isSetResourceByUser())
hashCode = hashCode * 8191 + resourceByUser.hashCode();
return hashCode;
}
@Override
public int compareTo(TFetchResourceResult other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetProtocolVersion(), other.isSetProtocolVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProtocolVersion()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.protocolVersion, other.protocolVersion);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetResourceVersion(), other.isSetResourceVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetResourceVersion()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceVersion, other.resourceVersion);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetResourceByUser(), other.isSetResourceByUser());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetResourceByUser()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceByUser, other.resourceByUser);
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("TFetchResourceResult(");
boolean first = true;
sb.append("protocolVersion:");
if (this.protocolVersion == null) {
sb.append("null");
} else {
sb.append(this.protocolVersion);
}
first = false;
if (!first) sb.append(", ");
sb.append("resourceVersion:");
sb.append(this.resourceVersion);
first = false;
if (!first) sb.append(", ");
sb.append("resourceByUser:");
if (this.resourceByUser == null) {
sb.append("null");
} else {
sb.append(this.resourceByUser);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (protocolVersion == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocolVersion' was not present! Struct: " + toString());
}
// alas, we cannot check 'resourceVersion' because it's a primitive and you chose the non-beans generator.
if (resourceByUser == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'resourceByUser' 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 TFetchResourceResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TFetchResourceResultStandardScheme getScheme() {
return new TFetchResourceResultStandardScheme();
}
}
private static class TFetchResourceResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TFetchResourceResult> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResourceResult 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: // PROTOCOL_VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.protocolVersion = org.apache.doris.thrift.TAgentServiceVersion.findByValue(iprot.readI32());
struct.setProtocolVersionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // RESOURCE_VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.resourceVersion = iprot.readI64();
struct.setResourceVersionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // RESOURCE_BY_USER
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map214 = iprot.readMapBegin();
struct.resourceByUser = new java.util.HashMap<java.lang.String,TUserResource>(2*_map214.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key215;
@org.apache.thrift.annotation.Nullable TUserResource _val216;
for (int _i217 = 0; _i217 < _map214.size; ++_i217)
{
_key215 = iprot.readString();
_val216 = new TUserResource();
_val216.read(iprot);
struct.resourceByUser.put(_key215, _val216);
}
iprot.readMapEnd();
}
struct.setResourceByUserIsSet(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.isSetResourceVersion()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'resourceVersion' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResourceResult struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.protocolVersion != null) {
oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
oprot.writeI32(struct.protocolVersion.getValue());
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(RESOURCE_VERSION_FIELD_DESC);
oprot.writeI64(struct.resourceVersion);
oprot.writeFieldEnd();
if (struct.resourceByUser != null) {
oprot.writeFieldBegin(RESOURCE_BY_USER_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.resourceByUser.size()));
for (java.util.Map.Entry<java.lang.String, TUserResource> _iter218 : struct.resourceByUser.entrySet())
{
oprot.writeString(_iter218.getKey());
_iter218.getValue().write(oprot);
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TFetchResourceResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TFetchResourceResultTupleScheme getScheme() {
return new TFetchResourceResultTupleScheme();
}
}
private static class TFetchResourceResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TFetchResourceResult> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResourceResult struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI32(struct.protocolVersion.getValue());
oprot.writeI64(struct.resourceVersion);
{
oprot.writeI32(struct.resourceByUser.size());
for (java.util.Map.Entry<java.lang.String, TUserResource> _iter219 : struct.resourceByUser.entrySet())
{
oprot.writeString(_iter219.getKey());
_iter219.getValue().write(oprot);
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResourceResult struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.protocolVersion = org.apache.doris.thrift.TAgentServiceVersion.findByValue(iprot.readI32());
struct.setProtocolVersionIsSet(true);
struct.resourceVersion = iprot.readI64();
struct.setResourceVersionIsSet(true);
{
org.apache.thrift.protocol.TMap _map220 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT);
struct.resourceByUser = new java.util.HashMap<java.lang.String,TUserResource>(2*_map220.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key221;
@org.apache.thrift.annotation.Nullable TUserResource _val222;
for (int _i223 = 0; _i223 < _map220.size; ++_i223)
{
_key221 = iprot.readString();
_val222 = new TUserResource();
_val222.read(iprot);
struct.resourceByUser.put(_key221, _val222);
}
}
struct.setResourceByUserIsSet(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();
}
}