mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-25 12:46:21 +10:00
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-commons/trunk@834 84d0f5b1-2673-498c-a247-62c4ff18d310
868 lines
26 KiB
Java
868 lines
26 KiB
Java
/**
|
|
* Autogenerated by Thrift Compiler (0.8.0)
|
|
*
|
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
* @generated
|
|
*/
|
|
package com.profiler.common.dto.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 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 org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
public class AgentInfo implements org.apache.thrift.TBase<AgentInfo, AgentInfo._Fields>, java.io.Serializable, Cloneable {
|
|
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AgentInfo");
|
|
|
|
private static final org.apache.thrift.protocol.TField HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostname", org.apache.thrift.protocol.TType.STRING, (short)1);
|
|
private static final org.apache.thrift.protocol.TField PORTS_FIELD_DESC = new org.apache.thrift.protocol.TField("ports", org.apache.thrift.protocol.TType.STRING, (short)2);
|
|
private static final org.apache.thrift.protocol.TField AGENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("agentId", org.apache.thrift.protocol.TType.STRING, (short)3);
|
|
private static final org.apache.thrift.protocol.TField APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)4);
|
|
private static final org.apache.thrift.protocol.TField IS_ALIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isAlive", org.apache.thrift.protocol.TType.BOOL, (short)5);
|
|
private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)6);
|
|
|
|
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
|
static {
|
|
schemes.put(StandardScheme.class, new AgentInfoStandardSchemeFactory());
|
|
schemes.put(TupleScheme.class, new AgentInfoTupleSchemeFactory());
|
|
}
|
|
|
|
private String hostname; // required
|
|
private String ports; // required
|
|
private String agentId; // required
|
|
private String applicationName; // required
|
|
private boolean isAlive; // required
|
|
private long timestamp; // 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 {
|
|
HOSTNAME((short)1, "hostname"),
|
|
PORTS((short)2, "ports"),
|
|
AGENT_ID((short)3, "agentId"),
|
|
APPLICATION_NAME((short)4, "applicationName"),
|
|
IS_ALIVE((short)5, "isAlive"),
|
|
TIMESTAMP((short)6, "timestamp");
|
|
|
|
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
|
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: // HOSTNAME
|
|
return HOSTNAME;
|
|
case 2: // PORTS
|
|
return PORTS;
|
|
case 3: // AGENT_ID
|
|
return AGENT_ID;
|
|
case 4: // APPLICATION_NAME
|
|
return APPLICATION_NAME;
|
|
case 5: // IS_ALIVE
|
|
return IS_ALIVE;
|
|
case 6: // TIMESTAMP
|
|
return TIMESTAMP;
|
|
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 __ISALIVE_ISSET_ID = 0;
|
|
private static final int __TIMESTAMP_ISSET_ID = 1;
|
|
private BitSet __isset_bit_vector = new BitSet(2);
|
|
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.HOSTNAME, new org.apache.thrift.meta_data.FieldMetaData("hostname", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
tmpMap.put(_Fields.PORTS, new org.apache.thrift.meta_data.FieldMetaData("ports", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
tmpMap.put(_Fields.AGENT_ID, new org.apache.thrift.meta_data.FieldMetaData("agentId", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
tmpMap.put(_Fields.APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("applicationName", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
tmpMap.put(_Fields.IS_ALIVE, new org.apache.thrift.meta_data.FieldMetaData("isAlive", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
|
|
tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
|
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AgentInfo.class, metaDataMap);
|
|
}
|
|
|
|
public AgentInfo() {
|
|
}
|
|
|
|
public AgentInfo(
|
|
String hostname,
|
|
String ports,
|
|
String agentId,
|
|
String applicationName,
|
|
boolean isAlive,
|
|
long timestamp)
|
|
{
|
|
this();
|
|
this.hostname = hostname;
|
|
this.ports = ports;
|
|
this.agentId = agentId;
|
|
this.applicationName = applicationName;
|
|
this.isAlive = isAlive;
|
|
setIsAliveIsSet(true);
|
|
this.timestamp = timestamp;
|
|
setTimestampIsSet(true);
|
|
}
|
|
|
|
/**
|
|
* Performs a deep copy on <i>other</i>.
|
|
*/
|
|
public AgentInfo(AgentInfo other) {
|
|
__isset_bit_vector.clear();
|
|
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
if (other.isSetHostname()) {
|
|
this.hostname = other.hostname;
|
|
}
|
|
if (other.isSetPorts()) {
|
|
this.ports = other.ports;
|
|
}
|
|
if (other.isSetAgentId()) {
|
|
this.agentId = other.agentId;
|
|
}
|
|
if (other.isSetApplicationName()) {
|
|
this.applicationName = other.applicationName;
|
|
}
|
|
this.isAlive = other.isAlive;
|
|
this.timestamp = other.timestamp;
|
|
}
|
|
|
|
public AgentInfo deepCopy() {
|
|
return new AgentInfo(this);
|
|
}
|
|
|
|
@Override
|
|
public void clear() {
|
|
this.hostname = null;
|
|
this.ports = null;
|
|
this.agentId = null;
|
|
this.applicationName = null;
|
|
setIsAliveIsSet(false);
|
|
this.isAlive = false;
|
|
setTimestampIsSet(false);
|
|
this.timestamp = 0;
|
|
}
|
|
|
|
public String getHostname() {
|
|
return this.hostname;
|
|
}
|
|
|
|
public void setHostname(String hostname) {
|
|
this.hostname = hostname;
|
|
}
|
|
|
|
public void unsetHostname() {
|
|
this.hostname = null;
|
|
}
|
|
|
|
/** Returns true if field hostname is set (has been assigned a value) and false otherwise */
|
|
public boolean isSetHostname() {
|
|
return this.hostname != null;
|
|
}
|
|
|
|
public void setHostnameIsSet(boolean value) {
|
|
if (!value) {
|
|
this.hostname = null;
|
|
}
|
|
}
|
|
|
|
public String getPorts() {
|
|
return this.ports;
|
|
}
|
|
|
|
public void setPorts(String ports) {
|
|
this.ports = ports;
|
|
}
|
|
|
|
public void unsetPorts() {
|
|
this.ports = null;
|
|
}
|
|
|
|
/** Returns true if field ports is set (has been assigned a value) and false otherwise */
|
|
public boolean isSetPorts() {
|
|
return this.ports != null;
|
|
}
|
|
|
|
public void setPortsIsSet(boolean value) {
|
|
if (!value) {
|
|
this.ports = null;
|
|
}
|
|
}
|
|
|
|
public String getAgentId() {
|
|
return this.agentId;
|
|
}
|
|
|
|
public void setAgentId(String agentId) {
|
|
this.agentId = agentId;
|
|
}
|
|
|
|
public void unsetAgentId() {
|
|
this.agentId = null;
|
|
}
|
|
|
|
/** Returns true if field agentId is set (has been assigned a value) and false otherwise */
|
|
public boolean isSetAgentId() {
|
|
return this.agentId != null;
|
|
}
|
|
|
|
public void setAgentIdIsSet(boolean value) {
|
|
if (!value) {
|
|
this.agentId = null;
|
|
}
|
|
}
|
|
|
|
public String getApplicationName() {
|
|
return this.applicationName;
|
|
}
|
|
|
|
public void setApplicationName(String applicationName) {
|
|
this.applicationName = applicationName;
|
|
}
|
|
|
|
public void unsetApplicationName() {
|
|
this.applicationName = null;
|
|
}
|
|
|
|
/** Returns true if field applicationName is set (has been assigned a value) and false otherwise */
|
|
public boolean isSetApplicationName() {
|
|
return this.applicationName != null;
|
|
}
|
|
|
|
public void setApplicationNameIsSet(boolean value) {
|
|
if (!value) {
|
|
this.applicationName = null;
|
|
}
|
|
}
|
|
|
|
public boolean isIsAlive() {
|
|
return this.isAlive;
|
|
}
|
|
|
|
public void setIsAlive(boolean isAlive) {
|
|
this.isAlive = isAlive;
|
|
setIsAliveIsSet(true);
|
|
}
|
|
|
|
public void unsetIsAlive() {
|
|
__isset_bit_vector.clear(__ISALIVE_ISSET_ID);
|
|
}
|
|
|
|
/** Returns true if field isAlive is set (has been assigned a value) and false otherwise */
|
|
public boolean isSetIsAlive() {
|
|
return __isset_bit_vector.get(__ISALIVE_ISSET_ID);
|
|
}
|
|
|
|
public void setIsAliveIsSet(boolean value) {
|
|
__isset_bit_vector.set(__ISALIVE_ISSET_ID, value);
|
|
}
|
|
|
|
public long getTimestamp() {
|
|
return this.timestamp;
|
|
}
|
|
|
|
public void setTimestamp(long timestamp) {
|
|
this.timestamp = timestamp;
|
|
setTimestampIsSet(true);
|
|
}
|
|
|
|
public void unsetTimestamp() {
|
|
__isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
|
|
}
|
|
|
|
/** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
|
|
public boolean isSetTimestamp() {
|
|
return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
|
|
}
|
|
|
|
public void setTimestampIsSet(boolean value) {
|
|
__isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
|
|
}
|
|
|
|
public void setFieldValue(_Fields field, Object value) {
|
|
switch (field) {
|
|
case HOSTNAME:
|
|
if (value == null) {
|
|
unsetHostname();
|
|
} else {
|
|
setHostname((String)value);
|
|
}
|
|
break;
|
|
|
|
case PORTS:
|
|
if (value == null) {
|
|
unsetPorts();
|
|
} else {
|
|
setPorts((String)value);
|
|
}
|
|
break;
|
|
|
|
case AGENT_ID:
|
|
if (value == null) {
|
|
unsetAgentId();
|
|
} else {
|
|
setAgentId((String)value);
|
|
}
|
|
break;
|
|
|
|
case APPLICATION_NAME:
|
|
if (value == null) {
|
|
unsetApplicationName();
|
|
} else {
|
|
setApplicationName((String)value);
|
|
}
|
|
break;
|
|
|
|
case IS_ALIVE:
|
|
if (value == null) {
|
|
unsetIsAlive();
|
|
} else {
|
|
setIsAlive((Boolean)value);
|
|
}
|
|
break;
|
|
|
|
case TIMESTAMP:
|
|
if (value == null) {
|
|
unsetTimestamp();
|
|
} else {
|
|
setTimestamp((Long)value);
|
|
}
|
|
break;
|
|
|
|
}
|
|
}
|
|
|
|
public Object getFieldValue(_Fields field) {
|
|
switch (field) {
|
|
case HOSTNAME:
|
|
return getHostname();
|
|
|
|
case PORTS:
|
|
return getPorts();
|
|
|
|
case AGENT_ID:
|
|
return getAgentId();
|
|
|
|
case APPLICATION_NAME:
|
|
return getApplicationName();
|
|
|
|
case IS_ALIVE:
|
|
return Boolean.valueOf(isIsAlive());
|
|
|
|
case TIMESTAMP:
|
|
return Long.valueOf(getTimestamp());
|
|
|
|
}
|
|
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 HOSTNAME:
|
|
return isSetHostname();
|
|
case PORTS:
|
|
return isSetPorts();
|
|
case AGENT_ID:
|
|
return isSetAgentId();
|
|
case APPLICATION_NAME:
|
|
return isSetApplicationName();
|
|
case IS_ALIVE:
|
|
return isSetIsAlive();
|
|
case TIMESTAMP:
|
|
return isSetTimestamp();
|
|
}
|
|
throw new IllegalStateException();
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object that) {
|
|
if (that == null)
|
|
return false;
|
|
if (that instanceof AgentInfo)
|
|
return this.equals((AgentInfo)that);
|
|
return false;
|
|
}
|
|
|
|
public boolean equals(AgentInfo that) {
|
|
if (that == null)
|
|
return false;
|
|
|
|
boolean this_present_hostname = true && this.isSetHostname();
|
|
boolean that_present_hostname = true && that.isSetHostname();
|
|
if (this_present_hostname || that_present_hostname) {
|
|
if (!(this_present_hostname && that_present_hostname))
|
|
return false;
|
|
if (!this.hostname.equals(that.hostname))
|
|
return false;
|
|
}
|
|
|
|
boolean this_present_ports = true && this.isSetPorts();
|
|
boolean that_present_ports = true && that.isSetPorts();
|
|
if (this_present_ports || that_present_ports) {
|
|
if (!(this_present_ports && that_present_ports))
|
|
return false;
|
|
if (!this.ports.equals(that.ports))
|
|
return false;
|
|
}
|
|
|
|
boolean this_present_agentId = true && this.isSetAgentId();
|
|
boolean that_present_agentId = true && that.isSetAgentId();
|
|
if (this_present_agentId || that_present_agentId) {
|
|
if (!(this_present_agentId && that_present_agentId))
|
|
return false;
|
|
if (!this.agentId.equals(that.agentId))
|
|
return false;
|
|
}
|
|
|
|
boolean this_present_applicationName = true && this.isSetApplicationName();
|
|
boolean that_present_applicationName = true && that.isSetApplicationName();
|
|
if (this_present_applicationName || that_present_applicationName) {
|
|
if (!(this_present_applicationName && that_present_applicationName))
|
|
return false;
|
|
if (!this.applicationName.equals(that.applicationName))
|
|
return false;
|
|
}
|
|
|
|
boolean this_present_isAlive = true;
|
|
boolean that_present_isAlive = true;
|
|
if (this_present_isAlive || that_present_isAlive) {
|
|
if (!(this_present_isAlive && that_present_isAlive))
|
|
return false;
|
|
if (this.isAlive != that.isAlive)
|
|
return false;
|
|
}
|
|
|
|
boolean this_present_timestamp = true;
|
|
boolean that_present_timestamp = true;
|
|
if (this_present_timestamp || that_present_timestamp) {
|
|
if (!(this_present_timestamp && that_present_timestamp))
|
|
return false;
|
|
if (this.timestamp != that.timestamp)
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return 0;
|
|
}
|
|
|
|
public int compareTo(AgentInfo other) {
|
|
if (!getClass().equals(other.getClass())) {
|
|
return getClass().getName().compareTo(other.getClass().getName());
|
|
}
|
|
|
|
int lastComparison = 0;
|
|
AgentInfo typedOther = (AgentInfo)other;
|
|
|
|
lastComparison = Boolean.valueOf(isSetHostname()).compareTo(typedOther.isSetHostname());
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
if (isSetHostname()) {
|
|
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostname, typedOther.hostname);
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
}
|
|
lastComparison = Boolean.valueOf(isSetPorts()).compareTo(typedOther.isSetPorts());
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
if (isSetPorts()) {
|
|
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ports, typedOther.ports);
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
}
|
|
lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(typedOther.isSetAgentId());
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
if (isSetAgentId()) {
|
|
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, typedOther.agentId);
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
}
|
|
lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(typedOther.isSetApplicationName());
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
if (isSetApplicationName()) {
|
|
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, typedOther.applicationName);
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
}
|
|
lastComparison = Boolean.valueOf(isSetIsAlive()).compareTo(typedOther.isSetIsAlive());
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
if (isSetIsAlive()) {
|
|
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isAlive, typedOther.isAlive);
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
}
|
|
lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
if (isSetTimestamp()) {
|
|
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
|
|
if (lastComparison != 0) {
|
|
return lastComparison;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public _Fields fieldForId(int fieldId) {
|
|
return _Fields.findByThriftId(fieldId);
|
|
}
|
|
|
|
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
|
|
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
|
|
}
|
|
|
|
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
|
|
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder("AgentInfo(");
|
|
boolean first = true;
|
|
|
|
sb.append("hostname:");
|
|
if (this.hostname == null) {
|
|
sb.append("null");
|
|
} else {
|
|
sb.append(this.hostname);
|
|
}
|
|
first = false;
|
|
if (!first) sb.append(", ");
|
|
sb.append("ports:");
|
|
if (this.ports == null) {
|
|
sb.append("null");
|
|
} else {
|
|
sb.append(this.ports);
|
|
}
|
|
first = false;
|
|
if (!first) sb.append(", ");
|
|
sb.append("agentId:");
|
|
if (this.agentId == null) {
|
|
sb.append("null");
|
|
} else {
|
|
sb.append(this.agentId);
|
|
}
|
|
first = false;
|
|
if (!first) sb.append(", ");
|
|
sb.append("applicationName:");
|
|
if (this.applicationName == null) {
|
|
sb.append("null");
|
|
} else {
|
|
sb.append(this.applicationName);
|
|
}
|
|
first = false;
|
|
if (!first) sb.append(", ");
|
|
sb.append("isAlive:");
|
|
sb.append(this.isAlive);
|
|
first = false;
|
|
if (!first) sb.append(", ");
|
|
sb.append("timestamp:");
|
|
sb.append(this.timestamp);
|
|
first = false;
|
|
sb.append(")");
|
|
return sb.toString();
|
|
}
|
|
|
|
public void validate() throws org.apache.thrift.TException {
|
|
// check for required fields
|
|
}
|
|
|
|
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, 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_bit_vector = new BitSet(1);
|
|
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 AgentInfoStandardSchemeFactory implements SchemeFactory {
|
|
public AgentInfoStandardScheme getScheme() {
|
|
return new AgentInfoStandardScheme();
|
|
}
|
|
}
|
|
|
|
private static class AgentInfoStandardScheme extends StandardScheme<AgentInfo> {
|
|
|
|
public void read(org.apache.thrift.protocol.TProtocol iprot, AgentInfo 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: // HOSTNAME
|
|
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
|
struct.hostname = iprot.readString();
|
|
struct.setHostnameIsSet(true);
|
|
} else {
|
|
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
|
}
|
|
break;
|
|
case 2: // PORTS
|
|
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
|
struct.ports = iprot.readString();
|
|
struct.setPortsIsSet(true);
|
|
} else {
|
|
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
|
}
|
|
break;
|
|
case 3: // AGENT_ID
|
|
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
|
struct.agentId = iprot.readString();
|
|
struct.setAgentIdIsSet(true);
|
|
} else {
|
|
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
|
}
|
|
break;
|
|
case 4: // APPLICATION_NAME
|
|
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
|
struct.applicationName = iprot.readString();
|
|
struct.setApplicationNameIsSet(true);
|
|
} else {
|
|
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
|
}
|
|
break;
|
|
case 5: // IS_ALIVE
|
|
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
|
|
struct.isAlive = iprot.readBool();
|
|
struct.setIsAliveIsSet(true);
|
|
} else {
|
|
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
|
}
|
|
break;
|
|
case 6: // TIMESTAMP
|
|
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
|
struct.timestamp = iprot.readI64();
|
|
struct.setTimestampIsSet(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();
|
|
struct.validate();
|
|
}
|
|
|
|
public void write(org.apache.thrift.protocol.TProtocol oprot, AgentInfo struct) throws org.apache.thrift.TException {
|
|
struct.validate();
|
|
|
|
oprot.writeStructBegin(STRUCT_DESC);
|
|
if (struct.hostname != null) {
|
|
oprot.writeFieldBegin(HOSTNAME_FIELD_DESC);
|
|
oprot.writeString(struct.hostname);
|
|
oprot.writeFieldEnd();
|
|
}
|
|
if (struct.ports != null) {
|
|
oprot.writeFieldBegin(PORTS_FIELD_DESC);
|
|
oprot.writeString(struct.ports);
|
|
oprot.writeFieldEnd();
|
|
}
|
|
if (struct.agentId != null) {
|
|
oprot.writeFieldBegin(AGENT_ID_FIELD_DESC);
|
|
oprot.writeString(struct.agentId);
|
|
oprot.writeFieldEnd();
|
|
}
|
|
if (struct.applicationName != null) {
|
|
oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC);
|
|
oprot.writeString(struct.applicationName);
|
|
oprot.writeFieldEnd();
|
|
}
|
|
oprot.writeFieldBegin(IS_ALIVE_FIELD_DESC);
|
|
oprot.writeBool(struct.isAlive);
|
|
oprot.writeFieldEnd();
|
|
oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
|
|
oprot.writeI64(struct.timestamp);
|
|
oprot.writeFieldEnd();
|
|
oprot.writeFieldStop();
|
|
oprot.writeStructEnd();
|
|
}
|
|
|
|
}
|
|
|
|
private static class AgentInfoTupleSchemeFactory implements SchemeFactory {
|
|
public AgentInfoTupleScheme getScheme() {
|
|
return new AgentInfoTupleScheme();
|
|
}
|
|
}
|
|
|
|
private static class AgentInfoTupleScheme extends TupleScheme<AgentInfo> {
|
|
|
|
@Override
|
|
public void write(org.apache.thrift.protocol.TProtocol prot, AgentInfo struct) throws org.apache.thrift.TException {
|
|
TTupleProtocol oprot = (TTupleProtocol) prot;
|
|
BitSet optionals = new BitSet();
|
|
if (struct.isSetHostname()) {
|
|
optionals.set(0);
|
|
}
|
|
if (struct.isSetPorts()) {
|
|
optionals.set(1);
|
|
}
|
|
if (struct.isSetAgentId()) {
|
|
optionals.set(2);
|
|
}
|
|
if (struct.isSetApplicationName()) {
|
|
optionals.set(3);
|
|
}
|
|
if (struct.isSetIsAlive()) {
|
|
optionals.set(4);
|
|
}
|
|
if (struct.isSetTimestamp()) {
|
|
optionals.set(5);
|
|
}
|
|
oprot.writeBitSet(optionals, 6);
|
|
if (struct.isSetHostname()) {
|
|
oprot.writeString(struct.hostname);
|
|
}
|
|
if (struct.isSetPorts()) {
|
|
oprot.writeString(struct.ports);
|
|
}
|
|
if (struct.isSetAgentId()) {
|
|
oprot.writeString(struct.agentId);
|
|
}
|
|
if (struct.isSetApplicationName()) {
|
|
oprot.writeString(struct.applicationName);
|
|
}
|
|
if (struct.isSetIsAlive()) {
|
|
oprot.writeBool(struct.isAlive);
|
|
}
|
|
if (struct.isSetTimestamp()) {
|
|
oprot.writeI64(struct.timestamp);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void read(org.apache.thrift.protocol.TProtocol prot, AgentInfo struct) throws org.apache.thrift.TException {
|
|
TTupleProtocol iprot = (TTupleProtocol) prot;
|
|
BitSet incoming = iprot.readBitSet(6);
|
|
if (incoming.get(0)) {
|
|
struct.hostname = iprot.readString();
|
|
struct.setHostnameIsSet(true);
|
|
}
|
|
if (incoming.get(1)) {
|
|
struct.ports = iprot.readString();
|
|
struct.setPortsIsSet(true);
|
|
}
|
|
if (incoming.get(2)) {
|
|
struct.agentId = iprot.readString();
|
|
struct.setAgentIdIsSet(true);
|
|
}
|
|
if (incoming.get(3)) {
|
|
struct.applicationName = iprot.readString();
|
|
struct.setApplicationNameIsSet(true);
|
|
}
|
|
if (incoming.get(4)) {
|
|
struct.isAlive = iprot.readBool();
|
|
struct.setIsAliveIsSet(true);
|
|
}
|
|
if (incoming.get(5)) {
|
|
struct.timestamp = iprot.readI64();
|
|
struct.setTimestampIsSet(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|