org.apache.iotdb.common.rpc.thrift.TDataNodeLocation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotdb-thrift-commons Show documentation
Show all versions of iotdb-thrift-commons Show documentation
RPC (Thrift) common framework.
The newest version!
/**
* Autogenerated by Thrift Compiler (0.14.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.iotdb.common.rpc.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2024-09-12")
public class TDataNodeLocation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDataNodeLocation");
private static final org.apache.thrift.protocol.TField DATA_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dataNodeId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField CLIENT_RPC_END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("clientRpcEndPoint", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField INTERNAL_END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("internalEndPoint", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final org.apache.thrift.protocol.TField M_PPDATA_EXCHANGE_END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("mPPDataExchangeEndPoint", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final org.apache.thrift.protocol.TField DATA_REGION_CONSENSUS_END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("dataRegionConsensusEndPoint", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField SCHEMA_REGION_CONSENSUS_END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaRegionConsensusEndPoint", org.apache.thrift.protocol.TType.STRUCT, (short)6);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDataNodeLocationStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDataNodeLocationTupleSchemeFactory();
public int dataNodeId; // required
public @org.apache.thrift.annotation.Nullable TEndPoint clientRpcEndPoint; // required
public @org.apache.thrift.annotation.Nullable TEndPoint internalEndPoint; // required
public @org.apache.thrift.annotation.Nullable TEndPoint mPPDataExchangeEndPoint; // required
public @org.apache.thrift.annotation.Nullable TEndPoint dataRegionConsensusEndPoint; // required
public @org.apache.thrift.annotation.Nullable TEndPoint schemaRegionConsensusEndPoint; // 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 {
DATA_NODE_ID((short)1, "dataNodeId"),
CLIENT_RPC_END_POINT((short)2, "clientRpcEndPoint"),
INTERNAL_END_POINT((short)3, "internalEndPoint"),
M_PPDATA_EXCHANGE_END_POINT((short)4, "mPPDataExchangeEndPoint"),
DATA_REGION_CONSENSUS_END_POINT((short)5, "dataRegionConsensusEndPoint"),
SCHEMA_REGION_CONSENSUS_END_POINT((short)6, "schemaRegionConsensusEndPoint");
private static final java.util.Map byName = new java.util.HashMap();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // DATA_NODE_ID
return DATA_NODE_ID;
case 2: // CLIENT_RPC_END_POINT
return CLIENT_RPC_END_POINT;
case 3: // INTERNAL_END_POINT
return INTERNAL_END_POINT;
case 4: // M_PPDATA_EXCHANGE_END_POINT
return M_PPDATA_EXCHANGE_END_POINT;
case 5: // DATA_REGION_CONSENSUS_END_POINT
return DATA_REGION_CONSENSUS_END_POINT;
case 6: // SCHEMA_REGION_CONSENSUS_END_POINT
return SCHEMA_REGION_CONSENSUS_END_POINT;
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 __DATANODEID_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.DATA_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("dataNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.CLIENT_RPC_END_POINT, new org.apache.thrift.meta_data.FieldMetaData("clientRpcEndPoint", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TEndPoint.class)));
tmpMap.put(_Fields.INTERNAL_END_POINT, new org.apache.thrift.meta_data.FieldMetaData("internalEndPoint", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TEndPoint.class)));
tmpMap.put(_Fields.M_PPDATA_EXCHANGE_END_POINT, new org.apache.thrift.meta_data.FieldMetaData("mPPDataExchangeEndPoint", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TEndPoint.class)));
tmpMap.put(_Fields.DATA_REGION_CONSENSUS_END_POINT, new org.apache.thrift.meta_data.FieldMetaData("dataRegionConsensusEndPoint", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TEndPoint.class)));
tmpMap.put(_Fields.SCHEMA_REGION_CONSENSUS_END_POINT, new org.apache.thrift.meta_data.FieldMetaData("schemaRegionConsensusEndPoint", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TEndPoint.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDataNodeLocation.class, metaDataMap);
}
public TDataNodeLocation() {
}
public TDataNodeLocation(
int dataNodeId,
TEndPoint clientRpcEndPoint,
TEndPoint internalEndPoint,
TEndPoint mPPDataExchangeEndPoint,
TEndPoint dataRegionConsensusEndPoint,
TEndPoint schemaRegionConsensusEndPoint)
{
this();
this.dataNodeId = dataNodeId;
setDataNodeIdIsSet(true);
this.clientRpcEndPoint = clientRpcEndPoint;
this.internalEndPoint = internalEndPoint;
this.mPPDataExchangeEndPoint = mPPDataExchangeEndPoint;
this.dataRegionConsensusEndPoint = dataRegionConsensusEndPoint;
this.schemaRegionConsensusEndPoint = schemaRegionConsensusEndPoint;
}
/**
* Performs a deep copy on other.
*/
public TDataNodeLocation(TDataNodeLocation other) {
__isset_bitfield = other.__isset_bitfield;
this.dataNodeId = other.dataNodeId;
if (other.isSetClientRpcEndPoint()) {
this.clientRpcEndPoint = new TEndPoint(other.clientRpcEndPoint);
}
if (other.isSetInternalEndPoint()) {
this.internalEndPoint = new TEndPoint(other.internalEndPoint);
}
if (other.isSetMPPDataExchangeEndPoint()) {
this.mPPDataExchangeEndPoint = new TEndPoint(other.mPPDataExchangeEndPoint);
}
if (other.isSetDataRegionConsensusEndPoint()) {
this.dataRegionConsensusEndPoint = new TEndPoint(other.dataRegionConsensusEndPoint);
}
if (other.isSetSchemaRegionConsensusEndPoint()) {
this.schemaRegionConsensusEndPoint = new TEndPoint(other.schemaRegionConsensusEndPoint);
}
}
public TDataNodeLocation deepCopy() {
return new TDataNodeLocation(this);
}
@Override
public void clear() {
setDataNodeIdIsSet(false);
this.dataNodeId = 0;
this.clientRpcEndPoint = null;
this.internalEndPoint = null;
this.mPPDataExchangeEndPoint = null;
this.dataRegionConsensusEndPoint = null;
this.schemaRegionConsensusEndPoint = null;
}
public int getDataNodeId() {
return this.dataNodeId;
}
public TDataNodeLocation setDataNodeId(int dataNodeId) {
this.dataNodeId = dataNodeId;
setDataNodeIdIsSet(true);
return this;
}
public void unsetDataNodeId() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DATANODEID_ISSET_ID);
}
/** Returns true if field dataNodeId is set (has been assigned a value) and false otherwise */
public boolean isSetDataNodeId() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DATANODEID_ISSET_ID);
}
public void setDataNodeIdIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DATANODEID_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public TEndPoint getClientRpcEndPoint() {
return this.clientRpcEndPoint;
}
public TDataNodeLocation setClientRpcEndPoint(@org.apache.thrift.annotation.Nullable TEndPoint clientRpcEndPoint) {
this.clientRpcEndPoint = clientRpcEndPoint;
return this;
}
public void unsetClientRpcEndPoint() {
this.clientRpcEndPoint = null;
}
/** Returns true if field clientRpcEndPoint is set (has been assigned a value) and false otherwise */
public boolean isSetClientRpcEndPoint() {
return this.clientRpcEndPoint != null;
}
public void setClientRpcEndPointIsSet(boolean value) {
if (!value) {
this.clientRpcEndPoint = null;
}
}
@org.apache.thrift.annotation.Nullable
public TEndPoint getInternalEndPoint() {
return this.internalEndPoint;
}
public TDataNodeLocation setInternalEndPoint(@org.apache.thrift.annotation.Nullable TEndPoint internalEndPoint) {
this.internalEndPoint = internalEndPoint;
return this;
}
public void unsetInternalEndPoint() {
this.internalEndPoint = null;
}
/** Returns true if field internalEndPoint is set (has been assigned a value) and false otherwise */
public boolean isSetInternalEndPoint() {
return this.internalEndPoint != null;
}
public void setInternalEndPointIsSet(boolean value) {
if (!value) {
this.internalEndPoint = null;
}
}
@org.apache.thrift.annotation.Nullable
public TEndPoint getMPPDataExchangeEndPoint() {
return this.mPPDataExchangeEndPoint;
}
public TDataNodeLocation setMPPDataExchangeEndPoint(@org.apache.thrift.annotation.Nullable TEndPoint mPPDataExchangeEndPoint) {
this.mPPDataExchangeEndPoint = mPPDataExchangeEndPoint;
return this;
}
public void unsetMPPDataExchangeEndPoint() {
this.mPPDataExchangeEndPoint = null;
}
/** Returns true if field mPPDataExchangeEndPoint is set (has been assigned a value) and false otherwise */
public boolean isSetMPPDataExchangeEndPoint() {
return this.mPPDataExchangeEndPoint != null;
}
public void setMPPDataExchangeEndPointIsSet(boolean value) {
if (!value) {
this.mPPDataExchangeEndPoint = null;
}
}
@org.apache.thrift.annotation.Nullable
public TEndPoint getDataRegionConsensusEndPoint() {
return this.dataRegionConsensusEndPoint;
}
public TDataNodeLocation setDataRegionConsensusEndPoint(@org.apache.thrift.annotation.Nullable TEndPoint dataRegionConsensusEndPoint) {
this.dataRegionConsensusEndPoint = dataRegionConsensusEndPoint;
return this;
}
public void unsetDataRegionConsensusEndPoint() {
this.dataRegionConsensusEndPoint = null;
}
/** Returns true if field dataRegionConsensusEndPoint is set (has been assigned a value) and false otherwise */
public boolean isSetDataRegionConsensusEndPoint() {
return this.dataRegionConsensusEndPoint != null;
}
public void setDataRegionConsensusEndPointIsSet(boolean value) {
if (!value) {
this.dataRegionConsensusEndPoint = null;
}
}
@org.apache.thrift.annotation.Nullable
public TEndPoint getSchemaRegionConsensusEndPoint() {
return this.schemaRegionConsensusEndPoint;
}
public TDataNodeLocation setSchemaRegionConsensusEndPoint(@org.apache.thrift.annotation.Nullable TEndPoint schemaRegionConsensusEndPoint) {
this.schemaRegionConsensusEndPoint = schemaRegionConsensusEndPoint;
return this;
}
public void unsetSchemaRegionConsensusEndPoint() {
this.schemaRegionConsensusEndPoint = null;
}
/** Returns true if field schemaRegionConsensusEndPoint is set (has been assigned a value) and false otherwise */
public boolean isSetSchemaRegionConsensusEndPoint() {
return this.schemaRegionConsensusEndPoint != null;
}
public void setSchemaRegionConsensusEndPointIsSet(boolean value) {
if (!value) {
this.schemaRegionConsensusEndPoint = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case DATA_NODE_ID:
if (value == null) {
unsetDataNodeId();
} else {
setDataNodeId((java.lang.Integer)value);
}
break;
case CLIENT_RPC_END_POINT:
if (value == null) {
unsetClientRpcEndPoint();
} else {
setClientRpcEndPoint((TEndPoint)value);
}
break;
case INTERNAL_END_POINT:
if (value == null) {
unsetInternalEndPoint();
} else {
setInternalEndPoint((TEndPoint)value);
}
break;
case M_PPDATA_EXCHANGE_END_POINT:
if (value == null) {
unsetMPPDataExchangeEndPoint();
} else {
setMPPDataExchangeEndPoint((TEndPoint)value);
}
break;
case DATA_REGION_CONSENSUS_END_POINT:
if (value == null) {
unsetDataRegionConsensusEndPoint();
} else {
setDataRegionConsensusEndPoint((TEndPoint)value);
}
break;
case SCHEMA_REGION_CONSENSUS_END_POINT:
if (value == null) {
unsetSchemaRegionConsensusEndPoint();
} else {
setSchemaRegionConsensusEndPoint((TEndPoint)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case DATA_NODE_ID:
return getDataNodeId();
case CLIENT_RPC_END_POINT:
return getClientRpcEndPoint();
case INTERNAL_END_POINT:
return getInternalEndPoint();
case M_PPDATA_EXCHANGE_END_POINT:
return getMPPDataExchangeEndPoint();
case DATA_REGION_CONSENSUS_END_POINT:
return getDataRegionConsensusEndPoint();
case SCHEMA_REGION_CONSENSUS_END_POINT:
return getSchemaRegionConsensusEndPoint();
}
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 DATA_NODE_ID:
return isSetDataNodeId();
case CLIENT_RPC_END_POINT:
return isSetClientRpcEndPoint();
case INTERNAL_END_POINT:
return isSetInternalEndPoint();
case M_PPDATA_EXCHANGE_END_POINT:
return isSetMPPDataExchangeEndPoint();
case DATA_REGION_CONSENSUS_END_POINT:
return isSetDataRegionConsensusEndPoint();
case SCHEMA_REGION_CONSENSUS_END_POINT:
return isSetSchemaRegionConsensusEndPoint();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TDataNodeLocation)
return this.equals((TDataNodeLocation)that);
return false;
}
public boolean equals(TDataNodeLocation that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_dataNodeId = true;
boolean that_present_dataNodeId = true;
if (this_present_dataNodeId || that_present_dataNodeId) {
if (!(this_present_dataNodeId && that_present_dataNodeId))
return false;
if (this.dataNodeId != that.dataNodeId)
return false;
}
boolean this_present_clientRpcEndPoint = true && this.isSetClientRpcEndPoint();
boolean that_present_clientRpcEndPoint = true && that.isSetClientRpcEndPoint();
if (this_present_clientRpcEndPoint || that_present_clientRpcEndPoint) {
if (!(this_present_clientRpcEndPoint && that_present_clientRpcEndPoint))
return false;
if (!this.clientRpcEndPoint.equals(that.clientRpcEndPoint))
return false;
}
boolean this_present_internalEndPoint = true && this.isSetInternalEndPoint();
boolean that_present_internalEndPoint = true && that.isSetInternalEndPoint();
if (this_present_internalEndPoint || that_present_internalEndPoint) {
if (!(this_present_internalEndPoint && that_present_internalEndPoint))
return false;
if (!this.internalEndPoint.equals(that.internalEndPoint))
return false;
}
boolean this_present_mPPDataExchangeEndPoint = true && this.isSetMPPDataExchangeEndPoint();
boolean that_present_mPPDataExchangeEndPoint = true && that.isSetMPPDataExchangeEndPoint();
if (this_present_mPPDataExchangeEndPoint || that_present_mPPDataExchangeEndPoint) {
if (!(this_present_mPPDataExchangeEndPoint && that_present_mPPDataExchangeEndPoint))
return false;
if (!this.mPPDataExchangeEndPoint.equals(that.mPPDataExchangeEndPoint))
return false;
}
boolean this_present_dataRegionConsensusEndPoint = true && this.isSetDataRegionConsensusEndPoint();
boolean that_present_dataRegionConsensusEndPoint = true && that.isSetDataRegionConsensusEndPoint();
if (this_present_dataRegionConsensusEndPoint || that_present_dataRegionConsensusEndPoint) {
if (!(this_present_dataRegionConsensusEndPoint && that_present_dataRegionConsensusEndPoint))
return false;
if (!this.dataRegionConsensusEndPoint.equals(that.dataRegionConsensusEndPoint))
return false;
}
boolean this_present_schemaRegionConsensusEndPoint = true && this.isSetSchemaRegionConsensusEndPoint();
boolean that_present_schemaRegionConsensusEndPoint = true && that.isSetSchemaRegionConsensusEndPoint();
if (this_present_schemaRegionConsensusEndPoint || that_present_schemaRegionConsensusEndPoint) {
if (!(this_present_schemaRegionConsensusEndPoint && that_present_schemaRegionConsensusEndPoint))
return false;
if (!this.schemaRegionConsensusEndPoint.equals(that.schemaRegionConsensusEndPoint))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + dataNodeId;
hashCode = hashCode * 8191 + ((isSetClientRpcEndPoint()) ? 131071 : 524287);
if (isSetClientRpcEndPoint())
hashCode = hashCode * 8191 + clientRpcEndPoint.hashCode();
hashCode = hashCode * 8191 + ((isSetInternalEndPoint()) ? 131071 : 524287);
if (isSetInternalEndPoint())
hashCode = hashCode * 8191 + internalEndPoint.hashCode();
hashCode = hashCode * 8191 + ((isSetMPPDataExchangeEndPoint()) ? 131071 : 524287);
if (isSetMPPDataExchangeEndPoint())
hashCode = hashCode * 8191 + mPPDataExchangeEndPoint.hashCode();
hashCode = hashCode * 8191 + ((isSetDataRegionConsensusEndPoint()) ? 131071 : 524287);
if (isSetDataRegionConsensusEndPoint())
hashCode = hashCode * 8191 + dataRegionConsensusEndPoint.hashCode();
hashCode = hashCode * 8191 + ((isSetSchemaRegionConsensusEndPoint()) ? 131071 : 524287);
if (isSetSchemaRegionConsensusEndPoint())
hashCode = hashCode * 8191 + schemaRegionConsensusEndPoint.hashCode();
return hashCode;
}
@Override
public int compareTo(TDataNodeLocation other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetDataNodeId(), other.isSetDataNodeId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDataNodeId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataNodeId, other.dataNodeId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetClientRpcEndPoint(), other.isSetClientRpcEndPoint());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetClientRpcEndPoint()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientRpcEndPoint, other.clientRpcEndPoint);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetInternalEndPoint(), other.isSetInternalEndPoint());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInternalEndPoint()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalEndPoint, other.internalEndPoint);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetMPPDataExchangeEndPoint(), other.isSetMPPDataExchangeEndPoint());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMPPDataExchangeEndPoint()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mPPDataExchangeEndPoint, other.mPPDataExchangeEndPoint);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetDataRegionConsensusEndPoint(), other.isSetDataRegionConsensusEndPoint());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDataRegionConsensusEndPoint()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataRegionConsensusEndPoint, other.dataRegionConsensusEndPoint);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetSchemaRegionConsensusEndPoint(), other.isSetSchemaRegionConsensusEndPoint());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSchemaRegionConsensusEndPoint()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaRegionConsensusEndPoint, other.schemaRegionConsensusEndPoint);
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("TDataNodeLocation(");
boolean first = true;
sb.append("dataNodeId:");
sb.append(this.dataNodeId);
first = false;
if (!first) sb.append(", ");
sb.append("clientRpcEndPoint:");
if (this.clientRpcEndPoint == null) {
sb.append("null");
} else {
sb.append(this.clientRpcEndPoint);
}
first = false;
if (!first) sb.append(", ");
sb.append("internalEndPoint:");
if (this.internalEndPoint == null) {
sb.append("null");
} else {
sb.append(this.internalEndPoint);
}
first = false;
if (!first) sb.append(", ");
sb.append("mPPDataExchangeEndPoint:");
if (this.mPPDataExchangeEndPoint == null) {
sb.append("null");
} else {
sb.append(this.mPPDataExchangeEndPoint);
}
first = false;
if (!first) sb.append(", ");
sb.append("dataRegionConsensusEndPoint:");
if (this.dataRegionConsensusEndPoint == null) {
sb.append("null");
} else {
sb.append(this.dataRegionConsensusEndPoint);
}
first = false;
if (!first) sb.append(", ");
sb.append("schemaRegionConsensusEndPoint:");
if (this.schemaRegionConsensusEndPoint == null) {
sb.append("null");
} else {
sb.append(this.schemaRegionConsensusEndPoint);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'dataNodeId' because it's a primitive and you chose the non-beans generator.
if (clientRpcEndPoint == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientRpcEndPoint' was not present! Struct: " + toString());
}
if (internalEndPoint == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'internalEndPoint' was not present! Struct: " + toString());
}
if (mPPDataExchangeEndPoint == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'mPPDataExchangeEndPoint' was not present! Struct: " + toString());
}
if (dataRegionConsensusEndPoint == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataRegionConsensusEndPoint' was not present! Struct: " + toString());
}
if (schemaRegionConsensusEndPoint == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'schemaRegionConsensusEndPoint' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (clientRpcEndPoint != null) {
clientRpcEndPoint.validate();
}
if (internalEndPoint != null) {
internalEndPoint.validate();
}
if (mPPDataExchangeEndPoint != null) {
mPPDataExchangeEndPoint.validate();
}
if (dataRegionConsensusEndPoint != null) {
dataRegionConsensusEndPoint.validate();
}
if (schemaRegionConsensusEndPoint != null) {
schemaRegionConsensusEndPoint.validate();
}
}
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 TDataNodeLocationStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TDataNodeLocationStandardScheme getScheme() {
return new TDataNodeLocationStandardScheme();
}
}
private static class TDataNodeLocationStandardScheme extends org.apache.thrift.scheme.StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, TDataNodeLocation 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: // DATA_NODE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.dataNodeId = iprot.readI32();
struct.setDataNodeIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // CLIENT_RPC_END_POINT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.clientRpcEndPoint = new TEndPoint();
struct.clientRpcEndPoint.read(iprot);
struct.setClientRpcEndPointIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // INTERNAL_END_POINT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.internalEndPoint = new TEndPoint();
struct.internalEndPoint.read(iprot);
struct.setInternalEndPointIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // M_PPDATA_EXCHANGE_END_POINT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.mPPDataExchangeEndPoint = new TEndPoint();
struct.mPPDataExchangeEndPoint.read(iprot);
struct.setMPPDataExchangeEndPointIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // DATA_REGION_CONSENSUS_END_POINT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.dataRegionConsensusEndPoint = new TEndPoint();
struct.dataRegionConsensusEndPoint.read(iprot);
struct.setDataRegionConsensusEndPointIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // SCHEMA_REGION_CONSENSUS_END_POINT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.schemaRegionConsensusEndPoint = new TEndPoint();
struct.schemaRegionConsensusEndPoint.read(iprot);
struct.setSchemaRegionConsensusEndPointIsSet(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.isSetDataNodeId()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataNodeId' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TDataNodeLocation struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(DATA_NODE_ID_FIELD_DESC);
oprot.writeI32(struct.dataNodeId);
oprot.writeFieldEnd();
if (struct.clientRpcEndPoint != null) {
oprot.writeFieldBegin(CLIENT_RPC_END_POINT_FIELD_DESC);
struct.clientRpcEndPoint.write(oprot);
oprot.writeFieldEnd();
}
if (struct.internalEndPoint != null) {
oprot.writeFieldBegin(INTERNAL_END_POINT_FIELD_DESC);
struct.internalEndPoint.write(oprot);
oprot.writeFieldEnd();
}
if (struct.mPPDataExchangeEndPoint != null) {
oprot.writeFieldBegin(M_PPDATA_EXCHANGE_END_POINT_FIELD_DESC);
struct.mPPDataExchangeEndPoint.write(oprot);
oprot.writeFieldEnd();
}
if (struct.dataRegionConsensusEndPoint != null) {
oprot.writeFieldBegin(DATA_REGION_CONSENSUS_END_POINT_FIELD_DESC);
struct.dataRegionConsensusEndPoint.write(oprot);
oprot.writeFieldEnd();
}
if (struct.schemaRegionConsensusEndPoint != null) {
oprot.writeFieldBegin(SCHEMA_REGION_CONSENSUS_END_POINT_FIELD_DESC);
struct.schemaRegionConsensusEndPoint.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TDataNodeLocationTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TDataNodeLocationTupleScheme getScheme() {
return new TDataNodeLocationTupleScheme();
}
}
private static class TDataNodeLocationTupleScheme extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TDataNodeLocation struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI32(struct.dataNodeId);
struct.clientRpcEndPoint.write(oprot);
struct.internalEndPoint.write(oprot);
struct.mPPDataExchangeEndPoint.write(oprot);
struct.dataRegionConsensusEndPoint.write(oprot);
struct.schemaRegionConsensusEndPoint.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TDataNodeLocation struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.dataNodeId = iprot.readI32();
struct.setDataNodeIdIsSet(true);
struct.clientRpcEndPoint = new TEndPoint();
struct.clientRpcEndPoint.read(iprot);
struct.setClientRpcEndPointIsSet(true);
struct.internalEndPoint = new TEndPoint();
struct.internalEndPoint.read(iprot);
struct.setInternalEndPointIsSet(true);
struct.mPPDataExchangeEndPoint = new TEndPoint();
struct.mPPDataExchangeEndPoint.read(iprot);
struct.setMPPDataExchangeEndPointIsSet(true);
struct.dataRegionConsensusEndPoint = new TEndPoint();
struct.dataRegionConsensusEndPoint.read(iprot);
struct.setDataRegionConsensusEndPointIsSet(true);
struct.schemaRegionConsensusEndPoint = new TEndPoint();
struct.schemaRegionConsensusEndPoint.read(iprot);
struct.setSchemaRegionConsensusEndPointIsSet(true);
}
}
private static 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();
}
}