
alluxio.thrift.WorkerNetAddress Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alluxio-core-common Show documentation
Show all versions of alluxio-core-common Show documentation
Common utilities shared in Alluxio core modules
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package alluxio.thrift;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
* Address information about workers.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-06-03")
public class WorkerNetAddress 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("WorkerNetAddress");
private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField RPC_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("rpcPort", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField DATA_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("dataPort", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField WEB_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("webPort", org.apache.thrift.protocol.TType.I32, (short)4);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new WorkerNetAddressStandardSchemeFactory());
schemes.put(TupleScheme.class, new WorkerNetAddressTupleSchemeFactory());
}
private String host; // required
private int rpcPort; // required
private int dataPort; // required
private int webPort; // 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 {
HOST((short)1, "host"),
RPC_PORT((short)2, "rpcPort"),
DATA_PORT((short)3, "dataPort"),
WEB_PORT((short)4, "webPort");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // HOST
return HOST;
case 2: // RPC_PORT
return RPC_PORT;
case 3: // DATA_PORT
return DATA_PORT;
case 4: // WEB_PORT
return WEB_PORT;
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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __RPCPORT_ISSET_ID = 0;
private static final int __DATAPORT_ISSET_ID = 1;
private static final int __WEBPORT_ISSET_ID = 2;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.RPC_PORT, new org.apache.thrift.meta_data.FieldMetaData("rpcPort", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.DATA_PORT, new org.apache.thrift.meta_data.FieldMetaData("dataPort", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.WEB_PORT, new org.apache.thrift.meta_data.FieldMetaData("webPort", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkerNetAddress.class, metaDataMap);
}
public WorkerNetAddress() {
}
public WorkerNetAddress(
String host,
int rpcPort,
int dataPort,
int webPort)
{
this();
this.host = host;
this.rpcPort = rpcPort;
setRpcPortIsSet(true);
this.dataPort = dataPort;
setDataPortIsSet(true);
this.webPort = webPort;
setWebPortIsSet(true);
}
/**
* Performs a deep copy on other.
*/
public WorkerNetAddress(WorkerNetAddress other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetHost()) {
this.host = other.host;
}
this.rpcPort = other.rpcPort;
this.dataPort = other.dataPort;
this.webPort = other.webPort;
}
public WorkerNetAddress deepCopy() {
return new WorkerNetAddress(this);
}
@Override
public void clear() {
this.host = null;
setRpcPortIsSet(false);
this.rpcPort = 0;
setDataPortIsSet(false);
this.dataPort = 0;
setWebPortIsSet(false);
this.webPort = 0;
}
public String getHost() {
return this.host;
}
public WorkerNetAddress setHost(String host) {
this.host = host;
return this;
}
public void unsetHost() {
this.host = null;
}
/** Returns true if field host is set (has been assigned a value) and false otherwise */
public boolean isSetHost() {
return this.host != null;
}
public void setHostIsSet(boolean value) {
if (!value) {
this.host = null;
}
}
public int getRpcPort() {
return this.rpcPort;
}
public WorkerNetAddress setRpcPort(int rpcPort) {
this.rpcPort = rpcPort;
setRpcPortIsSet(true);
return this;
}
public void unsetRpcPort() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RPCPORT_ISSET_ID);
}
/** Returns true if field rpcPort is set (has been assigned a value) and false otherwise */
public boolean isSetRpcPort() {
return EncodingUtils.testBit(__isset_bitfield, __RPCPORT_ISSET_ID);
}
public void setRpcPortIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RPCPORT_ISSET_ID, value);
}
public int getDataPort() {
return this.dataPort;
}
public WorkerNetAddress setDataPort(int dataPort) {
this.dataPort = dataPort;
setDataPortIsSet(true);
return this;
}
public void unsetDataPort() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATAPORT_ISSET_ID);
}
/** Returns true if field dataPort is set (has been assigned a value) and false otherwise */
public boolean isSetDataPort() {
return EncodingUtils.testBit(__isset_bitfield, __DATAPORT_ISSET_ID);
}
public void setDataPortIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATAPORT_ISSET_ID, value);
}
public int getWebPort() {
return this.webPort;
}
public WorkerNetAddress setWebPort(int webPort) {
this.webPort = webPort;
setWebPortIsSet(true);
return this;
}
public void unsetWebPort() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WEBPORT_ISSET_ID);
}
/** Returns true if field webPort is set (has been assigned a value) and false otherwise */
public boolean isSetWebPort() {
return EncodingUtils.testBit(__isset_bitfield, __WEBPORT_ISSET_ID);
}
public void setWebPortIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WEBPORT_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case HOST:
if (value == null) {
unsetHost();
} else {
setHost((String)value);
}
break;
case RPC_PORT:
if (value == null) {
unsetRpcPort();
} else {
setRpcPort((Integer)value);
}
break;
case DATA_PORT:
if (value == null) {
unsetDataPort();
} else {
setDataPort((Integer)value);
}
break;
case WEB_PORT:
if (value == null) {
unsetWebPort();
} else {
setWebPort((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case HOST:
return getHost();
case RPC_PORT:
return getRpcPort();
case DATA_PORT:
return getDataPort();
case WEB_PORT:
return getWebPort();
}
throw new 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 IllegalArgumentException();
}
switch (field) {
case HOST:
return isSetHost();
case RPC_PORT:
return isSetRpcPort();
case DATA_PORT:
return isSetDataPort();
case WEB_PORT:
return isSetWebPort();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof WorkerNetAddress)
return this.equals((WorkerNetAddress)that);
return false;
}
public boolean equals(WorkerNetAddress that) {
if (that == null)
return false;
boolean this_present_host = true && this.isSetHost();
boolean that_present_host = true && that.isSetHost();
if (this_present_host || that_present_host) {
if (!(this_present_host && that_present_host))
return false;
if (!this.host.equals(that.host))
return false;
}
boolean this_present_rpcPort = true;
boolean that_present_rpcPort = true;
if (this_present_rpcPort || that_present_rpcPort) {
if (!(this_present_rpcPort && that_present_rpcPort))
return false;
if (this.rpcPort != that.rpcPort)
return false;
}
boolean this_present_dataPort = true;
boolean that_present_dataPort = true;
if (this_present_dataPort || that_present_dataPort) {
if (!(this_present_dataPort && that_present_dataPort))
return false;
if (this.dataPort != that.dataPort)
return false;
}
boolean this_present_webPort = true;
boolean that_present_webPort = true;
if (this_present_webPort || that_present_webPort) {
if (!(this_present_webPort && that_present_webPort))
return false;
if (this.webPort != that.webPort)
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy