diff --git a/src/main/java/com/profiler/common/dto/thrift/AgentInfo.java b/src/main/java/com/profiler/common/dto/thrift/AgentInfo.java index 650ffdfdf..9dd00031e 100644 --- a/src/main/java/com/profiler/common/dto/thrift/AgentInfo.java +++ b/src/main/java/com/profiler/common/dto/thrift/AgentInfo.java @@ -1,885 +1,867 @@ -/** - * 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, 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, SchemeFactory> schemes = new HashMap, 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 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: // 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 other. - */ - 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 { - - 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 { - - @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); - } - } - } - -} - +/** + * 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, 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, SchemeFactory> schemes = new HashMap, 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 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: // 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 other. + */ + 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 { + + 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 { + + @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); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/Annotation.java b/src/main/java/com/profiler/common/dto/thrift/Annotation.java index 19e901fb8..6f5a03af1 100644 --- a/src/main/java/com/profiler/common/dto/thrift/Annotation.java +++ b/src/main/java/com/profiler/common/dto/thrift/Annotation.java @@ -1,697 +1,683 @@ -/** - * 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 Annotation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Annotation"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short) 1); - private static final org.apache.thrift.protocol.TField VALUE_TYPE_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypeCode", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short) 3); - 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) 4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new AnnotationStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AnnotationTupleSchemeFactory()); - } - - private String key; // required - private int valueTypeCode; // required - private ByteBuffer value; // optional - private long timestamp; // optional - - /** - * The set of fields this struct contains, along with convenience methods for finding and manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY((short) 1, "key"), - VALUE_TYPE_CODE((short) 2, "valueTypeCode"), - VALUE((short) 3, "value"), - TIMESTAMP((short) 4, "timestamp"); - - 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: // KEY - return KEY; - case 2: // VALUE_TYPE_CODE - return VALUE_TYPE_CODE; - case 3: // VALUE - return VALUE; - case 4: // 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 __VALUETYPECODE_ISSET_ID = 0; - private static final int __TIMESTAMP_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - private _Fields optionals[] = {_Fields.VALUE, _Fields.TIMESTAMP}; - 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.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VALUE_TYPE_CODE, new org.apache.thrift.meta_data.FieldMetaData("valueTypeCode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING, true))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Annotation.class, metaDataMap); - } - - public Annotation() { - } - - public Annotation( - String key, - int valueTypeCode) { - this(); - this.key = key; - this.valueTypeCode = valueTypeCode; - setValueTypeCodeIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public Annotation(Annotation other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetKey()) { - this.key = other.key; - } - this.valueTypeCode = other.valueTypeCode; - if (other.isSetValue()) { - this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); - ; - } - this.timestamp = other.timestamp; - } - - public Annotation deepCopy() { - return new Annotation(this); - } - - @Override - public void clear() { - this.key = null; - setValueTypeCodeIsSet(false); - this.valueTypeCode = 0; - this.value = null; - setTimestampIsSet(false); - this.timestamp = 0; - } - - public String getKey() { - return this.key; - } - - public void setKey(String key) { - this.key = key; - } - - public void unsetKey() { - this.key = null; - } - - /** - * Returns true if field key is set (has been assigned a value) and false otherwise - */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public int getValueTypeCode() { - return this.valueTypeCode; - } - - public void setValueTypeCode(int valueTypeCode) { - this.valueTypeCode = valueTypeCode; - setValueTypeCodeIsSet(true); - } - - public void unsetValueTypeCode() { - __isset_bit_vector.clear(__VALUETYPECODE_ISSET_ID); - } - - /** - * Returns true if field valueTypeCode is set (has been assigned a value) and false otherwise - */ - public boolean isSetValueTypeCode() { - return __isset_bit_vector.get(__VALUETYPECODE_ISSET_ID); - } - - public void setValueTypeCodeIsSet(boolean value) { - __isset_bit_vector.set(__VALUETYPECODE_ISSET_ID, value); - } - - public byte[] getValue() { - setValue(org.apache.thrift.TBaseHelper.rightSize(value)); - return value == null ? null : value.array(); - } - - public ByteBuffer bufferForValue() { - return value; - } - - public void setValue(byte[] value) { - setValue(value == null ? (ByteBuffer) null : ByteBuffer.wrap(value)); - } - - public void setValue(ByteBuffer value) { - this.value = value; - } - - public void unsetValue() { - this.value = null; - } - - /** - * Returns true if field value is set (has been assigned a value) and false otherwise - */ - public boolean isSetValue() { - return this.value != null; - } - - public void setValueIsSet(boolean value) { - if (!value) { - this.value = null; - } - } - - 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 KEY: - if (value == null) { - unsetKey(); - } else { - setKey((String) value); - } - break; - - case VALUE_TYPE_CODE: - if (value == null) { - unsetValueTypeCode(); - } else { - setValueTypeCode((Integer) value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((ByteBuffer) value); - } - break; - - case TIMESTAMP: - if (value == null) { - unsetTimestamp(); - } else { - setTimestamp((Long) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case VALUE_TYPE_CODE: - return Integer.valueOf(getValueTypeCode()); - - case VALUE: - return getValue(); - - 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 KEY: - return isSetKey(); - case VALUE_TYPE_CODE: - return isSetValueTypeCode(); - case VALUE: - return isSetValue(); - case TIMESTAMP: - return isSetTimestamp(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Annotation) - return this.equals((Annotation) that); - return false; - } - - public boolean equals(Annotation that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_valueTypeCode = true; - boolean that_present_valueTypeCode = true; - if (this_present_valueTypeCode || that_present_valueTypeCode) { - if (!(this_present_valueTypeCode && that_present_valueTypeCode)) - return false; - if (this.valueTypeCode != that.valueTypeCode) - return false; - } - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (!this.value.equals(that.value)) - return false; - } - - boolean this_present_timestamp = true && this.isSetTimestamp(); - boolean that_present_timestamp = true && that.isSetTimestamp(); - 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(Annotation other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - Annotation typedOther = (Annotation) other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValueTypeCode()).compareTo(typedOther.isSetValueTypeCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValueTypeCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueTypeCode, typedOther.valueTypeCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - 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("Annotation("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - if (!first) sb.append(", "); - sb.append("valueTypeCode:"); - sb.append(this.valueTypeCode); - first = false; - if (isSetValue()) { - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.value, sb); - } - first = false; - } - if (isSetTimestamp()) { - 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 AnnotationStandardSchemeFactory implements SchemeFactory { - public AnnotationStandardScheme getScheme() { - return new AnnotationStandardScheme(); - } - } - - private static class AnnotationStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, Annotation 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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.key = iprot.readString(); - struct.setKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE_TYPE_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.valueTypeCode = iprot.readI32(); - struct.setValueTypeCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.value = iprot.readBinary(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // 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, Annotation struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeString(struct.key); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(VALUE_TYPE_CODE_FIELD_DESC); - oprot.writeI32(struct.valueTypeCode); - oprot.writeFieldEnd(); - if (struct.value != null) { - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeBinary(struct.value); - oprot.writeFieldEnd(); - } - } - if (struct.isSetTimestamp()) { - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class AnnotationTupleSchemeFactory implements SchemeFactory { - public AnnotationTupleScheme getScheme() { - return new AnnotationTupleScheme(); - } - } - - private static class AnnotationTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, Annotation struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - if (struct.isSetValueTypeCode()) { - optionals.set(1); - } - if (struct.isSetValue()) { - optionals.set(2); - } - if (struct.isSetTimestamp()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetKey()) { - oprot.writeString(struct.key); - } - if (struct.isSetValueTypeCode()) { - oprot.writeI32(struct.valueTypeCode); - } - if (struct.isSetValue()) { - oprot.writeBinary(struct.value); - } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, Annotation struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.key = iprot.readString(); - struct.setKeyIsSet(true); - } - if (incoming.get(1)) { - struct.valueTypeCode = iprot.readI32(); - struct.setValueTypeCodeIsSet(true); - } - if (incoming.get(2)) { - struct.value = iprot.readBinary(); - struct.setValueIsSet(true); - } - if (incoming.get(3)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(true); - } - } - } - -} - +/** + * 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 Annotation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Annotation"); + + private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField VALUE_TYPE_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypeCode", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)3); + 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)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AnnotationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AnnotationTupleSchemeFactory()); + } + + private String key; // required + private int valueTypeCode; // required + private ByteBuffer value; // optional + private long timestamp; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + KEY((short)1, "key"), + VALUE_TYPE_CODE((short)2, "valueTypeCode"), + VALUE((short)3, "value"), + TIMESTAMP((short)4, "timestamp"); + + 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: // KEY + return KEY; + case 2: // VALUE_TYPE_CODE + return VALUE_TYPE_CODE; + case 3: // VALUE + return VALUE; + case 4: // 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 __VALUETYPECODE_ISSET_ID = 0; + private static final int __TIMESTAMP_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); + private _Fields optionals[] = {_Fields.VALUE,_Fields.TIMESTAMP}; + 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.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VALUE_TYPE_CODE, new org.apache.thrift.meta_data.FieldMetaData("valueTypeCode", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Annotation.class, metaDataMap); + } + + public Annotation() { + } + + public Annotation( + String key, + int valueTypeCode) + { + this(); + this.key = key; + this.valueTypeCode = valueTypeCode; + setValueTypeCodeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public Annotation(Annotation other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetKey()) { + this.key = other.key; + } + this.valueTypeCode = other.valueTypeCode; + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); +; + } + this.timestamp = other.timestamp; + } + + public Annotation deepCopy() { + return new Annotation(this); + } + + @Override + public void clear() { + this.key = null; + setValueTypeCodeIsSet(false); + this.valueTypeCode = 0; + this.value = null; + setTimestampIsSet(false); + this.timestamp = 0; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + } + + public void unsetKey() { + this.key = null; + } + + /** Returns true if field key is set (has been assigned a value) and false otherwise */ + public boolean isSetKey() { + return this.key != null; + } + + public void setKeyIsSet(boolean value) { + if (!value) { + this.key = null; + } + } + + public int getValueTypeCode() { + return this.valueTypeCode; + } + + public void setValueTypeCode(int valueTypeCode) { + this.valueTypeCode = valueTypeCode; + setValueTypeCodeIsSet(true); + } + + public void unsetValueTypeCode() { + __isset_bit_vector.clear(__VALUETYPECODE_ISSET_ID); + } + + /** Returns true if field valueTypeCode is set (has been assigned a value) and false otherwise */ + public boolean isSetValueTypeCode() { + return __isset_bit_vector.get(__VALUETYPECODE_ISSET_ID); + } + + public void setValueTypeCodeIsSet(boolean value) { + __isset_bit_vector.set(__VALUETYPECODE_ISSET_ID, value); + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return value; + } + + public void setValue(byte[] value) { + setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value)); + } + + public void setValue(ByteBuffer value) { + this.value = value; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + 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 KEY: + if (value == null) { + unsetKey(); + } else { + setKey((String)value); + } + break; + + case VALUE_TYPE_CODE: + if (value == null) { + unsetValueTypeCode(); + } else { + setValueTypeCode((Integer)value); + } + break; + + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case KEY: + return getKey(); + + case VALUE_TYPE_CODE: + return Integer.valueOf(getValueTypeCode()); + + case VALUE: + return getValue(); + + 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 KEY: + return isSetKey(); + case VALUE_TYPE_CODE: + return isSetValueTypeCode(); + case VALUE: + return isSetValue(); + case TIMESTAMP: + return isSetTimestamp(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Annotation) + return this.equals((Annotation)that); + return false; + } + + public boolean equals(Annotation that) { + if (that == null) + return false; + + boolean this_present_key = true && this.isSetKey(); + boolean that_present_key = true && that.isSetKey(); + if (this_present_key || that_present_key) { + if (!(this_present_key && that_present_key)) + return false; + if (!this.key.equals(that.key)) + return false; + } + + boolean this_present_valueTypeCode = true; + boolean that_present_valueTypeCode = true; + if (this_present_valueTypeCode || that_present_valueTypeCode) { + if (!(this_present_valueTypeCode && that_present_valueTypeCode)) + return false; + if (this.valueTypeCode != that.valueTypeCode) + return false; + } + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + boolean this_present_timestamp = true && this.isSetTimestamp(); + boolean that_present_timestamp = true && that.isSetTimestamp(); + 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(Annotation other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Annotation typedOther = (Annotation)other; + + lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValueTypeCode()).compareTo(typedOther.isSetValueTypeCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValueTypeCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueTypeCode, typedOther.valueTypeCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + 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("Annotation("); + boolean first = true; + + sb.append("key:"); + if (this.key == null) { + sb.append("null"); + } else { + sb.append(this.key); + } + first = false; + if (!first) sb.append(", "); + sb.append("valueTypeCode:"); + sb.append(this.valueTypeCode); + first = false; + if (isSetValue()) { + if (!first) sb.append(", "); + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + } + if (isSetTimestamp()) { + 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 AnnotationStandardSchemeFactory implements SchemeFactory { + public AnnotationStandardScheme getScheme() { + return new AnnotationStandardScheme(); + } + } + + private static class AnnotationStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Annotation 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: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readString(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUE_TYPE_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.valueTypeCode = iprot.readI32(); + struct.setValueTypeCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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, Annotation struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeString(struct.key); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(VALUE_TYPE_CODE_FIELD_DESC); + oprot.writeI32(struct.valueTypeCode); + oprot.writeFieldEnd(); + if (struct.value != null) { + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class AnnotationTupleSchemeFactory implements SchemeFactory { + public AnnotationTupleScheme getScheme() { + return new AnnotationTupleScheme(); + } + } + + private static class AnnotationTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Annotation struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetKey()) { + optionals.set(0); + } + if (struct.isSetValueTypeCode()) { + optionals.set(1); + } + if (struct.isSetValue()) { + optionals.set(2); + } + if (struct.isSetTimestamp()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetKey()) { + oprot.writeString(struct.key); + } + if (struct.isSetValueTypeCode()) { + oprot.writeI32(struct.valueTypeCode); + } + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Annotation struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.key = iprot.readString(); + struct.setKeyIsSet(true); + } + if (incoming.get(1)) { + struct.valueTypeCode = iprot.readI32(); + struct.setValueTypeCodeIsSet(true); + } + if (incoming.get(2)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + if (incoming.get(3)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/ApiAnnotation.java b/src/main/java/com/profiler/common/dto/thrift/ApiAnnotation.java index 2273e9db4..bcbbf9b2f 100644 --- a/src/main/java/com/profiler/common/dto/thrift/ApiAnnotation.java +++ b/src/main/java/com/profiler/common/dto/thrift/ApiAnnotation.java @@ -1,1139 +1,1130 @@ -/** - * 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 ApiAnnotation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ApiAnnotation"); - - private static final org.apache.thrift.protocol.TField API_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("apiId", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("className", org.apache.thrift.protocol.TType.STRING, (short) 2); - private static final org.apache.thrift.protocol.TField METHOD_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("methodName", org.apache.thrift.protocol.TType.STRING, (short) 3); - private static final org.apache.thrift.protocol.TField PARAMETER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterType", org.apache.thrift.protocol.TType.LIST, (short) 4); - private static final org.apache.thrift.protocol.TField PARAMETER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterName", org.apache.thrift.protocol.TType.LIST, (short) 5); - private static final org.apache.thrift.protocol.TField PARAMETER_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterValue", org.apache.thrift.protocol.TType.LIST, (short) 6); - private static final org.apache.thrift.protocol.TField LINE_FIELD_DESC = new org.apache.thrift.protocol.TField("line", org.apache.thrift.protocol.TType.I32, (short) 7); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new ApiAnnotationStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ApiAnnotationTupleSchemeFactory()); - } - - private int apiId; // optional - private String className; // optional - private String methodName; // optional - private List parameterType; // optional - private List parameterName; // optional - private List parameterValue; // optional - private int line; // optional - - /** - * The set of fields this struct contains, along with convenience methods for finding and manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - API_ID((short) 1, "apiId"), - CLASS_NAME((short) 2, "className"), - METHOD_NAME((short) 3, "methodName"), - PARAMETER_TYPE((short) 4, "parameterType"), - PARAMETER_NAME((short) 5, "parameterName"), - PARAMETER_VALUE((short) 6, "parameterValue"), - LINE((short) 7, "line"); - - 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: // API_ID - return API_ID; - case 2: // CLASS_NAME - return CLASS_NAME; - case 3: // METHOD_NAME - return METHOD_NAME; - case 4: // PARAMETER_TYPE - return PARAMETER_TYPE; - case 5: // PARAMETER_NAME - return PARAMETER_NAME; - case 6: // PARAMETER_VALUE - return PARAMETER_VALUE; - case 7: // LINE - return LINE; - 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 __APIID_ISSET_ID = 0; - private static final int __LINE_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - private _Fields optionals[] = {_Fields.API_ID, _Fields.CLASS_NAME, _Fields.METHOD_NAME, _Fields.PARAMETER_TYPE, _Fields.PARAMETER_NAME, _Fields.PARAMETER_VALUE, _Fields.LINE}; - 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.API_ID, new org.apache.thrift.meta_data.FieldMetaData("apiId", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("className", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.METHOD_NAME, new org.apache.thrift.meta_data.FieldMetaData("methodName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PARAMETER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("parameterType", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.PARAMETER_NAME, new org.apache.thrift.meta_data.FieldMetaData("parameterName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.PARAMETER_VALUE, new org.apache.thrift.meta_data.FieldMetaData("parameterValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.LINE, new org.apache.thrift.meta_data.FieldMetaData("line", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ApiAnnotation.class, metaDataMap); - } - - public ApiAnnotation() { - } - - /** - * Performs a deep copy on other. - */ - public ApiAnnotation(ApiAnnotation other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.apiId = other.apiId; - if (other.isSetClassName()) { - this.className = other.className; - } - if (other.isSetMethodName()) { - this.methodName = other.methodName; - } - if (other.isSetParameterType()) { - List __this__parameterType = new ArrayList(); - for (String other_element : other.parameterType) { - __this__parameterType.add(other_element); - } - this.parameterType = __this__parameterType; - } - if (other.isSetParameterName()) { - List __this__parameterName = new ArrayList(); - for (String other_element : other.parameterName) { - __this__parameterName.add(other_element); - } - this.parameterName = __this__parameterName; - } - if (other.isSetParameterValue()) { - List __this__parameterValue = new ArrayList(); - for (String other_element : other.parameterValue) { - __this__parameterValue.add(other_element); - } - this.parameterValue = __this__parameterValue; - } - this.line = other.line; - } - - public ApiAnnotation deepCopy() { - return new ApiAnnotation(this); - } - - @Override - public void clear() { - setApiIdIsSet(false); - this.apiId = 0; - this.className = null; - this.methodName = null; - this.parameterType = null; - this.parameterName = null; - this.parameterValue = null; - setLineIsSet(false); - this.line = 0; - } - - public int getApiId() { - return this.apiId; - } - - public void setApiId(int apiId) { - this.apiId = apiId; - setApiIdIsSet(true); - } - - public void unsetApiId() { - __isset_bit_vector.clear(__APIID_ISSET_ID); - } - - /** - * Returns true if field apiId is set (has been assigned a value) and false otherwise - */ - public boolean isSetApiId() { - return __isset_bit_vector.get(__APIID_ISSET_ID); - } - - public void setApiIdIsSet(boolean value) { - __isset_bit_vector.set(__APIID_ISSET_ID, value); - } - - public String getClassName() { - return this.className; - } - - public void setClassName(String className) { - this.className = className; - } - - public void unsetClassName() { - this.className = null; - } - - /** - * Returns true if field className is set (has been assigned a value) and false otherwise - */ - public boolean isSetClassName() { - return this.className != null; - } - - public void setClassNameIsSet(boolean value) { - if (!value) { - this.className = null; - } - } - - public String getMethodName() { - return this.methodName; - } - - public void setMethodName(String methodName) { - this.methodName = methodName; - } - - public void unsetMethodName() { - this.methodName = null; - } - - /** - * Returns true if field methodName is set (has been assigned a value) and false otherwise - */ - public boolean isSetMethodName() { - return this.methodName != null; - } - - public void setMethodNameIsSet(boolean value) { - if (!value) { - this.methodName = null; - } - } - - public int getParameterTypeSize() { - return (this.parameterType == null) ? 0 : this.parameterType.size(); - } - - public java.util.Iterator getParameterTypeIterator() { - return (this.parameterType == null) ? null : this.parameterType.iterator(); - } - - public void addToParameterType(String elem) { - if (this.parameterType == null) { - this.parameterType = new ArrayList(); - } - this.parameterType.add(elem); - } - - public List getParameterType() { - return this.parameterType; - } - - public void setParameterType(List parameterType) { - this.parameterType = parameterType; - } - - public void unsetParameterType() { - this.parameterType = null; - } - - /** - * Returns true if field parameterType is set (has been assigned a value) and false otherwise - */ - public boolean isSetParameterType() { - return this.parameterType != null; - } - - public void setParameterTypeIsSet(boolean value) { - if (!value) { - this.parameterType = null; - } - } - - public int getParameterNameSize() { - return (this.parameterName == null) ? 0 : this.parameterName.size(); - } - - public java.util.Iterator getParameterNameIterator() { - return (this.parameterName == null) ? null : this.parameterName.iterator(); - } - - public void addToParameterName(String elem) { - if (this.parameterName == null) { - this.parameterName = new ArrayList(); - } - this.parameterName.add(elem); - } - - public List getParameterName() { - return this.parameterName; - } - - public void setParameterName(List parameterName) { - this.parameterName = parameterName; - } - - public void unsetParameterName() { - this.parameterName = null; - } - - /** - * Returns true if field parameterName is set (has been assigned a value) and false otherwise - */ - public boolean isSetParameterName() { - return this.parameterName != null; - } - - public void setParameterNameIsSet(boolean value) { - if (!value) { - this.parameterName = null; - } - } - - public int getParameterValueSize() { - return (this.parameterValue == null) ? 0 : this.parameterValue.size(); - } - - public java.util.Iterator getParameterValueIterator() { - return (this.parameterValue == null) ? null : this.parameterValue.iterator(); - } - - public void addToParameterValue(String elem) { - if (this.parameterValue == null) { - this.parameterValue = new ArrayList(); - } - this.parameterValue.add(elem); - } - - public List getParameterValue() { - return this.parameterValue; - } - - public void setParameterValue(List parameterValue) { - this.parameterValue = parameterValue; - } - - public void unsetParameterValue() { - this.parameterValue = null; - } - - /** - * Returns true if field parameterValue is set (has been assigned a value) and false otherwise - */ - public boolean isSetParameterValue() { - return this.parameterValue != null; - } - - public void setParameterValueIsSet(boolean value) { - if (!value) { - this.parameterValue = null; - } - } - - public int getLine() { - return this.line; - } - - public void setLine(int line) { - this.line = line; - setLineIsSet(true); - } - - public void unsetLine() { - __isset_bit_vector.clear(__LINE_ISSET_ID); - } - - /** - * Returns true if field line is set (has been assigned a value) and false otherwise - */ - public boolean isSetLine() { - return __isset_bit_vector.get(__LINE_ISSET_ID); - } - - public void setLineIsSet(boolean value) { - __isset_bit_vector.set(__LINE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case API_ID: - if (value == null) { - unsetApiId(); - } else { - setApiId((Integer) value); - } - break; - - case CLASS_NAME: - if (value == null) { - unsetClassName(); - } else { - setClassName((String) value); - } - break; - - case METHOD_NAME: - if (value == null) { - unsetMethodName(); - } else { - setMethodName((String) value); - } - break; - - case PARAMETER_TYPE: - if (value == null) { - unsetParameterType(); - } else { - setParameterType((List) value); - } - break; - - case PARAMETER_NAME: - if (value == null) { - unsetParameterName(); - } else { - setParameterName((List) value); - } - break; - - case PARAMETER_VALUE: - if (value == null) { - unsetParameterValue(); - } else { - setParameterValue((List) value); - } - break; - - case LINE: - if (value == null) { - unsetLine(); - } else { - setLine((Integer) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case API_ID: - return Integer.valueOf(getApiId()); - - case CLASS_NAME: - return getClassName(); - - case METHOD_NAME: - return getMethodName(); - - case PARAMETER_TYPE: - return getParameterType(); - - case PARAMETER_NAME: - return getParameterName(); - - case PARAMETER_VALUE: - return getParameterValue(); - - case LINE: - return Integer.valueOf(getLine()); - - } - 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 API_ID: - return isSetApiId(); - case CLASS_NAME: - return isSetClassName(); - case METHOD_NAME: - return isSetMethodName(); - case PARAMETER_TYPE: - return isSetParameterType(); - case PARAMETER_NAME: - return isSetParameterName(); - case PARAMETER_VALUE: - return isSetParameterValue(); - case LINE: - return isSetLine(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ApiAnnotation) - return this.equals((ApiAnnotation) that); - return false; - } - - public boolean equals(ApiAnnotation that) { - if (that == null) - return false; - - boolean this_present_apiId = true && this.isSetApiId(); - boolean that_present_apiId = true && that.isSetApiId(); - if (this_present_apiId || that_present_apiId) { - if (!(this_present_apiId && that_present_apiId)) - return false; - if (this.apiId != that.apiId) - return false; - } - - boolean this_present_className = true && this.isSetClassName(); - boolean that_present_className = true && that.isSetClassName(); - if (this_present_className || that_present_className) { - if (!(this_present_className && that_present_className)) - return false; - if (!this.className.equals(that.className)) - return false; - } - - boolean this_present_methodName = true && this.isSetMethodName(); - boolean that_present_methodName = true && that.isSetMethodName(); - if (this_present_methodName || that_present_methodName) { - if (!(this_present_methodName && that_present_methodName)) - return false; - if (!this.methodName.equals(that.methodName)) - return false; - } - - boolean this_present_parameterType = true && this.isSetParameterType(); - boolean that_present_parameterType = true && that.isSetParameterType(); - if (this_present_parameterType || that_present_parameterType) { - if (!(this_present_parameterType && that_present_parameterType)) - return false; - if (!this.parameterType.equals(that.parameterType)) - return false; - } - - boolean this_present_parameterName = true && this.isSetParameterName(); - boolean that_present_parameterName = true && that.isSetParameterName(); - if (this_present_parameterName || that_present_parameterName) { - if (!(this_present_parameterName && that_present_parameterName)) - return false; - if (!this.parameterName.equals(that.parameterName)) - return false; - } - - boolean this_present_parameterValue = true && this.isSetParameterValue(); - boolean that_present_parameterValue = true && that.isSetParameterValue(); - if (this_present_parameterValue || that_present_parameterValue) { - if (!(this_present_parameterValue && that_present_parameterValue)) - return false; - if (!this.parameterValue.equals(that.parameterValue)) - return false; - } - - boolean this_present_line = true && this.isSetLine(); - boolean that_present_line = true && that.isSetLine(); - if (this_present_line || that_present_line) { - if (!(this_present_line && that_present_line)) - return false; - if (this.line != that.line) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(ApiAnnotation other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - ApiAnnotation typedOther = (ApiAnnotation) other; - - lastComparison = Boolean.valueOf(isSetApiId()).compareTo(typedOther.isSetApiId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApiId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.apiId, typedOther.apiId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetClassName()).compareTo(typedOther.isSetClassName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClassName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.className, typedOther.className); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMethodName()).compareTo(typedOther.isSetMethodName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMethodName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.methodName, typedOther.methodName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParameterType()).compareTo(typedOther.isSetParameterType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParameterType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterType, typedOther.parameterType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParameterName()).compareTo(typedOther.isSetParameterName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParameterName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterName, typedOther.parameterName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParameterValue()).compareTo(typedOther.isSetParameterValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParameterValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterValue, typedOther.parameterValue); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLine()).compareTo(typedOther.isSetLine()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLine()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.line, typedOther.line); - 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("ApiAnnotation("); - boolean first = true; - - if (isSetApiId()) { - sb.append("apiId:"); - sb.append(this.apiId); - first = false; - } - if (isSetClassName()) { - if (!first) sb.append(", "); - sb.append("className:"); - if (this.className == null) { - sb.append("null"); - } else { - sb.append(this.className); - } - first = false; - } - if (isSetMethodName()) { - if (!first) sb.append(", "); - sb.append("methodName:"); - if (this.methodName == null) { - sb.append("null"); - } else { - sb.append(this.methodName); - } - first = false; - } - if (isSetParameterType()) { - if (!first) sb.append(", "); - sb.append("parameterType:"); - if (this.parameterType == null) { - sb.append("null"); - } else { - sb.append(this.parameterType); - } - first = false; - } - if (isSetParameterName()) { - if (!first) sb.append(", "); - sb.append("parameterName:"); - if (this.parameterName == null) { - sb.append("null"); - } else { - sb.append(this.parameterName); - } - first = false; - } - if (isSetParameterValue()) { - if (!first) sb.append(", "); - sb.append("parameterValue:"); - if (this.parameterValue == null) { - sb.append("null"); - } else { - sb.append(this.parameterValue); - } - first = false; - } - if (isSetLine()) { - if (!first) sb.append(", "); - sb.append("line:"); - sb.append(this.line); - 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 ApiAnnotationStandardSchemeFactory implements SchemeFactory { - public ApiAnnotationStandardScheme getScheme() { - return new ApiAnnotationStandardScheme(); - } - } - - private static class ApiAnnotationStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ApiAnnotation 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: // API_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.apiId = iprot.readI32(); - struct.setApiIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CLASS_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.className = iprot.readString(); - struct.setClassNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // METHOD_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.methodName = iprot.readString(); - struct.setMethodNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARAMETER_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.parameterType = new ArrayList(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) { - String _elem2; // required - _elem2 = iprot.readString(); - struct.parameterType.add(_elem2); - } - iprot.readListEnd(); - } - struct.setParameterTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // PARAMETER_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); - struct.parameterName = new ArrayList(_list3.size); - for (int _i4 = 0; _i4 < _list3.size; ++_i4) { - String _elem5; // required - _elem5 = iprot.readString(); - struct.parameterName.add(_elem5); - } - iprot.readListEnd(); - } - struct.setParameterNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // PARAMETER_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list6 = iprot.readListBegin(); - struct.parameterValue = new ArrayList(_list6.size); - for (int _i7 = 0; _i7 < _list6.size; ++_i7) { - String _elem8; // required - _elem8 = iprot.readString(); - struct.parameterValue.add(_elem8); - } - iprot.readListEnd(); - } - struct.setParameterValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // LINE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.line = iprot.readI32(); - struct.setLineIsSet(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, ApiAnnotation struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetApiId()) { - oprot.writeFieldBegin(API_ID_FIELD_DESC); - oprot.writeI32(struct.apiId); - oprot.writeFieldEnd(); - } - if (struct.className != null) { - if (struct.isSetClassName()) { - oprot.writeFieldBegin(CLASS_NAME_FIELD_DESC); - oprot.writeString(struct.className); - oprot.writeFieldEnd(); - } - } - if (struct.methodName != null) { - if (struct.isSetMethodName()) { - oprot.writeFieldBegin(METHOD_NAME_FIELD_DESC); - oprot.writeString(struct.methodName); - oprot.writeFieldEnd(); - } - } - if (struct.parameterType != null) { - if (struct.isSetParameterType()) { - oprot.writeFieldBegin(PARAMETER_TYPE_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parameterType.size())); - for (String _iter9 : struct.parameterType) { - oprot.writeString(_iter9); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.parameterName != null) { - if (struct.isSetParameterName()) { - oprot.writeFieldBegin(PARAMETER_NAME_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parameterName.size())); - for (String _iter10 : struct.parameterName) { - oprot.writeString(_iter10); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.parameterValue != null) { - if (struct.isSetParameterValue()) { - oprot.writeFieldBegin(PARAMETER_VALUE_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parameterValue.size())); - for (String _iter11 : struct.parameterValue) { - oprot.writeString(_iter11); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.isSetLine()) { - oprot.writeFieldBegin(LINE_FIELD_DESC); - oprot.writeI32(struct.line); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ApiAnnotationTupleSchemeFactory implements SchemeFactory { - public ApiAnnotationTupleScheme getScheme() { - return new ApiAnnotationTupleScheme(); - } - } - - private static class ApiAnnotationTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ApiAnnotation struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetApiId()) { - optionals.set(0); - } - if (struct.isSetClassName()) { - optionals.set(1); - } - if (struct.isSetMethodName()) { - optionals.set(2); - } - if (struct.isSetParameterType()) { - optionals.set(3); - } - if (struct.isSetParameterName()) { - optionals.set(4); - } - if (struct.isSetParameterValue()) { - optionals.set(5); - } - if (struct.isSetLine()) { - optionals.set(6); - } - oprot.writeBitSet(optionals, 7); - if (struct.isSetApiId()) { - oprot.writeI32(struct.apiId); - } - if (struct.isSetClassName()) { - oprot.writeString(struct.className); - } - if (struct.isSetMethodName()) { - oprot.writeString(struct.methodName); - } - if (struct.isSetParameterType()) { - { - oprot.writeI32(struct.parameterType.size()); - for (String _iter12 : struct.parameterType) { - oprot.writeString(_iter12); - } - } - } - if (struct.isSetParameterName()) { - { - oprot.writeI32(struct.parameterName.size()); - for (String _iter13 : struct.parameterName) { - oprot.writeString(_iter13); - } - } - } - if (struct.isSetParameterValue()) { - { - oprot.writeI32(struct.parameterValue.size()); - for (String _iter14 : struct.parameterValue) { - oprot.writeString(_iter14); - } - } - } - if (struct.isSetLine()) { - oprot.writeI32(struct.line); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ApiAnnotation struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); - if (incoming.get(0)) { - struct.apiId = iprot.readI32(); - struct.setApiIdIsSet(true); - } - if (incoming.get(1)) { - struct.className = iprot.readString(); - struct.setClassNameIsSet(true); - } - if (incoming.get(2)) { - struct.methodName = iprot.readString(); - struct.setMethodNameIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TList _list15 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.parameterType = new ArrayList(_list15.size); - for (int _i16 = 0; _i16 < _list15.size; ++_i16) { - String _elem17; // required - _elem17 = iprot.readString(); - struct.parameterType.add(_elem17); - } - } - struct.setParameterTypeIsSet(true); - } - if (incoming.get(4)) { - { - org.apache.thrift.protocol.TList _list18 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.parameterName = new ArrayList(_list18.size); - for (int _i19 = 0; _i19 < _list18.size; ++_i19) { - String _elem20; // required - _elem20 = iprot.readString(); - struct.parameterName.add(_elem20); - } - } - struct.setParameterNameIsSet(true); - } - if (incoming.get(5)) { - { - org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.parameterValue = new ArrayList(_list21.size); - for (int _i22 = 0; _i22 < _list21.size; ++_i22) { - String _elem23; // required - _elem23 = iprot.readString(); - struct.parameterValue.add(_elem23); - } - } - struct.setParameterValueIsSet(true); - } - if (incoming.get(6)) { - struct.line = iprot.readI32(); - struct.setLineIsSet(true); - } - } - } - -} - +/** + * 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 ApiAnnotation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ApiAnnotation"); + + private static final org.apache.thrift.protocol.TField API_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("apiId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("className", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField METHOD_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("methodName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField PARAMETER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterType", org.apache.thrift.protocol.TType.LIST, (short)4); + private static final org.apache.thrift.protocol.TField PARAMETER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterName", org.apache.thrift.protocol.TType.LIST, (short)5); + private static final org.apache.thrift.protocol.TField PARAMETER_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterValue", org.apache.thrift.protocol.TType.LIST, (short)6); + private static final org.apache.thrift.protocol.TField LINE_FIELD_DESC = new org.apache.thrift.protocol.TField("line", org.apache.thrift.protocol.TType.I32, (short)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ApiAnnotationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ApiAnnotationTupleSchemeFactory()); + } + + private int apiId; // optional + private String className; // optional + private String methodName; // optional + private List parameterType; // optional + private List parameterName; // optional + private List parameterValue; // optional + private int line; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + API_ID((short)1, "apiId"), + CLASS_NAME((short)2, "className"), + METHOD_NAME((short)3, "methodName"), + PARAMETER_TYPE((short)4, "parameterType"), + PARAMETER_NAME((short)5, "parameterName"), + PARAMETER_VALUE((short)6, "parameterValue"), + LINE((short)7, "line"); + + 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: // API_ID + return API_ID; + case 2: // CLASS_NAME + return CLASS_NAME; + case 3: // METHOD_NAME + return METHOD_NAME; + case 4: // PARAMETER_TYPE + return PARAMETER_TYPE; + case 5: // PARAMETER_NAME + return PARAMETER_NAME; + case 6: // PARAMETER_VALUE + return PARAMETER_VALUE; + case 7: // LINE + return LINE; + 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 __APIID_ISSET_ID = 0; + private static final int __LINE_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); + private _Fields optionals[] = {_Fields.API_ID,_Fields.CLASS_NAME,_Fields.METHOD_NAME,_Fields.PARAMETER_TYPE,_Fields.PARAMETER_NAME,_Fields.PARAMETER_VALUE,_Fields.LINE}; + 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.API_ID, new org.apache.thrift.meta_data.FieldMetaData("apiId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("className", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.METHOD_NAME, new org.apache.thrift.meta_data.FieldMetaData("methodName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PARAMETER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("parameterType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.PARAMETER_NAME, new org.apache.thrift.meta_data.FieldMetaData("parameterName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.PARAMETER_VALUE, new org.apache.thrift.meta_data.FieldMetaData("parameterValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.LINE, new org.apache.thrift.meta_data.FieldMetaData("line", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ApiAnnotation.class, metaDataMap); + } + + public ApiAnnotation() { + } + + /** + * Performs a deep copy on other. + */ + public ApiAnnotation(ApiAnnotation other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.apiId = other.apiId; + if (other.isSetClassName()) { + this.className = other.className; + } + if (other.isSetMethodName()) { + this.methodName = other.methodName; + } + if (other.isSetParameterType()) { + List __this__parameterType = new ArrayList(); + for (String other_element : other.parameterType) { + __this__parameterType.add(other_element); + } + this.parameterType = __this__parameterType; + } + if (other.isSetParameterName()) { + List __this__parameterName = new ArrayList(); + for (String other_element : other.parameterName) { + __this__parameterName.add(other_element); + } + this.parameterName = __this__parameterName; + } + if (other.isSetParameterValue()) { + List __this__parameterValue = new ArrayList(); + for (String other_element : other.parameterValue) { + __this__parameterValue.add(other_element); + } + this.parameterValue = __this__parameterValue; + } + this.line = other.line; + } + + public ApiAnnotation deepCopy() { + return new ApiAnnotation(this); + } + + @Override + public void clear() { + setApiIdIsSet(false); + this.apiId = 0; + this.className = null; + this.methodName = null; + this.parameterType = null; + this.parameterName = null; + this.parameterValue = null; + setLineIsSet(false); + this.line = 0; + } + + public int getApiId() { + return this.apiId; + } + + public void setApiId(int apiId) { + this.apiId = apiId; + setApiIdIsSet(true); + } + + public void unsetApiId() { + __isset_bit_vector.clear(__APIID_ISSET_ID); + } + + /** Returns true if field apiId is set (has been assigned a value) and false otherwise */ + public boolean isSetApiId() { + return __isset_bit_vector.get(__APIID_ISSET_ID); + } + + public void setApiIdIsSet(boolean value) { + __isset_bit_vector.set(__APIID_ISSET_ID, value); + } + + public String getClassName() { + return this.className; + } + + public void setClassName(String className) { + this.className = className; + } + + public void unsetClassName() { + this.className = null; + } + + /** Returns true if field className is set (has been assigned a value) and false otherwise */ + public boolean isSetClassName() { + return this.className != null; + } + + public void setClassNameIsSet(boolean value) { + if (!value) { + this.className = null; + } + } + + public String getMethodName() { + return this.methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + public void unsetMethodName() { + this.methodName = null; + } + + /** Returns true if field methodName is set (has been assigned a value) and false otherwise */ + public boolean isSetMethodName() { + return this.methodName != null; + } + + public void setMethodNameIsSet(boolean value) { + if (!value) { + this.methodName = null; + } + } + + public int getParameterTypeSize() { + return (this.parameterType == null) ? 0 : this.parameterType.size(); + } + + public java.util.Iterator getParameterTypeIterator() { + return (this.parameterType == null) ? null : this.parameterType.iterator(); + } + + public void addToParameterType(String elem) { + if (this.parameterType == null) { + this.parameterType = new ArrayList(); + } + this.parameterType.add(elem); + } + + public List getParameterType() { + return this.parameterType; + } + + public void setParameterType(List parameterType) { + this.parameterType = parameterType; + } + + public void unsetParameterType() { + this.parameterType = null; + } + + /** Returns true if field parameterType is set (has been assigned a value) and false otherwise */ + public boolean isSetParameterType() { + return this.parameterType != null; + } + + public void setParameterTypeIsSet(boolean value) { + if (!value) { + this.parameterType = null; + } + } + + public int getParameterNameSize() { + return (this.parameterName == null) ? 0 : this.parameterName.size(); + } + + public java.util.Iterator getParameterNameIterator() { + return (this.parameterName == null) ? null : this.parameterName.iterator(); + } + + public void addToParameterName(String elem) { + if (this.parameterName == null) { + this.parameterName = new ArrayList(); + } + this.parameterName.add(elem); + } + + public List getParameterName() { + return this.parameterName; + } + + public void setParameterName(List parameterName) { + this.parameterName = parameterName; + } + + public void unsetParameterName() { + this.parameterName = null; + } + + /** Returns true if field parameterName is set (has been assigned a value) and false otherwise */ + public boolean isSetParameterName() { + return this.parameterName != null; + } + + public void setParameterNameIsSet(boolean value) { + if (!value) { + this.parameterName = null; + } + } + + public int getParameterValueSize() { + return (this.parameterValue == null) ? 0 : this.parameterValue.size(); + } + + public java.util.Iterator getParameterValueIterator() { + return (this.parameterValue == null) ? null : this.parameterValue.iterator(); + } + + public void addToParameterValue(String elem) { + if (this.parameterValue == null) { + this.parameterValue = new ArrayList(); + } + this.parameterValue.add(elem); + } + + public List getParameterValue() { + return this.parameterValue; + } + + public void setParameterValue(List parameterValue) { + this.parameterValue = parameterValue; + } + + public void unsetParameterValue() { + this.parameterValue = null; + } + + /** Returns true if field parameterValue is set (has been assigned a value) and false otherwise */ + public boolean isSetParameterValue() { + return this.parameterValue != null; + } + + public void setParameterValueIsSet(boolean value) { + if (!value) { + this.parameterValue = null; + } + } + + public int getLine() { + return this.line; + } + + public void setLine(int line) { + this.line = line; + setLineIsSet(true); + } + + public void unsetLine() { + __isset_bit_vector.clear(__LINE_ISSET_ID); + } + + /** Returns true if field line is set (has been assigned a value) and false otherwise */ + public boolean isSetLine() { + return __isset_bit_vector.get(__LINE_ISSET_ID); + } + + public void setLineIsSet(boolean value) { + __isset_bit_vector.set(__LINE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case API_ID: + if (value == null) { + unsetApiId(); + } else { + setApiId((Integer)value); + } + break; + + case CLASS_NAME: + if (value == null) { + unsetClassName(); + } else { + setClassName((String)value); + } + break; + + case METHOD_NAME: + if (value == null) { + unsetMethodName(); + } else { + setMethodName((String)value); + } + break; + + case PARAMETER_TYPE: + if (value == null) { + unsetParameterType(); + } else { + setParameterType((List)value); + } + break; + + case PARAMETER_NAME: + if (value == null) { + unsetParameterName(); + } else { + setParameterName((List)value); + } + break; + + case PARAMETER_VALUE: + if (value == null) { + unsetParameterValue(); + } else { + setParameterValue((List)value); + } + break; + + case LINE: + if (value == null) { + unsetLine(); + } else { + setLine((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case API_ID: + return Integer.valueOf(getApiId()); + + case CLASS_NAME: + return getClassName(); + + case METHOD_NAME: + return getMethodName(); + + case PARAMETER_TYPE: + return getParameterType(); + + case PARAMETER_NAME: + return getParameterName(); + + case PARAMETER_VALUE: + return getParameterValue(); + + case LINE: + return Integer.valueOf(getLine()); + + } + 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 API_ID: + return isSetApiId(); + case CLASS_NAME: + return isSetClassName(); + case METHOD_NAME: + return isSetMethodName(); + case PARAMETER_TYPE: + return isSetParameterType(); + case PARAMETER_NAME: + return isSetParameterName(); + case PARAMETER_VALUE: + return isSetParameterValue(); + case LINE: + return isSetLine(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ApiAnnotation) + return this.equals((ApiAnnotation)that); + return false; + } + + public boolean equals(ApiAnnotation that) { + if (that == null) + return false; + + boolean this_present_apiId = true && this.isSetApiId(); + boolean that_present_apiId = true && that.isSetApiId(); + if (this_present_apiId || that_present_apiId) { + if (!(this_present_apiId && that_present_apiId)) + return false; + if (this.apiId != that.apiId) + return false; + } + + boolean this_present_className = true && this.isSetClassName(); + boolean that_present_className = true && that.isSetClassName(); + if (this_present_className || that_present_className) { + if (!(this_present_className && that_present_className)) + return false; + if (!this.className.equals(that.className)) + return false; + } + + boolean this_present_methodName = true && this.isSetMethodName(); + boolean that_present_methodName = true && that.isSetMethodName(); + if (this_present_methodName || that_present_methodName) { + if (!(this_present_methodName && that_present_methodName)) + return false; + if (!this.methodName.equals(that.methodName)) + return false; + } + + boolean this_present_parameterType = true && this.isSetParameterType(); + boolean that_present_parameterType = true && that.isSetParameterType(); + if (this_present_parameterType || that_present_parameterType) { + if (!(this_present_parameterType && that_present_parameterType)) + return false; + if (!this.parameterType.equals(that.parameterType)) + return false; + } + + boolean this_present_parameterName = true && this.isSetParameterName(); + boolean that_present_parameterName = true && that.isSetParameterName(); + if (this_present_parameterName || that_present_parameterName) { + if (!(this_present_parameterName && that_present_parameterName)) + return false; + if (!this.parameterName.equals(that.parameterName)) + return false; + } + + boolean this_present_parameterValue = true && this.isSetParameterValue(); + boolean that_present_parameterValue = true && that.isSetParameterValue(); + if (this_present_parameterValue || that_present_parameterValue) { + if (!(this_present_parameterValue && that_present_parameterValue)) + return false; + if (!this.parameterValue.equals(that.parameterValue)) + return false; + } + + boolean this_present_line = true && this.isSetLine(); + boolean that_present_line = true && that.isSetLine(); + if (this_present_line || that_present_line) { + if (!(this_present_line && that_present_line)) + return false; + if (this.line != that.line) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(ApiAnnotation other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ApiAnnotation typedOther = (ApiAnnotation)other; + + lastComparison = Boolean.valueOf(isSetApiId()).compareTo(typedOther.isSetApiId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetApiId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.apiId, typedOther.apiId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetClassName()).compareTo(typedOther.isSetClassName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClassName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.className, typedOther.className); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMethodName()).compareTo(typedOther.isSetMethodName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMethodName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.methodName, typedOther.methodName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParameterType()).compareTo(typedOther.isSetParameterType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParameterType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterType, typedOther.parameterType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParameterName()).compareTo(typedOther.isSetParameterName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParameterName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterName, typedOther.parameterName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParameterValue()).compareTo(typedOther.isSetParameterValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParameterValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterValue, typedOther.parameterValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLine()).compareTo(typedOther.isSetLine()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLine()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.line, typedOther.line); + 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("ApiAnnotation("); + boolean first = true; + + if (isSetApiId()) { + sb.append("apiId:"); + sb.append(this.apiId); + first = false; + } + if (isSetClassName()) { + if (!first) sb.append(", "); + sb.append("className:"); + if (this.className == null) { + sb.append("null"); + } else { + sb.append(this.className); + } + first = false; + } + if (isSetMethodName()) { + if (!first) sb.append(", "); + sb.append("methodName:"); + if (this.methodName == null) { + sb.append("null"); + } else { + sb.append(this.methodName); + } + first = false; + } + if (isSetParameterType()) { + if (!first) sb.append(", "); + sb.append("parameterType:"); + if (this.parameterType == null) { + sb.append("null"); + } else { + sb.append(this.parameterType); + } + first = false; + } + if (isSetParameterName()) { + if (!first) sb.append(", "); + sb.append("parameterName:"); + if (this.parameterName == null) { + sb.append("null"); + } else { + sb.append(this.parameterName); + } + first = false; + } + if (isSetParameterValue()) { + if (!first) sb.append(", "); + sb.append("parameterValue:"); + if (this.parameterValue == null) { + sb.append("null"); + } else { + sb.append(this.parameterValue); + } + first = false; + } + if (isSetLine()) { + if (!first) sb.append(", "); + sb.append("line:"); + sb.append(this.line); + 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 ApiAnnotationStandardSchemeFactory implements SchemeFactory { + public ApiAnnotationStandardScheme getScheme() { + return new ApiAnnotationStandardScheme(); + } + } + + private static class ApiAnnotationStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ApiAnnotation 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: // API_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.apiId = iprot.readI32(); + struct.setApiIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CLASS_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.className = iprot.readString(); + struct.setClassNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // METHOD_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.methodName = iprot.readString(); + struct.setMethodNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // PARAMETER_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.parameterType = new ArrayList(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + String _elem2; // required + _elem2 = iprot.readString(); + struct.parameterType.add(_elem2); + } + iprot.readListEnd(); + } + struct.setParameterTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // PARAMETER_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); + struct.parameterName = new ArrayList(_list3.size); + for (int _i4 = 0; _i4 < _list3.size; ++_i4) + { + String _elem5; // required + _elem5 = iprot.readString(); + struct.parameterName.add(_elem5); + } + iprot.readListEnd(); + } + struct.setParameterNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // PARAMETER_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list6 = iprot.readListBegin(); + struct.parameterValue = new ArrayList(_list6.size); + for (int _i7 = 0; _i7 < _list6.size; ++_i7) + { + String _elem8; // required + _elem8 = iprot.readString(); + struct.parameterValue.add(_elem8); + } + iprot.readListEnd(); + } + struct.setParameterValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // LINE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.line = iprot.readI32(); + struct.setLineIsSet(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, ApiAnnotation struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetApiId()) { + oprot.writeFieldBegin(API_ID_FIELD_DESC); + oprot.writeI32(struct.apiId); + oprot.writeFieldEnd(); + } + if (struct.className != null) { + if (struct.isSetClassName()) { + oprot.writeFieldBegin(CLASS_NAME_FIELD_DESC); + oprot.writeString(struct.className); + oprot.writeFieldEnd(); + } + } + if (struct.methodName != null) { + if (struct.isSetMethodName()) { + oprot.writeFieldBegin(METHOD_NAME_FIELD_DESC); + oprot.writeString(struct.methodName); + oprot.writeFieldEnd(); + } + } + if (struct.parameterType != null) { + if (struct.isSetParameterType()) { + oprot.writeFieldBegin(PARAMETER_TYPE_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parameterType.size())); + for (String _iter9 : struct.parameterType) + { + oprot.writeString(_iter9); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.parameterName != null) { + if (struct.isSetParameterName()) { + oprot.writeFieldBegin(PARAMETER_NAME_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parameterName.size())); + for (String _iter10 : struct.parameterName) + { + oprot.writeString(_iter10); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.parameterValue != null) { + if (struct.isSetParameterValue()) { + oprot.writeFieldBegin(PARAMETER_VALUE_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parameterValue.size())); + for (String _iter11 : struct.parameterValue) + { + oprot.writeString(_iter11); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetLine()) { + oprot.writeFieldBegin(LINE_FIELD_DESC); + oprot.writeI32(struct.line); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ApiAnnotationTupleSchemeFactory implements SchemeFactory { + public ApiAnnotationTupleScheme getScheme() { + return new ApiAnnotationTupleScheme(); + } + } + + private static class ApiAnnotationTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ApiAnnotation struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetApiId()) { + optionals.set(0); + } + if (struct.isSetClassName()) { + optionals.set(1); + } + if (struct.isSetMethodName()) { + optionals.set(2); + } + if (struct.isSetParameterType()) { + optionals.set(3); + } + if (struct.isSetParameterName()) { + optionals.set(4); + } + if (struct.isSetParameterValue()) { + optionals.set(5); + } + if (struct.isSetLine()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); + if (struct.isSetApiId()) { + oprot.writeI32(struct.apiId); + } + if (struct.isSetClassName()) { + oprot.writeString(struct.className); + } + if (struct.isSetMethodName()) { + oprot.writeString(struct.methodName); + } + if (struct.isSetParameterType()) { + { + oprot.writeI32(struct.parameterType.size()); + for (String _iter12 : struct.parameterType) + { + oprot.writeString(_iter12); + } + } + } + if (struct.isSetParameterName()) { + { + oprot.writeI32(struct.parameterName.size()); + for (String _iter13 : struct.parameterName) + { + oprot.writeString(_iter13); + } + } + } + if (struct.isSetParameterValue()) { + { + oprot.writeI32(struct.parameterValue.size()); + for (String _iter14 : struct.parameterValue) + { + oprot.writeString(_iter14); + } + } + } + if (struct.isSetLine()) { + oprot.writeI32(struct.line); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ApiAnnotation struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(7); + if (incoming.get(0)) { + struct.apiId = iprot.readI32(); + struct.setApiIdIsSet(true); + } + if (incoming.get(1)) { + struct.className = iprot.readString(); + struct.setClassNameIsSet(true); + } + if (incoming.get(2)) { + struct.methodName = iprot.readString(); + struct.setMethodNameIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list15 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.parameterType = new ArrayList(_list15.size); + for (int _i16 = 0; _i16 < _list15.size; ++_i16) + { + String _elem17; // required + _elem17 = iprot.readString(); + struct.parameterType.add(_elem17); + } + } + struct.setParameterTypeIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TList _list18 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.parameterName = new ArrayList(_list18.size); + for (int _i19 = 0; _i19 < _list18.size; ++_i19) + { + String _elem20; // required + _elem20 = iprot.readString(); + struct.parameterName.add(_elem20); + } + } + struct.setParameterNameIsSet(true); + } + if (incoming.get(5)) { + { + org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.parameterValue = new ArrayList(_list21.size); + for (int _i22 = 0; _i22 < _list21.size; ++_i22) + { + String _elem23; // required + _elem23 = iprot.readString(); + struct.parameterValue.add(_elem23); + } + } + struct.setParameterValueIsSet(true); + } + if (incoming.get(6)) { + struct.line = iprot.readI32(); + struct.setLineIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/JVMInfoThriftDTO.java b/src/main/java/com/profiler/common/dto/thrift/JVMInfoThriftDTO.java index 9fe77c43c..e716b7063 100644 --- a/src/main/java/com/profiler/common/dto/thrift/JVMInfoThriftDTO.java +++ b/src/main/java/com/profiler/common/dto/thrift/JVMInfoThriftDTO.java @@ -1,1443 +1,1413 @@ -/** - * 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 JVMInfoThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JVMInfoThriftDTO"); - - 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) 1); - private static final org.apache.thrift.protocol.TField DATA_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("dataTime", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField ACTIVE_THREAD_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("activeThreadCount", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField GC1_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("gc1Count", org.apache.thrift.protocol.TType.I64, (short) 4); - private static final org.apache.thrift.protocol.TField GC1_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("gc1Time", org.apache.thrift.protocol.TType.I64, (short) 5); - private static final org.apache.thrift.protocol.TField GC2_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("gc2Count", org.apache.thrift.protocol.TType.I64, (short) 6); - private static final org.apache.thrift.protocol.TField GC2_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("gc2Time", org.apache.thrift.protocol.TType.I64, (short) 7); - private static final org.apache.thrift.protocol.TField HEAP_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("heapUsed", org.apache.thrift.protocol.TType.I64, (short) 8); - private static final org.apache.thrift.protocol.TField HEAP_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("heapCommitted", org.apache.thrift.protocol.TType.I64, (short) 9); - private static final org.apache.thrift.protocol.TField NON_HEAP_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("nonHeapUsed", org.apache.thrift.protocol.TType.I64, (short) 10); - private static final org.apache.thrift.protocol.TField NON_HEAP_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("nonHeapCommitted", org.apache.thrift.protocol.TType.I64, (short) 11); - private static final org.apache.thrift.protocol.TField PROCESS_CPUTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("processCPUTime", org.apache.thrift.protocol.TType.DOUBLE, (short) 12); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new JVMInfoThriftDTOStandardSchemeFactory()); - schemes.put(TupleScheme.class, new JVMInfoThriftDTOTupleSchemeFactory()); - } - - private String agentId; // required - private long dataTime; // required - private int activeThreadCount; // required - private long gc1Count; // optional - private long gc1Time; // optional - private long gc2Count; // optional - private long gc2Time; // optional - private long heapUsed; // required - private long heapCommitted; // required - private long nonHeapUsed; // required - private long nonHeapCommitted; // required - private double processCPUTime; // optional - - /** - * The set of fields this struct contains, along with convenience methods for finding and manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - AGENT_ID((short) 1, "agentId"), - DATA_TIME((short) 2, "dataTime"), - ACTIVE_THREAD_COUNT((short) 3, "activeThreadCount"), - GC1_COUNT((short) 4, "gc1Count"), - GC1_TIME((short) 5, "gc1Time"), - GC2_COUNT((short) 6, "gc2Count"), - GC2_TIME((short) 7, "gc2Time"), - HEAP_USED((short) 8, "heapUsed"), - HEAP_COMMITTED((short) 9, "heapCommitted"), - NON_HEAP_USED((short) 10, "nonHeapUsed"), - NON_HEAP_COMMITTED((short) 11, "nonHeapCommitted"), - PROCESS_CPUTIME((short) 12, "processCPUTime"); - - 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: // AGENT_ID - return AGENT_ID; - case 2: // DATA_TIME - return DATA_TIME; - case 3: // ACTIVE_THREAD_COUNT - return ACTIVE_THREAD_COUNT; - case 4: // GC1_COUNT - return GC1_COUNT; - case 5: // GC1_TIME - return GC1_TIME; - case 6: // GC2_COUNT - return GC2_COUNT; - case 7: // GC2_TIME - return GC2_TIME; - case 8: // HEAP_USED - return HEAP_USED; - case 9: // HEAP_COMMITTED - return HEAP_COMMITTED; - case 10: // NON_HEAP_USED - return NON_HEAP_USED; - case 11: // NON_HEAP_COMMITTED - return NON_HEAP_COMMITTED; - case 12: // PROCESS_CPUTIME - return PROCESS_CPUTIME; - 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 __DATATIME_ISSET_ID = 0; - private static final int __ACTIVETHREADCOUNT_ISSET_ID = 1; - private static final int __GC1COUNT_ISSET_ID = 2; - private static final int __GC1TIME_ISSET_ID = 3; - private static final int __GC2COUNT_ISSET_ID = 4; - private static final int __GC2TIME_ISSET_ID = 5; - private static final int __HEAPUSED_ISSET_ID = 6; - private static final int __HEAPCOMMITTED_ISSET_ID = 7; - private static final int __NONHEAPUSED_ISSET_ID = 8; - private static final int __NONHEAPCOMMITTED_ISSET_ID = 9; - private static final int __PROCESSCPUTIME_ISSET_ID = 10; - private BitSet __isset_bit_vector = new BitSet(11); - private _Fields optionals[] = {_Fields.GC1_COUNT, _Fields.GC1_TIME, _Fields.GC2_COUNT, _Fields.GC2_TIME, _Fields.PROCESS_CPUTIME}; - 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.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.DATA_TIME, new org.apache.thrift.meta_data.FieldMetaData("dataTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.ACTIVE_THREAD_COUNT, new org.apache.thrift.meta_data.FieldMetaData("activeThreadCount", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.GC1_COUNT, new org.apache.thrift.meta_data.FieldMetaData("gc1Count", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.GC1_TIME, new org.apache.thrift.meta_data.FieldMetaData("gc1Time", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.GC2_COUNT, new org.apache.thrift.meta_data.FieldMetaData("gc2Count", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.GC2_TIME, new org.apache.thrift.meta_data.FieldMetaData("gc2Time", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.HEAP_USED, new org.apache.thrift.meta_data.FieldMetaData("heapUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.HEAP_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("heapCommitted", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.NON_HEAP_USED, new org.apache.thrift.meta_data.FieldMetaData("nonHeapUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.NON_HEAP_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("nonHeapCommitted", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.PROCESS_CPUTIME, new org.apache.thrift.meta_data.FieldMetaData("processCPUTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JVMInfoThriftDTO.class, metaDataMap); - } - - public JVMInfoThriftDTO() { - } - - public JVMInfoThriftDTO( - String agentId, - long dataTime, - int activeThreadCount, - long heapUsed, - long heapCommitted, - long nonHeapUsed, - long nonHeapCommitted) { - this(); - this.agentId = agentId; - this.dataTime = dataTime; - setDataTimeIsSet(true); - this.activeThreadCount = activeThreadCount; - setActiveThreadCountIsSet(true); - this.heapUsed = heapUsed; - setHeapUsedIsSet(true); - this.heapCommitted = heapCommitted; - setHeapCommittedIsSet(true); - this.nonHeapUsed = nonHeapUsed; - setNonHeapUsedIsSet(true); - this.nonHeapCommitted = nonHeapCommitted; - setNonHeapCommittedIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public JVMInfoThriftDTO(JVMInfoThriftDTO other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetAgentId()) { - this.agentId = other.agentId; - } - this.dataTime = other.dataTime; - this.activeThreadCount = other.activeThreadCount; - this.gc1Count = other.gc1Count; - this.gc1Time = other.gc1Time; - this.gc2Count = other.gc2Count; - this.gc2Time = other.gc2Time; - this.heapUsed = other.heapUsed; - this.heapCommitted = other.heapCommitted; - this.nonHeapUsed = other.nonHeapUsed; - this.nonHeapCommitted = other.nonHeapCommitted; - this.processCPUTime = other.processCPUTime; - } - - public JVMInfoThriftDTO deepCopy() { - return new JVMInfoThriftDTO(this); - } - - @Override - public void clear() { - this.agentId = null; - setDataTimeIsSet(false); - this.dataTime = 0; - setActiveThreadCountIsSet(false); - this.activeThreadCount = 0; - setGc1CountIsSet(false); - this.gc1Count = 0; - setGc1TimeIsSet(false); - this.gc1Time = 0; - setGc2CountIsSet(false); - this.gc2Count = 0; - setGc2TimeIsSet(false); - this.gc2Time = 0; - setHeapUsedIsSet(false); - this.heapUsed = 0; - setHeapCommittedIsSet(false); - this.heapCommitted = 0; - setNonHeapUsedIsSet(false); - this.nonHeapUsed = 0; - setNonHeapCommittedIsSet(false); - this.nonHeapCommitted = 0; - setProcessCPUTimeIsSet(false); - this.processCPUTime = 0.0; - } - - 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 long getDataTime() { - return this.dataTime; - } - - public void setDataTime(long dataTime) { - this.dataTime = dataTime; - setDataTimeIsSet(true); - } - - public void unsetDataTime() { - __isset_bit_vector.clear(__DATATIME_ISSET_ID); - } - - /** - * Returns true if field dataTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetDataTime() { - return __isset_bit_vector.get(__DATATIME_ISSET_ID); - } - - public void setDataTimeIsSet(boolean value) { - __isset_bit_vector.set(__DATATIME_ISSET_ID, value); - } - - public int getActiveThreadCount() { - return this.activeThreadCount; - } - - public void setActiveThreadCount(int activeThreadCount) { - this.activeThreadCount = activeThreadCount; - setActiveThreadCountIsSet(true); - } - - public void unsetActiveThreadCount() { - __isset_bit_vector.clear(__ACTIVETHREADCOUNT_ISSET_ID); - } - - /** - * Returns true if field activeThreadCount is set (has been assigned a value) and false otherwise - */ - public boolean isSetActiveThreadCount() { - return __isset_bit_vector.get(__ACTIVETHREADCOUNT_ISSET_ID); - } - - public void setActiveThreadCountIsSet(boolean value) { - __isset_bit_vector.set(__ACTIVETHREADCOUNT_ISSET_ID, value); - } - - public long getGc1Count() { - return this.gc1Count; - } - - public void setGc1Count(long gc1Count) { - this.gc1Count = gc1Count; - setGc1CountIsSet(true); - } - - public void unsetGc1Count() { - __isset_bit_vector.clear(__GC1COUNT_ISSET_ID); - } - - /** - * Returns true if field gc1Count is set (has been assigned a value) and false otherwise - */ - public boolean isSetGc1Count() { - return __isset_bit_vector.get(__GC1COUNT_ISSET_ID); - } - - public void setGc1CountIsSet(boolean value) { - __isset_bit_vector.set(__GC1COUNT_ISSET_ID, value); - } - - public long getGc1Time() { - return this.gc1Time; - } - - public void setGc1Time(long gc1Time) { - this.gc1Time = gc1Time; - setGc1TimeIsSet(true); - } - - public void unsetGc1Time() { - __isset_bit_vector.clear(__GC1TIME_ISSET_ID); - } - - /** - * Returns true if field gc1Time is set (has been assigned a value) and false otherwise - */ - public boolean isSetGc1Time() { - return __isset_bit_vector.get(__GC1TIME_ISSET_ID); - } - - public void setGc1TimeIsSet(boolean value) { - __isset_bit_vector.set(__GC1TIME_ISSET_ID, value); - } - - public long getGc2Count() { - return this.gc2Count; - } - - public void setGc2Count(long gc2Count) { - this.gc2Count = gc2Count; - setGc2CountIsSet(true); - } - - public void unsetGc2Count() { - __isset_bit_vector.clear(__GC2COUNT_ISSET_ID); - } - - /** - * Returns true if field gc2Count is set (has been assigned a value) and false otherwise - */ - public boolean isSetGc2Count() { - return __isset_bit_vector.get(__GC2COUNT_ISSET_ID); - } - - public void setGc2CountIsSet(boolean value) { - __isset_bit_vector.set(__GC2COUNT_ISSET_ID, value); - } - - public long getGc2Time() { - return this.gc2Time; - } - - public void setGc2Time(long gc2Time) { - this.gc2Time = gc2Time; - setGc2TimeIsSet(true); - } - - public void unsetGc2Time() { - __isset_bit_vector.clear(__GC2TIME_ISSET_ID); - } - - /** - * Returns true if field gc2Time is set (has been assigned a value) and false otherwise - */ - public boolean isSetGc2Time() { - return __isset_bit_vector.get(__GC2TIME_ISSET_ID); - } - - public void setGc2TimeIsSet(boolean value) { - __isset_bit_vector.set(__GC2TIME_ISSET_ID, value); - } - - public long getHeapUsed() { - return this.heapUsed; - } - - public void setHeapUsed(long heapUsed) { - this.heapUsed = heapUsed; - setHeapUsedIsSet(true); - } - - public void unsetHeapUsed() { - __isset_bit_vector.clear(__HEAPUSED_ISSET_ID); - } - - /** - * Returns true if field heapUsed is set (has been assigned a value) and false otherwise - */ - public boolean isSetHeapUsed() { - return __isset_bit_vector.get(__HEAPUSED_ISSET_ID); - } - - public void setHeapUsedIsSet(boolean value) { - __isset_bit_vector.set(__HEAPUSED_ISSET_ID, value); - } - - public long getHeapCommitted() { - return this.heapCommitted; - } - - public void setHeapCommitted(long heapCommitted) { - this.heapCommitted = heapCommitted; - setHeapCommittedIsSet(true); - } - - public void unsetHeapCommitted() { - __isset_bit_vector.clear(__HEAPCOMMITTED_ISSET_ID); - } - - /** - * Returns true if field heapCommitted is set (has been assigned a value) and false otherwise - */ - public boolean isSetHeapCommitted() { - return __isset_bit_vector.get(__HEAPCOMMITTED_ISSET_ID); - } - - public void setHeapCommittedIsSet(boolean value) { - __isset_bit_vector.set(__HEAPCOMMITTED_ISSET_ID, value); - } - - public long getNonHeapUsed() { - return this.nonHeapUsed; - } - - public void setNonHeapUsed(long nonHeapUsed) { - this.nonHeapUsed = nonHeapUsed; - setNonHeapUsedIsSet(true); - } - - public void unsetNonHeapUsed() { - __isset_bit_vector.clear(__NONHEAPUSED_ISSET_ID); - } - - /** - * Returns true if field nonHeapUsed is set (has been assigned a value) and false otherwise - */ - public boolean isSetNonHeapUsed() { - return __isset_bit_vector.get(__NONHEAPUSED_ISSET_ID); - } - - public void setNonHeapUsedIsSet(boolean value) { - __isset_bit_vector.set(__NONHEAPUSED_ISSET_ID, value); - } - - public long getNonHeapCommitted() { - return this.nonHeapCommitted; - } - - public void setNonHeapCommitted(long nonHeapCommitted) { - this.nonHeapCommitted = nonHeapCommitted; - setNonHeapCommittedIsSet(true); - } - - public void unsetNonHeapCommitted() { - __isset_bit_vector.clear(__NONHEAPCOMMITTED_ISSET_ID); - } - - /** - * Returns true if field nonHeapCommitted is set (has been assigned a value) and false otherwise - */ - public boolean isSetNonHeapCommitted() { - return __isset_bit_vector.get(__NONHEAPCOMMITTED_ISSET_ID); - } - - public void setNonHeapCommittedIsSet(boolean value) { - __isset_bit_vector.set(__NONHEAPCOMMITTED_ISSET_ID, value); - } - - public double getProcessCPUTime() { - return this.processCPUTime; - } - - public void setProcessCPUTime(double processCPUTime) { - this.processCPUTime = processCPUTime; - setProcessCPUTimeIsSet(true); - } - - public void unsetProcessCPUTime() { - __isset_bit_vector.clear(__PROCESSCPUTIME_ISSET_ID); - } - - /** - * Returns true if field processCPUTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetProcessCPUTime() { - return __isset_bit_vector.get(__PROCESSCPUTIME_ISSET_ID); - } - - public void setProcessCPUTimeIsSet(boolean value) { - __isset_bit_vector.set(__PROCESSCPUTIME_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AGENT_ID: - if (value == null) { - unsetAgentId(); - } else { - setAgentId((String) value); - } - break; - - case DATA_TIME: - if (value == null) { - unsetDataTime(); - } else { - setDataTime((Long) value); - } - break; - - case ACTIVE_THREAD_COUNT: - if (value == null) { - unsetActiveThreadCount(); - } else { - setActiveThreadCount((Integer) value); - } - break; - - case GC1_COUNT: - if (value == null) { - unsetGc1Count(); - } else { - setGc1Count((Long) value); - } - break; - - case GC1_TIME: - if (value == null) { - unsetGc1Time(); - } else { - setGc1Time((Long) value); - } - break; - - case GC2_COUNT: - if (value == null) { - unsetGc2Count(); - } else { - setGc2Count((Long) value); - } - break; - - case GC2_TIME: - if (value == null) { - unsetGc2Time(); - } else { - setGc2Time((Long) value); - } - break; - - case HEAP_USED: - if (value == null) { - unsetHeapUsed(); - } else { - setHeapUsed((Long) value); - } - break; - - case HEAP_COMMITTED: - if (value == null) { - unsetHeapCommitted(); - } else { - setHeapCommitted((Long) value); - } - break; - - case NON_HEAP_USED: - if (value == null) { - unsetNonHeapUsed(); - } else { - setNonHeapUsed((Long) value); - } - break; - - case NON_HEAP_COMMITTED: - if (value == null) { - unsetNonHeapCommitted(); - } else { - setNonHeapCommitted((Long) value); - } - break; - - case PROCESS_CPUTIME: - if (value == null) { - unsetProcessCPUTime(); - } else { - setProcessCPUTime((Double) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AGENT_ID: - return getAgentId(); - - case DATA_TIME: - return Long.valueOf(getDataTime()); - - case ACTIVE_THREAD_COUNT: - return Integer.valueOf(getActiveThreadCount()); - - case GC1_COUNT: - return Long.valueOf(getGc1Count()); - - case GC1_TIME: - return Long.valueOf(getGc1Time()); - - case GC2_COUNT: - return Long.valueOf(getGc2Count()); - - case GC2_TIME: - return Long.valueOf(getGc2Time()); - - case HEAP_USED: - return Long.valueOf(getHeapUsed()); - - case HEAP_COMMITTED: - return Long.valueOf(getHeapCommitted()); - - case NON_HEAP_USED: - return Long.valueOf(getNonHeapUsed()); - - case NON_HEAP_COMMITTED: - return Long.valueOf(getNonHeapCommitted()); - - case PROCESS_CPUTIME: - return Double.valueOf(getProcessCPUTime()); - - } - 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 AGENT_ID: - return isSetAgentId(); - case DATA_TIME: - return isSetDataTime(); - case ACTIVE_THREAD_COUNT: - return isSetActiveThreadCount(); - case GC1_COUNT: - return isSetGc1Count(); - case GC1_TIME: - return isSetGc1Time(); - case GC2_COUNT: - return isSetGc2Count(); - case GC2_TIME: - return isSetGc2Time(); - case HEAP_USED: - return isSetHeapUsed(); - case HEAP_COMMITTED: - return isSetHeapCommitted(); - case NON_HEAP_USED: - return isSetNonHeapUsed(); - case NON_HEAP_COMMITTED: - return isSetNonHeapCommitted(); - case PROCESS_CPUTIME: - return isSetProcessCPUTime(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof JVMInfoThriftDTO) - return this.equals((JVMInfoThriftDTO) that); - return false; - } - - public boolean equals(JVMInfoThriftDTO that) { - if (that == null) - 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_dataTime = true; - boolean that_present_dataTime = true; - if (this_present_dataTime || that_present_dataTime) { - if (!(this_present_dataTime && that_present_dataTime)) - return false; - if (this.dataTime != that.dataTime) - return false; - } - - boolean this_present_activeThreadCount = true; - boolean that_present_activeThreadCount = true; - if (this_present_activeThreadCount || that_present_activeThreadCount) { - if (!(this_present_activeThreadCount && that_present_activeThreadCount)) - return false; - if (this.activeThreadCount != that.activeThreadCount) - return false; - } - - boolean this_present_gc1Count = true && this.isSetGc1Count(); - boolean that_present_gc1Count = true && that.isSetGc1Count(); - if (this_present_gc1Count || that_present_gc1Count) { - if (!(this_present_gc1Count && that_present_gc1Count)) - return false; - if (this.gc1Count != that.gc1Count) - return false; - } - - boolean this_present_gc1Time = true && this.isSetGc1Time(); - boolean that_present_gc1Time = true && that.isSetGc1Time(); - if (this_present_gc1Time || that_present_gc1Time) { - if (!(this_present_gc1Time && that_present_gc1Time)) - return false; - if (this.gc1Time != that.gc1Time) - return false; - } - - boolean this_present_gc2Count = true && this.isSetGc2Count(); - boolean that_present_gc2Count = true && that.isSetGc2Count(); - if (this_present_gc2Count || that_present_gc2Count) { - if (!(this_present_gc2Count && that_present_gc2Count)) - return false; - if (this.gc2Count != that.gc2Count) - return false; - } - - boolean this_present_gc2Time = true && this.isSetGc2Time(); - boolean that_present_gc2Time = true && that.isSetGc2Time(); - if (this_present_gc2Time || that_present_gc2Time) { - if (!(this_present_gc2Time && that_present_gc2Time)) - return false; - if (this.gc2Time != that.gc2Time) - return false; - } - - boolean this_present_heapUsed = true; - boolean that_present_heapUsed = true; - if (this_present_heapUsed || that_present_heapUsed) { - if (!(this_present_heapUsed && that_present_heapUsed)) - return false; - if (this.heapUsed != that.heapUsed) - return false; - } - - boolean this_present_heapCommitted = true; - boolean that_present_heapCommitted = true; - if (this_present_heapCommitted || that_present_heapCommitted) { - if (!(this_present_heapCommitted && that_present_heapCommitted)) - return false; - if (this.heapCommitted != that.heapCommitted) - return false; - } - - boolean this_present_nonHeapUsed = true; - boolean that_present_nonHeapUsed = true; - if (this_present_nonHeapUsed || that_present_nonHeapUsed) { - if (!(this_present_nonHeapUsed && that_present_nonHeapUsed)) - return false; - if (this.nonHeapUsed != that.nonHeapUsed) - return false; - } - - boolean this_present_nonHeapCommitted = true; - boolean that_present_nonHeapCommitted = true; - if (this_present_nonHeapCommitted || that_present_nonHeapCommitted) { - if (!(this_present_nonHeapCommitted && that_present_nonHeapCommitted)) - return false; - if (this.nonHeapCommitted != that.nonHeapCommitted) - return false; - } - - boolean this_present_processCPUTime = true && this.isSetProcessCPUTime(); - boolean that_present_processCPUTime = true && that.isSetProcessCPUTime(); - if (this_present_processCPUTime || that_present_processCPUTime) { - if (!(this_present_processCPUTime && that_present_processCPUTime)) - return false; - if (this.processCPUTime != that.processCPUTime) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(JVMInfoThriftDTO other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - JVMInfoThriftDTO typedOther = (JVMInfoThriftDTO) other; - - 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(isSetDataTime()).compareTo(typedOther.isSetDataTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDataTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, typedOther.dataTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetActiveThreadCount()).compareTo(typedOther.isSetActiveThreadCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetActiveThreadCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.activeThreadCount, typedOther.activeThreadCount); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGc1Count()).compareTo(typedOther.isSetGc1Count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGc1Count()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc1Count, typedOther.gc1Count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGc1Time()).compareTo(typedOther.isSetGc1Time()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGc1Time()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc1Time, typedOther.gc1Time); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGc2Count()).compareTo(typedOther.isSetGc2Count()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGc2Count()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc2Count, typedOther.gc2Count); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGc2Time()).compareTo(typedOther.isSetGc2Time()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGc2Time()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc2Time, typedOther.gc2Time); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHeapUsed()).compareTo(typedOther.isSetHeapUsed()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHeapUsed()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heapUsed, typedOther.heapUsed); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHeapCommitted()).compareTo(typedOther.isSetHeapCommitted()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHeapCommitted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heapCommitted, typedOther.heapCommitted); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNonHeapUsed()).compareTo(typedOther.isSetNonHeapUsed()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNonHeapUsed()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonHeapUsed, typedOther.nonHeapUsed); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNonHeapCommitted()).compareTo(typedOther.isSetNonHeapCommitted()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNonHeapCommitted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonHeapCommitted, typedOther.nonHeapCommitted); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProcessCPUTime()).compareTo(typedOther.isSetProcessCPUTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProcessCPUTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.processCPUTime, typedOther.processCPUTime); - 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("JVMInfoThriftDTO("); - boolean first = true; - - sb.append("agentId:"); - if (this.agentId == null) { - sb.append("null"); - } else { - sb.append(this.agentId); - } - first = false; - if (!first) sb.append(", "); - sb.append("dataTime:"); - sb.append(this.dataTime); - first = false; - if (!first) sb.append(", "); - sb.append("activeThreadCount:"); - sb.append(this.activeThreadCount); - first = false; - if (isSetGc1Count()) { - if (!first) sb.append(", "); - sb.append("gc1Count:"); - sb.append(this.gc1Count); - first = false; - } - if (isSetGc1Time()) { - if (!first) sb.append(", "); - sb.append("gc1Time:"); - sb.append(this.gc1Time); - first = false; - } - if (isSetGc2Count()) { - if (!first) sb.append(", "); - sb.append("gc2Count:"); - sb.append(this.gc2Count); - first = false; - } - if (isSetGc2Time()) { - if (!first) sb.append(", "); - sb.append("gc2Time:"); - sb.append(this.gc2Time); - first = false; - } - if (!first) sb.append(", "); - sb.append("heapUsed:"); - sb.append(this.heapUsed); - first = false; - if (!first) sb.append(", "); - sb.append("heapCommitted:"); - sb.append(this.heapCommitted); - first = false; - if (!first) sb.append(", "); - sb.append("nonHeapUsed:"); - sb.append(this.nonHeapUsed); - first = false; - if (!first) sb.append(", "); - sb.append("nonHeapCommitted:"); - sb.append(this.nonHeapCommitted); - first = false; - if (isSetProcessCPUTime()) { - if (!first) sb.append(", "); - sb.append("processCPUTime:"); - sb.append(this.processCPUTime); - 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 JVMInfoThriftDTOStandardSchemeFactory implements SchemeFactory { - public JVMInfoThriftDTOStandardScheme getScheme() { - return new JVMInfoThriftDTOStandardScheme(); - } - } - - private static class JVMInfoThriftDTOStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, JVMInfoThriftDTO 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: // 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 2: // DATA_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.dataTime = iprot.readI64(); - struct.setDataTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // ACTIVE_THREAD_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.activeThreadCount = iprot.readI32(); - struct.setActiveThreadCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // GC1_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.gc1Count = iprot.readI64(); - struct.setGc1CountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // GC1_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.gc1Time = iprot.readI64(); - struct.setGc1TimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // GC2_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.gc2Count = iprot.readI64(); - struct.setGc2CountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // GC2_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.gc2Time = iprot.readI64(); - struct.setGc2TimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // HEAP_USED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.heapUsed = iprot.readI64(); - struct.setHeapUsedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // HEAP_COMMITTED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.heapCommitted = iprot.readI64(); - struct.setHeapCommittedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // NON_HEAP_USED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.nonHeapUsed = iprot.readI64(); - struct.setNonHeapUsedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // NON_HEAP_COMMITTED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.nonHeapCommitted = iprot.readI64(); - struct.setNonHeapCommittedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // PROCESS_CPUTIME - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.processCPUTime = iprot.readDouble(); - struct.setProcessCPUTimeIsSet(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, JVMInfoThriftDTO struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.agentId != null) { - oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); - oprot.writeString(struct.agentId); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(DATA_TIME_FIELD_DESC); - oprot.writeI64(struct.dataTime); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(ACTIVE_THREAD_COUNT_FIELD_DESC); - oprot.writeI32(struct.activeThreadCount); - oprot.writeFieldEnd(); - if (struct.isSetGc1Count()) { - oprot.writeFieldBegin(GC1_COUNT_FIELD_DESC); - oprot.writeI64(struct.gc1Count); - oprot.writeFieldEnd(); - } - if (struct.isSetGc1Time()) { - oprot.writeFieldBegin(GC1_TIME_FIELD_DESC); - oprot.writeI64(struct.gc1Time); - oprot.writeFieldEnd(); - } - if (struct.isSetGc2Count()) { - oprot.writeFieldBegin(GC2_COUNT_FIELD_DESC); - oprot.writeI64(struct.gc2Count); - oprot.writeFieldEnd(); - } - if (struct.isSetGc2Time()) { - oprot.writeFieldBegin(GC2_TIME_FIELD_DESC); - oprot.writeI64(struct.gc2Time); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(HEAP_USED_FIELD_DESC); - oprot.writeI64(struct.heapUsed); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(HEAP_COMMITTED_FIELD_DESC); - oprot.writeI64(struct.heapCommitted); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NON_HEAP_USED_FIELD_DESC); - oprot.writeI64(struct.nonHeapUsed); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NON_HEAP_COMMITTED_FIELD_DESC); - oprot.writeI64(struct.nonHeapCommitted); - oprot.writeFieldEnd(); - if (struct.isSetProcessCPUTime()) { - oprot.writeFieldBegin(PROCESS_CPUTIME_FIELD_DESC); - oprot.writeDouble(struct.processCPUTime); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class JVMInfoThriftDTOTupleSchemeFactory implements SchemeFactory { - public JVMInfoThriftDTOTupleScheme getScheme() { - return new JVMInfoThriftDTOTupleScheme(); - } - } - - private static class JVMInfoThriftDTOTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, JVMInfoThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAgentId()) { - optionals.set(0); - } - if (struct.isSetDataTime()) { - optionals.set(1); - } - if (struct.isSetActiveThreadCount()) { - optionals.set(2); - } - if (struct.isSetGc1Count()) { - optionals.set(3); - } - if (struct.isSetGc1Time()) { - optionals.set(4); - } - if (struct.isSetGc2Count()) { - optionals.set(5); - } - if (struct.isSetGc2Time()) { - optionals.set(6); - } - if (struct.isSetHeapUsed()) { - optionals.set(7); - } - if (struct.isSetHeapCommitted()) { - optionals.set(8); - } - if (struct.isSetNonHeapUsed()) { - optionals.set(9); - } - if (struct.isSetNonHeapCommitted()) { - optionals.set(10); - } - if (struct.isSetProcessCPUTime()) { - optionals.set(11); - } - oprot.writeBitSet(optionals, 12); - if (struct.isSetAgentId()) { - oprot.writeString(struct.agentId); - } - if (struct.isSetDataTime()) { - oprot.writeI64(struct.dataTime); - } - if (struct.isSetActiveThreadCount()) { - oprot.writeI32(struct.activeThreadCount); - } - if (struct.isSetGc1Count()) { - oprot.writeI64(struct.gc1Count); - } - if (struct.isSetGc1Time()) { - oprot.writeI64(struct.gc1Time); - } - if (struct.isSetGc2Count()) { - oprot.writeI64(struct.gc2Count); - } - if (struct.isSetGc2Time()) { - oprot.writeI64(struct.gc2Time); - } - if (struct.isSetHeapUsed()) { - oprot.writeI64(struct.heapUsed); - } - if (struct.isSetHeapCommitted()) { - oprot.writeI64(struct.heapCommitted); - } - if (struct.isSetNonHeapUsed()) { - oprot.writeI64(struct.nonHeapUsed); - } - if (struct.isSetNonHeapCommitted()) { - oprot.writeI64(struct.nonHeapCommitted); - } - if (struct.isSetProcessCPUTime()) { - oprot.writeDouble(struct.processCPUTime); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, JVMInfoThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(12); - if (incoming.get(0)) { - struct.agentId = iprot.readString(); - struct.setAgentIdIsSet(true); - } - if (incoming.get(1)) { - struct.dataTime = iprot.readI64(); - struct.setDataTimeIsSet(true); - } - if (incoming.get(2)) { - struct.activeThreadCount = iprot.readI32(); - struct.setActiveThreadCountIsSet(true); - } - if (incoming.get(3)) { - struct.gc1Count = iprot.readI64(); - struct.setGc1CountIsSet(true); - } - if (incoming.get(4)) { - struct.gc1Time = iprot.readI64(); - struct.setGc1TimeIsSet(true); - } - if (incoming.get(5)) { - struct.gc2Count = iprot.readI64(); - struct.setGc2CountIsSet(true); - } - if (incoming.get(6)) { - struct.gc2Time = iprot.readI64(); - struct.setGc2TimeIsSet(true); - } - if (incoming.get(7)) { - struct.heapUsed = iprot.readI64(); - struct.setHeapUsedIsSet(true); - } - if (incoming.get(8)) { - struct.heapCommitted = iprot.readI64(); - struct.setHeapCommittedIsSet(true); - } - if (incoming.get(9)) { - struct.nonHeapUsed = iprot.readI64(); - struct.setNonHeapUsedIsSet(true); - } - if (incoming.get(10)) { - struct.nonHeapCommitted = iprot.readI64(); - struct.setNonHeapCommittedIsSet(true); - } - if (incoming.get(11)) { - struct.processCPUTime = iprot.readDouble(); - struct.setProcessCPUTimeIsSet(true); - } - } - } - -} - +/** + * 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 JVMInfoThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JVMInfoThriftDTO"); + + 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)1); + private static final org.apache.thrift.protocol.TField DATA_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("dataTime", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField ACTIVE_THREAD_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("activeThreadCount", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField GC1_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("gc1Count", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField GC1_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("gc1Time", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField GC2_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("gc2Count", org.apache.thrift.protocol.TType.I64, (short)6); + private static final org.apache.thrift.protocol.TField GC2_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("gc2Time", org.apache.thrift.protocol.TType.I64, (short)7); + private static final org.apache.thrift.protocol.TField HEAP_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("heapUsed", org.apache.thrift.protocol.TType.I64, (short)8); + private static final org.apache.thrift.protocol.TField HEAP_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("heapCommitted", org.apache.thrift.protocol.TType.I64, (short)9); + private static final org.apache.thrift.protocol.TField NON_HEAP_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("nonHeapUsed", org.apache.thrift.protocol.TType.I64, (short)10); + private static final org.apache.thrift.protocol.TField NON_HEAP_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("nonHeapCommitted", org.apache.thrift.protocol.TType.I64, (short)11); + private static final org.apache.thrift.protocol.TField PROCESS_CPUTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("processCPUTime", org.apache.thrift.protocol.TType.DOUBLE, (short)12); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new JVMInfoThriftDTOStandardSchemeFactory()); + schemes.put(TupleScheme.class, new JVMInfoThriftDTOTupleSchemeFactory()); + } + + private String agentId; // required + private long dataTime; // required + private int activeThreadCount; // required + private long gc1Count; // optional + private long gc1Time; // optional + private long gc2Count; // optional + private long gc2Time; // optional + private long heapUsed; // required + private long heapCommitted; // required + private long nonHeapUsed; // required + private long nonHeapCommitted; // required + private double processCPUTime; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + AGENT_ID((short)1, "agentId"), + DATA_TIME((short)2, "dataTime"), + ACTIVE_THREAD_COUNT((short)3, "activeThreadCount"), + GC1_COUNT((short)4, "gc1Count"), + GC1_TIME((short)5, "gc1Time"), + GC2_COUNT((short)6, "gc2Count"), + GC2_TIME((short)7, "gc2Time"), + HEAP_USED((short)8, "heapUsed"), + HEAP_COMMITTED((short)9, "heapCommitted"), + NON_HEAP_USED((short)10, "nonHeapUsed"), + NON_HEAP_COMMITTED((short)11, "nonHeapCommitted"), + PROCESS_CPUTIME((short)12, "processCPUTime"); + + 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: // AGENT_ID + return AGENT_ID; + case 2: // DATA_TIME + return DATA_TIME; + case 3: // ACTIVE_THREAD_COUNT + return ACTIVE_THREAD_COUNT; + case 4: // GC1_COUNT + return GC1_COUNT; + case 5: // GC1_TIME + return GC1_TIME; + case 6: // GC2_COUNT + return GC2_COUNT; + case 7: // GC2_TIME + return GC2_TIME; + case 8: // HEAP_USED + return HEAP_USED; + case 9: // HEAP_COMMITTED + return HEAP_COMMITTED; + case 10: // NON_HEAP_USED + return NON_HEAP_USED; + case 11: // NON_HEAP_COMMITTED + return NON_HEAP_COMMITTED; + case 12: // PROCESS_CPUTIME + return PROCESS_CPUTIME; + 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 __DATATIME_ISSET_ID = 0; + private static final int __ACTIVETHREADCOUNT_ISSET_ID = 1; + private static final int __GC1COUNT_ISSET_ID = 2; + private static final int __GC1TIME_ISSET_ID = 3; + private static final int __GC2COUNT_ISSET_ID = 4; + private static final int __GC2TIME_ISSET_ID = 5; + private static final int __HEAPUSED_ISSET_ID = 6; + private static final int __HEAPCOMMITTED_ISSET_ID = 7; + private static final int __NONHEAPUSED_ISSET_ID = 8; + private static final int __NONHEAPCOMMITTED_ISSET_ID = 9; + private static final int __PROCESSCPUTIME_ISSET_ID = 10; + private BitSet __isset_bit_vector = new BitSet(11); + private _Fields optionals[] = {_Fields.GC1_COUNT,_Fields.GC1_TIME,_Fields.GC2_COUNT,_Fields.GC2_TIME,_Fields.PROCESS_CPUTIME}; + 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.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.DATA_TIME, new org.apache.thrift.meta_data.FieldMetaData("dataTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ACTIVE_THREAD_COUNT, new org.apache.thrift.meta_data.FieldMetaData("activeThreadCount", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.GC1_COUNT, new org.apache.thrift.meta_data.FieldMetaData("gc1Count", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.GC1_TIME, new org.apache.thrift.meta_data.FieldMetaData("gc1Time", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.GC2_COUNT, new org.apache.thrift.meta_data.FieldMetaData("gc2Count", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.GC2_TIME, new org.apache.thrift.meta_data.FieldMetaData("gc2Time", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.HEAP_USED, new org.apache.thrift.meta_data.FieldMetaData("heapUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.HEAP_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("heapCommitted", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.NON_HEAP_USED, new org.apache.thrift.meta_data.FieldMetaData("nonHeapUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.NON_HEAP_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("nonHeapCommitted", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.PROCESS_CPUTIME, new org.apache.thrift.meta_data.FieldMetaData("processCPUTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JVMInfoThriftDTO.class, metaDataMap); + } + + public JVMInfoThriftDTO() { + } + + public JVMInfoThriftDTO( + String agentId, + long dataTime, + int activeThreadCount, + long heapUsed, + long heapCommitted, + long nonHeapUsed, + long nonHeapCommitted) + { + this(); + this.agentId = agentId; + this.dataTime = dataTime; + setDataTimeIsSet(true); + this.activeThreadCount = activeThreadCount; + setActiveThreadCountIsSet(true); + this.heapUsed = heapUsed; + setHeapUsedIsSet(true); + this.heapCommitted = heapCommitted; + setHeapCommittedIsSet(true); + this.nonHeapUsed = nonHeapUsed; + setNonHeapUsedIsSet(true); + this.nonHeapCommitted = nonHeapCommitted; + setNonHeapCommittedIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public JVMInfoThriftDTO(JVMInfoThriftDTO other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.dataTime = other.dataTime; + this.activeThreadCount = other.activeThreadCount; + this.gc1Count = other.gc1Count; + this.gc1Time = other.gc1Time; + this.gc2Count = other.gc2Count; + this.gc2Time = other.gc2Time; + this.heapUsed = other.heapUsed; + this.heapCommitted = other.heapCommitted; + this.nonHeapUsed = other.nonHeapUsed; + this.nonHeapCommitted = other.nonHeapCommitted; + this.processCPUTime = other.processCPUTime; + } + + public JVMInfoThriftDTO deepCopy() { + return new JVMInfoThriftDTO(this); + } + + @Override + public void clear() { + this.agentId = null; + setDataTimeIsSet(false); + this.dataTime = 0; + setActiveThreadCountIsSet(false); + this.activeThreadCount = 0; + setGc1CountIsSet(false); + this.gc1Count = 0; + setGc1TimeIsSet(false); + this.gc1Time = 0; + setGc2CountIsSet(false); + this.gc2Count = 0; + setGc2TimeIsSet(false); + this.gc2Time = 0; + setHeapUsedIsSet(false); + this.heapUsed = 0; + setHeapCommittedIsSet(false); + this.heapCommitted = 0; + setNonHeapUsedIsSet(false); + this.nonHeapUsed = 0; + setNonHeapCommittedIsSet(false); + this.nonHeapCommitted = 0; + setProcessCPUTimeIsSet(false); + this.processCPUTime = 0.0; + } + + 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 long getDataTime() { + return this.dataTime; + } + + public void setDataTime(long dataTime) { + this.dataTime = dataTime; + setDataTimeIsSet(true); + } + + public void unsetDataTime() { + __isset_bit_vector.clear(__DATATIME_ISSET_ID); + } + + /** Returns true if field dataTime is set (has been assigned a value) and false otherwise */ + public boolean isSetDataTime() { + return __isset_bit_vector.get(__DATATIME_ISSET_ID); + } + + public void setDataTimeIsSet(boolean value) { + __isset_bit_vector.set(__DATATIME_ISSET_ID, value); + } + + public int getActiveThreadCount() { + return this.activeThreadCount; + } + + public void setActiveThreadCount(int activeThreadCount) { + this.activeThreadCount = activeThreadCount; + setActiveThreadCountIsSet(true); + } + + public void unsetActiveThreadCount() { + __isset_bit_vector.clear(__ACTIVETHREADCOUNT_ISSET_ID); + } + + /** Returns true if field activeThreadCount is set (has been assigned a value) and false otherwise */ + public boolean isSetActiveThreadCount() { + return __isset_bit_vector.get(__ACTIVETHREADCOUNT_ISSET_ID); + } + + public void setActiveThreadCountIsSet(boolean value) { + __isset_bit_vector.set(__ACTIVETHREADCOUNT_ISSET_ID, value); + } + + public long getGc1Count() { + return this.gc1Count; + } + + public void setGc1Count(long gc1Count) { + this.gc1Count = gc1Count; + setGc1CountIsSet(true); + } + + public void unsetGc1Count() { + __isset_bit_vector.clear(__GC1COUNT_ISSET_ID); + } + + /** Returns true if field gc1Count is set (has been assigned a value) and false otherwise */ + public boolean isSetGc1Count() { + return __isset_bit_vector.get(__GC1COUNT_ISSET_ID); + } + + public void setGc1CountIsSet(boolean value) { + __isset_bit_vector.set(__GC1COUNT_ISSET_ID, value); + } + + public long getGc1Time() { + return this.gc1Time; + } + + public void setGc1Time(long gc1Time) { + this.gc1Time = gc1Time; + setGc1TimeIsSet(true); + } + + public void unsetGc1Time() { + __isset_bit_vector.clear(__GC1TIME_ISSET_ID); + } + + /** Returns true if field gc1Time is set (has been assigned a value) and false otherwise */ + public boolean isSetGc1Time() { + return __isset_bit_vector.get(__GC1TIME_ISSET_ID); + } + + public void setGc1TimeIsSet(boolean value) { + __isset_bit_vector.set(__GC1TIME_ISSET_ID, value); + } + + public long getGc2Count() { + return this.gc2Count; + } + + public void setGc2Count(long gc2Count) { + this.gc2Count = gc2Count; + setGc2CountIsSet(true); + } + + public void unsetGc2Count() { + __isset_bit_vector.clear(__GC2COUNT_ISSET_ID); + } + + /** Returns true if field gc2Count is set (has been assigned a value) and false otherwise */ + public boolean isSetGc2Count() { + return __isset_bit_vector.get(__GC2COUNT_ISSET_ID); + } + + public void setGc2CountIsSet(boolean value) { + __isset_bit_vector.set(__GC2COUNT_ISSET_ID, value); + } + + public long getGc2Time() { + return this.gc2Time; + } + + public void setGc2Time(long gc2Time) { + this.gc2Time = gc2Time; + setGc2TimeIsSet(true); + } + + public void unsetGc2Time() { + __isset_bit_vector.clear(__GC2TIME_ISSET_ID); + } + + /** Returns true if field gc2Time is set (has been assigned a value) and false otherwise */ + public boolean isSetGc2Time() { + return __isset_bit_vector.get(__GC2TIME_ISSET_ID); + } + + public void setGc2TimeIsSet(boolean value) { + __isset_bit_vector.set(__GC2TIME_ISSET_ID, value); + } + + public long getHeapUsed() { + return this.heapUsed; + } + + public void setHeapUsed(long heapUsed) { + this.heapUsed = heapUsed; + setHeapUsedIsSet(true); + } + + public void unsetHeapUsed() { + __isset_bit_vector.clear(__HEAPUSED_ISSET_ID); + } + + /** Returns true if field heapUsed is set (has been assigned a value) and false otherwise */ + public boolean isSetHeapUsed() { + return __isset_bit_vector.get(__HEAPUSED_ISSET_ID); + } + + public void setHeapUsedIsSet(boolean value) { + __isset_bit_vector.set(__HEAPUSED_ISSET_ID, value); + } + + public long getHeapCommitted() { + return this.heapCommitted; + } + + public void setHeapCommitted(long heapCommitted) { + this.heapCommitted = heapCommitted; + setHeapCommittedIsSet(true); + } + + public void unsetHeapCommitted() { + __isset_bit_vector.clear(__HEAPCOMMITTED_ISSET_ID); + } + + /** Returns true if field heapCommitted is set (has been assigned a value) and false otherwise */ + public boolean isSetHeapCommitted() { + return __isset_bit_vector.get(__HEAPCOMMITTED_ISSET_ID); + } + + public void setHeapCommittedIsSet(boolean value) { + __isset_bit_vector.set(__HEAPCOMMITTED_ISSET_ID, value); + } + + public long getNonHeapUsed() { + return this.nonHeapUsed; + } + + public void setNonHeapUsed(long nonHeapUsed) { + this.nonHeapUsed = nonHeapUsed; + setNonHeapUsedIsSet(true); + } + + public void unsetNonHeapUsed() { + __isset_bit_vector.clear(__NONHEAPUSED_ISSET_ID); + } + + /** Returns true if field nonHeapUsed is set (has been assigned a value) and false otherwise */ + public boolean isSetNonHeapUsed() { + return __isset_bit_vector.get(__NONHEAPUSED_ISSET_ID); + } + + public void setNonHeapUsedIsSet(boolean value) { + __isset_bit_vector.set(__NONHEAPUSED_ISSET_ID, value); + } + + public long getNonHeapCommitted() { + return this.nonHeapCommitted; + } + + public void setNonHeapCommitted(long nonHeapCommitted) { + this.nonHeapCommitted = nonHeapCommitted; + setNonHeapCommittedIsSet(true); + } + + public void unsetNonHeapCommitted() { + __isset_bit_vector.clear(__NONHEAPCOMMITTED_ISSET_ID); + } + + /** Returns true if field nonHeapCommitted is set (has been assigned a value) and false otherwise */ + public boolean isSetNonHeapCommitted() { + return __isset_bit_vector.get(__NONHEAPCOMMITTED_ISSET_ID); + } + + public void setNonHeapCommittedIsSet(boolean value) { + __isset_bit_vector.set(__NONHEAPCOMMITTED_ISSET_ID, value); + } + + public double getProcessCPUTime() { + return this.processCPUTime; + } + + public void setProcessCPUTime(double processCPUTime) { + this.processCPUTime = processCPUTime; + setProcessCPUTimeIsSet(true); + } + + public void unsetProcessCPUTime() { + __isset_bit_vector.clear(__PROCESSCPUTIME_ISSET_ID); + } + + /** Returns true if field processCPUTime is set (has been assigned a value) and false otherwise */ + public boolean isSetProcessCPUTime() { + return __isset_bit_vector.get(__PROCESSCPUTIME_ISSET_ID); + } + + public void setProcessCPUTimeIsSet(boolean value) { + __isset_bit_vector.set(__PROCESSCPUTIME_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case DATA_TIME: + if (value == null) { + unsetDataTime(); + } else { + setDataTime((Long)value); + } + break; + + case ACTIVE_THREAD_COUNT: + if (value == null) { + unsetActiveThreadCount(); + } else { + setActiveThreadCount((Integer)value); + } + break; + + case GC1_COUNT: + if (value == null) { + unsetGc1Count(); + } else { + setGc1Count((Long)value); + } + break; + + case GC1_TIME: + if (value == null) { + unsetGc1Time(); + } else { + setGc1Time((Long)value); + } + break; + + case GC2_COUNT: + if (value == null) { + unsetGc2Count(); + } else { + setGc2Count((Long)value); + } + break; + + case GC2_TIME: + if (value == null) { + unsetGc2Time(); + } else { + setGc2Time((Long)value); + } + break; + + case HEAP_USED: + if (value == null) { + unsetHeapUsed(); + } else { + setHeapUsed((Long)value); + } + break; + + case HEAP_COMMITTED: + if (value == null) { + unsetHeapCommitted(); + } else { + setHeapCommitted((Long)value); + } + break; + + case NON_HEAP_USED: + if (value == null) { + unsetNonHeapUsed(); + } else { + setNonHeapUsed((Long)value); + } + break; + + case NON_HEAP_COMMITTED: + if (value == null) { + unsetNonHeapCommitted(); + } else { + setNonHeapCommitted((Long)value); + } + break; + + case PROCESS_CPUTIME: + if (value == null) { + unsetProcessCPUTime(); + } else { + setProcessCPUTime((Double)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case DATA_TIME: + return Long.valueOf(getDataTime()); + + case ACTIVE_THREAD_COUNT: + return Integer.valueOf(getActiveThreadCount()); + + case GC1_COUNT: + return Long.valueOf(getGc1Count()); + + case GC1_TIME: + return Long.valueOf(getGc1Time()); + + case GC2_COUNT: + return Long.valueOf(getGc2Count()); + + case GC2_TIME: + return Long.valueOf(getGc2Time()); + + case HEAP_USED: + return Long.valueOf(getHeapUsed()); + + case HEAP_COMMITTED: + return Long.valueOf(getHeapCommitted()); + + case NON_HEAP_USED: + return Long.valueOf(getNonHeapUsed()); + + case NON_HEAP_COMMITTED: + return Long.valueOf(getNonHeapCommitted()); + + case PROCESS_CPUTIME: + return Double.valueOf(getProcessCPUTime()); + + } + 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 AGENT_ID: + return isSetAgentId(); + case DATA_TIME: + return isSetDataTime(); + case ACTIVE_THREAD_COUNT: + return isSetActiveThreadCount(); + case GC1_COUNT: + return isSetGc1Count(); + case GC1_TIME: + return isSetGc1Time(); + case GC2_COUNT: + return isSetGc2Count(); + case GC2_TIME: + return isSetGc2Time(); + case HEAP_USED: + return isSetHeapUsed(); + case HEAP_COMMITTED: + return isSetHeapCommitted(); + case NON_HEAP_USED: + return isSetNonHeapUsed(); + case NON_HEAP_COMMITTED: + return isSetNonHeapCommitted(); + case PROCESS_CPUTIME: + return isSetProcessCPUTime(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof JVMInfoThriftDTO) + return this.equals((JVMInfoThriftDTO)that); + return false; + } + + public boolean equals(JVMInfoThriftDTO that) { + if (that == null) + 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_dataTime = true; + boolean that_present_dataTime = true; + if (this_present_dataTime || that_present_dataTime) { + if (!(this_present_dataTime && that_present_dataTime)) + return false; + if (this.dataTime != that.dataTime) + return false; + } + + boolean this_present_activeThreadCount = true; + boolean that_present_activeThreadCount = true; + if (this_present_activeThreadCount || that_present_activeThreadCount) { + if (!(this_present_activeThreadCount && that_present_activeThreadCount)) + return false; + if (this.activeThreadCount != that.activeThreadCount) + return false; + } + + boolean this_present_gc1Count = true && this.isSetGc1Count(); + boolean that_present_gc1Count = true && that.isSetGc1Count(); + if (this_present_gc1Count || that_present_gc1Count) { + if (!(this_present_gc1Count && that_present_gc1Count)) + return false; + if (this.gc1Count != that.gc1Count) + return false; + } + + boolean this_present_gc1Time = true && this.isSetGc1Time(); + boolean that_present_gc1Time = true && that.isSetGc1Time(); + if (this_present_gc1Time || that_present_gc1Time) { + if (!(this_present_gc1Time && that_present_gc1Time)) + return false; + if (this.gc1Time != that.gc1Time) + return false; + } + + boolean this_present_gc2Count = true && this.isSetGc2Count(); + boolean that_present_gc2Count = true && that.isSetGc2Count(); + if (this_present_gc2Count || that_present_gc2Count) { + if (!(this_present_gc2Count && that_present_gc2Count)) + return false; + if (this.gc2Count != that.gc2Count) + return false; + } + + boolean this_present_gc2Time = true && this.isSetGc2Time(); + boolean that_present_gc2Time = true && that.isSetGc2Time(); + if (this_present_gc2Time || that_present_gc2Time) { + if (!(this_present_gc2Time && that_present_gc2Time)) + return false; + if (this.gc2Time != that.gc2Time) + return false; + } + + boolean this_present_heapUsed = true; + boolean that_present_heapUsed = true; + if (this_present_heapUsed || that_present_heapUsed) { + if (!(this_present_heapUsed && that_present_heapUsed)) + return false; + if (this.heapUsed != that.heapUsed) + return false; + } + + boolean this_present_heapCommitted = true; + boolean that_present_heapCommitted = true; + if (this_present_heapCommitted || that_present_heapCommitted) { + if (!(this_present_heapCommitted && that_present_heapCommitted)) + return false; + if (this.heapCommitted != that.heapCommitted) + return false; + } + + boolean this_present_nonHeapUsed = true; + boolean that_present_nonHeapUsed = true; + if (this_present_nonHeapUsed || that_present_nonHeapUsed) { + if (!(this_present_nonHeapUsed && that_present_nonHeapUsed)) + return false; + if (this.nonHeapUsed != that.nonHeapUsed) + return false; + } + + boolean this_present_nonHeapCommitted = true; + boolean that_present_nonHeapCommitted = true; + if (this_present_nonHeapCommitted || that_present_nonHeapCommitted) { + if (!(this_present_nonHeapCommitted && that_present_nonHeapCommitted)) + return false; + if (this.nonHeapCommitted != that.nonHeapCommitted) + return false; + } + + boolean this_present_processCPUTime = true && this.isSetProcessCPUTime(); + boolean that_present_processCPUTime = true && that.isSetProcessCPUTime(); + if (this_present_processCPUTime || that_present_processCPUTime) { + if (!(this_present_processCPUTime && that_present_processCPUTime)) + return false; + if (this.processCPUTime != that.processCPUTime) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(JVMInfoThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + JVMInfoThriftDTO typedOther = (JVMInfoThriftDTO)other; + + 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(isSetDataTime()).compareTo(typedOther.isSetDataTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, typedOther.dataTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetActiveThreadCount()).compareTo(typedOther.isSetActiveThreadCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetActiveThreadCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.activeThreadCount, typedOther.activeThreadCount); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc1Count()).compareTo(typedOther.isSetGc1Count()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc1Count()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc1Count, typedOther.gc1Count); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc1Time()).compareTo(typedOther.isSetGc1Time()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc1Time()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc1Time, typedOther.gc1Time); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc2Count()).compareTo(typedOther.isSetGc2Count()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc2Count()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc2Count, typedOther.gc2Count); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc2Time()).compareTo(typedOther.isSetGc2Time()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc2Time()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc2Time, typedOther.gc2Time); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHeapUsed()).compareTo(typedOther.isSetHeapUsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHeapUsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heapUsed, typedOther.heapUsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHeapCommitted()).compareTo(typedOther.isSetHeapCommitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHeapCommitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heapCommitted, typedOther.heapCommitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNonHeapUsed()).compareTo(typedOther.isSetNonHeapUsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNonHeapUsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonHeapUsed, typedOther.nonHeapUsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNonHeapCommitted()).compareTo(typedOther.isSetNonHeapCommitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNonHeapCommitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonHeapCommitted, typedOther.nonHeapCommitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProcessCPUTime()).compareTo(typedOther.isSetProcessCPUTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProcessCPUTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.processCPUTime, typedOther.processCPUTime); + 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("JVMInfoThriftDTO("); + boolean first = true; + + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + if (!first) sb.append(", "); + sb.append("dataTime:"); + sb.append(this.dataTime); + first = false; + if (!first) sb.append(", "); + sb.append("activeThreadCount:"); + sb.append(this.activeThreadCount); + first = false; + if (isSetGc1Count()) { + if (!first) sb.append(", "); + sb.append("gc1Count:"); + sb.append(this.gc1Count); + first = false; + } + if (isSetGc1Time()) { + if (!first) sb.append(", "); + sb.append("gc1Time:"); + sb.append(this.gc1Time); + first = false; + } + if (isSetGc2Count()) { + if (!first) sb.append(", "); + sb.append("gc2Count:"); + sb.append(this.gc2Count); + first = false; + } + if (isSetGc2Time()) { + if (!first) sb.append(", "); + sb.append("gc2Time:"); + sb.append(this.gc2Time); + first = false; + } + if (!first) sb.append(", "); + sb.append("heapUsed:"); + sb.append(this.heapUsed); + first = false; + if (!first) sb.append(", "); + sb.append("heapCommitted:"); + sb.append(this.heapCommitted); + first = false; + if (!first) sb.append(", "); + sb.append("nonHeapUsed:"); + sb.append(this.nonHeapUsed); + first = false; + if (!first) sb.append(", "); + sb.append("nonHeapCommitted:"); + sb.append(this.nonHeapCommitted); + first = false; + if (isSetProcessCPUTime()) { + if (!first) sb.append(", "); + sb.append("processCPUTime:"); + sb.append(this.processCPUTime); + 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 JVMInfoThriftDTOStandardSchemeFactory implements SchemeFactory { + public JVMInfoThriftDTOStandardScheme getScheme() { + return new JVMInfoThriftDTOStandardScheme(); + } + } + + private static class JVMInfoThriftDTOStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, JVMInfoThriftDTO 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: // 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 2: // DATA_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.dataTime = iprot.readI64(); + struct.setDataTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // ACTIVE_THREAD_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.activeThreadCount = iprot.readI32(); + struct.setActiveThreadCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // GC1_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.gc1Count = iprot.readI64(); + struct.setGc1CountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // GC1_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.gc1Time = iprot.readI64(); + struct.setGc1TimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // GC2_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.gc2Count = iprot.readI64(); + struct.setGc2CountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // GC2_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.gc2Time = iprot.readI64(); + struct.setGc2TimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // HEAP_USED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.heapUsed = iprot.readI64(); + struct.setHeapUsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // HEAP_COMMITTED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.heapCommitted = iprot.readI64(); + struct.setHeapCommittedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // NON_HEAP_USED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.nonHeapUsed = iprot.readI64(); + struct.setNonHeapUsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // NON_HEAP_COMMITTED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.nonHeapCommitted = iprot.readI64(); + struct.setNonHeapCommittedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // PROCESS_CPUTIME + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.processCPUTime = iprot.readDouble(); + struct.setProcessCPUTimeIsSet(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, JVMInfoThriftDTO struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentId != null) { + oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); + oprot.writeString(struct.agentId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DATA_TIME_FIELD_DESC); + oprot.writeI64(struct.dataTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(ACTIVE_THREAD_COUNT_FIELD_DESC); + oprot.writeI32(struct.activeThreadCount); + oprot.writeFieldEnd(); + if (struct.isSetGc1Count()) { + oprot.writeFieldBegin(GC1_COUNT_FIELD_DESC); + oprot.writeI64(struct.gc1Count); + oprot.writeFieldEnd(); + } + if (struct.isSetGc1Time()) { + oprot.writeFieldBegin(GC1_TIME_FIELD_DESC); + oprot.writeI64(struct.gc1Time); + oprot.writeFieldEnd(); + } + if (struct.isSetGc2Count()) { + oprot.writeFieldBegin(GC2_COUNT_FIELD_DESC); + oprot.writeI64(struct.gc2Count); + oprot.writeFieldEnd(); + } + if (struct.isSetGc2Time()) { + oprot.writeFieldBegin(GC2_TIME_FIELD_DESC); + oprot.writeI64(struct.gc2Time); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(HEAP_USED_FIELD_DESC); + oprot.writeI64(struct.heapUsed); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(HEAP_COMMITTED_FIELD_DESC); + oprot.writeI64(struct.heapCommitted); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NON_HEAP_USED_FIELD_DESC); + oprot.writeI64(struct.nonHeapUsed); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NON_HEAP_COMMITTED_FIELD_DESC); + oprot.writeI64(struct.nonHeapCommitted); + oprot.writeFieldEnd(); + if (struct.isSetProcessCPUTime()) { + oprot.writeFieldBegin(PROCESS_CPUTIME_FIELD_DESC); + oprot.writeDouble(struct.processCPUTime); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class JVMInfoThriftDTOTupleSchemeFactory implements SchemeFactory { + public JVMInfoThriftDTOTupleScheme getScheme() { + return new JVMInfoThriftDTOTupleScheme(); + } + } + + private static class JVMInfoThriftDTOTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, JVMInfoThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetDataTime()) { + optionals.set(1); + } + if (struct.isSetActiveThreadCount()) { + optionals.set(2); + } + if (struct.isSetGc1Count()) { + optionals.set(3); + } + if (struct.isSetGc1Time()) { + optionals.set(4); + } + if (struct.isSetGc2Count()) { + optionals.set(5); + } + if (struct.isSetGc2Time()) { + optionals.set(6); + } + if (struct.isSetHeapUsed()) { + optionals.set(7); + } + if (struct.isSetHeapCommitted()) { + optionals.set(8); + } + if (struct.isSetNonHeapUsed()) { + optionals.set(9); + } + if (struct.isSetNonHeapCommitted()) { + optionals.set(10); + } + if (struct.isSetProcessCPUTime()) { + optionals.set(11); + } + oprot.writeBitSet(optionals, 12); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetDataTime()) { + oprot.writeI64(struct.dataTime); + } + if (struct.isSetActiveThreadCount()) { + oprot.writeI32(struct.activeThreadCount); + } + if (struct.isSetGc1Count()) { + oprot.writeI64(struct.gc1Count); + } + if (struct.isSetGc1Time()) { + oprot.writeI64(struct.gc1Time); + } + if (struct.isSetGc2Count()) { + oprot.writeI64(struct.gc2Count); + } + if (struct.isSetGc2Time()) { + oprot.writeI64(struct.gc2Time); + } + if (struct.isSetHeapUsed()) { + oprot.writeI64(struct.heapUsed); + } + if (struct.isSetHeapCommitted()) { + oprot.writeI64(struct.heapCommitted); + } + if (struct.isSetNonHeapUsed()) { + oprot.writeI64(struct.nonHeapUsed); + } + if (struct.isSetNonHeapCommitted()) { + oprot.writeI64(struct.nonHeapCommitted); + } + if (struct.isSetProcessCPUTime()) { + oprot.writeDouble(struct.processCPUTime); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, JVMInfoThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(12); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.dataTime = iprot.readI64(); + struct.setDataTimeIsSet(true); + } + if (incoming.get(2)) { + struct.activeThreadCount = iprot.readI32(); + struct.setActiveThreadCountIsSet(true); + } + if (incoming.get(3)) { + struct.gc1Count = iprot.readI64(); + struct.setGc1CountIsSet(true); + } + if (incoming.get(4)) { + struct.gc1Time = iprot.readI64(); + struct.setGc1TimeIsSet(true); + } + if (incoming.get(5)) { + struct.gc2Count = iprot.readI64(); + struct.setGc2CountIsSet(true); + } + if (incoming.get(6)) { + struct.gc2Time = iprot.readI64(); + struct.setGc2TimeIsSet(true); + } + if (incoming.get(7)) { + struct.heapUsed = iprot.readI64(); + struct.setHeapUsedIsSet(true); + } + if (incoming.get(8)) { + struct.heapCommitted = iprot.readI64(); + struct.setHeapCommittedIsSet(true); + } + if (incoming.get(9)) { + struct.nonHeapUsed = iprot.readI64(); + struct.setNonHeapUsedIsSet(true); + } + if (incoming.get(10)) { + struct.nonHeapCommitted = iprot.readI64(); + struct.setNonHeapCommittedIsSet(true); + } + if (incoming.get(11)) { + struct.processCPUTime = iprot.readDouble(); + struct.setProcessCPUTimeIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/RequestDataListThriftDTO.java b/src/main/java/com/profiler/common/dto/thrift/RequestDataListThriftDTO.java index bd0dc1e18..9b61dcf1e 100644 --- a/src/main/java/com/profiler/common/dto/thrift/RequestDataListThriftDTO.java +++ b/src/main/java/com/profiler/common/dto/thrift/RequestDataListThriftDTO.java @@ -1,638 +1,630 @@ -/** - * 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 RequestDataListThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RequestDataListThriftDTO"); - - 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) 1); - private static final org.apache.thrift.protocol.TField REQUEST_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("requestHashCode", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField REQUEST_DATA_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("requestDataList", org.apache.thrift.protocol.TType.LIST, (short) 3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new RequestDataListThriftDTOStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RequestDataListThriftDTOTupleSchemeFactory()); - } - - private String agentId; // required - private int requestHashCode; // required - private List requestDataList; // 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 { - AGENT_ID((short) 1, "agentId"), - REQUEST_HASH_CODE((short) 2, "requestHashCode"), - REQUEST_DATA_LIST((short) 3, "requestDataList"); - - 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: // AGENT_ID - return AGENT_ID; - case 2: // REQUEST_HASH_CODE - return REQUEST_HASH_CODE; - case 3: // REQUEST_DATA_LIST - return REQUEST_DATA_LIST; - 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 __REQUESTHASHCODE_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - 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.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.REQUEST_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("requestHashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.REQUEST_DATA_LIST, new org.apache.thrift.meta_data.FieldMetaData("requestDataList", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RequestDataThriftDTO.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestDataListThriftDTO.class, metaDataMap); - } - - public RequestDataListThriftDTO() { - } - - public RequestDataListThriftDTO( - String agentId, - int requestHashCode, - List requestDataList) { - this(); - this.agentId = agentId; - this.requestHashCode = requestHashCode; - setRequestHashCodeIsSet(true); - this.requestDataList = requestDataList; - } - - /** - * Performs a deep copy on other. - */ - public RequestDataListThriftDTO(RequestDataListThriftDTO other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetAgentId()) { - this.agentId = other.agentId; - } - this.requestHashCode = other.requestHashCode; - if (other.isSetRequestDataList()) { - List __this__requestDataList = new ArrayList(); - for (RequestDataThriftDTO other_element : other.requestDataList) { - __this__requestDataList.add(new RequestDataThriftDTO(other_element)); - } - this.requestDataList = __this__requestDataList; - } - } - - public RequestDataListThriftDTO deepCopy() { - return new RequestDataListThriftDTO(this); - } - - @Override - public void clear() { - this.agentId = null; - setRequestHashCodeIsSet(false); - this.requestHashCode = 0; - this.requestDataList = 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 int getRequestHashCode() { - return this.requestHashCode; - } - - public void setRequestHashCode(int requestHashCode) { - this.requestHashCode = requestHashCode; - setRequestHashCodeIsSet(true); - } - - public void unsetRequestHashCode() { - __isset_bit_vector.clear(__REQUESTHASHCODE_ISSET_ID); - } - - /** - * Returns true if field requestHashCode is set (has been assigned a value) and false otherwise - */ - public boolean isSetRequestHashCode() { - return __isset_bit_vector.get(__REQUESTHASHCODE_ISSET_ID); - } - - public void setRequestHashCodeIsSet(boolean value) { - __isset_bit_vector.set(__REQUESTHASHCODE_ISSET_ID, value); - } - - public int getRequestDataListSize() { - return (this.requestDataList == null) ? 0 : this.requestDataList.size(); - } - - public java.util.Iterator getRequestDataListIterator() { - return (this.requestDataList == null) ? null : this.requestDataList.iterator(); - } - - public void addToRequestDataList(RequestDataThriftDTO elem) { - if (this.requestDataList == null) { - this.requestDataList = new ArrayList(); - } - this.requestDataList.add(elem); - } - - public List getRequestDataList() { - return this.requestDataList; - } - - public void setRequestDataList(List requestDataList) { - this.requestDataList = requestDataList; - } - - public void unsetRequestDataList() { - this.requestDataList = null; - } - - /** - * Returns true if field requestDataList is set (has been assigned a value) and false otherwise - */ - public boolean isSetRequestDataList() { - return this.requestDataList != null; - } - - public void setRequestDataListIsSet(boolean value) { - if (!value) { - this.requestDataList = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AGENT_ID: - if (value == null) { - unsetAgentId(); - } else { - setAgentId((String) value); - } - break; - - case REQUEST_HASH_CODE: - if (value == null) { - unsetRequestHashCode(); - } else { - setRequestHashCode((Integer) value); - } - break; - - case REQUEST_DATA_LIST: - if (value == null) { - unsetRequestDataList(); - } else { - setRequestDataList((List) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AGENT_ID: - return getAgentId(); - - case REQUEST_HASH_CODE: - return Integer.valueOf(getRequestHashCode()); - - case REQUEST_DATA_LIST: - return getRequestDataList(); - - } - 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 AGENT_ID: - return isSetAgentId(); - case REQUEST_HASH_CODE: - return isSetRequestHashCode(); - case REQUEST_DATA_LIST: - return isSetRequestDataList(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RequestDataListThriftDTO) - return this.equals((RequestDataListThriftDTO) that); - return false; - } - - public boolean equals(RequestDataListThriftDTO that) { - if (that == null) - 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_requestHashCode = true; - boolean that_present_requestHashCode = true; - if (this_present_requestHashCode || that_present_requestHashCode) { - if (!(this_present_requestHashCode && that_present_requestHashCode)) - return false; - if (this.requestHashCode != that.requestHashCode) - return false; - } - - boolean this_present_requestDataList = true && this.isSetRequestDataList(); - boolean that_present_requestDataList = true && that.isSetRequestDataList(); - if (this_present_requestDataList || that_present_requestDataList) { - if (!(this_present_requestDataList && that_present_requestDataList)) - return false; - if (!this.requestDataList.equals(that.requestDataList)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(RequestDataListThriftDTO other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - RequestDataListThriftDTO typedOther = (RequestDataListThriftDTO) other; - - 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(isSetRequestHashCode()).compareTo(typedOther.isSetRequestHashCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequestHashCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestHashCode, typedOther.requestHashCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRequestDataList()).compareTo(typedOther.isSetRequestDataList()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequestDataList()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestDataList, typedOther.requestDataList); - 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("RequestDataListThriftDTO("); - boolean first = true; - - sb.append("agentId:"); - if (this.agentId == null) { - sb.append("null"); - } else { - sb.append(this.agentId); - } - first = false; - if (!first) sb.append(", "); - sb.append("requestHashCode:"); - sb.append(this.requestHashCode); - first = false; - if (!first) sb.append(", "); - sb.append("requestDataList:"); - if (this.requestDataList == null) { - sb.append("null"); - } else { - sb.append(this.requestDataList); - } - 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 RequestDataListThriftDTOStandardSchemeFactory implements SchemeFactory { - public RequestDataListThriftDTOStandardScheme getScheme() { - return new RequestDataListThriftDTOStandardScheme(); - } - } - - private static class RequestDataListThriftDTOStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RequestDataListThriftDTO 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: // 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 2: // REQUEST_HASH_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.requestHashCode = iprot.readI32(); - struct.setRequestHashCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // REQUEST_DATA_LIST - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.requestDataList = new ArrayList(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) { - RequestDataThriftDTO _elem2; // required - _elem2 = new RequestDataThriftDTO(); - _elem2.read(iprot); - struct.requestDataList.add(_elem2); - } - iprot.readListEnd(); - } - struct.setRequestDataListIsSet(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, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.agentId != null) { - oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); - oprot.writeString(struct.agentId); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(REQUEST_HASH_CODE_FIELD_DESC); - oprot.writeI32(struct.requestHashCode); - oprot.writeFieldEnd(); - if (struct.requestDataList != null) { - oprot.writeFieldBegin(REQUEST_DATA_LIST_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.requestDataList.size())); - for (RequestDataThriftDTO _iter3 : struct.requestDataList) { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class RequestDataListThriftDTOTupleSchemeFactory implements SchemeFactory { - public RequestDataListThriftDTOTupleScheme getScheme() { - return new RequestDataListThriftDTOTupleScheme(); - } - } - - private static class RequestDataListThriftDTOTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAgentId()) { - optionals.set(0); - } - if (struct.isSetRequestHashCode()) { - optionals.set(1); - } - if (struct.isSetRequestDataList()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetAgentId()) { - oprot.writeString(struct.agentId); - } - if (struct.isSetRequestHashCode()) { - oprot.writeI32(struct.requestHashCode); - } - if (struct.isSetRequestDataList()) { - { - oprot.writeI32(struct.requestDataList.size()); - for (RequestDataThriftDTO _iter4 : struct.requestDataList) { - _iter4.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.agentId = iprot.readString(); - struct.setAgentIdIsSet(true); - } - if (incoming.get(1)) { - struct.requestHashCode = iprot.readI32(); - struct.setRequestHashCodeIsSet(true); - } - if (incoming.get(2)) { - { - org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.requestDataList = new ArrayList(_list5.size); - for (int _i6 = 0; _i6 < _list5.size; ++_i6) { - RequestDataThriftDTO _elem7; // required - _elem7 = new RequestDataThriftDTO(); - _elem7.read(iprot); - struct.requestDataList.add(_elem7); - } - } - struct.setRequestDataListIsSet(true); - } - } - } - -} - +/** + * 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 RequestDataListThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RequestDataListThriftDTO"); + + 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)1); + private static final org.apache.thrift.protocol.TField REQUEST_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("requestHashCode", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField REQUEST_DATA_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("requestDataList", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RequestDataListThriftDTOStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RequestDataListThriftDTOTupleSchemeFactory()); + } + + private String agentId; // required + private int requestHashCode; // required + private List requestDataList; // 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 { + AGENT_ID((short)1, "agentId"), + REQUEST_HASH_CODE((short)2, "requestHashCode"), + REQUEST_DATA_LIST((short)3, "requestDataList"); + + 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: // AGENT_ID + return AGENT_ID; + case 2: // REQUEST_HASH_CODE + return REQUEST_HASH_CODE; + case 3: // REQUEST_DATA_LIST + return REQUEST_DATA_LIST; + 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 __REQUESTHASHCODE_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + 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.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.REQUEST_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("requestHashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.REQUEST_DATA_LIST, new org.apache.thrift.meta_data.FieldMetaData("requestDataList", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RequestDataThriftDTO.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestDataListThriftDTO.class, metaDataMap); + } + + public RequestDataListThriftDTO() { + } + + public RequestDataListThriftDTO( + String agentId, + int requestHashCode, + List requestDataList) + { + this(); + this.agentId = agentId; + this.requestHashCode = requestHashCode; + setRequestHashCodeIsSet(true); + this.requestDataList = requestDataList; + } + + /** + * Performs a deep copy on other. + */ + public RequestDataListThriftDTO(RequestDataListThriftDTO other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.requestHashCode = other.requestHashCode; + if (other.isSetRequestDataList()) { + List __this__requestDataList = new ArrayList(); + for (RequestDataThriftDTO other_element : other.requestDataList) { + __this__requestDataList.add(new RequestDataThriftDTO(other_element)); + } + this.requestDataList = __this__requestDataList; + } + } + + public RequestDataListThriftDTO deepCopy() { + return new RequestDataListThriftDTO(this); + } + + @Override + public void clear() { + this.agentId = null; + setRequestHashCodeIsSet(false); + this.requestHashCode = 0; + this.requestDataList = 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 int getRequestHashCode() { + return this.requestHashCode; + } + + public void setRequestHashCode(int requestHashCode) { + this.requestHashCode = requestHashCode; + setRequestHashCodeIsSet(true); + } + + public void unsetRequestHashCode() { + __isset_bit_vector.clear(__REQUESTHASHCODE_ISSET_ID); + } + + /** Returns true if field requestHashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestHashCode() { + return __isset_bit_vector.get(__REQUESTHASHCODE_ISSET_ID); + } + + public void setRequestHashCodeIsSet(boolean value) { + __isset_bit_vector.set(__REQUESTHASHCODE_ISSET_ID, value); + } + + public int getRequestDataListSize() { + return (this.requestDataList == null) ? 0 : this.requestDataList.size(); + } + + public java.util.Iterator getRequestDataListIterator() { + return (this.requestDataList == null) ? null : this.requestDataList.iterator(); + } + + public void addToRequestDataList(RequestDataThriftDTO elem) { + if (this.requestDataList == null) { + this.requestDataList = new ArrayList(); + } + this.requestDataList.add(elem); + } + + public List getRequestDataList() { + return this.requestDataList; + } + + public void setRequestDataList(List requestDataList) { + this.requestDataList = requestDataList; + } + + public void unsetRequestDataList() { + this.requestDataList = null; + } + + /** Returns true if field requestDataList is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestDataList() { + return this.requestDataList != null; + } + + public void setRequestDataListIsSet(boolean value) { + if (!value) { + this.requestDataList = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case REQUEST_HASH_CODE: + if (value == null) { + unsetRequestHashCode(); + } else { + setRequestHashCode((Integer)value); + } + break; + + case REQUEST_DATA_LIST: + if (value == null) { + unsetRequestDataList(); + } else { + setRequestDataList((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case REQUEST_HASH_CODE: + return Integer.valueOf(getRequestHashCode()); + + case REQUEST_DATA_LIST: + return getRequestDataList(); + + } + 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 AGENT_ID: + return isSetAgentId(); + case REQUEST_HASH_CODE: + return isSetRequestHashCode(); + case REQUEST_DATA_LIST: + return isSetRequestDataList(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof RequestDataListThriftDTO) + return this.equals((RequestDataListThriftDTO)that); + return false; + } + + public boolean equals(RequestDataListThriftDTO that) { + if (that == null) + 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_requestHashCode = true; + boolean that_present_requestHashCode = true; + if (this_present_requestHashCode || that_present_requestHashCode) { + if (!(this_present_requestHashCode && that_present_requestHashCode)) + return false; + if (this.requestHashCode != that.requestHashCode) + return false; + } + + boolean this_present_requestDataList = true && this.isSetRequestDataList(); + boolean that_present_requestDataList = true && that.isSetRequestDataList(); + if (this_present_requestDataList || that_present_requestDataList) { + if (!(this_present_requestDataList && that_present_requestDataList)) + return false; + if (!this.requestDataList.equals(that.requestDataList)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(RequestDataListThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + RequestDataListThriftDTO typedOther = (RequestDataListThriftDTO)other; + + 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(isSetRequestHashCode()).compareTo(typedOther.isSetRequestHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestHashCode, typedOther.requestHashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestDataList()).compareTo(typedOther.isSetRequestDataList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestDataList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestDataList, typedOther.requestDataList); + 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("RequestDataListThriftDTO("); + boolean first = true; + + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + if (!first) sb.append(", "); + sb.append("requestHashCode:"); + sb.append(this.requestHashCode); + first = false; + if (!first) sb.append(", "); + sb.append("requestDataList:"); + if (this.requestDataList == null) { + sb.append("null"); + } else { + sb.append(this.requestDataList); + } + 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 RequestDataListThriftDTOStandardSchemeFactory implements SchemeFactory { + public RequestDataListThriftDTOStandardScheme getScheme() { + return new RequestDataListThriftDTOStandardScheme(); + } + } + + private static class RequestDataListThriftDTOStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RequestDataListThriftDTO 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: // 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 2: // REQUEST_HASH_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.requestHashCode = iprot.readI32(); + struct.setRequestHashCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // REQUEST_DATA_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.requestDataList = new ArrayList(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + RequestDataThriftDTO _elem2; // required + _elem2 = new RequestDataThriftDTO(); + _elem2.read(iprot); + struct.requestDataList.add(_elem2); + } + iprot.readListEnd(); + } + struct.setRequestDataListIsSet(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, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentId != null) { + oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); + oprot.writeString(struct.agentId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(REQUEST_HASH_CODE_FIELD_DESC); + oprot.writeI32(struct.requestHashCode); + oprot.writeFieldEnd(); + if (struct.requestDataList != null) { + oprot.writeFieldBegin(REQUEST_DATA_LIST_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.requestDataList.size())); + for (RequestDataThriftDTO _iter3 : struct.requestDataList) + { + _iter3.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class RequestDataListThriftDTOTupleSchemeFactory implements SchemeFactory { + public RequestDataListThriftDTOTupleScheme getScheme() { + return new RequestDataListThriftDTOTupleScheme(); + } + } + + private static class RequestDataListThriftDTOTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetRequestHashCode()) { + optionals.set(1); + } + if (struct.isSetRequestDataList()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetRequestHashCode()) { + oprot.writeI32(struct.requestHashCode); + } + if (struct.isSetRequestDataList()) { + { + oprot.writeI32(struct.requestDataList.size()); + for (RequestDataThriftDTO _iter4 : struct.requestDataList) + { + _iter4.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.requestHashCode = iprot.readI32(); + struct.setRequestHashCodeIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.requestDataList = new ArrayList(_list5.size); + for (int _i6 = 0; _i6 < _list5.size; ++_i6) + { + RequestDataThriftDTO _elem7; // required + _elem7 = new RequestDataThriftDTO(); + _elem7.read(iprot); + struct.requestDataList.add(_elem7); + } + } + struct.setRequestDataListIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/RequestDataThriftDTO.java b/src/main/java/com/profiler/common/dto/thrift/RequestDataThriftDTO.java index 69dee71c6..58d25196c 100644 --- a/src/main/java/com/profiler/common/dto/thrift/RequestDataThriftDTO.java +++ b/src/main/java/com/profiler/common/dto/thrift/RequestDataThriftDTO.java @@ -1,1566 +1,1534 @@ -/** - * 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 RequestDataThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RequestDataThriftDTO"); - - private static final org.apache.thrift.protocol.TField DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataType", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField DATA_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("dataTime", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField DATA_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataHashCode", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField DATA_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("dataString", org.apache.thrift.protocol.TType.STRING, (short) 4); - private static final org.apache.thrift.protocol.TField EXTRA_DATA1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData1", org.apache.thrift.protocol.TType.STRING, (short) 5); - private static final org.apache.thrift.protocol.TField EXTRA_DATA2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData2", org.apache.thrift.protocol.TType.STRING, (short) 6); - private static final org.apache.thrift.protocol.TField EXTRA_DATA3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData3", org.apache.thrift.protocol.TType.STRING, (short) 7); - private static final org.apache.thrift.protocol.TField EXTRA_INT1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt1", org.apache.thrift.protocol.TType.I32, (short) 8); - private static final org.apache.thrift.protocol.TField EXTRA_INT2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt2", org.apache.thrift.protocol.TType.I32, (short) 9); - private static final org.apache.thrift.protocol.TField EXTRA_INT3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt3", org.apache.thrift.protocol.TType.I32, (short) 10); - private static final org.apache.thrift.protocol.TField EXTRA_LONG1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong1", org.apache.thrift.protocol.TType.I64, (short) 11); - private static final org.apache.thrift.protocol.TField EXTRA_LONG2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong2", org.apache.thrift.protocol.TType.I64, (short) 12); - private static final org.apache.thrift.protocol.TField EXTRA_LONG3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong3", org.apache.thrift.protocol.TType.I64, (short) 13); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new RequestDataThriftDTOStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RequestDataThriftDTOTupleSchemeFactory()); - } - - private int dataType; // required - private long dataTime; // required - private int dataHashCode; // optional - private String dataString; // optional - private String extraData1; // optional - private String extraData2; // optional - private String extraData3; // optional - private int extraInt1; // optional - private int extraInt2; // optional - private int extraInt3; // optional - private long extraLong1; // optional - private long extraLong2; // optional - private long extraLong3; // optional - - /** - * 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_TYPE((short) 1, "dataType"), - DATA_TIME((short) 2, "dataTime"), - DATA_HASH_CODE((short) 3, "dataHashCode"), - DATA_STRING((short) 4, "dataString"), - EXTRA_DATA1((short) 5, "extraData1"), - EXTRA_DATA2((short) 6, "extraData2"), - EXTRA_DATA3((short) 7, "extraData3"), - EXTRA_INT1((short) 8, "extraInt1"), - EXTRA_INT2((short) 9, "extraInt2"), - EXTRA_INT3((short) 10, "extraInt3"), - EXTRA_LONG1((short) 11, "extraLong1"), - EXTRA_LONG2((short) 12, "extraLong2"), - EXTRA_LONG3((short) 13, "extraLong3"); - - 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: // DATA_TYPE - return DATA_TYPE; - case 2: // DATA_TIME - return DATA_TIME; - case 3: // DATA_HASH_CODE - return DATA_HASH_CODE; - case 4: // DATA_STRING - return DATA_STRING; - case 5: // EXTRA_DATA1 - return EXTRA_DATA1; - case 6: // EXTRA_DATA2 - return EXTRA_DATA2; - case 7: // EXTRA_DATA3 - return EXTRA_DATA3; - case 8: // EXTRA_INT1 - return EXTRA_INT1; - case 9: // EXTRA_INT2 - return EXTRA_INT2; - case 10: // EXTRA_INT3 - return EXTRA_INT3; - case 11: // EXTRA_LONG1 - return EXTRA_LONG1; - case 12: // EXTRA_LONG2 - return EXTRA_LONG2; - case 13: // EXTRA_LONG3 - return EXTRA_LONG3; - 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 __DATATYPE_ISSET_ID = 0; - private static final int __DATATIME_ISSET_ID = 1; - private static final int __DATAHASHCODE_ISSET_ID = 2; - private static final int __EXTRAINT1_ISSET_ID = 3; - private static final int __EXTRAINT2_ISSET_ID = 4; - private static final int __EXTRAINT3_ISSET_ID = 5; - private static final int __EXTRALONG1_ISSET_ID = 6; - private static final int __EXTRALONG2_ISSET_ID = 7; - private static final int __EXTRALONG3_ISSET_ID = 8; - private BitSet __isset_bit_vector = new BitSet(9); - private _Fields optionals[] = {_Fields.DATA_HASH_CODE, _Fields.DATA_STRING, _Fields.EXTRA_DATA1, _Fields.EXTRA_DATA2, _Fields.EXTRA_DATA3, _Fields.EXTRA_INT1, _Fields.EXTRA_INT2, _Fields.EXTRA_INT3, _Fields.EXTRA_LONG1, _Fields.EXTRA_LONG2, _Fields.EXTRA_LONG3}; - 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.DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataType", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.DATA_TIME, new org.apache.thrift.meta_data.FieldMetaData("dataTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.DATA_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("dataHashCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.DATA_STRING, new org.apache.thrift.meta_data.FieldMetaData("dataString", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_DATA1, new org.apache.thrift.meta_data.FieldMetaData("extraData1", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_DATA2, new org.apache.thrift.meta_data.FieldMetaData("extraData2", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_DATA3, new org.apache.thrift.meta_data.FieldMetaData("extraData3", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_INT1, new org.apache.thrift.meta_data.FieldMetaData("extraInt1", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.EXTRA_INT2, new org.apache.thrift.meta_data.FieldMetaData("extraInt2", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.EXTRA_INT3, new org.apache.thrift.meta_data.FieldMetaData("extraInt3", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.EXTRA_LONG1, new org.apache.thrift.meta_data.FieldMetaData("extraLong1", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.EXTRA_LONG2, new org.apache.thrift.meta_data.FieldMetaData("extraLong2", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.EXTRA_LONG3, new org.apache.thrift.meta_data.FieldMetaData("extraLong3", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestDataThriftDTO.class, metaDataMap); - } - - public RequestDataThriftDTO() { - } - - public RequestDataThriftDTO( - int dataType, - long dataTime) { - this(); - this.dataType = dataType; - setDataTypeIsSet(true); - this.dataTime = dataTime; - setDataTimeIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public RequestDataThriftDTO(RequestDataThriftDTO other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.dataType = other.dataType; - this.dataTime = other.dataTime; - this.dataHashCode = other.dataHashCode; - if (other.isSetDataString()) { - this.dataString = other.dataString; - } - if (other.isSetExtraData1()) { - this.extraData1 = other.extraData1; - } - if (other.isSetExtraData2()) { - this.extraData2 = other.extraData2; - } - if (other.isSetExtraData3()) { - this.extraData3 = other.extraData3; - } - this.extraInt1 = other.extraInt1; - this.extraInt2 = other.extraInt2; - this.extraInt3 = other.extraInt3; - this.extraLong1 = other.extraLong1; - this.extraLong2 = other.extraLong2; - this.extraLong3 = other.extraLong3; - } - - public RequestDataThriftDTO deepCopy() { - return new RequestDataThriftDTO(this); - } - - @Override - public void clear() { - setDataTypeIsSet(false); - this.dataType = 0; - setDataTimeIsSet(false); - this.dataTime = 0; - setDataHashCodeIsSet(false); - this.dataHashCode = 0; - this.dataString = null; - this.extraData1 = null; - this.extraData2 = null; - this.extraData3 = null; - setExtraInt1IsSet(false); - this.extraInt1 = 0; - setExtraInt2IsSet(false); - this.extraInt2 = 0; - setExtraInt3IsSet(false); - this.extraInt3 = 0; - setExtraLong1IsSet(false); - this.extraLong1 = 0; - setExtraLong2IsSet(false); - this.extraLong2 = 0; - setExtraLong3IsSet(false); - this.extraLong3 = 0; - } - - public int getDataType() { - return this.dataType; - } - - public void setDataType(int dataType) { - this.dataType = dataType; - setDataTypeIsSet(true); - } - - public void unsetDataType() { - __isset_bit_vector.clear(__DATATYPE_ISSET_ID); - } - - /** - * Returns true if field dataType is set (has been assigned a value) and false otherwise - */ - public boolean isSetDataType() { - return __isset_bit_vector.get(__DATATYPE_ISSET_ID); - } - - public void setDataTypeIsSet(boolean value) { - __isset_bit_vector.set(__DATATYPE_ISSET_ID, value); - } - - public long getDataTime() { - return this.dataTime; - } - - public void setDataTime(long dataTime) { - this.dataTime = dataTime; - setDataTimeIsSet(true); - } - - public void unsetDataTime() { - __isset_bit_vector.clear(__DATATIME_ISSET_ID); - } - - /** - * Returns true if field dataTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetDataTime() { - return __isset_bit_vector.get(__DATATIME_ISSET_ID); - } - - public void setDataTimeIsSet(boolean value) { - __isset_bit_vector.set(__DATATIME_ISSET_ID, value); - } - - public int getDataHashCode() { - return this.dataHashCode; - } - - public void setDataHashCode(int dataHashCode) { - this.dataHashCode = dataHashCode; - setDataHashCodeIsSet(true); - } - - public void unsetDataHashCode() { - __isset_bit_vector.clear(__DATAHASHCODE_ISSET_ID); - } - - /** - * Returns true if field dataHashCode is set (has been assigned a value) and false otherwise - */ - public boolean isSetDataHashCode() { - return __isset_bit_vector.get(__DATAHASHCODE_ISSET_ID); - } - - public void setDataHashCodeIsSet(boolean value) { - __isset_bit_vector.set(__DATAHASHCODE_ISSET_ID, value); - } - - public String getDataString() { - return this.dataString; - } - - public void setDataString(String dataString) { - this.dataString = dataString; - } - - public void unsetDataString() { - this.dataString = null; - } - - /** - * Returns true if field dataString is set (has been assigned a value) and false otherwise - */ - public boolean isSetDataString() { - return this.dataString != null; - } - - public void setDataStringIsSet(boolean value) { - if (!value) { - this.dataString = null; - } - } - - public String getExtraData1() { - return this.extraData1; - } - - public void setExtraData1(String extraData1) { - this.extraData1 = extraData1; - } - - public void unsetExtraData1() { - this.extraData1 = null; - } - - /** - * Returns true if field extraData1 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraData1() { - return this.extraData1 != null; - } - - public void setExtraData1IsSet(boolean value) { - if (!value) { - this.extraData1 = null; - } - } - - public String getExtraData2() { - return this.extraData2; - } - - public void setExtraData2(String extraData2) { - this.extraData2 = extraData2; - } - - public void unsetExtraData2() { - this.extraData2 = null; - } - - /** - * Returns true if field extraData2 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraData2() { - return this.extraData2 != null; - } - - public void setExtraData2IsSet(boolean value) { - if (!value) { - this.extraData2 = null; - } - } - - public String getExtraData3() { - return this.extraData3; - } - - public void setExtraData3(String extraData3) { - this.extraData3 = extraData3; - } - - public void unsetExtraData3() { - this.extraData3 = null; - } - - /** - * Returns true if field extraData3 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraData3() { - return this.extraData3 != null; - } - - public void setExtraData3IsSet(boolean value) { - if (!value) { - this.extraData3 = null; - } - } - - public int getExtraInt1() { - return this.extraInt1; - } - - public void setExtraInt1(int extraInt1) { - this.extraInt1 = extraInt1; - setExtraInt1IsSet(true); - } - - public void unsetExtraInt1() { - __isset_bit_vector.clear(__EXTRAINT1_ISSET_ID); - } - - /** - * Returns true if field extraInt1 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraInt1() { - return __isset_bit_vector.get(__EXTRAINT1_ISSET_ID); - } - - public void setExtraInt1IsSet(boolean value) { - __isset_bit_vector.set(__EXTRAINT1_ISSET_ID, value); - } - - public int getExtraInt2() { - return this.extraInt2; - } - - public void setExtraInt2(int extraInt2) { - this.extraInt2 = extraInt2; - setExtraInt2IsSet(true); - } - - public void unsetExtraInt2() { - __isset_bit_vector.clear(__EXTRAINT2_ISSET_ID); - } - - /** - * Returns true if field extraInt2 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraInt2() { - return __isset_bit_vector.get(__EXTRAINT2_ISSET_ID); - } - - public void setExtraInt2IsSet(boolean value) { - __isset_bit_vector.set(__EXTRAINT2_ISSET_ID, value); - } - - public int getExtraInt3() { - return this.extraInt3; - } - - public void setExtraInt3(int extraInt3) { - this.extraInt3 = extraInt3; - setExtraInt3IsSet(true); - } - - public void unsetExtraInt3() { - __isset_bit_vector.clear(__EXTRAINT3_ISSET_ID); - } - - /** - * Returns true if field extraInt3 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraInt3() { - return __isset_bit_vector.get(__EXTRAINT3_ISSET_ID); - } - - public void setExtraInt3IsSet(boolean value) { - __isset_bit_vector.set(__EXTRAINT3_ISSET_ID, value); - } - - public long getExtraLong1() { - return this.extraLong1; - } - - public void setExtraLong1(long extraLong1) { - this.extraLong1 = extraLong1; - setExtraLong1IsSet(true); - } - - public void unsetExtraLong1() { - __isset_bit_vector.clear(__EXTRALONG1_ISSET_ID); - } - - /** - * Returns true if field extraLong1 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraLong1() { - return __isset_bit_vector.get(__EXTRALONG1_ISSET_ID); - } - - public void setExtraLong1IsSet(boolean value) { - __isset_bit_vector.set(__EXTRALONG1_ISSET_ID, value); - } - - public long getExtraLong2() { - return this.extraLong2; - } - - public void setExtraLong2(long extraLong2) { - this.extraLong2 = extraLong2; - setExtraLong2IsSet(true); - } - - public void unsetExtraLong2() { - __isset_bit_vector.clear(__EXTRALONG2_ISSET_ID); - } - - /** - * Returns true if field extraLong2 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraLong2() { - return __isset_bit_vector.get(__EXTRALONG2_ISSET_ID); - } - - public void setExtraLong2IsSet(boolean value) { - __isset_bit_vector.set(__EXTRALONG2_ISSET_ID, value); - } - - public long getExtraLong3() { - return this.extraLong3; - } - - public void setExtraLong3(long extraLong3) { - this.extraLong3 = extraLong3; - setExtraLong3IsSet(true); - } - - public void unsetExtraLong3() { - __isset_bit_vector.clear(__EXTRALONG3_ISSET_ID); - } - - /** - * Returns true if field extraLong3 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraLong3() { - return __isset_bit_vector.get(__EXTRALONG3_ISSET_ID); - } - - public void setExtraLong3IsSet(boolean value) { - __isset_bit_vector.set(__EXTRALONG3_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case DATA_TYPE: - if (value == null) { - unsetDataType(); - } else { - setDataType((Integer) value); - } - break; - - case DATA_TIME: - if (value == null) { - unsetDataTime(); - } else { - setDataTime((Long) value); - } - break; - - case DATA_HASH_CODE: - if (value == null) { - unsetDataHashCode(); - } else { - setDataHashCode((Integer) value); - } - break; - - case DATA_STRING: - if (value == null) { - unsetDataString(); - } else { - setDataString((String) value); - } - break; - - case EXTRA_DATA1: - if (value == null) { - unsetExtraData1(); - } else { - setExtraData1((String) value); - } - break; - - case EXTRA_DATA2: - if (value == null) { - unsetExtraData2(); - } else { - setExtraData2((String) value); - } - break; - - case EXTRA_DATA3: - if (value == null) { - unsetExtraData3(); - } else { - setExtraData3((String) value); - } - break; - - case EXTRA_INT1: - if (value == null) { - unsetExtraInt1(); - } else { - setExtraInt1((Integer) value); - } - break; - - case EXTRA_INT2: - if (value == null) { - unsetExtraInt2(); - } else { - setExtraInt2((Integer) value); - } - break; - - case EXTRA_INT3: - if (value == null) { - unsetExtraInt3(); - } else { - setExtraInt3((Integer) value); - } - break; - - case EXTRA_LONG1: - if (value == null) { - unsetExtraLong1(); - } else { - setExtraLong1((Long) value); - } - break; - - case EXTRA_LONG2: - if (value == null) { - unsetExtraLong2(); - } else { - setExtraLong2((Long) value); - } - break; - - case EXTRA_LONG3: - if (value == null) { - unsetExtraLong3(); - } else { - setExtraLong3((Long) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case DATA_TYPE: - return Integer.valueOf(getDataType()); - - case DATA_TIME: - return Long.valueOf(getDataTime()); - - case DATA_HASH_CODE: - return Integer.valueOf(getDataHashCode()); - - case DATA_STRING: - return getDataString(); - - case EXTRA_DATA1: - return getExtraData1(); - - case EXTRA_DATA2: - return getExtraData2(); - - case EXTRA_DATA3: - return getExtraData3(); - - case EXTRA_INT1: - return Integer.valueOf(getExtraInt1()); - - case EXTRA_INT2: - return Integer.valueOf(getExtraInt2()); - - case EXTRA_INT3: - return Integer.valueOf(getExtraInt3()); - - case EXTRA_LONG1: - return Long.valueOf(getExtraLong1()); - - case EXTRA_LONG2: - return Long.valueOf(getExtraLong2()); - - case EXTRA_LONG3: - return Long.valueOf(getExtraLong3()); - - } - 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 DATA_TYPE: - return isSetDataType(); - case DATA_TIME: - return isSetDataTime(); - case DATA_HASH_CODE: - return isSetDataHashCode(); - case DATA_STRING: - return isSetDataString(); - case EXTRA_DATA1: - return isSetExtraData1(); - case EXTRA_DATA2: - return isSetExtraData2(); - case EXTRA_DATA3: - return isSetExtraData3(); - case EXTRA_INT1: - return isSetExtraInt1(); - case EXTRA_INT2: - return isSetExtraInt2(); - case EXTRA_INT3: - return isSetExtraInt3(); - case EXTRA_LONG1: - return isSetExtraLong1(); - case EXTRA_LONG2: - return isSetExtraLong2(); - case EXTRA_LONG3: - return isSetExtraLong3(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RequestDataThriftDTO) - return this.equals((RequestDataThriftDTO) that); - return false; - } - - public boolean equals(RequestDataThriftDTO that) { - if (that == null) - return false; - - boolean this_present_dataType = true; - boolean that_present_dataType = true; - if (this_present_dataType || that_present_dataType) { - if (!(this_present_dataType && that_present_dataType)) - return false; - if (this.dataType != that.dataType) - return false; - } - - boolean this_present_dataTime = true; - boolean that_present_dataTime = true; - if (this_present_dataTime || that_present_dataTime) { - if (!(this_present_dataTime && that_present_dataTime)) - return false; - if (this.dataTime != that.dataTime) - return false; - } - - boolean this_present_dataHashCode = true && this.isSetDataHashCode(); - boolean that_present_dataHashCode = true && that.isSetDataHashCode(); - if (this_present_dataHashCode || that_present_dataHashCode) { - if (!(this_present_dataHashCode && that_present_dataHashCode)) - return false; - if (this.dataHashCode != that.dataHashCode) - return false; - } - - boolean this_present_dataString = true && this.isSetDataString(); - boolean that_present_dataString = true && that.isSetDataString(); - if (this_present_dataString || that_present_dataString) { - if (!(this_present_dataString && that_present_dataString)) - return false; - if (!this.dataString.equals(that.dataString)) - return false; - } - - boolean this_present_extraData1 = true && this.isSetExtraData1(); - boolean that_present_extraData1 = true && that.isSetExtraData1(); - if (this_present_extraData1 || that_present_extraData1) { - if (!(this_present_extraData1 && that_present_extraData1)) - return false; - if (!this.extraData1.equals(that.extraData1)) - return false; - } - - boolean this_present_extraData2 = true && this.isSetExtraData2(); - boolean that_present_extraData2 = true && that.isSetExtraData2(); - if (this_present_extraData2 || that_present_extraData2) { - if (!(this_present_extraData2 && that_present_extraData2)) - return false; - if (!this.extraData2.equals(that.extraData2)) - return false; - } - - boolean this_present_extraData3 = true && this.isSetExtraData3(); - boolean that_present_extraData3 = true && that.isSetExtraData3(); - if (this_present_extraData3 || that_present_extraData3) { - if (!(this_present_extraData3 && that_present_extraData3)) - return false; - if (!this.extraData3.equals(that.extraData3)) - return false; - } - - boolean this_present_extraInt1 = true && this.isSetExtraInt1(); - boolean that_present_extraInt1 = true && that.isSetExtraInt1(); - if (this_present_extraInt1 || that_present_extraInt1) { - if (!(this_present_extraInt1 && that_present_extraInt1)) - return false; - if (this.extraInt1 != that.extraInt1) - return false; - } - - boolean this_present_extraInt2 = true && this.isSetExtraInt2(); - boolean that_present_extraInt2 = true && that.isSetExtraInt2(); - if (this_present_extraInt2 || that_present_extraInt2) { - if (!(this_present_extraInt2 && that_present_extraInt2)) - return false; - if (this.extraInt2 != that.extraInt2) - return false; - } - - boolean this_present_extraInt3 = true && this.isSetExtraInt3(); - boolean that_present_extraInt3 = true && that.isSetExtraInt3(); - if (this_present_extraInt3 || that_present_extraInt3) { - if (!(this_present_extraInt3 && that_present_extraInt3)) - return false; - if (this.extraInt3 != that.extraInt3) - return false; - } - - boolean this_present_extraLong1 = true && this.isSetExtraLong1(); - boolean that_present_extraLong1 = true && that.isSetExtraLong1(); - if (this_present_extraLong1 || that_present_extraLong1) { - if (!(this_present_extraLong1 && that_present_extraLong1)) - return false; - if (this.extraLong1 != that.extraLong1) - return false; - } - - boolean this_present_extraLong2 = true && this.isSetExtraLong2(); - boolean that_present_extraLong2 = true && that.isSetExtraLong2(); - if (this_present_extraLong2 || that_present_extraLong2) { - if (!(this_present_extraLong2 && that_present_extraLong2)) - return false; - if (this.extraLong2 != that.extraLong2) - return false; - } - - boolean this_present_extraLong3 = true && this.isSetExtraLong3(); - boolean that_present_extraLong3 = true && that.isSetExtraLong3(); - if (this_present_extraLong3 || that_present_extraLong3) { - if (!(this_present_extraLong3 && that_present_extraLong3)) - return false; - if (this.extraLong3 != that.extraLong3) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(RequestDataThriftDTO other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - RequestDataThriftDTO typedOther = (RequestDataThriftDTO) other; - - lastComparison = Boolean.valueOf(isSetDataType()).compareTo(typedOther.isSetDataType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDataType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, typedOther.dataType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDataTime()).compareTo(typedOther.isSetDataTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDataTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, typedOther.dataTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDataHashCode()).compareTo(typedOther.isSetDataHashCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDataHashCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataHashCode, typedOther.dataHashCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDataString()).compareTo(typedOther.isSetDataString()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDataString()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataString, typedOther.dataString); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraData1()).compareTo(typedOther.isSetExtraData1()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraData1()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData1, typedOther.extraData1); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraData2()).compareTo(typedOther.isSetExtraData2()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraData2()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData2, typedOther.extraData2); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraData3()).compareTo(typedOther.isSetExtraData3()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraData3()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData3, typedOther.extraData3); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraInt1()).compareTo(typedOther.isSetExtraInt1()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraInt1()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt1, typedOther.extraInt1); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraInt2()).compareTo(typedOther.isSetExtraInt2()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraInt2()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt2, typedOther.extraInt2); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraInt3()).compareTo(typedOther.isSetExtraInt3()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraInt3()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt3, typedOther.extraInt3); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraLong1()).compareTo(typedOther.isSetExtraLong1()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraLong1()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong1, typedOther.extraLong1); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraLong2()).compareTo(typedOther.isSetExtraLong2()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraLong2()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong2, typedOther.extraLong2); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraLong3()).compareTo(typedOther.isSetExtraLong3()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraLong3()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong3, typedOther.extraLong3); - 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("RequestDataThriftDTO("); - boolean first = true; - - sb.append("dataType:"); - sb.append(this.dataType); - first = false; - if (!first) sb.append(", "); - sb.append("dataTime:"); - sb.append(this.dataTime); - first = false; - if (isSetDataHashCode()) { - if (!first) sb.append(", "); - sb.append("dataHashCode:"); - sb.append(this.dataHashCode); - first = false; - } - if (isSetDataString()) { - if (!first) sb.append(", "); - sb.append("dataString:"); - if (this.dataString == null) { - sb.append("null"); - } else { - sb.append(this.dataString); - } - first = false; - } - if (isSetExtraData1()) { - if (!first) sb.append(", "); - sb.append("extraData1:"); - if (this.extraData1 == null) { - sb.append("null"); - } else { - sb.append(this.extraData1); - } - first = false; - } - if (isSetExtraData2()) { - if (!first) sb.append(", "); - sb.append("extraData2:"); - if (this.extraData2 == null) { - sb.append("null"); - } else { - sb.append(this.extraData2); - } - first = false; - } - if (isSetExtraData3()) { - if (!first) sb.append(", "); - sb.append("extraData3:"); - if (this.extraData3 == null) { - sb.append("null"); - } else { - sb.append(this.extraData3); - } - first = false; - } - if (isSetExtraInt1()) { - if (!first) sb.append(", "); - sb.append("extraInt1:"); - sb.append(this.extraInt1); - first = false; - } - if (isSetExtraInt2()) { - if (!first) sb.append(", "); - sb.append("extraInt2:"); - sb.append(this.extraInt2); - first = false; - } - if (isSetExtraInt3()) { - if (!first) sb.append(", "); - sb.append("extraInt3:"); - sb.append(this.extraInt3); - first = false; - } - if (isSetExtraLong1()) { - if (!first) sb.append(", "); - sb.append("extraLong1:"); - sb.append(this.extraLong1); - first = false; - } - if (isSetExtraLong2()) { - if (!first) sb.append(", "); - sb.append("extraLong2:"); - sb.append(this.extraLong2); - first = false; - } - if (isSetExtraLong3()) { - if (!first) sb.append(", "); - sb.append("extraLong3:"); - sb.append(this.extraLong3); - 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 RequestDataThriftDTOStandardSchemeFactory implements SchemeFactory { - public RequestDataThriftDTOStandardScheme getScheme() { - return new RequestDataThriftDTOStandardScheme(); - } - } - - private static class RequestDataThriftDTOStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RequestDataThriftDTO 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_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.dataType = iprot.readI32(); - struct.setDataTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DATA_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.dataTime = iprot.readI64(); - struct.setDataTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // DATA_HASH_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.dataHashCode = iprot.readI32(); - struct.setDataHashCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // DATA_STRING - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.dataString = iprot.readString(); - struct.setDataStringIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // EXTRA_DATA1 - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.extraData1 = iprot.readString(); - struct.setExtraData1IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // EXTRA_DATA2 - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.extraData2 = iprot.readString(); - struct.setExtraData2IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // EXTRA_DATA3 - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.extraData3 = iprot.readString(); - struct.setExtraData3IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // EXTRA_INT1 - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.extraInt1 = iprot.readI32(); - struct.setExtraInt1IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // EXTRA_INT2 - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.extraInt2 = iprot.readI32(); - struct.setExtraInt2IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // EXTRA_INT3 - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.extraInt3 = iprot.readI32(); - struct.setExtraInt3IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // EXTRA_LONG1 - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.extraLong1 = iprot.readI64(); - struct.setExtraLong1IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // EXTRA_LONG2 - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.extraLong2 = iprot.readI64(); - struct.setExtraLong2IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 13: // EXTRA_LONG3 - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.extraLong3 = iprot.readI64(); - struct.setExtraLong3IsSet(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, RequestDataThriftDTO struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(DATA_TYPE_FIELD_DESC); - oprot.writeI32(struct.dataType); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DATA_TIME_FIELD_DESC); - oprot.writeI64(struct.dataTime); - oprot.writeFieldEnd(); - if (struct.isSetDataHashCode()) { - oprot.writeFieldBegin(DATA_HASH_CODE_FIELD_DESC); - oprot.writeI32(struct.dataHashCode); - oprot.writeFieldEnd(); - } - if (struct.dataString != null) { - if (struct.isSetDataString()) { - oprot.writeFieldBegin(DATA_STRING_FIELD_DESC); - oprot.writeString(struct.dataString); - oprot.writeFieldEnd(); - } - } - if (struct.extraData1 != null) { - if (struct.isSetExtraData1()) { - oprot.writeFieldBegin(EXTRA_DATA1_FIELD_DESC); - oprot.writeString(struct.extraData1); - oprot.writeFieldEnd(); - } - } - if (struct.extraData2 != null) { - if (struct.isSetExtraData2()) { - oprot.writeFieldBegin(EXTRA_DATA2_FIELD_DESC); - oprot.writeString(struct.extraData2); - oprot.writeFieldEnd(); - } - } - if (struct.extraData3 != null) { - if (struct.isSetExtraData3()) { - oprot.writeFieldBegin(EXTRA_DATA3_FIELD_DESC); - oprot.writeString(struct.extraData3); - oprot.writeFieldEnd(); - } - } - if (struct.isSetExtraInt1()) { - oprot.writeFieldBegin(EXTRA_INT1_FIELD_DESC); - oprot.writeI32(struct.extraInt1); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraInt2()) { - oprot.writeFieldBegin(EXTRA_INT2_FIELD_DESC); - oprot.writeI32(struct.extraInt2); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraInt3()) { - oprot.writeFieldBegin(EXTRA_INT3_FIELD_DESC); - oprot.writeI32(struct.extraInt3); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraLong1()) { - oprot.writeFieldBegin(EXTRA_LONG1_FIELD_DESC); - oprot.writeI64(struct.extraLong1); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraLong2()) { - oprot.writeFieldBegin(EXTRA_LONG2_FIELD_DESC); - oprot.writeI64(struct.extraLong2); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraLong3()) { - oprot.writeFieldBegin(EXTRA_LONG3_FIELD_DESC); - oprot.writeI64(struct.extraLong3); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class RequestDataThriftDTOTupleSchemeFactory implements SchemeFactory { - public RequestDataThriftDTOTupleScheme getScheme() { - return new RequestDataThriftDTOTupleScheme(); - } - } - - private static class RequestDataThriftDTOTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RequestDataThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetDataType()) { - optionals.set(0); - } - if (struct.isSetDataTime()) { - optionals.set(1); - } - if (struct.isSetDataHashCode()) { - optionals.set(2); - } - if (struct.isSetDataString()) { - optionals.set(3); - } - if (struct.isSetExtraData1()) { - optionals.set(4); - } - if (struct.isSetExtraData2()) { - optionals.set(5); - } - if (struct.isSetExtraData3()) { - optionals.set(6); - } - if (struct.isSetExtraInt1()) { - optionals.set(7); - } - if (struct.isSetExtraInt2()) { - optionals.set(8); - } - if (struct.isSetExtraInt3()) { - optionals.set(9); - } - if (struct.isSetExtraLong1()) { - optionals.set(10); - } - if (struct.isSetExtraLong2()) { - optionals.set(11); - } - if (struct.isSetExtraLong3()) { - optionals.set(12); - } - oprot.writeBitSet(optionals, 13); - if (struct.isSetDataType()) { - oprot.writeI32(struct.dataType); - } - if (struct.isSetDataTime()) { - oprot.writeI64(struct.dataTime); - } - if (struct.isSetDataHashCode()) { - oprot.writeI32(struct.dataHashCode); - } - if (struct.isSetDataString()) { - oprot.writeString(struct.dataString); - } - if (struct.isSetExtraData1()) { - oprot.writeString(struct.extraData1); - } - if (struct.isSetExtraData2()) { - oprot.writeString(struct.extraData2); - } - if (struct.isSetExtraData3()) { - oprot.writeString(struct.extraData3); - } - if (struct.isSetExtraInt1()) { - oprot.writeI32(struct.extraInt1); - } - if (struct.isSetExtraInt2()) { - oprot.writeI32(struct.extraInt2); - } - if (struct.isSetExtraInt3()) { - oprot.writeI32(struct.extraInt3); - } - if (struct.isSetExtraLong1()) { - oprot.writeI64(struct.extraLong1); - } - if (struct.isSetExtraLong2()) { - oprot.writeI64(struct.extraLong2); - } - if (struct.isSetExtraLong3()) { - oprot.writeI64(struct.extraLong3); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RequestDataThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(13); - if (incoming.get(0)) { - struct.dataType = iprot.readI32(); - struct.setDataTypeIsSet(true); - } - if (incoming.get(1)) { - struct.dataTime = iprot.readI64(); - struct.setDataTimeIsSet(true); - } - if (incoming.get(2)) { - struct.dataHashCode = iprot.readI32(); - struct.setDataHashCodeIsSet(true); - } - if (incoming.get(3)) { - struct.dataString = iprot.readString(); - struct.setDataStringIsSet(true); - } - if (incoming.get(4)) { - struct.extraData1 = iprot.readString(); - struct.setExtraData1IsSet(true); - } - if (incoming.get(5)) { - struct.extraData2 = iprot.readString(); - struct.setExtraData2IsSet(true); - } - if (incoming.get(6)) { - struct.extraData3 = iprot.readString(); - struct.setExtraData3IsSet(true); - } - if (incoming.get(7)) { - struct.extraInt1 = iprot.readI32(); - struct.setExtraInt1IsSet(true); - } - if (incoming.get(8)) { - struct.extraInt2 = iprot.readI32(); - struct.setExtraInt2IsSet(true); - } - if (incoming.get(9)) { - struct.extraInt3 = iprot.readI32(); - struct.setExtraInt3IsSet(true); - } - if (incoming.get(10)) { - struct.extraLong1 = iprot.readI64(); - struct.setExtraLong1IsSet(true); - } - if (incoming.get(11)) { - struct.extraLong2 = iprot.readI64(); - struct.setExtraLong2IsSet(true); - } - if (incoming.get(12)) { - struct.extraLong3 = iprot.readI64(); - struct.setExtraLong3IsSet(true); - } - } - } - -} - +/** + * 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 RequestDataThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RequestDataThriftDTO"); + + private static final org.apache.thrift.protocol.TField DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataType", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField DATA_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("dataTime", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField DATA_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataHashCode", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField DATA_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("dataString", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField EXTRA_DATA1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData1", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField EXTRA_DATA2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData2", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField EXTRA_DATA3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData3", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField EXTRA_INT1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt1", org.apache.thrift.protocol.TType.I32, (short)8); + private static final org.apache.thrift.protocol.TField EXTRA_INT2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt2", org.apache.thrift.protocol.TType.I32, (short)9); + private static final org.apache.thrift.protocol.TField EXTRA_INT3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt3", org.apache.thrift.protocol.TType.I32, (short)10); + private static final org.apache.thrift.protocol.TField EXTRA_LONG1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong1", org.apache.thrift.protocol.TType.I64, (short)11); + private static final org.apache.thrift.protocol.TField EXTRA_LONG2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong2", org.apache.thrift.protocol.TType.I64, (short)12); + private static final org.apache.thrift.protocol.TField EXTRA_LONG3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong3", org.apache.thrift.protocol.TType.I64, (short)13); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RequestDataThriftDTOStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RequestDataThriftDTOTupleSchemeFactory()); + } + + private int dataType; // required + private long dataTime; // required + private int dataHashCode; // optional + private String dataString; // optional + private String extraData1; // optional + private String extraData2; // optional + private String extraData3; // optional + private int extraInt1; // optional + private int extraInt2; // optional + private int extraInt3; // optional + private long extraLong1; // optional + private long extraLong2; // optional + private long extraLong3; // optional + + /** 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_TYPE((short)1, "dataType"), + DATA_TIME((short)2, "dataTime"), + DATA_HASH_CODE((short)3, "dataHashCode"), + DATA_STRING((short)4, "dataString"), + EXTRA_DATA1((short)5, "extraData1"), + EXTRA_DATA2((short)6, "extraData2"), + EXTRA_DATA3((short)7, "extraData3"), + EXTRA_INT1((short)8, "extraInt1"), + EXTRA_INT2((short)9, "extraInt2"), + EXTRA_INT3((short)10, "extraInt3"), + EXTRA_LONG1((short)11, "extraLong1"), + EXTRA_LONG2((short)12, "extraLong2"), + EXTRA_LONG3((short)13, "extraLong3"); + + 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: // DATA_TYPE + return DATA_TYPE; + case 2: // DATA_TIME + return DATA_TIME; + case 3: // DATA_HASH_CODE + return DATA_HASH_CODE; + case 4: // DATA_STRING + return DATA_STRING; + case 5: // EXTRA_DATA1 + return EXTRA_DATA1; + case 6: // EXTRA_DATA2 + return EXTRA_DATA2; + case 7: // EXTRA_DATA3 + return EXTRA_DATA3; + case 8: // EXTRA_INT1 + return EXTRA_INT1; + case 9: // EXTRA_INT2 + return EXTRA_INT2; + case 10: // EXTRA_INT3 + return EXTRA_INT3; + case 11: // EXTRA_LONG1 + return EXTRA_LONG1; + case 12: // EXTRA_LONG2 + return EXTRA_LONG2; + case 13: // EXTRA_LONG3 + return EXTRA_LONG3; + 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 __DATATYPE_ISSET_ID = 0; + private static final int __DATATIME_ISSET_ID = 1; + private static final int __DATAHASHCODE_ISSET_ID = 2; + private static final int __EXTRAINT1_ISSET_ID = 3; + private static final int __EXTRAINT2_ISSET_ID = 4; + private static final int __EXTRAINT3_ISSET_ID = 5; + private static final int __EXTRALONG1_ISSET_ID = 6; + private static final int __EXTRALONG2_ISSET_ID = 7; + private static final int __EXTRALONG3_ISSET_ID = 8; + private BitSet __isset_bit_vector = new BitSet(9); + private _Fields optionals[] = {_Fields.DATA_HASH_CODE,_Fields.DATA_STRING,_Fields.EXTRA_DATA1,_Fields.EXTRA_DATA2,_Fields.EXTRA_DATA3,_Fields.EXTRA_INT1,_Fields.EXTRA_INT2,_Fields.EXTRA_INT3,_Fields.EXTRA_LONG1,_Fields.EXTRA_LONG2,_Fields.EXTRA_LONG3}; + 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.DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.DATA_TIME, new org.apache.thrift.meta_data.FieldMetaData("dataTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.DATA_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("dataHashCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.DATA_STRING, new org.apache.thrift.meta_data.FieldMetaData("dataString", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_DATA1, new org.apache.thrift.meta_data.FieldMetaData("extraData1", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_DATA2, new org.apache.thrift.meta_data.FieldMetaData("extraData2", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_DATA3, new org.apache.thrift.meta_data.FieldMetaData("extraData3", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_INT1, new org.apache.thrift.meta_data.FieldMetaData("extraInt1", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.EXTRA_INT2, new org.apache.thrift.meta_data.FieldMetaData("extraInt2", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.EXTRA_INT3, new org.apache.thrift.meta_data.FieldMetaData("extraInt3", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.EXTRA_LONG1, new org.apache.thrift.meta_data.FieldMetaData("extraLong1", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.EXTRA_LONG2, new org.apache.thrift.meta_data.FieldMetaData("extraLong2", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.EXTRA_LONG3, new org.apache.thrift.meta_data.FieldMetaData("extraLong3", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestDataThriftDTO.class, metaDataMap); + } + + public RequestDataThriftDTO() { + } + + public RequestDataThriftDTO( + int dataType, + long dataTime) + { + this(); + this.dataType = dataType; + setDataTypeIsSet(true); + this.dataTime = dataTime; + setDataTimeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public RequestDataThriftDTO(RequestDataThriftDTO other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.dataType = other.dataType; + this.dataTime = other.dataTime; + this.dataHashCode = other.dataHashCode; + if (other.isSetDataString()) { + this.dataString = other.dataString; + } + if (other.isSetExtraData1()) { + this.extraData1 = other.extraData1; + } + if (other.isSetExtraData2()) { + this.extraData2 = other.extraData2; + } + if (other.isSetExtraData3()) { + this.extraData3 = other.extraData3; + } + this.extraInt1 = other.extraInt1; + this.extraInt2 = other.extraInt2; + this.extraInt3 = other.extraInt3; + this.extraLong1 = other.extraLong1; + this.extraLong2 = other.extraLong2; + this.extraLong3 = other.extraLong3; + } + + public RequestDataThriftDTO deepCopy() { + return new RequestDataThriftDTO(this); + } + + @Override + public void clear() { + setDataTypeIsSet(false); + this.dataType = 0; + setDataTimeIsSet(false); + this.dataTime = 0; + setDataHashCodeIsSet(false); + this.dataHashCode = 0; + this.dataString = null; + this.extraData1 = null; + this.extraData2 = null; + this.extraData3 = null; + setExtraInt1IsSet(false); + this.extraInt1 = 0; + setExtraInt2IsSet(false); + this.extraInt2 = 0; + setExtraInt3IsSet(false); + this.extraInt3 = 0; + setExtraLong1IsSet(false); + this.extraLong1 = 0; + setExtraLong2IsSet(false); + this.extraLong2 = 0; + setExtraLong3IsSet(false); + this.extraLong3 = 0; + } + + public int getDataType() { + return this.dataType; + } + + public void setDataType(int dataType) { + this.dataType = dataType; + setDataTypeIsSet(true); + } + + public void unsetDataType() { + __isset_bit_vector.clear(__DATATYPE_ISSET_ID); + } + + /** Returns true if field dataType is set (has been assigned a value) and false otherwise */ + public boolean isSetDataType() { + return __isset_bit_vector.get(__DATATYPE_ISSET_ID); + } + + public void setDataTypeIsSet(boolean value) { + __isset_bit_vector.set(__DATATYPE_ISSET_ID, value); + } + + public long getDataTime() { + return this.dataTime; + } + + public void setDataTime(long dataTime) { + this.dataTime = dataTime; + setDataTimeIsSet(true); + } + + public void unsetDataTime() { + __isset_bit_vector.clear(__DATATIME_ISSET_ID); + } + + /** Returns true if field dataTime is set (has been assigned a value) and false otherwise */ + public boolean isSetDataTime() { + return __isset_bit_vector.get(__DATATIME_ISSET_ID); + } + + public void setDataTimeIsSet(boolean value) { + __isset_bit_vector.set(__DATATIME_ISSET_ID, value); + } + + public int getDataHashCode() { + return this.dataHashCode; + } + + public void setDataHashCode(int dataHashCode) { + this.dataHashCode = dataHashCode; + setDataHashCodeIsSet(true); + } + + public void unsetDataHashCode() { + __isset_bit_vector.clear(__DATAHASHCODE_ISSET_ID); + } + + /** Returns true if field dataHashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetDataHashCode() { + return __isset_bit_vector.get(__DATAHASHCODE_ISSET_ID); + } + + public void setDataHashCodeIsSet(boolean value) { + __isset_bit_vector.set(__DATAHASHCODE_ISSET_ID, value); + } + + public String getDataString() { + return this.dataString; + } + + public void setDataString(String dataString) { + this.dataString = dataString; + } + + public void unsetDataString() { + this.dataString = null; + } + + /** Returns true if field dataString is set (has been assigned a value) and false otherwise */ + public boolean isSetDataString() { + return this.dataString != null; + } + + public void setDataStringIsSet(boolean value) { + if (!value) { + this.dataString = null; + } + } + + public String getExtraData1() { + return this.extraData1; + } + + public void setExtraData1(String extraData1) { + this.extraData1 = extraData1; + } + + public void unsetExtraData1() { + this.extraData1 = null; + } + + /** Returns true if field extraData1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraData1() { + return this.extraData1 != null; + } + + public void setExtraData1IsSet(boolean value) { + if (!value) { + this.extraData1 = null; + } + } + + public String getExtraData2() { + return this.extraData2; + } + + public void setExtraData2(String extraData2) { + this.extraData2 = extraData2; + } + + public void unsetExtraData2() { + this.extraData2 = null; + } + + /** Returns true if field extraData2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraData2() { + return this.extraData2 != null; + } + + public void setExtraData2IsSet(boolean value) { + if (!value) { + this.extraData2 = null; + } + } + + public String getExtraData3() { + return this.extraData3; + } + + public void setExtraData3(String extraData3) { + this.extraData3 = extraData3; + } + + public void unsetExtraData3() { + this.extraData3 = null; + } + + /** Returns true if field extraData3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraData3() { + return this.extraData3 != null; + } + + public void setExtraData3IsSet(boolean value) { + if (!value) { + this.extraData3 = null; + } + } + + public int getExtraInt1() { + return this.extraInt1; + } + + public void setExtraInt1(int extraInt1) { + this.extraInt1 = extraInt1; + setExtraInt1IsSet(true); + } + + public void unsetExtraInt1() { + __isset_bit_vector.clear(__EXTRAINT1_ISSET_ID); + } + + /** Returns true if field extraInt1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt1() { + return __isset_bit_vector.get(__EXTRAINT1_ISSET_ID); + } + + public void setExtraInt1IsSet(boolean value) { + __isset_bit_vector.set(__EXTRAINT1_ISSET_ID, value); + } + + public int getExtraInt2() { + return this.extraInt2; + } + + public void setExtraInt2(int extraInt2) { + this.extraInt2 = extraInt2; + setExtraInt2IsSet(true); + } + + public void unsetExtraInt2() { + __isset_bit_vector.clear(__EXTRAINT2_ISSET_ID); + } + + /** Returns true if field extraInt2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt2() { + return __isset_bit_vector.get(__EXTRAINT2_ISSET_ID); + } + + public void setExtraInt2IsSet(boolean value) { + __isset_bit_vector.set(__EXTRAINT2_ISSET_ID, value); + } + + public int getExtraInt3() { + return this.extraInt3; + } + + public void setExtraInt3(int extraInt3) { + this.extraInt3 = extraInt3; + setExtraInt3IsSet(true); + } + + public void unsetExtraInt3() { + __isset_bit_vector.clear(__EXTRAINT3_ISSET_ID); + } + + /** Returns true if field extraInt3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt3() { + return __isset_bit_vector.get(__EXTRAINT3_ISSET_ID); + } + + public void setExtraInt3IsSet(boolean value) { + __isset_bit_vector.set(__EXTRAINT3_ISSET_ID, value); + } + + public long getExtraLong1() { + return this.extraLong1; + } + + public void setExtraLong1(long extraLong1) { + this.extraLong1 = extraLong1; + setExtraLong1IsSet(true); + } + + public void unsetExtraLong1() { + __isset_bit_vector.clear(__EXTRALONG1_ISSET_ID); + } + + /** Returns true if field extraLong1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong1() { + return __isset_bit_vector.get(__EXTRALONG1_ISSET_ID); + } + + public void setExtraLong1IsSet(boolean value) { + __isset_bit_vector.set(__EXTRALONG1_ISSET_ID, value); + } + + public long getExtraLong2() { + return this.extraLong2; + } + + public void setExtraLong2(long extraLong2) { + this.extraLong2 = extraLong2; + setExtraLong2IsSet(true); + } + + public void unsetExtraLong2() { + __isset_bit_vector.clear(__EXTRALONG2_ISSET_ID); + } + + /** Returns true if field extraLong2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong2() { + return __isset_bit_vector.get(__EXTRALONG2_ISSET_ID); + } + + public void setExtraLong2IsSet(boolean value) { + __isset_bit_vector.set(__EXTRALONG2_ISSET_ID, value); + } + + public long getExtraLong3() { + return this.extraLong3; + } + + public void setExtraLong3(long extraLong3) { + this.extraLong3 = extraLong3; + setExtraLong3IsSet(true); + } + + public void unsetExtraLong3() { + __isset_bit_vector.clear(__EXTRALONG3_ISSET_ID); + } + + /** Returns true if field extraLong3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong3() { + return __isset_bit_vector.get(__EXTRALONG3_ISSET_ID); + } + + public void setExtraLong3IsSet(boolean value) { + __isset_bit_vector.set(__EXTRALONG3_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case DATA_TYPE: + if (value == null) { + unsetDataType(); + } else { + setDataType((Integer)value); + } + break; + + case DATA_TIME: + if (value == null) { + unsetDataTime(); + } else { + setDataTime((Long)value); + } + break; + + case DATA_HASH_CODE: + if (value == null) { + unsetDataHashCode(); + } else { + setDataHashCode((Integer)value); + } + break; + + case DATA_STRING: + if (value == null) { + unsetDataString(); + } else { + setDataString((String)value); + } + break; + + case EXTRA_DATA1: + if (value == null) { + unsetExtraData1(); + } else { + setExtraData1((String)value); + } + break; + + case EXTRA_DATA2: + if (value == null) { + unsetExtraData2(); + } else { + setExtraData2((String)value); + } + break; + + case EXTRA_DATA3: + if (value == null) { + unsetExtraData3(); + } else { + setExtraData3((String)value); + } + break; + + case EXTRA_INT1: + if (value == null) { + unsetExtraInt1(); + } else { + setExtraInt1((Integer)value); + } + break; + + case EXTRA_INT2: + if (value == null) { + unsetExtraInt2(); + } else { + setExtraInt2((Integer)value); + } + break; + + case EXTRA_INT3: + if (value == null) { + unsetExtraInt3(); + } else { + setExtraInt3((Integer)value); + } + break; + + case EXTRA_LONG1: + if (value == null) { + unsetExtraLong1(); + } else { + setExtraLong1((Long)value); + } + break; + + case EXTRA_LONG2: + if (value == null) { + unsetExtraLong2(); + } else { + setExtraLong2((Long)value); + } + break; + + case EXTRA_LONG3: + if (value == null) { + unsetExtraLong3(); + } else { + setExtraLong3((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case DATA_TYPE: + return Integer.valueOf(getDataType()); + + case DATA_TIME: + return Long.valueOf(getDataTime()); + + case DATA_HASH_CODE: + return Integer.valueOf(getDataHashCode()); + + case DATA_STRING: + return getDataString(); + + case EXTRA_DATA1: + return getExtraData1(); + + case EXTRA_DATA2: + return getExtraData2(); + + case EXTRA_DATA3: + return getExtraData3(); + + case EXTRA_INT1: + return Integer.valueOf(getExtraInt1()); + + case EXTRA_INT2: + return Integer.valueOf(getExtraInt2()); + + case EXTRA_INT3: + return Integer.valueOf(getExtraInt3()); + + case EXTRA_LONG1: + return Long.valueOf(getExtraLong1()); + + case EXTRA_LONG2: + return Long.valueOf(getExtraLong2()); + + case EXTRA_LONG3: + return Long.valueOf(getExtraLong3()); + + } + 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 DATA_TYPE: + return isSetDataType(); + case DATA_TIME: + return isSetDataTime(); + case DATA_HASH_CODE: + return isSetDataHashCode(); + case DATA_STRING: + return isSetDataString(); + case EXTRA_DATA1: + return isSetExtraData1(); + case EXTRA_DATA2: + return isSetExtraData2(); + case EXTRA_DATA3: + return isSetExtraData3(); + case EXTRA_INT1: + return isSetExtraInt1(); + case EXTRA_INT2: + return isSetExtraInt2(); + case EXTRA_INT3: + return isSetExtraInt3(); + case EXTRA_LONG1: + return isSetExtraLong1(); + case EXTRA_LONG2: + return isSetExtraLong2(); + case EXTRA_LONG3: + return isSetExtraLong3(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof RequestDataThriftDTO) + return this.equals((RequestDataThriftDTO)that); + return false; + } + + public boolean equals(RequestDataThriftDTO that) { + if (that == null) + return false; + + boolean this_present_dataType = true; + boolean that_present_dataType = true; + if (this_present_dataType || that_present_dataType) { + if (!(this_present_dataType && that_present_dataType)) + return false; + if (this.dataType != that.dataType) + return false; + } + + boolean this_present_dataTime = true; + boolean that_present_dataTime = true; + if (this_present_dataTime || that_present_dataTime) { + if (!(this_present_dataTime && that_present_dataTime)) + return false; + if (this.dataTime != that.dataTime) + return false; + } + + boolean this_present_dataHashCode = true && this.isSetDataHashCode(); + boolean that_present_dataHashCode = true && that.isSetDataHashCode(); + if (this_present_dataHashCode || that_present_dataHashCode) { + if (!(this_present_dataHashCode && that_present_dataHashCode)) + return false; + if (this.dataHashCode != that.dataHashCode) + return false; + } + + boolean this_present_dataString = true && this.isSetDataString(); + boolean that_present_dataString = true && that.isSetDataString(); + if (this_present_dataString || that_present_dataString) { + if (!(this_present_dataString && that_present_dataString)) + return false; + if (!this.dataString.equals(that.dataString)) + return false; + } + + boolean this_present_extraData1 = true && this.isSetExtraData1(); + boolean that_present_extraData1 = true && that.isSetExtraData1(); + if (this_present_extraData1 || that_present_extraData1) { + if (!(this_present_extraData1 && that_present_extraData1)) + return false; + if (!this.extraData1.equals(that.extraData1)) + return false; + } + + boolean this_present_extraData2 = true && this.isSetExtraData2(); + boolean that_present_extraData2 = true && that.isSetExtraData2(); + if (this_present_extraData2 || that_present_extraData2) { + if (!(this_present_extraData2 && that_present_extraData2)) + return false; + if (!this.extraData2.equals(that.extraData2)) + return false; + } + + boolean this_present_extraData3 = true && this.isSetExtraData3(); + boolean that_present_extraData3 = true && that.isSetExtraData3(); + if (this_present_extraData3 || that_present_extraData3) { + if (!(this_present_extraData3 && that_present_extraData3)) + return false; + if (!this.extraData3.equals(that.extraData3)) + return false; + } + + boolean this_present_extraInt1 = true && this.isSetExtraInt1(); + boolean that_present_extraInt1 = true && that.isSetExtraInt1(); + if (this_present_extraInt1 || that_present_extraInt1) { + if (!(this_present_extraInt1 && that_present_extraInt1)) + return false; + if (this.extraInt1 != that.extraInt1) + return false; + } + + boolean this_present_extraInt2 = true && this.isSetExtraInt2(); + boolean that_present_extraInt2 = true && that.isSetExtraInt2(); + if (this_present_extraInt2 || that_present_extraInt2) { + if (!(this_present_extraInt2 && that_present_extraInt2)) + return false; + if (this.extraInt2 != that.extraInt2) + return false; + } + + boolean this_present_extraInt3 = true && this.isSetExtraInt3(); + boolean that_present_extraInt3 = true && that.isSetExtraInt3(); + if (this_present_extraInt3 || that_present_extraInt3) { + if (!(this_present_extraInt3 && that_present_extraInt3)) + return false; + if (this.extraInt3 != that.extraInt3) + return false; + } + + boolean this_present_extraLong1 = true && this.isSetExtraLong1(); + boolean that_present_extraLong1 = true && that.isSetExtraLong1(); + if (this_present_extraLong1 || that_present_extraLong1) { + if (!(this_present_extraLong1 && that_present_extraLong1)) + return false; + if (this.extraLong1 != that.extraLong1) + return false; + } + + boolean this_present_extraLong2 = true && this.isSetExtraLong2(); + boolean that_present_extraLong2 = true && that.isSetExtraLong2(); + if (this_present_extraLong2 || that_present_extraLong2) { + if (!(this_present_extraLong2 && that_present_extraLong2)) + return false; + if (this.extraLong2 != that.extraLong2) + return false; + } + + boolean this_present_extraLong3 = true && this.isSetExtraLong3(); + boolean that_present_extraLong3 = true && that.isSetExtraLong3(); + if (this_present_extraLong3 || that_present_extraLong3) { + if (!(this_present_extraLong3 && that_present_extraLong3)) + return false; + if (this.extraLong3 != that.extraLong3) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(RequestDataThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + RequestDataThriftDTO typedOther = (RequestDataThriftDTO)other; + + lastComparison = Boolean.valueOf(isSetDataType()).compareTo(typedOther.isSetDataType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, typedOther.dataType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataTime()).compareTo(typedOther.isSetDataTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, typedOther.dataTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataHashCode()).compareTo(typedOther.isSetDataHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataHashCode, typedOther.dataHashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataString()).compareTo(typedOther.isSetDataString()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataString()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataString, typedOther.dataString); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData1()).compareTo(typedOther.isSetExtraData1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData1, typedOther.extraData1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData2()).compareTo(typedOther.isSetExtraData2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData2, typedOther.extraData2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData3()).compareTo(typedOther.isSetExtraData3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData3, typedOther.extraData3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt1()).compareTo(typedOther.isSetExtraInt1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt1, typedOther.extraInt1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt2()).compareTo(typedOther.isSetExtraInt2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt2, typedOther.extraInt2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt3()).compareTo(typedOther.isSetExtraInt3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt3, typedOther.extraInt3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong1()).compareTo(typedOther.isSetExtraLong1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong1, typedOther.extraLong1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong2()).compareTo(typedOther.isSetExtraLong2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong2, typedOther.extraLong2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong3()).compareTo(typedOther.isSetExtraLong3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong3, typedOther.extraLong3); + 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("RequestDataThriftDTO("); + boolean first = true; + + sb.append("dataType:"); + sb.append(this.dataType); + first = false; + if (!first) sb.append(", "); + sb.append("dataTime:"); + sb.append(this.dataTime); + first = false; + if (isSetDataHashCode()) { + if (!first) sb.append(", "); + sb.append("dataHashCode:"); + sb.append(this.dataHashCode); + first = false; + } + if (isSetDataString()) { + if (!first) sb.append(", "); + sb.append("dataString:"); + if (this.dataString == null) { + sb.append("null"); + } else { + sb.append(this.dataString); + } + first = false; + } + if (isSetExtraData1()) { + if (!first) sb.append(", "); + sb.append("extraData1:"); + if (this.extraData1 == null) { + sb.append("null"); + } else { + sb.append(this.extraData1); + } + first = false; + } + if (isSetExtraData2()) { + if (!first) sb.append(", "); + sb.append("extraData2:"); + if (this.extraData2 == null) { + sb.append("null"); + } else { + sb.append(this.extraData2); + } + first = false; + } + if (isSetExtraData3()) { + if (!first) sb.append(", "); + sb.append("extraData3:"); + if (this.extraData3 == null) { + sb.append("null"); + } else { + sb.append(this.extraData3); + } + first = false; + } + if (isSetExtraInt1()) { + if (!first) sb.append(", "); + sb.append("extraInt1:"); + sb.append(this.extraInt1); + first = false; + } + if (isSetExtraInt2()) { + if (!first) sb.append(", "); + sb.append("extraInt2:"); + sb.append(this.extraInt2); + first = false; + } + if (isSetExtraInt3()) { + if (!first) sb.append(", "); + sb.append("extraInt3:"); + sb.append(this.extraInt3); + first = false; + } + if (isSetExtraLong1()) { + if (!first) sb.append(", "); + sb.append("extraLong1:"); + sb.append(this.extraLong1); + first = false; + } + if (isSetExtraLong2()) { + if (!first) sb.append(", "); + sb.append("extraLong2:"); + sb.append(this.extraLong2); + first = false; + } + if (isSetExtraLong3()) { + if (!first) sb.append(", "); + sb.append("extraLong3:"); + sb.append(this.extraLong3); + 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 RequestDataThriftDTOStandardSchemeFactory implements SchemeFactory { + public RequestDataThriftDTOStandardScheme getScheme() { + return new RequestDataThriftDTOStandardScheme(); + } + } + + private static class RequestDataThriftDTOStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RequestDataThriftDTO 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_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dataType = iprot.readI32(); + struct.setDataTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DATA_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.dataTime = iprot.readI64(); + struct.setDataTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DATA_HASH_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dataHashCode = iprot.readI32(); + struct.setDataHashCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DATA_STRING + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.dataString = iprot.readString(); + struct.setDataStringIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // EXTRA_DATA1 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.extraData1 = iprot.readString(); + struct.setExtraData1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // EXTRA_DATA2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.extraData2 = iprot.readString(); + struct.setExtraData2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // EXTRA_DATA3 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.extraData3 = iprot.readString(); + struct.setExtraData3IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // EXTRA_INT1 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.extraInt1 = iprot.readI32(); + struct.setExtraInt1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // EXTRA_INT2 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.extraInt2 = iprot.readI32(); + struct.setExtraInt2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // EXTRA_INT3 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.extraInt3 = iprot.readI32(); + struct.setExtraInt3IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // EXTRA_LONG1 + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.extraLong1 = iprot.readI64(); + struct.setExtraLong1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // EXTRA_LONG2 + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.extraLong2 = iprot.readI64(); + struct.setExtraLong2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // EXTRA_LONG3 + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.extraLong3 = iprot.readI64(); + struct.setExtraLong3IsSet(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, RequestDataThriftDTO struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(DATA_TYPE_FIELD_DESC); + oprot.writeI32(struct.dataType); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(DATA_TIME_FIELD_DESC); + oprot.writeI64(struct.dataTime); + oprot.writeFieldEnd(); + if (struct.isSetDataHashCode()) { + oprot.writeFieldBegin(DATA_HASH_CODE_FIELD_DESC); + oprot.writeI32(struct.dataHashCode); + oprot.writeFieldEnd(); + } + if (struct.dataString != null) { + if (struct.isSetDataString()) { + oprot.writeFieldBegin(DATA_STRING_FIELD_DESC); + oprot.writeString(struct.dataString); + oprot.writeFieldEnd(); + } + } + if (struct.extraData1 != null) { + if (struct.isSetExtraData1()) { + oprot.writeFieldBegin(EXTRA_DATA1_FIELD_DESC); + oprot.writeString(struct.extraData1); + oprot.writeFieldEnd(); + } + } + if (struct.extraData2 != null) { + if (struct.isSetExtraData2()) { + oprot.writeFieldBegin(EXTRA_DATA2_FIELD_DESC); + oprot.writeString(struct.extraData2); + oprot.writeFieldEnd(); + } + } + if (struct.extraData3 != null) { + if (struct.isSetExtraData3()) { + oprot.writeFieldBegin(EXTRA_DATA3_FIELD_DESC); + oprot.writeString(struct.extraData3); + oprot.writeFieldEnd(); + } + } + if (struct.isSetExtraInt1()) { + oprot.writeFieldBegin(EXTRA_INT1_FIELD_DESC); + oprot.writeI32(struct.extraInt1); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraInt2()) { + oprot.writeFieldBegin(EXTRA_INT2_FIELD_DESC); + oprot.writeI32(struct.extraInt2); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraInt3()) { + oprot.writeFieldBegin(EXTRA_INT3_FIELD_DESC); + oprot.writeI32(struct.extraInt3); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraLong1()) { + oprot.writeFieldBegin(EXTRA_LONG1_FIELD_DESC); + oprot.writeI64(struct.extraLong1); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraLong2()) { + oprot.writeFieldBegin(EXTRA_LONG2_FIELD_DESC); + oprot.writeI64(struct.extraLong2); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraLong3()) { + oprot.writeFieldBegin(EXTRA_LONG3_FIELD_DESC); + oprot.writeI64(struct.extraLong3); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class RequestDataThriftDTOTupleSchemeFactory implements SchemeFactory { + public RequestDataThriftDTOTupleScheme getScheme() { + return new RequestDataThriftDTOTupleScheme(); + } + } + + private static class RequestDataThriftDTOTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RequestDataThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetDataType()) { + optionals.set(0); + } + if (struct.isSetDataTime()) { + optionals.set(1); + } + if (struct.isSetDataHashCode()) { + optionals.set(2); + } + if (struct.isSetDataString()) { + optionals.set(3); + } + if (struct.isSetExtraData1()) { + optionals.set(4); + } + if (struct.isSetExtraData2()) { + optionals.set(5); + } + if (struct.isSetExtraData3()) { + optionals.set(6); + } + if (struct.isSetExtraInt1()) { + optionals.set(7); + } + if (struct.isSetExtraInt2()) { + optionals.set(8); + } + if (struct.isSetExtraInt3()) { + optionals.set(9); + } + if (struct.isSetExtraLong1()) { + optionals.set(10); + } + if (struct.isSetExtraLong2()) { + optionals.set(11); + } + if (struct.isSetExtraLong3()) { + optionals.set(12); + } + oprot.writeBitSet(optionals, 13); + if (struct.isSetDataType()) { + oprot.writeI32(struct.dataType); + } + if (struct.isSetDataTime()) { + oprot.writeI64(struct.dataTime); + } + if (struct.isSetDataHashCode()) { + oprot.writeI32(struct.dataHashCode); + } + if (struct.isSetDataString()) { + oprot.writeString(struct.dataString); + } + if (struct.isSetExtraData1()) { + oprot.writeString(struct.extraData1); + } + if (struct.isSetExtraData2()) { + oprot.writeString(struct.extraData2); + } + if (struct.isSetExtraData3()) { + oprot.writeString(struct.extraData3); + } + if (struct.isSetExtraInt1()) { + oprot.writeI32(struct.extraInt1); + } + if (struct.isSetExtraInt2()) { + oprot.writeI32(struct.extraInt2); + } + if (struct.isSetExtraInt3()) { + oprot.writeI32(struct.extraInt3); + } + if (struct.isSetExtraLong1()) { + oprot.writeI64(struct.extraLong1); + } + if (struct.isSetExtraLong2()) { + oprot.writeI64(struct.extraLong2); + } + if (struct.isSetExtraLong3()) { + oprot.writeI64(struct.extraLong3); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, RequestDataThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(13); + if (incoming.get(0)) { + struct.dataType = iprot.readI32(); + struct.setDataTypeIsSet(true); + } + if (incoming.get(1)) { + struct.dataTime = iprot.readI64(); + struct.setDataTimeIsSet(true); + } + if (incoming.get(2)) { + struct.dataHashCode = iprot.readI32(); + struct.setDataHashCodeIsSet(true); + } + if (incoming.get(3)) { + struct.dataString = iprot.readString(); + struct.setDataStringIsSet(true); + } + if (incoming.get(4)) { + struct.extraData1 = iprot.readString(); + struct.setExtraData1IsSet(true); + } + if (incoming.get(5)) { + struct.extraData2 = iprot.readString(); + struct.setExtraData2IsSet(true); + } + if (incoming.get(6)) { + struct.extraData3 = iprot.readString(); + struct.setExtraData3IsSet(true); + } + if (incoming.get(7)) { + struct.extraInt1 = iprot.readI32(); + struct.setExtraInt1IsSet(true); + } + if (incoming.get(8)) { + struct.extraInt2 = iprot.readI32(); + struct.setExtraInt2IsSet(true); + } + if (incoming.get(9)) { + struct.extraInt3 = iprot.readI32(); + struct.setExtraInt3IsSet(true); + } + if (incoming.get(10)) { + struct.extraLong1 = iprot.readI64(); + struct.setExtraLong1IsSet(true); + } + if (incoming.get(11)) { + struct.extraLong2 = iprot.readI64(); + struct.setExtraLong2IsSet(true); + } + if (incoming.get(12)) { + struct.extraLong3 = iprot.readI64(); + struct.setExtraLong3IsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/RequestThriftDTO.java b/src/main/java/com/profiler/common/dto/thrift/RequestThriftDTO.java index 760a97723..3570be718 100644 --- a/src/main/java/com/profiler/common/dto/thrift/RequestThriftDTO.java +++ b/src/main/java/com/profiler/common/dto/thrift/RequestThriftDTO.java @@ -1,2062 +1,2020 @@ -/** - * 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 RequestThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RequestThriftDTO"); - - 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) 1); - private static final org.apache.thrift.protocol.TField REQUEST_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("requestHashCode", org.apache.thrift.protocol.TType.I32, (short) 2); - private static final org.apache.thrift.protocol.TField DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataType", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField DATA_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("dataTime", org.apache.thrift.protocol.TType.I64, (short) 4); - private static final org.apache.thrift.protocol.TField THREAD_CPUTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("threadCPUTime", org.apache.thrift.protocol.TType.I64, (short) 5); - private static final org.apache.thrift.protocol.TField THREAD_USER_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("threadUserTime", org.apache.thrift.protocol.TType.I64, (short) 6); - private static final org.apache.thrift.protocol.TField REQUEST_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("requestID", org.apache.thrift.protocol.TType.STRING, (short) 7); - private static final org.apache.thrift.protocol.TField REQUEST_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("requestURL", org.apache.thrift.protocol.TType.STRING, (short) 8); - private static final org.apache.thrift.protocol.TField CLIENT_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("clientIP", org.apache.thrift.protocol.TType.STRING, (short) 9); - private static final org.apache.thrift.protocol.TField EXTRA_DATA1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData1", org.apache.thrift.protocol.TType.STRING, (short) 10); - private static final org.apache.thrift.protocol.TField EXTRA_DATA2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData2", org.apache.thrift.protocol.TType.STRING, (short) 11); - private static final org.apache.thrift.protocol.TField EXTRA_DATA3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData3", org.apache.thrift.protocol.TType.STRING, (short) 12); - private static final org.apache.thrift.protocol.TField EXTRA_INT1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt1", org.apache.thrift.protocol.TType.I32, (short) 13); - private static final org.apache.thrift.protocol.TField EXTRA_INT2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt2", org.apache.thrift.protocol.TType.I32, (short) 14); - private static final org.apache.thrift.protocol.TField EXTRA_INT3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt3", org.apache.thrift.protocol.TType.I32, (short) 15); - private static final org.apache.thrift.protocol.TField EXTRA_LONG1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong1", org.apache.thrift.protocol.TType.I64, (short) 16); - private static final org.apache.thrift.protocol.TField EXTRA_LONG2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong2", org.apache.thrift.protocol.TType.I64, (short) 17); - private static final org.apache.thrift.protocol.TField EXTRA_LONG3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong3", org.apache.thrift.protocol.TType.I64, (short) 18); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new RequestThriftDTOStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RequestThriftDTOTupleSchemeFactory()); - } - - private String agentId; // required - private int requestHashCode; // required - private int dataType; // required - private long dataTime; // required - private long threadCPUTime; // required - private long threadUserTime; // required - private String requestID; // optional - private String requestURL; // optional - private String clientIP; // optional - private String extraData1; // optional - private String extraData2; // optional - private String extraData3; // optional - private int extraInt1; // optional - private int extraInt2; // optional - private int extraInt3; // optional - private long extraLong1; // optional - private long extraLong2; // optional - private long extraLong3; // optional - - /** - * The set of fields this struct contains, along with convenience methods for finding and manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - AGENT_ID((short) 1, "agentId"), - REQUEST_HASH_CODE((short) 2, "requestHashCode"), - DATA_TYPE((short) 3, "dataType"), - DATA_TIME((short) 4, "dataTime"), - THREAD_CPUTIME((short) 5, "threadCPUTime"), - THREAD_USER_TIME((short) 6, "threadUserTime"), - REQUEST_ID((short) 7, "requestID"), - REQUEST_URL((short) 8, "requestURL"), - CLIENT_IP((short) 9, "clientIP"), - EXTRA_DATA1((short) 10, "extraData1"), - EXTRA_DATA2((short) 11, "extraData2"), - EXTRA_DATA3((short) 12, "extraData3"), - EXTRA_INT1((short) 13, "extraInt1"), - EXTRA_INT2((short) 14, "extraInt2"), - EXTRA_INT3((short) 15, "extraInt3"), - EXTRA_LONG1((short) 16, "extraLong1"), - EXTRA_LONG2((short) 17, "extraLong2"), - EXTRA_LONG3((short) 18, "extraLong3"); - - 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: // AGENT_ID - return AGENT_ID; - case 2: // REQUEST_HASH_CODE - return REQUEST_HASH_CODE; - case 3: // DATA_TYPE - return DATA_TYPE; - case 4: // DATA_TIME - return DATA_TIME; - case 5: // THREAD_CPUTIME - return THREAD_CPUTIME; - case 6: // THREAD_USER_TIME - return THREAD_USER_TIME; - case 7: // REQUEST_ID - return REQUEST_ID; - case 8: // REQUEST_URL - return REQUEST_URL; - case 9: // CLIENT_IP - return CLIENT_IP; - case 10: // EXTRA_DATA1 - return EXTRA_DATA1; - case 11: // EXTRA_DATA2 - return EXTRA_DATA2; - case 12: // EXTRA_DATA3 - return EXTRA_DATA3; - case 13: // EXTRA_INT1 - return EXTRA_INT1; - case 14: // EXTRA_INT2 - return EXTRA_INT2; - case 15: // EXTRA_INT3 - return EXTRA_INT3; - case 16: // EXTRA_LONG1 - return EXTRA_LONG1; - case 17: // EXTRA_LONG2 - return EXTRA_LONG2; - case 18: // EXTRA_LONG3 - return EXTRA_LONG3; - 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 __REQUESTHASHCODE_ISSET_ID = 0; - private static final int __DATATYPE_ISSET_ID = 1; - private static final int __DATATIME_ISSET_ID = 2; - private static final int __THREADCPUTIME_ISSET_ID = 3; - private static final int __THREADUSERTIME_ISSET_ID = 4; - private static final int __EXTRAINT1_ISSET_ID = 5; - private static final int __EXTRAINT2_ISSET_ID = 6; - private static final int __EXTRAINT3_ISSET_ID = 7; - private static final int __EXTRALONG1_ISSET_ID = 8; - private static final int __EXTRALONG2_ISSET_ID = 9; - private static final int __EXTRALONG3_ISSET_ID = 10; - private BitSet __isset_bit_vector = new BitSet(11); - private _Fields optionals[] = {_Fields.REQUEST_ID, _Fields.REQUEST_URL, _Fields.CLIENT_IP, _Fields.EXTRA_DATA1, _Fields.EXTRA_DATA2, _Fields.EXTRA_DATA3, _Fields.EXTRA_INT1, _Fields.EXTRA_INT2, _Fields.EXTRA_INT3, _Fields.EXTRA_LONG1, _Fields.EXTRA_LONG2, _Fields.EXTRA_LONG3}; - 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.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.REQUEST_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("requestHashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataType", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.DATA_TIME, new org.apache.thrift.meta_data.FieldMetaData("dataTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.THREAD_CPUTIME, new org.apache.thrift.meta_data.FieldMetaData("threadCPUTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.THREAD_USER_TIME, new org.apache.thrift.meta_data.FieldMetaData("threadUserTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.REQUEST_ID, new org.apache.thrift.meta_data.FieldMetaData("requestID", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.REQUEST_URL, new org.apache.thrift.meta_data.FieldMetaData("requestURL", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CLIENT_IP, new org.apache.thrift.meta_data.FieldMetaData("clientIP", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_DATA1, new org.apache.thrift.meta_data.FieldMetaData("extraData1", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_DATA2, new org.apache.thrift.meta_data.FieldMetaData("extraData2", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_DATA3, new org.apache.thrift.meta_data.FieldMetaData("extraData3", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTRA_INT1, new org.apache.thrift.meta_data.FieldMetaData("extraInt1", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.EXTRA_INT2, new org.apache.thrift.meta_data.FieldMetaData("extraInt2", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.EXTRA_INT3, new org.apache.thrift.meta_data.FieldMetaData("extraInt3", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.EXTRA_LONG1, new org.apache.thrift.meta_data.FieldMetaData("extraLong1", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.EXTRA_LONG2, new org.apache.thrift.meta_data.FieldMetaData("extraLong2", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.EXTRA_LONG3, new org.apache.thrift.meta_data.FieldMetaData("extraLong3", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestThriftDTO.class, metaDataMap); - } - - public RequestThriftDTO() { - } - - public RequestThriftDTO( - String agentId, - int requestHashCode, - int dataType, - long dataTime, - long threadCPUTime, - long threadUserTime) { - this(); - this.agentId = agentId; - this.requestHashCode = requestHashCode; - setRequestHashCodeIsSet(true); - this.dataType = dataType; - setDataTypeIsSet(true); - this.dataTime = dataTime; - setDataTimeIsSet(true); - this.threadCPUTime = threadCPUTime; - setThreadCPUTimeIsSet(true); - this.threadUserTime = threadUserTime; - setThreadUserTimeIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public RequestThriftDTO(RequestThriftDTO other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetAgentId()) { - this.agentId = other.agentId; - } - this.requestHashCode = other.requestHashCode; - this.dataType = other.dataType; - this.dataTime = other.dataTime; - this.threadCPUTime = other.threadCPUTime; - this.threadUserTime = other.threadUserTime; - if (other.isSetRequestID()) { - this.requestID = other.requestID; - } - if (other.isSetRequestURL()) { - this.requestURL = other.requestURL; - } - if (other.isSetClientIP()) { - this.clientIP = other.clientIP; - } - if (other.isSetExtraData1()) { - this.extraData1 = other.extraData1; - } - if (other.isSetExtraData2()) { - this.extraData2 = other.extraData2; - } - if (other.isSetExtraData3()) { - this.extraData3 = other.extraData3; - } - this.extraInt1 = other.extraInt1; - this.extraInt2 = other.extraInt2; - this.extraInt3 = other.extraInt3; - this.extraLong1 = other.extraLong1; - this.extraLong2 = other.extraLong2; - this.extraLong3 = other.extraLong3; - } - - public RequestThriftDTO deepCopy() { - return new RequestThriftDTO(this); - } - - @Override - public void clear() { - this.agentId = null; - setRequestHashCodeIsSet(false); - this.requestHashCode = 0; - setDataTypeIsSet(false); - this.dataType = 0; - setDataTimeIsSet(false); - this.dataTime = 0; - setThreadCPUTimeIsSet(false); - this.threadCPUTime = 0; - setThreadUserTimeIsSet(false); - this.threadUserTime = 0; - this.requestID = null; - this.requestURL = null; - this.clientIP = null; - this.extraData1 = null; - this.extraData2 = null; - this.extraData3 = null; - setExtraInt1IsSet(false); - this.extraInt1 = 0; - setExtraInt2IsSet(false); - this.extraInt2 = 0; - setExtraInt3IsSet(false); - this.extraInt3 = 0; - setExtraLong1IsSet(false); - this.extraLong1 = 0; - setExtraLong2IsSet(false); - this.extraLong2 = 0; - setExtraLong3IsSet(false); - this.extraLong3 = 0; - } - - 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 int getRequestHashCode() { - return this.requestHashCode; - } - - public void setRequestHashCode(int requestHashCode) { - this.requestHashCode = requestHashCode; - setRequestHashCodeIsSet(true); - } - - public void unsetRequestHashCode() { - __isset_bit_vector.clear(__REQUESTHASHCODE_ISSET_ID); - } - - /** - * Returns true if field requestHashCode is set (has been assigned a value) and false otherwise - */ - public boolean isSetRequestHashCode() { - return __isset_bit_vector.get(__REQUESTHASHCODE_ISSET_ID); - } - - public void setRequestHashCodeIsSet(boolean value) { - __isset_bit_vector.set(__REQUESTHASHCODE_ISSET_ID, value); - } - - public int getDataType() { - return this.dataType; - } - - public void setDataType(int dataType) { - this.dataType = dataType; - setDataTypeIsSet(true); - } - - public void unsetDataType() { - __isset_bit_vector.clear(__DATATYPE_ISSET_ID); - } - - /** - * Returns true if field dataType is set (has been assigned a value) and false otherwise - */ - public boolean isSetDataType() { - return __isset_bit_vector.get(__DATATYPE_ISSET_ID); - } - - public void setDataTypeIsSet(boolean value) { - __isset_bit_vector.set(__DATATYPE_ISSET_ID, value); - } - - public long getDataTime() { - return this.dataTime; - } - - public void setDataTime(long dataTime) { - this.dataTime = dataTime; - setDataTimeIsSet(true); - } - - public void unsetDataTime() { - __isset_bit_vector.clear(__DATATIME_ISSET_ID); - } - - /** - * Returns true if field dataTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetDataTime() { - return __isset_bit_vector.get(__DATATIME_ISSET_ID); - } - - public void setDataTimeIsSet(boolean value) { - __isset_bit_vector.set(__DATATIME_ISSET_ID, value); - } - - public long getThreadCPUTime() { - return this.threadCPUTime; - } - - public void setThreadCPUTime(long threadCPUTime) { - this.threadCPUTime = threadCPUTime; - setThreadCPUTimeIsSet(true); - } - - public void unsetThreadCPUTime() { - __isset_bit_vector.clear(__THREADCPUTIME_ISSET_ID); - } - - /** - * Returns true if field threadCPUTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetThreadCPUTime() { - return __isset_bit_vector.get(__THREADCPUTIME_ISSET_ID); - } - - public void setThreadCPUTimeIsSet(boolean value) { - __isset_bit_vector.set(__THREADCPUTIME_ISSET_ID, value); - } - - public long getThreadUserTime() { - return this.threadUserTime; - } - - public void setThreadUserTime(long threadUserTime) { - this.threadUserTime = threadUserTime; - setThreadUserTimeIsSet(true); - } - - public void unsetThreadUserTime() { - __isset_bit_vector.clear(__THREADUSERTIME_ISSET_ID); - } - - /** - * Returns true if field threadUserTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetThreadUserTime() { - return __isset_bit_vector.get(__THREADUSERTIME_ISSET_ID); - } - - public void setThreadUserTimeIsSet(boolean value) { - __isset_bit_vector.set(__THREADUSERTIME_ISSET_ID, value); - } - - public String getRequestID() { - return this.requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - public void unsetRequestID() { - this.requestID = null; - } - - /** - * Returns true if field requestID is set (has been assigned a value) and false otherwise - */ - public boolean isSetRequestID() { - return this.requestID != null; - } - - public void setRequestIDIsSet(boolean value) { - if (!value) { - this.requestID = null; - } - } - - public String getRequestURL() { - return this.requestURL; - } - - public void setRequestURL(String requestURL) { - this.requestURL = requestURL; - } - - public void unsetRequestURL() { - this.requestURL = null; - } - - /** - * Returns true if field requestURL is set (has been assigned a value) and false otherwise - */ - public boolean isSetRequestURL() { - return this.requestURL != null; - } - - public void setRequestURLIsSet(boolean value) { - if (!value) { - this.requestURL = null; - } - } - - public String getClientIP() { - return this.clientIP; - } - - public void setClientIP(String clientIP) { - this.clientIP = clientIP; - } - - public void unsetClientIP() { - this.clientIP = null; - } - - /** - * Returns true if field clientIP is set (has been assigned a value) and false otherwise - */ - public boolean isSetClientIP() { - return this.clientIP != null; - } - - public void setClientIPIsSet(boolean value) { - if (!value) { - this.clientIP = null; - } - } - - public String getExtraData1() { - return this.extraData1; - } - - public void setExtraData1(String extraData1) { - this.extraData1 = extraData1; - } - - public void unsetExtraData1() { - this.extraData1 = null; - } - - /** - * Returns true if field extraData1 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraData1() { - return this.extraData1 != null; - } - - public void setExtraData1IsSet(boolean value) { - if (!value) { - this.extraData1 = null; - } - } - - public String getExtraData2() { - return this.extraData2; - } - - public void setExtraData2(String extraData2) { - this.extraData2 = extraData2; - } - - public void unsetExtraData2() { - this.extraData2 = null; - } - - /** - * Returns true if field extraData2 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraData2() { - return this.extraData2 != null; - } - - public void setExtraData2IsSet(boolean value) { - if (!value) { - this.extraData2 = null; - } - } - - public String getExtraData3() { - return this.extraData3; - } - - public void setExtraData3(String extraData3) { - this.extraData3 = extraData3; - } - - public void unsetExtraData3() { - this.extraData3 = null; - } - - /** - * Returns true if field extraData3 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraData3() { - return this.extraData3 != null; - } - - public void setExtraData3IsSet(boolean value) { - if (!value) { - this.extraData3 = null; - } - } - - public int getExtraInt1() { - return this.extraInt1; - } - - public void setExtraInt1(int extraInt1) { - this.extraInt1 = extraInt1; - setExtraInt1IsSet(true); - } - - public void unsetExtraInt1() { - __isset_bit_vector.clear(__EXTRAINT1_ISSET_ID); - } - - /** - * Returns true if field extraInt1 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraInt1() { - return __isset_bit_vector.get(__EXTRAINT1_ISSET_ID); - } - - public void setExtraInt1IsSet(boolean value) { - __isset_bit_vector.set(__EXTRAINT1_ISSET_ID, value); - } - - public int getExtraInt2() { - return this.extraInt2; - } - - public void setExtraInt2(int extraInt2) { - this.extraInt2 = extraInt2; - setExtraInt2IsSet(true); - } - - public void unsetExtraInt2() { - __isset_bit_vector.clear(__EXTRAINT2_ISSET_ID); - } - - /** - * Returns true if field extraInt2 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraInt2() { - return __isset_bit_vector.get(__EXTRAINT2_ISSET_ID); - } - - public void setExtraInt2IsSet(boolean value) { - __isset_bit_vector.set(__EXTRAINT2_ISSET_ID, value); - } - - public int getExtraInt3() { - return this.extraInt3; - } - - public void setExtraInt3(int extraInt3) { - this.extraInt3 = extraInt3; - setExtraInt3IsSet(true); - } - - public void unsetExtraInt3() { - __isset_bit_vector.clear(__EXTRAINT3_ISSET_ID); - } - - /** - * Returns true if field extraInt3 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraInt3() { - return __isset_bit_vector.get(__EXTRAINT3_ISSET_ID); - } - - public void setExtraInt3IsSet(boolean value) { - __isset_bit_vector.set(__EXTRAINT3_ISSET_ID, value); - } - - public long getExtraLong1() { - return this.extraLong1; - } - - public void setExtraLong1(long extraLong1) { - this.extraLong1 = extraLong1; - setExtraLong1IsSet(true); - } - - public void unsetExtraLong1() { - __isset_bit_vector.clear(__EXTRALONG1_ISSET_ID); - } - - /** - * Returns true if field extraLong1 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraLong1() { - return __isset_bit_vector.get(__EXTRALONG1_ISSET_ID); - } - - public void setExtraLong1IsSet(boolean value) { - __isset_bit_vector.set(__EXTRALONG1_ISSET_ID, value); - } - - public long getExtraLong2() { - return this.extraLong2; - } - - public void setExtraLong2(long extraLong2) { - this.extraLong2 = extraLong2; - setExtraLong2IsSet(true); - } - - public void unsetExtraLong2() { - __isset_bit_vector.clear(__EXTRALONG2_ISSET_ID); - } - - /** - * Returns true if field extraLong2 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraLong2() { - return __isset_bit_vector.get(__EXTRALONG2_ISSET_ID); - } - - public void setExtraLong2IsSet(boolean value) { - __isset_bit_vector.set(__EXTRALONG2_ISSET_ID, value); - } - - public long getExtraLong3() { - return this.extraLong3; - } - - public void setExtraLong3(long extraLong3) { - this.extraLong3 = extraLong3; - setExtraLong3IsSet(true); - } - - public void unsetExtraLong3() { - __isset_bit_vector.clear(__EXTRALONG3_ISSET_ID); - } - - /** - * Returns true if field extraLong3 is set (has been assigned a value) and false otherwise - */ - public boolean isSetExtraLong3() { - return __isset_bit_vector.get(__EXTRALONG3_ISSET_ID); - } - - public void setExtraLong3IsSet(boolean value) { - __isset_bit_vector.set(__EXTRALONG3_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AGENT_ID: - if (value == null) { - unsetAgentId(); - } else { - setAgentId((String) value); - } - break; - - case REQUEST_HASH_CODE: - if (value == null) { - unsetRequestHashCode(); - } else { - setRequestHashCode((Integer) value); - } - break; - - case DATA_TYPE: - if (value == null) { - unsetDataType(); - } else { - setDataType((Integer) value); - } - break; - - case DATA_TIME: - if (value == null) { - unsetDataTime(); - } else { - setDataTime((Long) value); - } - break; - - case THREAD_CPUTIME: - if (value == null) { - unsetThreadCPUTime(); - } else { - setThreadCPUTime((Long) value); - } - break; - - case THREAD_USER_TIME: - if (value == null) { - unsetThreadUserTime(); - } else { - setThreadUserTime((Long) value); - } - break; - - case REQUEST_ID: - if (value == null) { - unsetRequestID(); - } else { - setRequestID((String) value); - } - break; - - case REQUEST_URL: - if (value == null) { - unsetRequestURL(); - } else { - setRequestURL((String) value); - } - break; - - case CLIENT_IP: - if (value == null) { - unsetClientIP(); - } else { - setClientIP((String) value); - } - break; - - case EXTRA_DATA1: - if (value == null) { - unsetExtraData1(); - } else { - setExtraData1((String) value); - } - break; - - case EXTRA_DATA2: - if (value == null) { - unsetExtraData2(); - } else { - setExtraData2((String) value); - } - break; - - case EXTRA_DATA3: - if (value == null) { - unsetExtraData3(); - } else { - setExtraData3((String) value); - } - break; - - case EXTRA_INT1: - if (value == null) { - unsetExtraInt1(); - } else { - setExtraInt1((Integer) value); - } - break; - - case EXTRA_INT2: - if (value == null) { - unsetExtraInt2(); - } else { - setExtraInt2((Integer) value); - } - break; - - case EXTRA_INT3: - if (value == null) { - unsetExtraInt3(); - } else { - setExtraInt3((Integer) value); - } - break; - - case EXTRA_LONG1: - if (value == null) { - unsetExtraLong1(); - } else { - setExtraLong1((Long) value); - } - break; - - case EXTRA_LONG2: - if (value == null) { - unsetExtraLong2(); - } else { - setExtraLong2((Long) value); - } - break; - - case EXTRA_LONG3: - if (value == null) { - unsetExtraLong3(); - } else { - setExtraLong3((Long) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AGENT_ID: - return getAgentId(); - - case REQUEST_HASH_CODE: - return Integer.valueOf(getRequestHashCode()); - - case DATA_TYPE: - return Integer.valueOf(getDataType()); - - case DATA_TIME: - return Long.valueOf(getDataTime()); - - case THREAD_CPUTIME: - return Long.valueOf(getThreadCPUTime()); - - case THREAD_USER_TIME: - return Long.valueOf(getThreadUserTime()); - - case REQUEST_ID: - return getRequestID(); - - case REQUEST_URL: - return getRequestURL(); - - case CLIENT_IP: - return getClientIP(); - - case EXTRA_DATA1: - return getExtraData1(); - - case EXTRA_DATA2: - return getExtraData2(); - - case EXTRA_DATA3: - return getExtraData3(); - - case EXTRA_INT1: - return Integer.valueOf(getExtraInt1()); - - case EXTRA_INT2: - return Integer.valueOf(getExtraInt2()); - - case EXTRA_INT3: - return Integer.valueOf(getExtraInt3()); - - case EXTRA_LONG1: - return Long.valueOf(getExtraLong1()); - - case EXTRA_LONG2: - return Long.valueOf(getExtraLong2()); - - case EXTRA_LONG3: - return Long.valueOf(getExtraLong3()); - - } - 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 AGENT_ID: - return isSetAgentId(); - case REQUEST_HASH_CODE: - return isSetRequestHashCode(); - case DATA_TYPE: - return isSetDataType(); - case DATA_TIME: - return isSetDataTime(); - case THREAD_CPUTIME: - return isSetThreadCPUTime(); - case THREAD_USER_TIME: - return isSetThreadUserTime(); - case REQUEST_ID: - return isSetRequestID(); - case REQUEST_URL: - return isSetRequestURL(); - case CLIENT_IP: - return isSetClientIP(); - case EXTRA_DATA1: - return isSetExtraData1(); - case EXTRA_DATA2: - return isSetExtraData2(); - case EXTRA_DATA3: - return isSetExtraData3(); - case EXTRA_INT1: - return isSetExtraInt1(); - case EXTRA_INT2: - return isSetExtraInt2(); - case EXTRA_INT3: - return isSetExtraInt3(); - case EXTRA_LONG1: - return isSetExtraLong1(); - case EXTRA_LONG2: - return isSetExtraLong2(); - case EXTRA_LONG3: - return isSetExtraLong3(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RequestThriftDTO) - return this.equals((RequestThriftDTO) that); - return false; - } - - public boolean equals(RequestThriftDTO that) { - if (that == null) - 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_requestHashCode = true; - boolean that_present_requestHashCode = true; - if (this_present_requestHashCode || that_present_requestHashCode) { - if (!(this_present_requestHashCode && that_present_requestHashCode)) - return false; - if (this.requestHashCode != that.requestHashCode) - return false; - } - - boolean this_present_dataType = true; - boolean that_present_dataType = true; - if (this_present_dataType || that_present_dataType) { - if (!(this_present_dataType && that_present_dataType)) - return false; - if (this.dataType != that.dataType) - return false; - } - - boolean this_present_dataTime = true; - boolean that_present_dataTime = true; - if (this_present_dataTime || that_present_dataTime) { - if (!(this_present_dataTime && that_present_dataTime)) - return false; - if (this.dataTime != that.dataTime) - return false; - } - - boolean this_present_threadCPUTime = true; - boolean that_present_threadCPUTime = true; - if (this_present_threadCPUTime || that_present_threadCPUTime) { - if (!(this_present_threadCPUTime && that_present_threadCPUTime)) - return false; - if (this.threadCPUTime != that.threadCPUTime) - return false; - } - - boolean this_present_threadUserTime = true; - boolean that_present_threadUserTime = true; - if (this_present_threadUserTime || that_present_threadUserTime) { - if (!(this_present_threadUserTime && that_present_threadUserTime)) - return false; - if (this.threadUserTime != that.threadUserTime) - return false; - } - - boolean this_present_requestID = true && this.isSetRequestID(); - boolean that_present_requestID = true && that.isSetRequestID(); - if (this_present_requestID || that_present_requestID) { - if (!(this_present_requestID && that_present_requestID)) - return false; - if (!this.requestID.equals(that.requestID)) - return false; - } - - boolean this_present_requestURL = true && this.isSetRequestURL(); - boolean that_present_requestURL = true && that.isSetRequestURL(); - if (this_present_requestURL || that_present_requestURL) { - if (!(this_present_requestURL && that_present_requestURL)) - return false; - if (!this.requestURL.equals(that.requestURL)) - return false; - } - - boolean this_present_clientIP = true && this.isSetClientIP(); - boolean that_present_clientIP = true && that.isSetClientIP(); - if (this_present_clientIP || that_present_clientIP) { - if (!(this_present_clientIP && that_present_clientIP)) - return false; - if (!this.clientIP.equals(that.clientIP)) - return false; - } - - boolean this_present_extraData1 = true && this.isSetExtraData1(); - boolean that_present_extraData1 = true && that.isSetExtraData1(); - if (this_present_extraData1 || that_present_extraData1) { - if (!(this_present_extraData1 && that_present_extraData1)) - return false; - if (!this.extraData1.equals(that.extraData1)) - return false; - } - - boolean this_present_extraData2 = true && this.isSetExtraData2(); - boolean that_present_extraData2 = true && that.isSetExtraData2(); - if (this_present_extraData2 || that_present_extraData2) { - if (!(this_present_extraData2 && that_present_extraData2)) - return false; - if (!this.extraData2.equals(that.extraData2)) - return false; - } - - boolean this_present_extraData3 = true && this.isSetExtraData3(); - boolean that_present_extraData3 = true && that.isSetExtraData3(); - if (this_present_extraData3 || that_present_extraData3) { - if (!(this_present_extraData3 && that_present_extraData3)) - return false; - if (!this.extraData3.equals(that.extraData3)) - return false; - } - - boolean this_present_extraInt1 = true && this.isSetExtraInt1(); - boolean that_present_extraInt1 = true && that.isSetExtraInt1(); - if (this_present_extraInt1 || that_present_extraInt1) { - if (!(this_present_extraInt1 && that_present_extraInt1)) - return false; - if (this.extraInt1 != that.extraInt1) - return false; - } - - boolean this_present_extraInt2 = true && this.isSetExtraInt2(); - boolean that_present_extraInt2 = true && that.isSetExtraInt2(); - if (this_present_extraInt2 || that_present_extraInt2) { - if (!(this_present_extraInt2 && that_present_extraInt2)) - return false; - if (this.extraInt2 != that.extraInt2) - return false; - } - - boolean this_present_extraInt3 = true && this.isSetExtraInt3(); - boolean that_present_extraInt3 = true && that.isSetExtraInt3(); - if (this_present_extraInt3 || that_present_extraInt3) { - if (!(this_present_extraInt3 && that_present_extraInt3)) - return false; - if (this.extraInt3 != that.extraInt3) - return false; - } - - boolean this_present_extraLong1 = true && this.isSetExtraLong1(); - boolean that_present_extraLong1 = true && that.isSetExtraLong1(); - if (this_present_extraLong1 || that_present_extraLong1) { - if (!(this_present_extraLong1 && that_present_extraLong1)) - return false; - if (this.extraLong1 != that.extraLong1) - return false; - } - - boolean this_present_extraLong2 = true && this.isSetExtraLong2(); - boolean that_present_extraLong2 = true && that.isSetExtraLong2(); - if (this_present_extraLong2 || that_present_extraLong2) { - if (!(this_present_extraLong2 && that_present_extraLong2)) - return false; - if (this.extraLong2 != that.extraLong2) - return false; - } - - boolean this_present_extraLong3 = true && this.isSetExtraLong3(); - boolean that_present_extraLong3 = true && that.isSetExtraLong3(); - if (this_present_extraLong3 || that_present_extraLong3) { - if (!(this_present_extraLong3 && that_present_extraLong3)) - return false; - if (this.extraLong3 != that.extraLong3) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(RequestThriftDTO other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - RequestThriftDTO typedOther = (RequestThriftDTO) other; - - 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(isSetRequestHashCode()).compareTo(typedOther.isSetRequestHashCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequestHashCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestHashCode, typedOther.requestHashCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDataType()).compareTo(typedOther.isSetDataType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDataType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, typedOther.dataType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDataTime()).compareTo(typedOther.isSetDataTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDataTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, typedOther.dataTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetThreadCPUTime()).compareTo(typedOther.isSetThreadCPUTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetThreadCPUTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threadCPUTime, typedOther.threadCPUTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetThreadUserTime()).compareTo(typedOther.isSetThreadUserTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetThreadUserTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threadUserTime, typedOther.threadUserTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRequestID()).compareTo(typedOther.isSetRequestID()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequestID()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestID, typedOther.requestID); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRequestURL()).compareTo(typedOther.isSetRequestURL()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequestURL()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestURL, typedOther.requestURL); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetClientIP()).compareTo(typedOther.isSetClientIP()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClientIP()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientIP, typedOther.clientIP); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraData1()).compareTo(typedOther.isSetExtraData1()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraData1()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData1, typedOther.extraData1); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraData2()).compareTo(typedOther.isSetExtraData2()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraData2()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData2, typedOther.extraData2); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraData3()).compareTo(typedOther.isSetExtraData3()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraData3()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData3, typedOther.extraData3); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraInt1()).compareTo(typedOther.isSetExtraInt1()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraInt1()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt1, typedOther.extraInt1); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraInt2()).compareTo(typedOther.isSetExtraInt2()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraInt2()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt2, typedOther.extraInt2); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraInt3()).compareTo(typedOther.isSetExtraInt3()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraInt3()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt3, typedOther.extraInt3); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraLong1()).compareTo(typedOther.isSetExtraLong1()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraLong1()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong1, typedOther.extraLong1); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraLong2()).compareTo(typedOther.isSetExtraLong2()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraLong2()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong2, typedOther.extraLong2); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetExtraLong3()).compareTo(typedOther.isSetExtraLong3()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtraLong3()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong3, typedOther.extraLong3); - 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("RequestThriftDTO("); - boolean first = true; - - sb.append("agentId:"); - if (this.agentId == null) { - sb.append("null"); - } else { - sb.append(this.agentId); - } - first = false; - if (!first) sb.append(", "); - sb.append("requestHashCode:"); - sb.append(this.requestHashCode); - first = false; - if (!first) sb.append(", "); - sb.append("dataType:"); - sb.append(this.dataType); - first = false; - if (!first) sb.append(", "); - sb.append("dataTime:"); - sb.append(this.dataTime); - first = false; - if (!first) sb.append(", "); - sb.append("threadCPUTime:"); - sb.append(this.threadCPUTime); - first = false; - if (!first) sb.append(", "); - sb.append("threadUserTime:"); - sb.append(this.threadUserTime); - first = false; - if (isSetRequestID()) { - if (!first) sb.append(", "); - sb.append("requestID:"); - if (this.requestID == null) { - sb.append("null"); - } else { - sb.append(this.requestID); - } - first = false; - } - if (isSetRequestURL()) { - if (!first) sb.append(", "); - sb.append("requestURL:"); - if (this.requestURL == null) { - sb.append("null"); - } else { - sb.append(this.requestURL); - } - first = false; - } - if (isSetClientIP()) { - if (!first) sb.append(", "); - sb.append("clientIP:"); - if (this.clientIP == null) { - sb.append("null"); - } else { - sb.append(this.clientIP); - } - first = false; - } - if (isSetExtraData1()) { - if (!first) sb.append(", "); - sb.append("extraData1:"); - if (this.extraData1 == null) { - sb.append("null"); - } else { - sb.append(this.extraData1); - } - first = false; - } - if (isSetExtraData2()) { - if (!first) sb.append(", "); - sb.append("extraData2:"); - if (this.extraData2 == null) { - sb.append("null"); - } else { - sb.append(this.extraData2); - } - first = false; - } - if (isSetExtraData3()) { - if (!first) sb.append(", "); - sb.append("extraData3:"); - if (this.extraData3 == null) { - sb.append("null"); - } else { - sb.append(this.extraData3); - } - first = false; - } - if (isSetExtraInt1()) { - if (!first) sb.append(", "); - sb.append("extraInt1:"); - sb.append(this.extraInt1); - first = false; - } - if (isSetExtraInt2()) { - if (!first) sb.append(", "); - sb.append("extraInt2:"); - sb.append(this.extraInt2); - first = false; - } - if (isSetExtraInt3()) { - if (!first) sb.append(", "); - sb.append("extraInt3:"); - sb.append(this.extraInt3); - first = false; - } - if (isSetExtraLong1()) { - if (!first) sb.append(", "); - sb.append("extraLong1:"); - sb.append(this.extraLong1); - first = false; - } - if (isSetExtraLong2()) { - if (!first) sb.append(", "); - sb.append("extraLong2:"); - sb.append(this.extraLong2); - first = false; - } - if (isSetExtraLong3()) { - if (!first) sb.append(", "); - sb.append("extraLong3:"); - sb.append(this.extraLong3); - 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 RequestThriftDTOStandardSchemeFactory implements SchemeFactory { - public RequestThriftDTOStandardScheme getScheme() { - return new RequestThriftDTOStandardScheme(); - } - } - - private static class RequestThriftDTOStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RequestThriftDTO 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: // 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 2: // REQUEST_HASH_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.requestHashCode = iprot.readI32(); - struct.setRequestHashCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // DATA_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.dataType = iprot.readI32(); - struct.setDataTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // DATA_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.dataTime = iprot.readI64(); - struct.setDataTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // THREAD_CPUTIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.threadCPUTime = iprot.readI64(); - struct.setThreadCPUTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // THREAD_USER_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.threadUserTime = iprot.readI64(); - struct.setThreadUserTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // REQUEST_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.requestID = iprot.readString(); - struct.setRequestIDIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // REQUEST_URL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.requestURL = iprot.readString(); - struct.setRequestURLIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // CLIENT_IP - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.clientIP = iprot.readString(); - struct.setClientIPIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // EXTRA_DATA1 - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.extraData1 = iprot.readString(); - struct.setExtraData1IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // EXTRA_DATA2 - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.extraData2 = iprot.readString(); - struct.setExtraData2IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // EXTRA_DATA3 - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.extraData3 = iprot.readString(); - struct.setExtraData3IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 13: // EXTRA_INT1 - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.extraInt1 = iprot.readI32(); - struct.setExtraInt1IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 14: // EXTRA_INT2 - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.extraInt2 = iprot.readI32(); - struct.setExtraInt2IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 15: // EXTRA_INT3 - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.extraInt3 = iprot.readI32(); - struct.setExtraInt3IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 16: // EXTRA_LONG1 - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.extraLong1 = iprot.readI64(); - struct.setExtraLong1IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 17: // EXTRA_LONG2 - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.extraLong2 = iprot.readI64(); - struct.setExtraLong2IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 18: // EXTRA_LONG3 - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.extraLong3 = iprot.readI64(); - struct.setExtraLong3IsSet(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, RequestThriftDTO struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.agentId != null) { - oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); - oprot.writeString(struct.agentId); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(REQUEST_HASH_CODE_FIELD_DESC); - oprot.writeI32(struct.requestHashCode); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DATA_TYPE_FIELD_DESC); - oprot.writeI32(struct.dataType); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DATA_TIME_FIELD_DESC); - oprot.writeI64(struct.dataTime); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(THREAD_CPUTIME_FIELD_DESC); - oprot.writeI64(struct.threadCPUTime); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(THREAD_USER_TIME_FIELD_DESC); - oprot.writeI64(struct.threadUserTime); - oprot.writeFieldEnd(); - if (struct.requestID != null) { - if (struct.isSetRequestID()) { - oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC); - oprot.writeString(struct.requestID); - oprot.writeFieldEnd(); - } - } - if (struct.requestURL != null) { - if (struct.isSetRequestURL()) { - oprot.writeFieldBegin(REQUEST_URL_FIELD_DESC); - oprot.writeString(struct.requestURL); - oprot.writeFieldEnd(); - } - } - if (struct.clientIP != null) { - if (struct.isSetClientIP()) { - oprot.writeFieldBegin(CLIENT_IP_FIELD_DESC); - oprot.writeString(struct.clientIP); - oprot.writeFieldEnd(); - } - } - if (struct.extraData1 != null) { - if (struct.isSetExtraData1()) { - oprot.writeFieldBegin(EXTRA_DATA1_FIELD_DESC); - oprot.writeString(struct.extraData1); - oprot.writeFieldEnd(); - } - } - if (struct.extraData2 != null) { - if (struct.isSetExtraData2()) { - oprot.writeFieldBegin(EXTRA_DATA2_FIELD_DESC); - oprot.writeString(struct.extraData2); - oprot.writeFieldEnd(); - } - } - if (struct.extraData3 != null) { - if (struct.isSetExtraData3()) { - oprot.writeFieldBegin(EXTRA_DATA3_FIELD_DESC); - oprot.writeString(struct.extraData3); - oprot.writeFieldEnd(); - } - } - if (struct.isSetExtraInt1()) { - oprot.writeFieldBegin(EXTRA_INT1_FIELD_DESC); - oprot.writeI32(struct.extraInt1); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraInt2()) { - oprot.writeFieldBegin(EXTRA_INT2_FIELD_DESC); - oprot.writeI32(struct.extraInt2); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraInt3()) { - oprot.writeFieldBegin(EXTRA_INT3_FIELD_DESC); - oprot.writeI32(struct.extraInt3); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraLong1()) { - oprot.writeFieldBegin(EXTRA_LONG1_FIELD_DESC); - oprot.writeI64(struct.extraLong1); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraLong2()) { - oprot.writeFieldBegin(EXTRA_LONG2_FIELD_DESC); - oprot.writeI64(struct.extraLong2); - oprot.writeFieldEnd(); - } - if (struct.isSetExtraLong3()) { - oprot.writeFieldBegin(EXTRA_LONG3_FIELD_DESC); - oprot.writeI64(struct.extraLong3); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class RequestThriftDTOTupleSchemeFactory implements SchemeFactory { - public RequestThriftDTOTupleScheme getScheme() { - return new RequestThriftDTOTupleScheme(); - } - } - - private static class RequestThriftDTOTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RequestThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAgentId()) { - optionals.set(0); - } - if (struct.isSetRequestHashCode()) { - optionals.set(1); - } - if (struct.isSetDataType()) { - optionals.set(2); - } - if (struct.isSetDataTime()) { - optionals.set(3); - } - if (struct.isSetThreadCPUTime()) { - optionals.set(4); - } - if (struct.isSetThreadUserTime()) { - optionals.set(5); - } - if (struct.isSetRequestID()) { - optionals.set(6); - } - if (struct.isSetRequestURL()) { - optionals.set(7); - } - if (struct.isSetClientIP()) { - optionals.set(8); - } - if (struct.isSetExtraData1()) { - optionals.set(9); - } - if (struct.isSetExtraData2()) { - optionals.set(10); - } - if (struct.isSetExtraData3()) { - optionals.set(11); - } - if (struct.isSetExtraInt1()) { - optionals.set(12); - } - if (struct.isSetExtraInt2()) { - optionals.set(13); - } - if (struct.isSetExtraInt3()) { - optionals.set(14); - } - if (struct.isSetExtraLong1()) { - optionals.set(15); - } - if (struct.isSetExtraLong2()) { - optionals.set(16); - } - if (struct.isSetExtraLong3()) { - optionals.set(17); - } - oprot.writeBitSet(optionals, 18); - if (struct.isSetAgentId()) { - oprot.writeString(struct.agentId); - } - if (struct.isSetRequestHashCode()) { - oprot.writeI32(struct.requestHashCode); - } - if (struct.isSetDataType()) { - oprot.writeI32(struct.dataType); - } - if (struct.isSetDataTime()) { - oprot.writeI64(struct.dataTime); - } - if (struct.isSetThreadCPUTime()) { - oprot.writeI64(struct.threadCPUTime); - } - if (struct.isSetThreadUserTime()) { - oprot.writeI64(struct.threadUserTime); - } - if (struct.isSetRequestID()) { - oprot.writeString(struct.requestID); - } - if (struct.isSetRequestURL()) { - oprot.writeString(struct.requestURL); - } - if (struct.isSetClientIP()) { - oprot.writeString(struct.clientIP); - } - if (struct.isSetExtraData1()) { - oprot.writeString(struct.extraData1); - } - if (struct.isSetExtraData2()) { - oprot.writeString(struct.extraData2); - } - if (struct.isSetExtraData3()) { - oprot.writeString(struct.extraData3); - } - if (struct.isSetExtraInt1()) { - oprot.writeI32(struct.extraInt1); - } - if (struct.isSetExtraInt2()) { - oprot.writeI32(struct.extraInt2); - } - if (struct.isSetExtraInt3()) { - oprot.writeI32(struct.extraInt3); - } - if (struct.isSetExtraLong1()) { - oprot.writeI64(struct.extraLong1); - } - if (struct.isSetExtraLong2()) { - oprot.writeI64(struct.extraLong2); - } - if (struct.isSetExtraLong3()) { - oprot.writeI64(struct.extraLong3); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RequestThriftDTO struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(18); - if (incoming.get(0)) { - struct.agentId = iprot.readString(); - struct.setAgentIdIsSet(true); - } - if (incoming.get(1)) { - struct.requestHashCode = iprot.readI32(); - struct.setRequestHashCodeIsSet(true); - } - if (incoming.get(2)) { - struct.dataType = iprot.readI32(); - struct.setDataTypeIsSet(true); - } - if (incoming.get(3)) { - struct.dataTime = iprot.readI64(); - struct.setDataTimeIsSet(true); - } - if (incoming.get(4)) { - struct.threadCPUTime = iprot.readI64(); - struct.setThreadCPUTimeIsSet(true); - } - if (incoming.get(5)) { - struct.threadUserTime = iprot.readI64(); - struct.setThreadUserTimeIsSet(true); - } - if (incoming.get(6)) { - struct.requestID = iprot.readString(); - struct.setRequestIDIsSet(true); - } - if (incoming.get(7)) { - struct.requestURL = iprot.readString(); - struct.setRequestURLIsSet(true); - } - if (incoming.get(8)) { - struct.clientIP = iprot.readString(); - struct.setClientIPIsSet(true); - } - if (incoming.get(9)) { - struct.extraData1 = iprot.readString(); - struct.setExtraData1IsSet(true); - } - if (incoming.get(10)) { - struct.extraData2 = iprot.readString(); - struct.setExtraData2IsSet(true); - } - if (incoming.get(11)) { - struct.extraData3 = iprot.readString(); - struct.setExtraData3IsSet(true); - } - if (incoming.get(12)) { - struct.extraInt1 = iprot.readI32(); - struct.setExtraInt1IsSet(true); - } - if (incoming.get(13)) { - struct.extraInt2 = iprot.readI32(); - struct.setExtraInt2IsSet(true); - } - if (incoming.get(14)) { - struct.extraInt3 = iprot.readI32(); - struct.setExtraInt3IsSet(true); - } - if (incoming.get(15)) { - struct.extraLong1 = iprot.readI64(); - struct.setExtraLong1IsSet(true); - } - if (incoming.get(16)) { - struct.extraLong2 = iprot.readI64(); - struct.setExtraLong2IsSet(true); - } - if (incoming.get(17)) { - struct.extraLong3 = iprot.readI64(); - struct.setExtraLong3IsSet(true); - } - } - } - -} - +/** + * 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 RequestThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RequestThriftDTO"); + + 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)1); + private static final org.apache.thrift.protocol.TField REQUEST_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("requestHashCode", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataType", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField DATA_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("dataTime", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField THREAD_CPUTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("threadCPUTime", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField THREAD_USER_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("threadUserTime", org.apache.thrift.protocol.TType.I64, (short)6); + private static final org.apache.thrift.protocol.TField REQUEST_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("requestID", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField REQUEST_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("requestURL", org.apache.thrift.protocol.TType.STRING, (short)8); + private static final org.apache.thrift.protocol.TField CLIENT_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("clientIP", org.apache.thrift.protocol.TType.STRING, (short)9); + private static final org.apache.thrift.protocol.TField EXTRA_DATA1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData1", org.apache.thrift.protocol.TType.STRING, (short)10); + private static final org.apache.thrift.protocol.TField EXTRA_DATA2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData2", org.apache.thrift.protocol.TType.STRING, (short)11); + private static final org.apache.thrift.protocol.TField EXTRA_DATA3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraData3", org.apache.thrift.protocol.TType.STRING, (short)12); + private static final org.apache.thrift.protocol.TField EXTRA_INT1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt1", org.apache.thrift.protocol.TType.I32, (short)13); + private static final org.apache.thrift.protocol.TField EXTRA_INT2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt2", org.apache.thrift.protocol.TType.I32, (short)14); + private static final org.apache.thrift.protocol.TField EXTRA_INT3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraInt3", org.apache.thrift.protocol.TType.I32, (short)15); + private static final org.apache.thrift.protocol.TField EXTRA_LONG1_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong1", org.apache.thrift.protocol.TType.I64, (short)16); + private static final org.apache.thrift.protocol.TField EXTRA_LONG2_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong2", org.apache.thrift.protocol.TType.I64, (short)17); + private static final org.apache.thrift.protocol.TField EXTRA_LONG3_FIELD_DESC = new org.apache.thrift.protocol.TField("extraLong3", org.apache.thrift.protocol.TType.I64, (short)18); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RequestThriftDTOStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RequestThriftDTOTupleSchemeFactory()); + } + + private String agentId; // required + private int requestHashCode; // required + private int dataType; // required + private long dataTime; // required + private long threadCPUTime; // required + private long threadUserTime; // required + private String requestID; // optional + private String requestURL; // optional + private String clientIP; // optional + private String extraData1; // optional + private String extraData2; // optional + private String extraData3; // optional + private int extraInt1; // optional + private int extraInt2; // optional + private int extraInt3; // optional + private long extraLong1; // optional + private long extraLong2; // optional + private long extraLong3; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + AGENT_ID((short)1, "agentId"), + REQUEST_HASH_CODE((short)2, "requestHashCode"), + DATA_TYPE((short)3, "dataType"), + DATA_TIME((short)4, "dataTime"), + THREAD_CPUTIME((short)5, "threadCPUTime"), + THREAD_USER_TIME((short)6, "threadUserTime"), + REQUEST_ID((short)7, "requestID"), + REQUEST_URL((short)8, "requestURL"), + CLIENT_IP((short)9, "clientIP"), + EXTRA_DATA1((short)10, "extraData1"), + EXTRA_DATA2((short)11, "extraData2"), + EXTRA_DATA3((short)12, "extraData3"), + EXTRA_INT1((short)13, "extraInt1"), + EXTRA_INT2((short)14, "extraInt2"), + EXTRA_INT3((short)15, "extraInt3"), + EXTRA_LONG1((short)16, "extraLong1"), + EXTRA_LONG2((short)17, "extraLong2"), + EXTRA_LONG3((short)18, "extraLong3"); + + 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: // AGENT_ID + return AGENT_ID; + case 2: // REQUEST_HASH_CODE + return REQUEST_HASH_CODE; + case 3: // DATA_TYPE + return DATA_TYPE; + case 4: // DATA_TIME + return DATA_TIME; + case 5: // THREAD_CPUTIME + return THREAD_CPUTIME; + case 6: // THREAD_USER_TIME + return THREAD_USER_TIME; + case 7: // REQUEST_ID + return REQUEST_ID; + case 8: // REQUEST_URL + return REQUEST_URL; + case 9: // CLIENT_IP + return CLIENT_IP; + case 10: // EXTRA_DATA1 + return EXTRA_DATA1; + case 11: // EXTRA_DATA2 + return EXTRA_DATA2; + case 12: // EXTRA_DATA3 + return EXTRA_DATA3; + case 13: // EXTRA_INT1 + return EXTRA_INT1; + case 14: // EXTRA_INT2 + return EXTRA_INT2; + case 15: // EXTRA_INT3 + return EXTRA_INT3; + case 16: // EXTRA_LONG1 + return EXTRA_LONG1; + case 17: // EXTRA_LONG2 + return EXTRA_LONG2; + case 18: // EXTRA_LONG3 + return EXTRA_LONG3; + 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 __REQUESTHASHCODE_ISSET_ID = 0; + private static final int __DATATYPE_ISSET_ID = 1; + private static final int __DATATIME_ISSET_ID = 2; + private static final int __THREADCPUTIME_ISSET_ID = 3; + private static final int __THREADUSERTIME_ISSET_ID = 4; + private static final int __EXTRAINT1_ISSET_ID = 5; + private static final int __EXTRAINT2_ISSET_ID = 6; + private static final int __EXTRAINT3_ISSET_ID = 7; + private static final int __EXTRALONG1_ISSET_ID = 8; + private static final int __EXTRALONG2_ISSET_ID = 9; + private static final int __EXTRALONG3_ISSET_ID = 10; + private BitSet __isset_bit_vector = new BitSet(11); + private _Fields optionals[] = {_Fields.REQUEST_ID,_Fields.REQUEST_URL,_Fields.CLIENT_IP,_Fields.EXTRA_DATA1,_Fields.EXTRA_DATA2,_Fields.EXTRA_DATA3,_Fields.EXTRA_INT1,_Fields.EXTRA_INT2,_Fields.EXTRA_INT3,_Fields.EXTRA_LONG1,_Fields.EXTRA_LONG2,_Fields.EXTRA_LONG3}; + 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.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.REQUEST_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("requestHashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.DATA_TIME, new org.apache.thrift.meta_data.FieldMetaData("dataTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.THREAD_CPUTIME, new org.apache.thrift.meta_data.FieldMetaData("threadCPUTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.THREAD_USER_TIME, new org.apache.thrift.meta_data.FieldMetaData("threadUserTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.REQUEST_ID, new org.apache.thrift.meta_data.FieldMetaData("requestID", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.REQUEST_URL, new org.apache.thrift.meta_data.FieldMetaData("requestURL", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CLIENT_IP, new org.apache.thrift.meta_data.FieldMetaData("clientIP", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_DATA1, new org.apache.thrift.meta_data.FieldMetaData("extraData1", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_DATA2, new org.apache.thrift.meta_data.FieldMetaData("extraData2", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_DATA3, new org.apache.thrift.meta_data.FieldMetaData("extraData3", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EXTRA_INT1, new org.apache.thrift.meta_data.FieldMetaData("extraInt1", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.EXTRA_INT2, new org.apache.thrift.meta_data.FieldMetaData("extraInt2", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.EXTRA_INT3, new org.apache.thrift.meta_data.FieldMetaData("extraInt3", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.EXTRA_LONG1, new org.apache.thrift.meta_data.FieldMetaData("extraLong1", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.EXTRA_LONG2, new org.apache.thrift.meta_data.FieldMetaData("extraLong2", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.EXTRA_LONG3, new org.apache.thrift.meta_data.FieldMetaData("extraLong3", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestThriftDTO.class, metaDataMap); + } + + public RequestThriftDTO() { + } + + public RequestThriftDTO( + String agentId, + int requestHashCode, + int dataType, + long dataTime, + long threadCPUTime, + long threadUserTime) + { + this(); + this.agentId = agentId; + this.requestHashCode = requestHashCode; + setRequestHashCodeIsSet(true); + this.dataType = dataType; + setDataTypeIsSet(true); + this.dataTime = dataTime; + setDataTimeIsSet(true); + this.threadCPUTime = threadCPUTime; + setThreadCPUTimeIsSet(true); + this.threadUserTime = threadUserTime; + setThreadUserTimeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public RequestThriftDTO(RequestThriftDTO other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.requestHashCode = other.requestHashCode; + this.dataType = other.dataType; + this.dataTime = other.dataTime; + this.threadCPUTime = other.threadCPUTime; + this.threadUserTime = other.threadUserTime; + if (other.isSetRequestID()) { + this.requestID = other.requestID; + } + if (other.isSetRequestURL()) { + this.requestURL = other.requestURL; + } + if (other.isSetClientIP()) { + this.clientIP = other.clientIP; + } + if (other.isSetExtraData1()) { + this.extraData1 = other.extraData1; + } + if (other.isSetExtraData2()) { + this.extraData2 = other.extraData2; + } + if (other.isSetExtraData3()) { + this.extraData3 = other.extraData3; + } + this.extraInt1 = other.extraInt1; + this.extraInt2 = other.extraInt2; + this.extraInt3 = other.extraInt3; + this.extraLong1 = other.extraLong1; + this.extraLong2 = other.extraLong2; + this.extraLong3 = other.extraLong3; + } + + public RequestThriftDTO deepCopy() { + return new RequestThriftDTO(this); + } + + @Override + public void clear() { + this.agentId = null; + setRequestHashCodeIsSet(false); + this.requestHashCode = 0; + setDataTypeIsSet(false); + this.dataType = 0; + setDataTimeIsSet(false); + this.dataTime = 0; + setThreadCPUTimeIsSet(false); + this.threadCPUTime = 0; + setThreadUserTimeIsSet(false); + this.threadUserTime = 0; + this.requestID = null; + this.requestURL = null; + this.clientIP = null; + this.extraData1 = null; + this.extraData2 = null; + this.extraData3 = null; + setExtraInt1IsSet(false); + this.extraInt1 = 0; + setExtraInt2IsSet(false); + this.extraInt2 = 0; + setExtraInt3IsSet(false); + this.extraInt3 = 0; + setExtraLong1IsSet(false); + this.extraLong1 = 0; + setExtraLong2IsSet(false); + this.extraLong2 = 0; + setExtraLong3IsSet(false); + this.extraLong3 = 0; + } + + 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 int getRequestHashCode() { + return this.requestHashCode; + } + + public void setRequestHashCode(int requestHashCode) { + this.requestHashCode = requestHashCode; + setRequestHashCodeIsSet(true); + } + + public void unsetRequestHashCode() { + __isset_bit_vector.clear(__REQUESTHASHCODE_ISSET_ID); + } + + /** Returns true if field requestHashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestHashCode() { + return __isset_bit_vector.get(__REQUESTHASHCODE_ISSET_ID); + } + + public void setRequestHashCodeIsSet(boolean value) { + __isset_bit_vector.set(__REQUESTHASHCODE_ISSET_ID, value); + } + + public int getDataType() { + return this.dataType; + } + + public void setDataType(int dataType) { + this.dataType = dataType; + setDataTypeIsSet(true); + } + + public void unsetDataType() { + __isset_bit_vector.clear(__DATATYPE_ISSET_ID); + } + + /** Returns true if field dataType is set (has been assigned a value) and false otherwise */ + public boolean isSetDataType() { + return __isset_bit_vector.get(__DATATYPE_ISSET_ID); + } + + public void setDataTypeIsSet(boolean value) { + __isset_bit_vector.set(__DATATYPE_ISSET_ID, value); + } + + public long getDataTime() { + return this.dataTime; + } + + public void setDataTime(long dataTime) { + this.dataTime = dataTime; + setDataTimeIsSet(true); + } + + public void unsetDataTime() { + __isset_bit_vector.clear(__DATATIME_ISSET_ID); + } + + /** Returns true if field dataTime is set (has been assigned a value) and false otherwise */ + public boolean isSetDataTime() { + return __isset_bit_vector.get(__DATATIME_ISSET_ID); + } + + public void setDataTimeIsSet(boolean value) { + __isset_bit_vector.set(__DATATIME_ISSET_ID, value); + } + + public long getThreadCPUTime() { + return this.threadCPUTime; + } + + public void setThreadCPUTime(long threadCPUTime) { + this.threadCPUTime = threadCPUTime; + setThreadCPUTimeIsSet(true); + } + + public void unsetThreadCPUTime() { + __isset_bit_vector.clear(__THREADCPUTIME_ISSET_ID); + } + + /** Returns true if field threadCPUTime is set (has been assigned a value) and false otherwise */ + public boolean isSetThreadCPUTime() { + return __isset_bit_vector.get(__THREADCPUTIME_ISSET_ID); + } + + public void setThreadCPUTimeIsSet(boolean value) { + __isset_bit_vector.set(__THREADCPUTIME_ISSET_ID, value); + } + + public long getThreadUserTime() { + return this.threadUserTime; + } + + public void setThreadUserTime(long threadUserTime) { + this.threadUserTime = threadUserTime; + setThreadUserTimeIsSet(true); + } + + public void unsetThreadUserTime() { + __isset_bit_vector.clear(__THREADUSERTIME_ISSET_ID); + } + + /** Returns true if field threadUserTime is set (has been assigned a value) and false otherwise */ + public boolean isSetThreadUserTime() { + return __isset_bit_vector.get(__THREADUSERTIME_ISSET_ID); + } + + public void setThreadUserTimeIsSet(boolean value) { + __isset_bit_vector.set(__THREADUSERTIME_ISSET_ID, value); + } + + public String getRequestID() { + return this.requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + public void unsetRequestID() { + this.requestID = null; + } + + /** Returns true if field requestID is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestID() { + return this.requestID != null; + } + + public void setRequestIDIsSet(boolean value) { + if (!value) { + this.requestID = null; + } + } + + public String getRequestURL() { + return this.requestURL; + } + + public void setRequestURL(String requestURL) { + this.requestURL = requestURL; + } + + public void unsetRequestURL() { + this.requestURL = null; + } + + /** Returns true if field requestURL is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestURL() { + return this.requestURL != null; + } + + public void setRequestURLIsSet(boolean value) { + if (!value) { + this.requestURL = null; + } + } + + public String getClientIP() { + return this.clientIP; + } + + public void setClientIP(String clientIP) { + this.clientIP = clientIP; + } + + public void unsetClientIP() { + this.clientIP = null; + } + + /** Returns true if field clientIP is set (has been assigned a value) and false otherwise */ + public boolean isSetClientIP() { + return this.clientIP != null; + } + + public void setClientIPIsSet(boolean value) { + if (!value) { + this.clientIP = null; + } + } + + public String getExtraData1() { + return this.extraData1; + } + + public void setExtraData1(String extraData1) { + this.extraData1 = extraData1; + } + + public void unsetExtraData1() { + this.extraData1 = null; + } + + /** Returns true if field extraData1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraData1() { + return this.extraData1 != null; + } + + public void setExtraData1IsSet(boolean value) { + if (!value) { + this.extraData1 = null; + } + } + + public String getExtraData2() { + return this.extraData2; + } + + public void setExtraData2(String extraData2) { + this.extraData2 = extraData2; + } + + public void unsetExtraData2() { + this.extraData2 = null; + } + + /** Returns true if field extraData2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraData2() { + return this.extraData2 != null; + } + + public void setExtraData2IsSet(boolean value) { + if (!value) { + this.extraData2 = null; + } + } + + public String getExtraData3() { + return this.extraData3; + } + + public void setExtraData3(String extraData3) { + this.extraData3 = extraData3; + } + + public void unsetExtraData3() { + this.extraData3 = null; + } + + /** Returns true if field extraData3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraData3() { + return this.extraData3 != null; + } + + public void setExtraData3IsSet(boolean value) { + if (!value) { + this.extraData3 = null; + } + } + + public int getExtraInt1() { + return this.extraInt1; + } + + public void setExtraInt1(int extraInt1) { + this.extraInt1 = extraInt1; + setExtraInt1IsSet(true); + } + + public void unsetExtraInt1() { + __isset_bit_vector.clear(__EXTRAINT1_ISSET_ID); + } + + /** Returns true if field extraInt1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt1() { + return __isset_bit_vector.get(__EXTRAINT1_ISSET_ID); + } + + public void setExtraInt1IsSet(boolean value) { + __isset_bit_vector.set(__EXTRAINT1_ISSET_ID, value); + } + + public int getExtraInt2() { + return this.extraInt2; + } + + public void setExtraInt2(int extraInt2) { + this.extraInt2 = extraInt2; + setExtraInt2IsSet(true); + } + + public void unsetExtraInt2() { + __isset_bit_vector.clear(__EXTRAINT2_ISSET_ID); + } + + /** Returns true if field extraInt2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt2() { + return __isset_bit_vector.get(__EXTRAINT2_ISSET_ID); + } + + public void setExtraInt2IsSet(boolean value) { + __isset_bit_vector.set(__EXTRAINT2_ISSET_ID, value); + } + + public int getExtraInt3() { + return this.extraInt3; + } + + public void setExtraInt3(int extraInt3) { + this.extraInt3 = extraInt3; + setExtraInt3IsSet(true); + } + + public void unsetExtraInt3() { + __isset_bit_vector.clear(__EXTRAINT3_ISSET_ID); + } + + /** Returns true if field extraInt3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt3() { + return __isset_bit_vector.get(__EXTRAINT3_ISSET_ID); + } + + public void setExtraInt3IsSet(boolean value) { + __isset_bit_vector.set(__EXTRAINT3_ISSET_ID, value); + } + + public long getExtraLong1() { + return this.extraLong1; + } + + public void setExtraLong1(long extraLong1) { + this.extraLong1 = extraLong1; + setExtraLong1IsSet(true); + } + + public void unsetExtraLong1() { + __isset_bit_vector.clear(__EXTRALONG1_ISSET_ID); + } + + /** Returns true if field extraLong1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong1() { + return __isset_bit_vector.get(__EXTRALONG1_ISSET_ID); + } + + public void setExtraLong1IsSet(boolean value) { + __isset_bit_vector.set(__EXTRALONG1_ISSET_ID, value); + } + + public long getExtraLong2() { + return this.extraLong2; + } + + public void setExtraLong2(long extraLong2) { + this.extraLong2 = extraLong2; + setExtraLong2IsSet(true); + } + + public void unsetExtraLong2() { + __isset_bit_vector.clear(__EXTRALONG2_ISSET_ID); + } + + /** Returns true if field extraLong2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong2() { + return __isset_bit_vector.get(__EXTRALONG2_ISSET_ID); + } + + public void setExtraLong2IsSet(boolean value) { + __isset_bit_vector.set(__EXTRALONG2_ISSET_ID, value); + } + + public long getExtraLong3() { + return this.extraLong3; + } + + public void setExtraLong3(long extraLong3) { + this.extraLong3 = extraLong3; + setExtraLong3IsSet(true); + } + + public void unsetExtraLong3() { + __isset_bit_vector.clear(__EXTRALONG3_ISSET_ID); + } + + /** Returns true if field extraLong3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong3() { + return __isset_bit_vector.get(__EXTRALONG3_ISSET_ID); + } + + public void setExtraLong3IsSet(boolean value) { + __isset_bit_vector.set(__EXTRALONG3_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case REQUEST_HASH_CODE: + if (value == null) { + unsetRequestHashCode(); + } else { + setRequestHashCode((Integer)value); + } + break; + + case DATA_TYPE: + if (value == null) { + unsetDataType(); + } else { + setDataType((Integer)value); + } + break; + + case DATA_TIME: + if (value == null) { + unsetDataTime(); + } else { + setDataTime((Long)value); + } + break; + + case THREAD_CPUTIME: + if (value == null) { + unsetThreadCPUTime(); + } else { + setThreadCPUTime((Long)value); + } + break; + + case THREAD_USER_TIME: + if (value == null) { + unsetThreadUserTime(); + } else { + setThreadUserTime((Long)value); + } + break; + + case REQUEST_ID: + if (value == null) { + unsetRequestID(); + } else { + setRequestID((String)value); + } + break; + + case REQUEST_URL: + if (value == null) { + unsetRequestURL(); + } else { + setRequestURL((String)value); + } + break; + + case CLIENT_IP: + if (value == null) { + unsetClientIP(); + } else { + setClientIP((String)value); + } + break; + + case EXTRA_DATA1: + if (value == null) { + unsetExtraData1(); + } else { + setExtraData1((String)value); + } + break; + + case EXTRA_DATA2: + if (value == null) { + unsetExtraData2(); + } else { + setExtraData2((String)value); + } + break; + + case EXTRA_DATA3: + if (value == null) { + unsetExtraData3(); + } else { + setExtraData3((String)value); + } + break; + + case EXTRA_INT1: + if (value == null) { + unsetExtraInt1(); + } else { + setExtraInt1((Integer)value); + } + break; + + case EXTRA_INT2: + if (value == null) { + unsetExtraInt2(); + } else { + setExtraInt2((Integer)value); + } + break; + + case EXTRA_INT3: + if (value == null) { + unsetExtraInt3(); + } else { + setExtraInt3((Integer)value); + } + break; + + case EXTRA_LONG1: + if (value == null) { + unsetExtraLong1(); + } else { + setExtraLong1((Long)value); + } + break; + + case EXTRA_LONG2: + if (value == null) { + unsetExtraLong2(); + } else { + setExtraLong2((Long)value); + } + break; + + case EXTRA_LONG3: + if (value == null) { + unsetExtraLong3(); + } else { + setExtraLong3((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case REQUEST_HASH_CODE: + return Integer.valueOf(getRequestHashCode()); + + case DATA_TYPE: + return Integer.valueOf(getDataType()); + + case DATA_TIME: + return Long.valueOf(getDataTime()); + + case THREAD_CPUTIME: + return Long.valueOf(getThreadCPUTime()); + + case THREAD_USER_TIME: + return Long.valueOf(getThreadUserTime()); + + case REQUEST_ID: + return getRequestID(); + + case REQUEST_URL: + return getRequestURL(); + + case CLIENT_IP: + return getClientIP(); + + case EXTRA_DATA1: + return getExtraData1(); + + case EXTRA_DATA2: + return getExtraData2(); + + case EXTRA_DATA3: + return getExtraData3(); + + case EXTRA_INT1: + return Integer.valueOf(getExtraInt1()); + + case EXTRA_INT2: + return Integer.valueOf(getExtraInt2()); + + case EXTRA_INT3: + return Integer.valueOf(getExtraInt3()); + + case EXTRA_LONG1: + return Long.valueOf(getExtraLong1()); + + case EXTRA_LONG2: + return Long.valueOf(getExtraLong2()); + + case EXTRA_LONG3: + return Long.valueOf(getExtraLong3()); + + } + 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 AGENT_ID: + return isSetAgentId(); + case REQUEST_HASH_CODE: + return isSetRequestHashCode(); + case DATA_TYPE: + return isSetDataType(); + case DATA_TIME: + return isSetDataTime(); + case THREAD_CPUTIME: + return isSetThreadCPUTime(); + case THREAD_USER_TIME: + return isSetThreadUserTime(); + case REQUEST_ID: + return isSetRequestID(); + case REQUEST_URL: + return isSetRequestURL(); + case CLIENT_IP: + return isSetClientIP(); + case EXTRA_DATA1: + return isSetExtraData1(); + case EXTRA_DATA2: + return isSetExtraData2(); + case EXTRA_DATA3: + return isSetExtraData3(); + case EXTRA_INT1: + return isSetExtraInt1(); + case EXTRA_INT2: + return isSetExtraInt2(); + case EXTRA_INT3: + return isSetExtraInt3(); + case EXTRA_LONG1: + return isSetExtraLong1(); + case EXTRA_LONG2: + return isSetExtraLong2(); + case EXTRA_LONG3: + return isSetExtraLong3(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof RequestThriftDTO) + return this.equals((RequestThriftDTO)that); + return false; + } + + public boolean equals(RequestThriftDTO that) { + if (that == null) + 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_requestHashCode = true; + boolean that_present_requestHashCode = true; + if (this_present_requestHashCode || that_present_requestHashCode) { + if (!(this_present_requestHashCode && that_present_requestHashCode)) + return false; + if (this.requestHashCode != that.requestHashCode) + return false; + } + + boolean this_present_dataType = true; + boolean that_present_dataType = true; + if (this_present_dataType || that_present_dataType) { + if (!(this_present_dataType && that_present_dataType)) + return false; + if (this.dataType != that.dataType) + return false; + } + + boolean this_present_dataTime = true; + boolean that_present_dataTime = true; + if (this_present_dataTime || that_present_dataTime) { + if (!(this_present_dataTime && that_present_dataTime)) + return false; + if (this.dataTime != that.dataTime) + return false; + } + + boolean this_present_threadCPUTime = true; + boolean that_present_threadCPUTime = true; + if (this_present_threadCPUTime || that_present_threadCPUTime) { + if (!(this_present_threadCPUTime && that_present_threadCPUTime)) + return false; + if (this.threadCPUTime != that.threadCPUTime) + return false; + } + + boolean this_present_threadUserTime = true; + boolean that_present_threadUserTime = true; + if (this_present_threadUserTime || that_present_threadUserTime) { + if (!(this_present_threadUserTime && that_present_threadUserTime)) + return false; + if (this.threadUserTime != that.threadUserTime) + return false; + } + + boolean this_present_requestID = true && this.isSetRequestID(); + boolean that_present_requestID = true && that.isSetRequestID(); + if (this_present_requestID || that_present_requestID) { + if (!(this_present_requestID && that_present_requestID)) + return false; + if (!this.requestID.equals(that.requestID)) + return false; + } + + boolean this_present_requestURL = true && this.isSetRequestURL(); + boolean that_present_requestURL = true && that.isSetRequestURL(); + if (this_present_requestURL || that_present_requestURL) { + if (!(this_present_requestURL && that_present_requestURL)) + return false; + if (!this.requestURL.equals(that.requestURL)) + return false; + } + + boolean this_present_clientIP = true && this.isSetClientIP(); + boolean that_present_clientIP = true && that.isSetClientIP(); + if (this_present_clientIP || that_present_clientIP) { + if (!(this_present_clientIP && that_present_clientIP)) + return false; + if (!this.clientIP.equals(that.clientIP)) + return false; + } + + boolean this_present_extraData1 = true && this.isSetExtraData1(); + boolean that_present_extraData1 = true && that.isSetExtraData1(); + if (this_present_extraData1 || that_present_extraData1) { + if (!(this_present_extraData1 && that_present_extraData1)) + return false; + if (!this.extraData1.equals(that.extraData1)) + return false; + } + + boolean this_present_extraData2 = true && this.isSetExtraData2(); + boolean that_present_extraData2 = true && that.isSetExtraData2(); + if (this_present_extraData2 || that_present_extraData2) { + if (!(this_present_extraData2 && that_present_extraData2)) + return false; + if (!this.extraData2.equals(that.extraData2)) + return false; + } + + boolean this_present_extraData3 = true && this.isSetExtraData3(); + boolean that_present_extraData3 = true && that.isSetExtraData3(); + if (this_present_extraData3 || that_present_extraData3) { + if (!(this_present_extraData3 && that_present_extraData3)) + return false; + if (!this.extraData3.equals(that.extraData3)) + return false; + } + + boolean this_present_extraInt1 = true && this.isSetExtraInt1(); + boolean that_present_extraInt1 = true && that.isSetExtraInt1(); + if (this_present_extraInt1 || that_present_extraInt1) { + if (!(this_present_extraInt1 && that_present_extraInt1)) + return false; + if (this.extraInt1 != that.extraInt1) + return false; + } + + boolean this_present_extraInt2 = true && this.isSetExtraInt2(); + boolean that_present_extraInt2 = true && that.isSetExtraInt2(); + if (this_present_extraInt2 || that_present_extraInt2) { + if (!(this_present_extraInt2 && that_present_extraInt2)) + return false; + if (this.extraInt2 != that.extraInt2) + return false; + } + + boolean this_present_extraInt3 = true && this.isSetExtraInt3(); + boolean that_present_extraInt3 = true && that.isSetExtraInt3(); + if (this_present_extraInt3 || that_present_extraInt3) { + if (!(this_present_extraInt3 && that_present_extraInt3)) + return false; + if (this.extraInt3 != that.extraInt3) + return false; + } + + boolean this_present_extraLong1 = true && this.isSetExtraLong1(); + boolean that_present_extraLong1 = true && that.isSetExtraLong1(); + if (this_present_extraLong1 || that_present_extraLong1) { + if (!(this_present_extraLong1 && that_present_extraLong1)) + return false; + if (this.extraLong1 != that.extraLong1) + return false; + } + + boolean this_present_extraLong2 = true && this.isSetExtraLong2(); + boolean that_present_extraLong2 = true && that.isSetExtraLong2(); + if (this_present_extraLong2 || that_present_extraLong2) { + if (!(this_present_extraLong2 && that_present_extraLong2)) + return false; + if (this.extraLong2 != that.extraLong2) + return false; + } + + boolean this_present_extraLong3 = true && this.isSetExtraLong3(); + boolean that_present_extraLong3 = true && that.isSetExtraLong3(); + if (this_present_extraLong3 || that_present_extraLong3) { + if (!(this_present_extraLong3 && that_present_extraLong3)) + return false; + if (this.extraLong3 != that.extraLong3) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(RequestThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + RequestThriftDTO typedOther = (RequestThriftDTO)other; + + 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(isSetRequestHashCode()).compareTo(typedOther.isSetRequestHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestHashCode, typedOther.requestHashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataType()).compareTo(typedOther.isSetDataType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, typedOther.dataType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataTime()).compareTo(typedOther.isSetDataTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, typedOther.dataTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetThreadCPUTime()).compareTo(typedOther.isSetThreadCPUTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetThreadCPUTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threadCPUTime, typedOther.threadCPUTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetThreadUserTime()).compareTo(typedOther.isSetThreadUserTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetThreadUserTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threadUserTime, typedOther.threadUserTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestID()).compareTo(typedOther.isSetRequestID()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestID()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestID, typedOther.requestID); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestURL()).compareTo(typedOther.isSetRequestURL()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestURL()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestURL, typedOther.requestURL); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetClientIP()).compareTo(typedOther.isSetClientIP()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClientIP()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientIP, typedOther.clientIP); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData1()).compareTo(typedOther.isSetExtraData1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData1, typedOther.extraData1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData2()).compareTo(typedOther.isSetExtraData2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData2, typedOther.extraData2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData3()).compareTo(typedOther.isSetExtraData3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData3, typedOther.extraData3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt1()).compareTo(typedOther.isSetExtraInt1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt1, typedOther.extraInt1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt2()).compareTo(typedOther.isSetExtraInt2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt2, typedOther.extraInt2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt3()).compareTo(typedOther.isSetExtraInt3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt3, typedOther.extraInt3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong1()).compareTo(typedOther.isSetExtraLong1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong1, typedOther.extraLong1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong2()).compareTo(typedOther.isSetExtraLong2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong2, typedOther.extraLong2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong3()).compareTo(typedOther.isSetExtraLong3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong3, typedOther.extraLong3); + 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("RequestThriftDTO("); + boolean first = true; + + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + if (!first) sb.append(", "); + sb.append("requestHashCode:"); + sb.append(this.requestHashCode); + first = false; + if (!first) sb.append(", "); + sb.append("dataType:"); + sb.append(this.dataType); + first = false; + if (!first) sb.append(", "); + sb.append("dataTime:"); + sb.append(this.dataTime); + first = false; + if (!first) sb.append(", "); + sb.append("threadCPUTime:"); + sb.append(this.threadCPUTime); + first = false; + if (!first) sb.append(", "); + sb.append("threadUserTime:"); + sb.append(this.threadUserTime); + first = false; + if (isSetRequestID()) { + if (!first) sb.append(", "); + sb.append("requestID:"); + if (this.requestID == null) { + sb.append("null"); + } else { + sb.append(this.requestID); + } + first = false; + } + if (isSetRequestURL()) { + if (!first) sb.append(", "); + sb.append("requestURL:"); + if (this.requestURL == null) { + sb.append("null"); + } else { + sb.append(this.requestURL); + } + first = false; + } + if (isSetClientIP()) { + if (!first) sb.append(", "); + sb.append("clientIP:"); + if (this.clientIP == null) { + sb.append("null"); + } else { + sb.append(this.clientIP); + } + first = false; + } + if (isSetExtraData1()) { + if (!first) sb.append(", "); + sb.append("extraData1:"); + if (this.extraData1 == null) { + sb.append("null"); + } else { + sb.append(this.extraData1); + } + first = false; + } + if (isSetExtraData2()) { + if (!first) sb.append(", "); + sb.append("extraData2:"); + if (this.extraData2 == null) { + sb.append("null"); + } else { + sb.append(this.extraData2); + } + first = false; + } + if (isSetExtraData3()) { + if (!first) sb.append(", "); + sb.append("extraData3:"); + if (this.extraData3 == null) { + sb.append("null"); + } else { + sb.append(this.extraData3); + } + first = false; + } + if (isSetExtraInt1()) { + if (!first) sb.append(", "); + sb.append("extraInt1:"); + sb.append(this.extraInt1); + first = false; + } + if (isSetExtraInt2()) { + if (!first) sb.append(", "); + sb.append("extraInt2:"); + sb.append(this.extraInt2); + first = false; + } + if (isSetExtraInt3()) { + if (!first) sb.append(", "); + sb.append("extraInt3:"); + sb.append(this.extraInt3); + first = false; + } + if (isSetExtraLong1()) { + if (!first) sb.append(", "); + sb.append("extraLong1:"); + sb.append(this.extraLong1); + first = false; + } + if (isSetExtraLong2()) { + if (!first) sb.append(", "); + sb.append("extraLong2:"); + sb.append(this.extraLong2); + first = false; + } + if (isSetExtraLong3()) { + if (!first) sb.append(", "); + sb.append("extraLong3:"); + sb.append(this.extraLong3); + 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 RequestThriftDTOStandardSchemeFactory implements SchemeFactory { + public RequestThriftDTOStandardScheme getScheme() { + return new RequestThriftDTOStandardScheme(); + } + } + + private static class RequestThriftDTOStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RequestThriftDTO 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: // 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 2: // REQUEST_HASH_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.requestHashCode = iprot.readI32(); + struct.setRequestHashCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DATA_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dataType = iprot.readI32(); + struct.setDataTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DATA_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.dataTime = iprot.readI64(); + struct.setDataTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // THREAD_CPUTIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.threadCPUTime = iprot.readI64(); + struct.setThreadCPUTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // THREAD_USER_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.threadUserTime = iprot.readI64(); + struct.setThreadUserTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // REQUEST_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.requestID = iprot.readString(); + struct.setRequestIDIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // REQUEST_URL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.requestURL = iprot.readString(); + struct.setRequestURLIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // CLIENT_IP + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.clientIP = iprot.readString(); + struct.setClientIPIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // EXTRA_DATA1 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.extraData1 = iprot.readString(); + struct.setExtraData1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // EXTRA_DATA2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.extraData2 = iprot.readString(); + struct.setExtraData2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // EXTRA_DATA3 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.extraData3 = iprot.readString(); + struct.setExtraData3IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // EXTRA_INT1 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.extraInt1 = iprot.readI32(); + struct.setExtraInt1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 14: // EXTRA_INT2 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.extraInt2 = iprot.readI32(); + struct.setExtraInt2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 15: // EXTRA_INT3 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.extraInt3 = iprot.readI32(); + struct.setExtraInt3IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 16: // EXTRA_LONG1 + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.extraLong1 = iprot.readI64(); + struct.setExtraLong1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 17: // EXTRA_LONG2 + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.extraLong2 = iprot.readI64(); + struct.setExtraLong2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 18: // EXTRA_LONG3 + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.extraLong3 = iprot.readI64(); + struct.setExtraLong3IsSet(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, RequestThriftDTO struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentId != null) { + oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); + oprot.writeString(struct.agentId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(REQUEST_HASH_CODE_FIELD_DESC); + oprot.writeI32(struct.requestHashCode); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(DATA_TYPE_FIELD_DESC); + oprot.writeI32(struct.dataType); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(DATA_TIME_FIELD_DESC); + oprot.writeI64(struct.dataTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(THREAD_CPUTIME_FIELD_DESC); + oprot.writeI64(struct.threadCPUTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(THREAD_USER_TIME_FIELD_DESC); + oprot.writeI64(struct.threadUserTime); + oprot.writeFieldEnd(); + if (struct.requestID != null) { + if (struct.isSetRequestID()) { + oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC); + oprot.writeString(struct.requestID); + oprot.writeFieldEnd(); + } + } + if (struct.requestURL != null) { + if (struct.isSetRequestURL()) { + oprot.writeFieldBegin(REQUEST_URL_FIELD_DESC); + oprot.writeString(struct.requestURL); + oprot.writeFieldEnd(); + } + } + if (struct.clientIP != null) { + if (struct.isSetClientIP()) { + oprot.writeFieldBegin(CLIENT_IP_FIELD_DESC); + oprot.writeString(struct.clientIP); + oprot.writeFieldEnd(); + } + } + if (struct.extraData1 != null) { + if (struct.isSetExtraData1()) { + oprot.writeFieldBegin(EXTRA_DATA1_FIELD_DESC); + oprot.writeString(struct.extraData1); + oprot.writeFieldEnd(); + } + } + if (struct.extraData2 != null) { + if (struct.isSetExtraData2()) { + oprot.writeFieldBegin(EXTRA_DATA2_FIELD_DESC); + oprot.writeString(struct.extraData2); + oprot.writeFieldEnd(); + } + } + if (struct.extraData3 != null) { + if (struct.isSetExtraData3()) { + oprot.writeFieldBegin(EXTRA_DATA3_FIELD_DESC); + oprot.writeString(struct.extraData3); + oprot.writeFieldEnd(); + } + } + if (struct.isSetExtraInt1()) { + oprot.writeFieldBegin(EXTRA_INT1_FIELD_DESC); + oprot.writeI32(struct.extraInt1); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraInt2()) { + oprot.writeFieldBegin(EXTRA_INT2_FIELD_DESC); + oprot.writeI32(struct.extraInt2); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraInt3()) { + oprot.writeFieldBegin(EXTRA_INT3_FIELD_DESC); + oprot.writeI32(struct.extraInt3); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraLong1()) { + oprot.writeFieldBegin(EXTRA_LONG1_FIELD_DESC); + oprot.writeI64(struct.extraLong1); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraLong2()) { + oprot.writeFieldBegin(EXTRA_LONG2_FIELD_DESC); + oprot.writeI64(struct.extraLong2); + oprot.writeFieldEnd(); + } + if (struct.isSetExtraLong3()) { + oprot.writeFieldBegin(EXTRA_LONG3_FIELD_DESC); + oprot.writeI64(struct.extraLong3); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class RequestThriftDTOTupleSchemeFactory implements SchemeFactory { + public RequestThriftDTOTupleScheme getScheme() { + return new RequestThriftDTOTupleScheme(); + } + } + + private static class RequestThriftDTOTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RequestThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetRequestHashCode()) { + optionals.set(1); + } + if (struct.isSetDataType()) { + optionals.set(2); + } + if (struct.isSetDataTime()) { + optionals.set(3); + } + if (struct.isSetThreadCPUTime()) { + optionals.set(4); + } + if (struct.isSetThreadUserTime()) { + optionals.set(5); + } + if (struct.isSetRequestID()) { + optionals.set(6); + } + if (struct.isSetRequestURL()) { + optionals.set(7); + } + if (struct.isSetClientIP()) { + optionals.set(8); + } + if (struct.isSetExtraData1()) { + optionals.set(9); + } + if (struct.isSetExtraData2()) { + optionals.set(10); + } + if (struct.isSetExtraData3()) { + optionals.set(11); + } + if (struct.isSetExtraInt1()) { + optionals.set(12); + } + if (struct.isSetExtraInt2()) { + optionals.set(13); + } + if (struct.isSetExtraInt3()) { + optionals.set(14); + } + if (struct.isSetExtraLong1()) { + optionals.set(15); + } + if (struct.isSetExtraLong2()) { + optionals.set(16); + } + if (struct.isSetExtraLong3()) { + optionals.set(17); + } + oprot.writeBitSet(optionals, 18); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetRequestHashCode()) { + oprot.writeI32(struct.requestHashCode); + } + if (struct.isSetDataType()) { + oprot.writeI32(struct.dataType); + } + if (struct.isSetDataTime()) { + oprot.writeI64(struct.dataTime); + } + if (struct.isSetThreadCPUTime()) { + oprot.writeI64(struct.threadCPUTime); + } + if (struct.isSetThreadUserTime()) { + oprot.writeI64(struct.threadUserTime); + } + if (struct.isSetRequestID()) { + oprot.writeString(struct.requestID); + } + if (struct.isSetRequestURL()) { + oprot.writeString(struct.requestURL); + } + if (struct.isSetClientIP()) { + oprot.writeString(struct.clientIP); + } + if (struct.isSetExtraData1()) { + oprot.writeString(struct.extraData1); + } + if (struct.isSetExtraData2()) { + oprot.writeString(struct.extraData2); + } + if (struct.isSetExtraData3()) { + oprot.writeString(struct.extraData3); + } + if (struct.isSetExtraInt1()) { + oprot.writeI32(struct.extraInt1); + } + if (struct.isSetExtraInt2()) { + oprot.writeI32(struct.extraInt2); + } + if (struct.isSetExtraInt3()) { + oprot.writeI32(struct.extraInt3); + } + if (struct.isSetExtraLong1()) { + oprot.writeI64(struct.extraLong1); + } + if (struct.isSetExtraLong2()) { + oprot.writeI64(struct.extraLong2); + } + if (struct.isSetExtraLong3()) { + oprot.writeI64(struct.extraLong3); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, RequestThriftDTO struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(18); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.requestHashCode = iprot.readI32(); + struct.setRequestHashCodeIsSet(true); + } + if (incoming.get(2)) { + struct.dataType = iprot.readI32(); + struct.setDataTypeIsSet(true); + } + if (incoming.get(3)) { + struct.dataTime = iprot.readI64(); + struct.setDataTimeIsSet(true); + } + if (incoming.get(4)) { + struct.threadCPUTime = iprot.readI64(); + struct.setThreadCPUTimeIsSet(true); + } + if (incoming.get(5)) { + struct.threadUserTime = iprot.readI64(); + struct.setThreadUserTimeIsSet(true); + } + if (incoming.get(6)) { + struct.requestID = iprot.readString(); + struct.setRequestIDIsSet(true); + } + if (incoming.get(7)) { + struct.requestURL = iprot.readString(); + struct.setRequestURLIsSet(true); + } + if (incoming.get(8)) { + struct.clientIP = iprot.readString(); + struct.setClientIPIsSet(true); + } + if (incoming.get(9)) { + struct.extraData1 = iprot.readString(); + struct.setExtraData1IsSet(true); + } + if (incoming.get(10)) { + struct.extraData2 = iprot.readString(); + struct.setExtraData2IsSet(true); + } + if (incoming.get(11)) { + struct.extraData3 = iprot.readString(); + struct.setExtraData3IsSet(true); + } + if (incoming.get(12)) { + struct.extraInt1 = iprot.readI32(); + struct.setExtraInt1IsSet(true); + } + if (incoming.get(13)) { + struct.extraInt2 = iprot.readI32(); + struct.setExtraInt2IsSet(true); + } + if (incoming.get(14)) { + struct.extraInt3 = iprot.readI32(); + struct.setExtraInt3IsSet(true); + } + if (incoming.get(15)) { + struct.extraLong1 = iprot.readI64(); + struct.setExtraLong1IsSet(true); + } + if (incoming.get(16)) { + struct.extraLong2 = iprot.readI64(); + struct.setExtraLong2IsSet(true); + } + if (incoming.get(17)) { + struct.extraLong3 = iprot.readI64(); + struct.setExtraLong3IsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/Span.java b/src/main/java/com/profiler/common/dto/thrift/Span.java index 46ac57f21..b7eb80d7b 100644 --- a/src/main/java/com/profiler/common/dto/thrift/Span.java +++ b/src/main/java/com/profiler/common/dto/thrift/Span.java @@ -1,1858 +1,1830 @@ -/** - * 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 Span implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Span"); - - 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) 1); - private static final org.apache.thrift.protocol.TField MOST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mostTraceId", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField LEAST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leastTraceId", org.apache.thrift.protocol.TType.I64, (short) 3); - private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I64, (short) 4); - private static final org.apache.thrift.protocol.TField PARENT_SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentSpanId", org.apache.thrift.protocol.TType.I64, (short) 5); - private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short) 6); - private static final org.apache.thrift.protocol.TField ELAPSED_FIELD_DESC = new org.apache.thrift.protocol.TField("elapsed", org.apache.thrift.protocol.TType.I32, (short) 7); - private static final org.apache.thrift.protocol.TField RPC_FIELD_DESC = new org.apache.thrift.protocol.TField("rpc", org.apache.thrift.protocol.TType.STRING, (short) 8); - private static final org.apache.thrift.protocol.TField SERVICE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceName", org.apache.thrift.protocol.TType.STRING, (short) 9); - private static final org.apache.thrift.protocol.TField SERVICE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceType", org.apache.thrift.protocol.TType.I16, (short) 10); - private static final org.apache.thrift.protocol.TField END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("endPoint", org.apache.thrift.protocol.TType.STRING, (short) 11); - private static final org.apache.thrift.protocol.TField ANNOTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("annotations", org.apache.thrift.protocol.TType.LIST, (short) 12); - private static final org.apache.thrift.protocol.TField FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("flag", org.apache.thrift.protocol.TType.I16, (short) 13); - private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = new org.apache.thrift.protocol.TField("err", org.apache.thrift.protocol.TType.BOOL, (short) 14); - private static final org.apache.thrift.protocol.TField SUB_SPAN_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("subSpanList", org.apache.thrift.protocol.TType.LIST, (short) 15); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new SpanStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SpanTupleSchemeFactory()); - } - - private String agentId; // required - private long mostTraceId; // required - private long leastTraceId; // required - private long spanId; // required - private long parentSpanId; // required - private long startTime; // required - private int elapsed; // required - private String rpc; // required - private String serviceName; // required - private short serviceType; // required - private String endPoint; // required - private List annotations; // required - private short flag; // optional - private boolean err; // required - private List subSpanList; // optional - - /** - * The set of fields this struct contains, along with convenience methods for finding and manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - AGENT_ID((short) 1, "agentId"), - MOST_TRACE_ID((short) 2, "mostTraceId"), - LEAST_TRACE_ID((short) 3, "leastTraceId"), - SPAN_ID((short) 4, "spanId"), - PARENT_SPAN_ID((short) 5, "parentSpanId"), - START_TIME((short) 6, "startTime"), - ELAPSED((short) 7, "elapsed"), - RPC((short) 8, "rpc"), - SERVICE_NAME((short) 9, "serviceName"), - SERVICE_TYPE((short) 10, "serviceType"), - END_POINT((short) 11, "endPoint"), - ANNOTATIONS((short) 12, "annotations"), - FLAG((short) 13, "flag"), - ERR((short) 14, "err"), - SUB_SPAN_LIST((short) 15, "subSpanList"); - - 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: // AGENT_ID - return AGENT_ID; - case 2: // MOST_TRACE_ID - return MOST_TRACE_ID; - case 3: // LEAST_TRACE_ID - return LEAST_TRACE_ID; - case 4: // SPAN_ID - return SPAN_ID; - case 5: // PARENT_SPAN_ID - return PARENT_SPAN_ID; - case 6: // START_TIME - return START_TIME; - case 7: // ELAPSED - return ELAPSED; - case 8: // RPC - return RPC; - case 9: // SERVICE_NAME - return SERVICE_NAME; - case 10: // SERVICE_TYPE - return SERVICE_TYPE; - case 11: // END_POINT - return END_POINT; - case 12: // ANNOTATIONS - return ANNOTATIONS; - case 13: // FLAG - return FLAG; - case 14: // ERR - return ERR; - case 15: // SUB_SPAN_LIST - return SUB_SPAN_LIST; - 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 __MOSTTRACEID_ISSET_ID = 0; - private static final int __LEASTTRACEID_ISSET_ID = 1; - private static final int __SPANID_ISSET_ID = 2; - private static final int __PARENTSPANID_ISSET_ID = 3; - private static final int __STARTTIME_ISSET_ID = 4; - private static final int __ELAPSED_ISSET_ID = 5; - private static final int __SERVICETYPE_ISSET_ID = 6; - private static final int __FLAG_ISSET_ID = 7; - private static final int __ERR_ISSET_ID = 8; - private BitSet __isset_bit_vector = new BitSet(9); - private _Fields optionals[] = {_Fields.FLAG, _Fields.SUB_SPAN_LIST}; - 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.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.MOST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("mostTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.LEAST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("leastTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("spanId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.PARENT_SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("parentSpanId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.ELAPSED, new org.apache.thrift.meta_data.FieldMetaData("elapsed", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.RPC, new org.apache.thrift.meta_data.FieldMetaData("rpc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SERVICE_NAME, new org.apache.thrift.meta_data.FieldMetaData("serviceName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SERVICE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("serviceType", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.END_POINT, new org.apache.thrift.meta_data.FieldMetaData("endPoint", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ANNOTATIONS, new org.apache.thrift.meta_data.FieldMetaData("annotations", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Annotation.class)))); - tmpMap.put(_Fields.FLAG, new org.apache.thrift.meta_data.FieldMetaData("flag", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.ERR, new org.apache.thrift.meta_data.FieldMetaData("err", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.SUB_SPAN_LIST, new org.apache.thrift.meta_data.FieldMetaData("subSpanList", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SubSpan.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Span.class, metaDataMap); - } - - public Span() { - this.flag = (short) 0; - - } - - public Span( - String agentId, - long mostTraceId, - long leastTraceId, - long spanId, - long parentSpanId, - long startTime, - int elapsed, - String rpc, - String serviceName, - short serviceType, - String endPoint, - List annotations, - boolean err) { - this(); - this.agentId = agentId; - this.mostTraceId = mostTraceId; - setMostTraceIdIsSet(true); - this.leastTraceId = leastTraceId; - setLeastTraceIdIsSet(true); - this.spanId = spanId; - setSpanIdIsSet(true); - this.parentSpanId = parentSpanId; - setParentSpanIdIsSet(true); - this.startTime = startTime; - setStartTimeIsSet(true); - this.elapsed = elapsed; - setElapsedIsSet(true); - this.rpc = rpc; - this.serviceName = serviceName; - this.serviceType = serviceType; - setServiceTypeIsSet(true); - this.endPoint = endPoint; - this.annotations = annotations; - this.err = err; - setErrIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public Span(Span other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetAgentId()) { - this.agentId = other.agentId; - } - this.mostTraceId = other.mostTraceId; - this.leastTraceId = other.leastTraceId; - this.spanId = other.spanId; - this.parentSpanId = other.parentSpanId; - this.startTime = other.startTime; - this.elapsed = other.elapsed; - if (other.isSetRpc()) { - this.rpc = other.rpc; - } - if (other.isSetServiceName()) { - this.serviceName = other.serviceName; - } - this.serviceType = other.serviceType; - if (other.isSetEndPoint()) { - this.endPoint = other.endPoint; - } - if (other.isSetAnnotations()) { - List __this__annotations = new ArrayList(); - for (Annotation other_element : other.annotations) { - __this__annotations.add(new Annotation(other_element)); - } - this.annotations = __this__annotations; - } - this.flag = other.flag; - this.err = other.err; - if (other.isSetSubSpanList()) { - List __this__subSpanList = new ArrayList(); - for (SubSpan other_element : other.subSpanList) { - __this__subSpanList.add(new SubSpan(other_element)); - } - this.subSpanList = __this__subSpanList; - } - } - - public Span deepCopy() { - return new Span(this); - } - - @Override - public void clear() { - this.agentId = null; - setMostTraceIdIsSet(false); - this.mostTraceId = 0; - setLeastTraceIdIsSet(false); - this.leastTraceId = 0; - setSpanIdIsSet(false); - this.spanId = 0; - setParentSpanIdIsSet(false); - this.parentSpanId = 0; - setStartTimeIsSet(false); - this.startTime = 0; - setElapsedIsSet(false); - this.elapsed = 0; - this.rpc = null; - this.serviceName = null; - setServiceTypeIsSet(false); - this.serviceType = 0; - this.endPoint = null; - this.annotations = null; - this.flag = (short) 0; - - setErrIsSet(false); - this.err = false; - this.subSpanList = 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 long getMostTraceId() { - return this.mostTraceId; - } - - public void setMostTraceId(long mostTraceId) { - this.mostTraceId = mostTraceId; - setMostTraceIdIsSet(true); - } - - public void unsetMostTraceId() { - __isset_bit_vector.clear(__MOSTTRACEID_ISSET_ID); - } - - /** - * Returns true if field mostTraceId is set (has been assigned a value) and false otherwise - */ - public boolean isSetMostTraceId() { - return __isset_bit_vector.get(__MOSTTRACEID_ISSET_ID); - } - - public void setMostTraceIdIsSet(boolean value) { - __isset_bit_vector.set(__MOSTTRACEID_ISSET_ID, value); - } - - public long getLeastTraceId() { - return this.leastTraceId; - } - - public void setLeastTraceId(long leastTraceId) { - this.leastTraceId = leastTraceId; - setLeastTraceIdIsSet(true); - } - - public void unsetLeastTraceId() { - __isset_bit_vector.clear(__LEASTTRACEID_ISSET_ID); - } - - /** - * Returns true if field leastTraceId is set (has been assigned a value) and false otherwise - */ - public boolean isSetLeastTraceId() { - return __isset_bit_vector.get(__LEASTTRACEID_ISSET_ID); - } - - public void setLeastTraceIdIsSet(boolean value) { - __isset_bit_vector.set(__LEASTTRACEID_ISSET_ID, value); - } - - public long getSpanId() { - return this.spanId; - } - - public void setSpanId(long spanId) { - this.spanId = spanId; - setSpanIdIsSet(true); - } - - public void unsetSpanId() { - __isset_bit_vector.clear(__SPANID_ISSET_ID); - } - - /** - * Returns true if field spanId is set (has been assigned a value) and false otherwise - */ - public boolean isSetSpanId() { - return __isset_bit_vector.get(__SPANID_ISSET_ID); - } - - public void setSpanIdIsSet(boolean value) { - __isset_bit_vector.set(__SPANID_ISSET_ID, value); - } - - public long getParentSpanId() { - return this.parentSpanId; - } - - public void setParentSpanId(long parentSpanId) { - this.parentSpanId = parentSpanId; - setParentSpanIdIsSet(true); - } - - public void unsetParentSpanId() { - __isset_bit_vector.clear(__PARENTSPANID_ISSET_ID); - } - - /** - * Returns true if field parentSpanId is set (has been assigned a value) and false otherwise - */ - public boolean isSetParentSpanId() { - return __isset_bit_vector.get(__PARENTSPANID_ISSET_ID); - } - - public void setParentSpanIdIsSet(boolean value) { - __isset_bit_vector.set(__PARENTSPANID_ISSET_ID, value); - } - - public long getStartTime() { - return this.startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - setStartTimeIsSet(true); - } - - public void unsetStartTime() { - __isset_bit_vector.clear(__STARTTIME_ISSET_ID); - } - - /** - * Returns true if field startTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetStartTime() { - return __isset_bit_vector.get(__STARTTIME_ISSET_ID); - } - - public void setStartTimeIsSet(boolean value) { - __isset_bit_vector.set(__STARTTIME_ISSET_ID, value); - } - - public int getElapsed() { - return this.elapsed; - } - - public void setElapsed(int elapsed) { - this.elapsed = elapsed; - setElapsedIsSet(true); - } - - public void unsetElapsed() { - __isset_bit_vector.clear(__ELAPSED_ISSET_ID); - } - - /** - * Returns true if field elapsed is set (has been assigned a value) and false otherwise - */ - public boolean isSetElapsed() { - return __isset_bit_vector.get(__ELAPSED_ISSET_ID); - } - - public void setElapsedIsSet(boolean value) { - __isset_bit_vector.set(__ELAPSED_ISSET_ID, value); - } - - public String getRpc() { - return this.rpc; - } - - public void setRpc(String rpc) { - this.rpc = rpc; - } - - public void unsetRpc() { - this.rpc = null; - } - - /** - * Returns true if field rpc is set (has been assigned a value) and false otherwise - */ - public boolean isSetRpc() { - return this.rpc != null; - } - - public void setRpcIsSet(boolean value) { - if (!value) { - this.rpc = null; - } - } - - public String getServiceName() { - return this.serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public void unsetServiceName() { - this.serviceName = null; - } - - /** - * Returns true if field serviceName is set (has been assigned a value) and false otherwise - */ - public boolean isSetServiceName() { - return this.serviceName != null; - } - - public void setServiceNameIsSet(boolean value) { - if (!value) { - this.serviceName = null; - } - } - - public short getServiceType() { - return this.serviceType; - } - - public void setServiceType(short serviceType) { - this.serviceType = serviceType; - setServiceTypeIsSet(true); - } - - public void unsetServiceType() { - __isset_bit_vector.clear(__SERVICETYPE_ISSET_ID); - } - - /** - * Returns true if field serviceType is set (has been assigned a value) and false otherwise - */ - public boolean isSetServiceType() { - return __isset_bit_vector.get(__SERVICETYPE_ISSET_ID); - } - - public void setServiceTypeIsSet(boolean value) { - __isset_bit_vector.set(__SERVICETYPE_ISSET_ID, value); - } - - public String getEndPoint() { - return this.endPoint; - } - - public void setEndPoint(String endPoint) { - this.endPoint = endPoint; - } - - public void unsetEndPoint() { - this.endPoint = null; - } - - /** - * Returns true if field endPoint is set (has been assigned a value) and false otherwise - */ - public boolean isSetEndPoint() { - return this.endPoint != null; - } - - public void setEndPointIsSet(boolean value) { - if (!value) { - this.endPoint = null; - } - } - - public int getAnnotationsSize() { - return (this.annotations == null) ? 0 : this.annotations.size(); - } - - public java.util.Iterator getAnnotationsIterator() { - return (this.annotations == null) ? null : this.annotations.iterator(); - } - - public void addToAnnotations(Annotation elem) { - if (this.annotations == null) { - this.annotations = new ArrayList(); - } - this.annotations.add(elem); - } - - public List getAnnotations() { - return this.annotations; - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - public void unsetAnnotations() { - this.annotations = null; - } - - /** - * Returns true if field annotations is set (has been assigned a value) and false otherwise - */ - public boolean isSetAnnotations() { - return this.annotations != null; - } - - public void setAnnotationsIsSet(boolean value) { - if (!value) { - this.annotations = null; - } - } - - public short getFlag() { - return this.flag; - } - - public void setFlag(short flag) { - this.flag = flag; - setFlagIsSet(true); - } - - public void unsetFlag() { - __isset_bit_vector.clear(__FLAG_ISSET_ID); - } - - /** - * Returns true if field flag is set (has been assigned a value) and false otherwise - */ - public boolean isSetFlag() { - return __isset_bit_vector.get(__FLAG_ISSET_ID); - } - - public void setFlagIsSet(boolean value) { - __isset_bit_vector.set(__FLAG_ISSET_ID, value); - } - - public boolean isErr() { - return this.err; - } - - public void setErr(boolean err) { - this.err = err; - setErrIsSet(true); - } - - public void unsetErr() { - __isset_bit_vector.clear(__ERR_ISSET_ID); - } - - /** - * Returns true if field err is set (has been assigned a value) and false otherwise - */ - public boolean isSetErr() { - return __isset_bit_vector.get(__ERR_ISSET_ID); - } - - public void setErrIsSet(boolean value) { - __isset_bit_vector.set(__ERR_ISSET_ID, value); - } - - public int getSubSpanListSize() { - return (this.subSpanList == null) ? 0 : this.subSpanList.size(); - } - - public java.util.Iterator getSubSpanListIterator() { - return (this.subSpanList == null) ? null : this.subSpanList.iterator(); - } - - public void addToSubSpanList(SubSpan elem) { - if (this.subSpanList == null) { - this.subSpanList = new ArrayList(); - } - this.subSpanList.add(elem); - } - - public List getSubSpanList() { - return this.subSpanList; - } - - public void setSubSpanList(List subSpanList) { - this.subSpanList = subSpanList; - } - - public void unsetSubSpanList() { - this.subSpanList = null; - } - - /** - * Returns true if field subSpanList is set (has been assigned a value) and false otherwise - */ - public boolean isSetSubSpanList() { - return this.subSpanList != null; - } - - public void setSubSpanListIsSet(boolean value) { - if (!value) { - this.subSpanList = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AGENT_ID: - if (value == null) { - unsetAgentId(); - } else { - setAgentId((String) value); - } - break; - - case MOST_TRACE_ID: - if (value == null) { - unsetMostTraceId(); - } else { - setMostTraceId((Long) value); - } - break; - - case LEAST_TRACE_ID: - if (value == null) { - unsetLeastTraceId(); - } else { - setLeastTraceId((Long) value); - } - break; - - case SPAN_ID: - if (value == null) { - unsetSpanId(); - } else { - setSpanId((Long) value); - } - break; - - case PARENT_SPAN_ID: - if (value == null) { - unsetParentSpanId(); - } else { - setParentSpanId((Long) value); - } - break; - - case START_TIME: - if (value == null) { - unsetStartTime(); - } else { - setStartTime((Long) value); - } - break; - - case ELAPSED: - if (value == null) { - unsetElapsed(); - } else { - setElapsed((Integer) value); - } - break; - - case RPC: - if (value == null) { - unsetRpc(); - } else { - setRpc((String) value); - } - break; - - case SERVICE_NAME: - if (value == null) { - unsetServiceName(); - } else { - setServiceName((String) value); - } - break; - - case SERVICE_TYPE: - if (value == null) { - unsetServiceType(); - } else { - setServiceType((Short) value); - } - break; - - case END_POINT: - if (value == null) { - unsetEndPoint(); - } else { - setEndPoint((String) value); - } - break; - - case ANNOTATIONS: - if (value == null) { - unsetAnnotations(); - } else { - setAnnotations((List) value); - } - break; - - case FLAG: - if (value == null) { - unsetFlag(); - } else { - setFlag((Short) value); - } - break; - - case ERR: - if (value == null) { - unsetErr(); - } else { - setErr((Boolean) value); - } - break; - - case SUB_SPAN_LIST: - if (value == null) { - unsetSubSpanList(); - } else { - setSubSpanList((List) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AGENT_ID: - return getAgentId(); - - case MOST_TRACE_ID: - return Long.valueOf(getMostTraceId()); - - case LEAST_TRACE_ID: - return Long.valueOf(getLeastTraceId()); - - case SPAN_ID: - return Long.valueOf(getSpanId()); - - case PARENT_SPAN_ID: - return Long.valueOf(getParentSpanId()); - - case START_TIME: - return Long.valueOf(getStartTime()); - - case ELAPSED: - return Integer.valueOf(getElapsed()); - - case RPC: - return getRpc(); - - case SERVICE_NAME: - return getServiceName(); - - case SERVICE_TYPE: - return Short.valueOf(getServiceType()); - - case END_POINT: - return getEndPoint(); - - case ANNOTATIONS: - return getAnnotations(); - - case FLAG: - return Short.valueOf(getFlag()); - - case ERR: - return Boolean.valueOf(isErr()); - - case SUB_SPAN_LIST: - return getSubSpanList(); - - } - 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 AGENT_ID: - return isSetAgentId(); - case MOST_TRACE_ID: - return isSetMostTraceId(); - case LEAST_TRACE_ID: - return isSetLeastTraceId(); - case SPAN_ID: - return isSetSpanId(); - case PARENT_SPAN_ID: - return isSetParentSpanId(); - case START_TIME: - return isSetStartTime(); - case ELAPSED: - return isSetElapsed(); - case RPC: - return isSetRpc(); - case SERVICE_NAME: - return isSetServiceName(); - case SERVICE_TYPE: - return isSetServiceType(); - case END_POINT: - return isSetEndPoint(); - case ANNOTATIONS: - return isSetAnnotations(); - case FLAG: - return isSetFlag(); - case ERR: - return isSetErr(); - case SUB_SPAN_LIST: - return isSetSubSpanList(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Span) - return this.equals((Span) that); - return false; - } - - public boolean equals(Span that) { - if (that == null) - 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_mostTraceId = true; - boolean that_present_mostTraceId = true; - if (this_present_mostTraceId || that_present_mostTraceId) { - if (!(this_present_mostTraceId && that_present_mostTraceId)) - return false; - if (this.mostTraceId != that.mostTraceId) - return false; - } - - boolean this_present_leastTraceId = true; - boolean that_present_leastTraceId = true; - if (this_present_leastTraceId || that_present_leastTraceId) { - if (!(this_present_leastTraceId && that_present_leastTraceId)) - return false; - if (this.leastTraceId != that.leastTraceId) - return false; - } - - boolean this_present_spanId = true; - boolean that_present_spanId = true; - if (this_present_spanId || that_present_spanId) { - if (!(this_present_spanId && that_present_spanId)) - return false; - if (this.spanId != that.spanId) - return false; - } - - boolean this_present_parentSpanId = true; - boolean that_present_parentSpanId = true; - if (this_present_parentSpanId || that_present_parentSpanId) { - if (!(this_present_parentSpanId && that_present_parentSpanId)) - return false; - if (this.parentSpanId != that.parentSpanId) - return false; - } - - boolean this_present_startTime = true; - boolean that_present_startTime = true; - if (this_present_startTime || that_present_startTime) { - if (!(this_present_startTime && that_present_startTime)) - return false; - if (this.startTime != that.startTime) - return false; - } - - boolean this_present_elapsed = true; - boolean that_present_elapsed = true; - if (this_present_elapsed || that_present_elapsed) { - if (!(this_present_elapsed && that_present_elapsed)) - return false; - if (this.elapsed != that.elapsed) - return false; - } - - boolean this_present_rpc = true && this.isSetRpc(); - boolean that_present_rpc = true && that.isSetRpc(); - if (this_present_rpc || that_present_rpc) { - if (!(this_present_rpc && that_present_rpc)) - return false; - if (!this.rpc.equals(that.rpc)) - return false; - } - - boolean this_present_serviceName = true && this.isSetServiceName(); - boolean that_present_serviceName = true && that.isSetServiceName(); - if (this_present_serviceName || that_present_serviceName) { - if (!(this_present_serviceName && that_present_serviceName)) - return false; - if (!this.serviceName.equals(that.serviceName)) - return false; - } - - boolean this_present_serviceType = true; - boolean that_present_serviceType = true; - if (this_present_serviceType || that_present_serviceType) { - if (!(this_present_serviceType && that_present_serviceType)) - return false; - if (this.serviceType != that.serviceType) - return false; - } - - boolean this_present_endPoint = true && this.isSetEndPoint(); - boolean that_present_endPoint = true && that.isSetEndPoint(); - if (this_present_endPoint || that_present_endPoint) { - if (!(this_present_endPoint && that_present_endPoint)) - return false; - if (!this.endPoint.equals(that.endPoint)) - return false; - } - - boolean this_present_annotations = true && this.isSetAnnotations(); - boolean that_present_annotations = true && that.isSetAnnotations(); - if (this_present_annotations || that_present_annotations) { - if (!(this_present_annotations && that_present_annotations)) - return false; - if (!this.annotations.equals(that.annotations)) - return false; - } - - boolean this_present_flag = true && this.isSetFlag(); - boolean that_present_flag = true && that.isSetFlag(); - if (this_present_flag || that_present_flag) { - if (!(this_present_flag && that_present_flag)) - return false; - if (this.flag != that.flag) - return false; - } - - boolean this_present_err = true; - boolean that_present_err = true; - if (this_present_err || that_present_err) { - if (!(this_present_err && that_present_err)) - return false; - if (this.err != that.err) - return false; - } - - boolean this_present_subSpanList = true && this.isSetSubSpanList(); - boolean that_present_subSpanList = true && that.isSetSubSpanList(); - if (this_present_subSpanList || that_present_subSpanList) { - if (!(this_present_subSpanList && that_present_subSpanList)) - return false; - if (!this.subSpanList.equals(that.subSpanList)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(Span other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - Span typedOther = (Span) other; - - 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(isSetMostTraceId()).compareTo(typedOther.isSetMostTraceId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMostTraceId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, typedOther.mostTraceId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(typedOther.isSetLeastTraceId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLeastTraceId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, typedOther.leastTraceId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(typedOther.isSetSpanId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSpanId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, typedOther.spanId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParentSpanId()).compareTo(typedOther.isSetParentSpanId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParentSpanId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentSpanId, typedOther.parentSpanId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(typedOther.isSetStartTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, typedOther.startTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetElapsed()).compareTo(typedOther.isSetElapsed()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetElapsed()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.elapsed, typedOther.elapsed); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRpc()).compareTo(typedOther.isSetRpc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRpc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpc, typedOther.rpc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetServiceName()).compareTo(typedOther.isSetServiceName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServiceName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceName, typedOther.serviceName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(typedOther.isSetServiceType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServiceType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, typedOther.serviceType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEndPoint()).compareTo(typedOther.isSetEndPoint()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndPoint()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endPoint, typedOther.endPoint); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetAnnotations()).compareTo(typedOther.isSetAnnotations()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAnnotations()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.annotations, typedOther.annotations); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFlag()).compareTo(typedOther.isSetFlag()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFlag()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flag, typedOther.flag); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErr()).compareTo(typedOther.isSetErr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, typedOther.err); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSubSpanList()).compareTo(typedOther.isSetSubSpanList()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSubSpanList()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subSpanList, typedOther.subSpanList); - 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("Span("); - boolean first = true; - - sb.append("agentId:"); - if (this.agentId == null) { - sb.append("null"); - } else { - sb.append(this.agentId); - } - first = false; - if (!first) sb.append(", "); - sb.append("mostTraceId:"); - sb.append(this.mostTraceId); - first = false; - if (!first) sb.append(", "); - sb.append("leastTraceId:"); - sb.append(this.leastTraceId); - first = false; - if (!first) sb.append(", "); - sb.append("spanId:"); - sb.append(this.spanId); - first = false; - if (!first) sb.append(", "); - sb.append("parentSpanId:"); - sb.append(this.parentSpanId); - first = false; - if (!first) sb.append(", "); - sb.append("startTime:"); - sb.append(this.startTime); - first = false; - if (!first) sb.append(", "); - sb.append("elapsed:"); - sb.append(this.elapsed); - first = false; - if (!first) sb.append(", "); - sb.append("rpc:"); - if (this.rpc == null) { - sb.append("null"); - } else { - sb.append(this.rpc); - } - first = false; - if (!first) sb.append(", "); - sb.append("serviceName:"); - if (this.serviceName == null) { - sb.append("null"); - } else { - sb.append(this.serviceName); - } - first = false; - if (!first) sb.append(", "); - sb.append("serviceType:"); - sb.append(this.serviceType); - first = false; - if (!first) sb.append(", "); - sb.append("endPoint:"); - if (this.endPoint == null) { - sb.append("null"); - } else { - sb.append(this.endPoint); - } - first = false; - if (!first) sb.append(", "); - sb.append("annotations:"); - if (this.annotations == null) { - sb.append("null"); - } else { - sb.append(this.annotations); - } - first = false; - if (isSetFlag()) { - if (!first) sb.append(", "); - sb.append("flag:"); - sb.append(this.flag); - first = false; - } - if (!first) sb.append(", "); - sb.append("err:"); - sb.append(this.err); - first = false; - if (isSetSubSpanList()) { - if (!first) sb.append(", "); - sb.append("subSpanList:"); - if (this.subSpanList == null) { - sb.append("null"); - } else { - sb.append(this.subSpanList); - } - 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 SpanStandardSchemeFactory implements SchemeFactory { - public SpanStandardScheme getScheme() { - return new SpanStandardScheme(); - } - } - - private static class SpanStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, Span 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: // 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 2: // MOST_TRACE_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.mostTraceId = iprot.readI64(); - struct.setMostTraceIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // LEAST_TRACE_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.leastTraceId = iprot.readI64(); - struct.setLeastTraceIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // SPAN_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.spanId = iprot.readI64(); - struct.setSpanIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // PARENT_SPAN_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.parentSpanId = iprot.readI64(); - struct.setParentSpanIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // START_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // ELAPSED - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.elapsed = iprot.readI32(); - struct.setElapsedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // RPC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.rpc = iprot.readString(); - struct.setRpcIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // SERVICE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.serviceName = iprot.readString(); - struct.setServiceNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // SERVICE_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.serviceType = iprot.readI16(); - struct.setServiceTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // END_POINT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.endPoint = iprot.readString(); - struct.setEndPointIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // ANNOTATIONS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); - struct.annotations = new ArrayList(_list32.size); - for (int _i33 = 0; _i33 < _list32.size; ++_i33) { - Annotation _elem34; // required - _elem34 = new Annotation(); - _elem34.read(iprot); - struct.annotations.add(_elem34); - } - iprot.readListEnd(); - } - struct.setAnnotationsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 13: // FLAG - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.flag = iprot.readI16(); - struct.setFlagIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 14: // ERR - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.err = iprot.readBool(); - struct.setErrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 15: // SUB_SPAN_LIST - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list35 = iprot.readListBegin(); - struct.subSpanList = new ArrayList(_list35.size); - for (int _i36 = 0; _i36 < _list35.size; ++_i36) { - SubSpan _elem37; // required - _elem37 = new SubSpan(); - _elem37.read(iprot); - struct.subSpanList.add(_elem37); - } - iprot.readListEnd(); - } - struct.setSubSpanListIsSet(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, Span struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.agentId != null) { - oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); - oprot.writeString(struct.agentId); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(MOST_TRACE_ID_FIELD_DESC); - oprot.writeI64(struct.mostTraceId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LEAST_TRACE_ID_FIELD_DESC); - oprot.writeI64(struct.leastTraceId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(SPAN_ID_FIELD_DESC); - oprot.writeI64(struct.spanId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PARENT_SPAN_ID_FIELD_DESC); - oprot.writeI64(struct.parentSpanId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(START_TIME_FIELD_DESC); - oprot.writeI64(struct.startTime); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(ELAPSED_FIELD_DESC); - oprot.writeI32(struct.elapsed); - oprot.writeFieldEnd(); - if (struct.rpc != null) { - oprot.writeFieldBegin(RPC_FIELD_DESC); - oprot.writeString(struct.rpc); - oprot.writeFieldEnd(); - } - if (struct.serviceName != null) { - oprot.writeFieldBegin(SERVICE_NAME_FIELD_DESC); - oprot.writeString(struct.serviceName); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC); - oprot.writeI16(struct.serviceType); - oprot.writeFieldEnd(); - if (struct.endPoint != null) { - oprot.writeFieldBegin(END_POINT_FIELD_DESC); - oprot.writeString(struct.endPoint); - oprot.writeFieldEnd(); - } - if (struct.annotations != null) { - oprot.writeFieldBegin(ANNOTATIONS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.annotations.size())); - for (Annotation _iter38 : struct.annotations) { - _iter38.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.isSetFlag()) { - oprot.writeFieldBegin(FLAG_FIELD_DESC); - oprot.writeI16(struct.flag); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(ERR_FIELD_DESC); - oprot.writeBool(struct.err); - oprot.writeFieldEnd(); - if (struct.subSpanList != null) { - if (struct.isSetSubSpanList()) { - oprot.writeFieldBegin(SUB_SPAN_LIST_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.subSpanList.size())); - for (SubSpan _iter39 : struct.subSpanList) { - _iter39.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class SpanTupleSchemeFactory implements SchemeFactory { - public SpanTupleScheme getScheme() { - return new SpanTupleScheme(); - } - } - - private static class SpanTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, Span struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAgentId()) { - optionals.set(0); - } - if (struct.isSetMostTraceId()) { - optionals.set(1); - } - if (struct.isSetLeastTraceId()) { - optionals.set(2); - } - if (struct.isSetSpanId()) { - optionals.set(3); - } - if (struct.isSetParentSpanId()) { - optionals.set(4); - } - if (struct.isSetStartTime()) { - optionals.set(5); - } - if (struct.isSetElapsed()) { - optionals.set(6); - } - if (struct.isSetRpc()) { - optionals.set(7); - } - if (struct.isSetServiceName()) { - optionals.set(8); - } - if (struct.isSetServiceType()) { - optionals.set(9); - } - if (struct.isSetEndPoint()) { - optionals.set(10); - } - if (struct.isSetAnnotations()) { - optionals.set(11); - } - if (struct.isSetFlag()) { - optionals.set(12); - } - if (struct.isSetErr()) { - optionals.set(13); - } - if (struct.isSetSubSpanList()) { - optionals.set(14); - } - oprot.writeBitSet(optionals, 15); - if (struct.isSetAgentId()) { - oprot.writeString(struct.agentId); - } - if (struct.isSetMostTraceId()) { - oprot.writeI64(struct.mostTraceId); - } - if (struct.isSetLeastTraceId()) { - oprot.writeI64(struct.leastTraceId); - } - if (struct.isSetSpanId()) { - oprot.writeI64(struct.spanId); - } - if (struct.isSetParentSpanId()) { - oprot.writeI64(struct.parentSpanId); - } - if (struct.isSetStartTime()) { - oprot.writeI64(struct.startTime); - } - if (struct.isSetElapsed()) { - oprot.writeI32(struct.elapsed); - } - if (struct.isSetRpc()) { - oprot.writeString(struct.rpc); - } - if (struct.isSetServiceName()) { - oprot.writeString(struct.serviceName); - } - if (struct.isSetServiceType()) { - oprot.writeI16(struct.serviceType); - } - if (struct.isSetEndPoint()) { - oprot.writeString(struct.endPoint); - } - if (struct.isSetAnnotations()) { - { - oprot.writeI32(struct.annotations.size()); - for (Annotation _iter40 : struct.annotations) { - _iter40.write(oprot); - } - } - } - if (struct.isSetFlag()) { - oprot.writeI16(struct.flag); - } - if (struct.isSetErr()) { - oprot.writeBool(struct.err); - } - if (struct.isSetSubSpanList()) { - { - oprot.writeI32(struct.subSpanList.size()); - for (SubSpan _iter41 : struct.subSpanList) { - _iter41.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, Span struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(15); - if (incoming.get(0)) { - struct.agentId = iprot.readString(); - struct.setAgentIdIsSet(true); - } - if (incoming.get(1)) { - struct.mostTraceId = iprot.readI64(); - struct.setMostTraceIdIsSet(true); - } - if (incoming.get(2)) { - struct.leastTraceId = iprot.readI64(); - struct.setLeastTraceIdIsSet(true); - } - if (incoming.get(3)) { - struct.spanId = iprot.readI64(); - struct.setSpanIdIsSet(true); - } - if (incoming.get(4)) { - struct.parentSpanId = iprot.readI64(); - struct.setParentSpanIdIsSet(true); - } - if (incoming.get(5)) { - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(true); - } - if (incoming.get(6)) { - struct.elapsed = iprot.readI32(); - struct.setElapsedIsSet(true); - } - if (incoming.get(7)) { - struct.rpc = iprot.readString(); - struct.setRpcIsSet(true); - } - if (incoming.get(8)) { - struct.serviceName = iprot.readString(); - struct.setServiceNameIsSet(true); - } - if (incoming.get(9)) { - struct.serviceType = iprot.readI16(); - struct.setServiceTypeIsSet(true); - } - if (incoming.get(10)) { - struct.endPoint = iprot.readString(); - struct.setEndPointIsSet(true); - } - if (incoming.get(11)) { - { - org.apache.thrift.protocol.TList _list42 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.annotations = new ArrayList(_list42.size); - for (int _i43 = 0; _i43 < _list42.size; ++_i43) { - Annotation _elem44; // required - _elem44 = new Annotation(); - _elem44.read(iprot); - struct.annotations.add(_elem44); - } - } - struct.setAnnotationsIsSet(true); - } - if (incoming.get(12)) { - struct.flag = iprot.readI16(); - struct.setFlagIsSet(true); - } - if (incoming.get(13)) { - struct.err = iprot.readBool(); - struct.setErrIsSet(true); - } - if (incoming.get(14)) { - { - org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.subSpanList = new ArrayList(_list45.size); - for (int _i46 = 0; _i46 < _list45.size; ++_i46) { - SubSpan _elem47; // required - _elem47 = new SubSpan(); - _elem47.read(iprot); - struct.subSpanList.add(_elem47); - } - } - struct.setSubSpanListIsSet(true); - } - } - } - -} - +/** + * 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 Span implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Span"); + + 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)1); + private static final org.apache.thrift.protocol.TField MOST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mostTraceId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField LEAST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leastTraceId", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField PARENT_SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentSpanId", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)6); + private static final org.apache.thrift.protocol.TField ELAPSED_FIELD_DESC = new org.apache.thrift.protocol.TField("elapsed", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField RPC_FIELD_DESC = new org.apache.thrift.protocol.TField("rpc", org.apache.thrift.protocol.TType.STRING, (short)8); + private static final org.apache.thrift.protocol.TField SERVICE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceName", org.apache.thrift.protocol.TType.STRING, (short)9); + private static final org.apache.thrift.protocol.TField SERVICE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceType", org.apache.thrift.protocol.TType.I16, (short)10); + private static final org.apache.thrift.protocol.TField END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("endPoint", org.apache.thrift.protocol.TType.STRING, (short)11); + private static final org.apache.thrift.protocol.TField ANNOTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("annotations", org.apache.thrift.protocol.TType.LIST, (short)12); + private static final org.apache.thrift.protocol.TField FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("flag", org.apache.thrift.protocol.TType.I16, (short)13); + private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = new org.apache.thrift.protocol.TField("err", org.apache.thrift.protocol.TType.BOOL, (short)14); + private static final org.apache.thrift.protocol.TField SUB_SPAN_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("subSpanList", org.apache.thrift.protocol.TType.LIST, (short)15); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SpanStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SpanTupleSchemeFactory()); + } + + private String agentId; // required + private long mostTraceId; // required + private long leastTraceId; // required + private long spanId; // required + private long parentSpanId; // required + private long startTime; // required + private int elapsed; // required + private String rpc; // required + private String serviceName; // required + private short serviceType; // required + private String endPoint; // required + private List annotations; // required + private short flag; // optional + private boolean err; // required + private List subSpanList; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + AGENT_ID((short)1, "agentId"), + MOST_TRACE_ID((short)2, "mostTraceId"), + LEAST_TRACE_ID((short)3, "leastTraceId"), + SPAN_ID((short)4, "spanId"), + PARENT_SPAN_ID((short)5, "parentSpanId"), + START_TIME((short)6, "startTime"), + ELAPSED((short)7, "elapsed"), + RPC((short)8, "rpc"), + SERVICE_NAME((short)9, "serviceName"), + SERVICE_TYPE((short)10, "serviceType"), + END_POINT((short)11, "endPoint"), + ANNOTATIONS((short)12, "annotations"), + FLAG((short)13, "flag"), + ERR((short)14, "err"), + SUB_SPAN_LIST((short)15, "subSpanList"); + + 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: // AGENT_ID + return AGENT_ID; + case 2: // MOST_TRACE_ID + return MOST_TRACE_ID; + case 3: // LEAST_TRACE_ID + return LEAST_TRACE_ID; + case 4: // SPAN_ID + return SPAN_ID; + case 5: // PARENT_SPAN_ID + return PARENT_SPAN_ID; + case 6: // START_TIME + return START_TIME; + case 7: // ELAPSED + return ELAPSED; + case 8: // RPC + return RPC; + case 9: // SERVICE_NAME + return SERVICE_NAME; + case 10: // SERVICE_TYPE + return SERVICE_TYPE; + case 11: // END_POINT + return END_POINT; + case 12: // ANNOTATIONS + return ANNOTATIONS; + case 13: // FLAG + return FLAG; + case 14: // ERR + return ERR; + case 15: // SUB_SPAN_LIST + return SUB_SPAN_LIST; + 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 __MOSTTRACEID_ISSET_ID = 0; + private static final int __LEASTTRACEID_ISSET_ID = 1; + private static final int __SPANID_ISSET_ID = 2; + private static final int __PARENTSPANID_ISSET_ID = 3; + private static final int __STARTTIME_ISSET_ID = 4; + private static final int __ELAPSED_ISSET_ID = 5; + private static final int __SERVICETYPE_ISSET_ID = 6; + private static final int __FLAG_ISSET_ID = 7; + private static final int __ERR_ISSET_ID = 8; + private BitSet __isset_bit_vector = new BitSet(9); + private _Fields optionals[] = {_Fields.FLAG,_Fields.SUB_SPAN_LIST}; + 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.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.MOST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("mostTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.LEAST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("leastTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("spanId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.PARENT_SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("parentSpanId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ELAPSED, new org.apache.thrift.meta_data.FieldMetaData("elapsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.RPC, new org.apache.thrift.meta_data.FieldMetaData("rpc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SERVICE_NAME, new org.apache.thrift.meta_data.FieldMetaData("serviceName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SERVICE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("serviceType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.END_POINT, new org.apache.thrift.meta_data.FieldMetaData("endPoint", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ANNOTATIONS, new org.apache.thrift.meta_data.FieldMetaData("annotations", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Annotation.class)))); + tmpMap.put(_Fields.FLAG, new org.apache.thrift.meta_data.FieldMetaData("flag", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.ERR, new org.apache.thrift.meta_data.FieldMetaData("err", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.SUB_SPAN_LIST, new org.apache.thrift.meta_data.FieldMetaData("subSpanList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SubSpan.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Span.class, metaDataMap); + } + + public Span() { + this.flag = (short)0; + + } + + public Span( + String agentId, + long mostTraceId, + long leastTraceId, + long spanId, + long parentSpanId, + long startTime, + int elapsed, + String rpc, + String serviceName, + short serviceType, + String endPoint, + List annotations, + boolean err) + { + this(); + this.agentId = agentId; + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + this.spanId = spanId; + setSpanIdIsSet(true); + this.parentSpanId = parentSpanId; + setParentSpanIdIsSet(true); + this.startTime = startTime; + setStartTimeIsSet(true); + this.elapsed = elapsed; + setElapsedIsSet(true); + this.rpc = rpc; + this.serviceName = serviceName; + this.serviceType = serviceType; + setServiceTypeIsSet(true); + this.endPoint = endPoint; + this.annotations = annotations; + this.err = err; + setErrIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public Span(Span other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.mostTraceId = other.mostTraceId; + this.leastTraceId = other.leastTraceId; + this.spanId = other.spanId; + this.parentSpanId = other.parentSpanId; + this.startTime = other.startTime; + this.elapsed = other.elapsed; + if (other.isSetRpc()) { + this.rpc = other.rpc; + } + if (other.isSetServiceName()) { + this.serviceName = other.serviceName; + } + this.serviceType = other.serviceType; + if (other.isSetEndPoint()) { + this.endPoint = other.endPoint; + } + if (other.isSetAnnotations()) { + List __this__annotations = new ArrayList(); + for (Annotation other_element : other.annotations) { + __this__annotations.add(new Annotation(other_element)); + } + this.annotations = __this__annotations; + } + this.flag = other.flag; + this.err = other.err; + if (other.isSetSubSpanList()) { + List __this__subSpanList = new ArrayList(); + for (SubSpan other_element : other.subSpanList) { + __this__subSpanList.add(new SubSpan(other_element)); + } + this.subSpanList = __this__subSpanList; + } + } + + public Span deepCopy() { + return new Span(this); + } + + @Override + public void clear() { + this.agentId = null; + setMostTraceIdIsSet(false); + this.mostTraceId = 0; + setLeastTraceIdIsSet(false); + this.leastTraceId = 0; + setSpanIdIsSet(false); + this.spanId = 0; + setParentSpanIdIsSet(false); + this.parentSpanId = 0; + setStartTimeIsSet(false); + this.startTime = 0; + setElapsedIsSet(false); + this.elapsed = 0; + this.rpc = null; + this.serviceName = null; + setServiceTypeIsSet(false); + this.serviceType = 0; + this.endPoint = null; + this.annotations = null; + this.flag = (short)0; + + setErrIsSet(false); + this.err = false; + this.subSpanList = 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 long getMostTraceId() { + return this.mostTraceId; + } + + public void setMostTraceId(long mostTraceId) { + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + } + + public void unsetMostTraceId() { + __isset_bit_vector.clear(__MOSTTRACEID_ISSET_ID); + } + + /** Returns true if field mostTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetMostTraceId() { + return __isset_bit_vector.get(__MOSTTRACEID_ISSET_ID); + } + + public void setMostTraceIdIsSet(boolean value) { + __isset_bit_vector.set(__MOSTTRACEID_ISSET_ID, value); + } + + public long getLeastTraceId() { + return this.leastTraceId; + } + + public void setLeastTraceId(long leastTraceId) { + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + } + + public void unsetLeastTraceId() { + __isset_bit_vector.clear(__LEASTTRACEID_ISSET_ID); + } + + /** Returns true if field leastTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetLeastTraceId() { + return __isset_bit_vector.get(__LEASTTRACEID_ISSET_ID); + } + + public void setLeastTraceIdIsSet(boolean value) { + __isset_bit_vector.set(__LEASTTRACEID_ISSET_ID, value); + } + + public long getSpanId() { + return this.spanId; + } + + public void setSpanId(long spanId) { + this.spanId = spanId; + setSpanIdIsSet(true); + } + + public void unsetSpanId() { + __isset_bit_vector.clear(__SPANID_ISSET_ID); + } + + /** Returns true if field spanId is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanId() { + return __isset_bit_vector.get(__SPANID_ISSET_ID); + } + + public void setSpanIdIsSet(boolean value) { + __isset_bit_vector.set(__SPANID_ISSET_ID, value); + } + + public long getParentSpanId() { + return this.parentSpanId; + } + + public void setParentSpanId(long parentSpanId) { + this.parentSpanId = parentSpanId; + setParentSpanIdIsSet(true); + } + + public void unsetParentSpanId() { + __isset_bit_vector.clear(__PARENTSPANID_ISSET_ID); + } + + /** Returns true if field parentSpanId is set (has been assigned a value) and false otherwise */ + public boolean isSetParentSpanId() { + return __isset_bit_vector.get(__PARENTSPANID_ISSET_ID); + } + + public void setParentSpanIdIsSet(boolean value) { + __isset_bit_vector.set(__PARENTSPANID_ISSET_ID, value); + } + + public long getStartTime() { + return this.startTime; + } + + public void setStartTime(long startTime) { + this.startTime = startTime; + setStartTimeIsSet(true); + } + + public void unsetStartTime() { + __isset_bit_vector.clear(__STARTTIME_ISSET_ID); + } + + /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ + public boolean isSetStartTime() { + return __isset_bit_vector.get(__STARTTIME_ISSET_ID); + } + + public void setStartTimeIsSet(boolean value) { + __isset_bit_vector.set(__STARTTIME_ISSET_ID, value); + } + + public int getElapsed() { + return this.elapsed; + } + + public void setElapsed(int elapsed) { + this.elapsed = elapsed; + setElapsedIsSet(true); + } + + public void unsetElapsed() { + __isset_bit_vector.clear(__ELAPSED_ISSET_ID); + } + + /** Returns true if field elapsed is set (has been assigned a value) and false otherwise */ + public boolean isSetElapsed() { + return __isset_bit_vector.get(__ELAPSED_ISSET_ID); + } + + public void setElapsedIsSet(boolean value) { + __isset_bit_vector.set(__ELAPSED_ISSET_ID, value); + } + + public String getRpc() { + return this.rpc; + } + + public void setRpc(String rpc) { + this.rpc = rpc; + } + + public void unsetRpc() { + this.rpc = null; + } + + /** Returns true if field rpc is set (has been assigned a value) and false otherwise */ + public boolean isSetRpc() { + return this.rpc != null; + } + + public void setRpcIsSet(boolean value) { + if (!value) { + this.rpc = null; + } + } + + public String getServiceName() { + return this.serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public void unsetServiceName() { + this.serviceName = null; + } + + /** Returns true if field serviceName is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceName() { + return this.serviceName != null; + } + + public void setServiceNameIsSet(boolean value) { + if (!value) { + this.serviceName = null; + } + } + + public short getServiceType() { + return this.serviceType; + } + + public void setServiceType(short serviceType) { + this.serviceType = serviceType; + setServiceTypeIsSet(true); + } + + public void unsetServiceType() { + __isset_bit_vector.clear(__SERVICETYPE_ISSET_ID); + } + + /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceType() { + return __isset_bit_vector.get(__SERVICETYPE_ISSET_ID); + } + + public void setServiceTypeIsSet(boolean value) { + __isset_bit_vector.set(__SERVICETYPE_ISSET_ID, value); + } + + public String getEndPoint() { + return this.endPoint; + } + + public void setEndPoint(String endPoint) { + this.endPoint = endPoint; + } + + public void unsetEndPoint() { + this.endPoint = null; + } + + /** Returns true if field endPoint is set (has been assigned a value) and false otherwise */ + public boolean isSetEndPoint() { + return this.endPoint != null; + } + + public void setEndPointIsSet(boolean value) { + if (!value) { + this.endPoint = null; + } + } + + public int getAnnotationsSize() { + return (this.annotations == null) ? 0 : this.annotations.size(); + } + + public java.util.Iterator getAnnotationsIterator() { + return (this.annotations == null) ? null : this.annotations.iterator(); + } + + public void addToAnnotations(Annotation elem) { + if (this.annotations == null) { + this.annotations = new ArrayList(); + } + this.annotations.add(elem); + } + + public List getAnnotations() { + return this.annotations; + } + + public void setAnnotations(List annotations) { + this.annotations = annotations; + } + + public void unsetAnnotations() { + this.annotations = null; + } + + /** Returns true if field annotations is set (has been assigned a value) and false otherwise */ + public boolean isSetAnnotations() { + return this.annotations != null; + } + + public void setAnnotationsIsSet(boolean value) { + if (!value) { + this.annotations = null; + } + } + + public short getFlag() { + return this.flag; + } + + public void setFlag(short flag) { + this.flag = flag; + setFlagIsSet(true); + } + + public void unsetFlag() { + __isset_bit_vector.clear(__FLAG_ISSET_ID); + } + + /** Returns true if field flag is set (has been assigned a value) and false otherwise */ + public boolean isSetFlag() { + return __isset_bit_vector.get(__FLAG_ISSET_ID); + } + + public void setFlagIsSet(boolean value) { + __isset_bit_vector.set(__FLAG_ISSET_ID, value); + } + + public boolean isErr() { + return this.err; + } + + public void setErr(boolean err) { + this.err = err; + setErrIsSet(true); + } + + public void unsetErr() { + __isset_bit_vector.clear(__ERR_ISSET_ID); + } + + /** Returns true if field err is set (has been assigned a value) and false otherwise */ + public boolean isSetErr() { + return __isset_bit_vector.get(__ERR_ISSET_ID); + } + + public void setErrIsSet(boolean value) { + __isset_bit_vector.set(__ERR_ISSET_ID, value); + } + + public int getSubSpanListSize() { + return (this.subSpanList == null) ? 0 : this.subSpanList.size(); + } + + public java.util.Iterator getSubSpanListIterator() { + return (this.subSpanList == null) ? null : this.subSpanList.iterator(); + } + + public void addToSubSpanList(SubSpan elem) { + if (this.subSpanList == null) { + this.subSpanList = new ArrayList(); + } + this.subSpanList.add(elem); + } + + public List getSubSpanList() { + return this.subSpanList; + } + + public void setSubSpanList(List subSpanList) { + this.subSpanList = subSpanList; + } + + public void unsetSubSpanList() { + this.subSpanList = null; + } + + /** Returns true if field subSpanList is set (has been assigned a value) and false otherwise */ + public boolean isSetSubSpanList() { + return this.subSpanList != null; + } + + public void setSubSpanListIsSet(boolean value) { + if (!value) { + this.subSpanList = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case MOST_TRACE_ID: + if (value == null) { + unsetMostTraceId(); + } else { + setMostTraceId((Long)value); + } + break; + + case LEAST_TRACE_ID: + if (value == null) { + unsetLeastTraceId(); + } else { + setLeastTraceId((Long)value); + } + break; + + case SPAN_ID: + if (value == null) { + unsetSpanId(); + } else { + setSpanId((Long)value); + } + break; + + case PARENT_SPAN_ID: + if (value == null) { + unsetParentSpanId(); + } else { + setParentSpanId((Long)value); + } + break; + + case START_TIME: + if (value == null) { + unsetStartTime(); + } else { + setStartTime((Long)value); + } + break; + + case ELAPSED: + if (value == null) { + unsetElapsed(); + } else { + setElapsed((Integer)value); + } + break; + + case RPC: + if (value == null) { + unsetRpc(); + } else { + setRpc((String)value); + } + break; + + case SERVICE_NAME: + if (value == null) { + unsetServiceName(); + } else { + setServiceName((String)value); + } + break; + + case SERVICE_TYPE: + if (value == null) { + unsetServiceType(); + } else { + setServiceType((Short)value); + } + break; + + case END_POINT: + if (value == null) { + unsetEndPoint(); + } else { + setEndPoint((String)value); + } + break; + + case ANNOTATIONS: + if (value == null) { + unsetAnnotations(); + } else { + setAnnotations((List)value); + } + break; + + case FLAG: + if (value == null) { + unsetFlag(); + } else { + setFlag((Short)value); + } + break; + + case ERR: + if (value == null) { + unsetErr(); + } else { + setErr((Boolean)value); + } + break; + + case SUB_SPAN_LIST: + if (value == null) { + unsetSubSpanList(); + } else { + setSubSpanList((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case MOST_TRACE_ID: + return Long.valueOf(getMostTraceId()); + + case LEAST_TRACE_ID: + return Long.valueOf(getLeastTraceId()); + + case SPAN_ID: + return Long.valueOf(getSpanId()); + + case PARENT_SPAN_ID: + return Long.valueOf(getParentSpanId()); + + case START_TIME: + return Long.valueOf(getStartTime()); + + case ELAPSED: + return Integer.valueOf(getElapsed()); + + case RPC: + return getRpc(); + + case SERVICE_NAME: + return getServiceName(); + + case SERVICE_TYPE: + return Short.valueOf(getServiceType()); + + case END_POINT: + return getEndPoint(); + + case ANNOTATIONS: + return getAnnotations(); + + case FLAG: + return Short.valueOf(getFlag()); + + case ERR: + return Boolean.valueOf(isErr()); + + case SUB_SPAN_LIST: + return getSubSpanList(); + + } + 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 AGENT_ID: + return isSetAgentId(); + case MOST_TRACE_ID: + return isSetMostTraceId(); + case LEAST_TRACE_ID: + return isSetLeastTraceId(); + case SPAN_ID: + return isSetSpanId(); + case PARENT_SPAN_ID: + return isSetParentSpanId(); + case START_TIME: + return isSetStartTime(); + case ELAPSED: + return isSetElapsed(); + case RPC: + return isSetRpc(); + case SERVICE_NAME: + return isSetServiceName(); + case SERVICE_TYPE: + return isSetServiceType(); + case END_POINT: + return isSetEndPoint(); + case ANNOTATIONS: + return isSetAnnotations(); + case FLAG: + return isSetFlag(); + case ERR: + return isSetErr(); + case SUB_SPAN_LIST: + return isSetSubSpanList(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Span) + return this.equals((Span)that); + return false; + } + + public boolean equals(Span that) { + if (that == null) + 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_mostTraceId = true; + boolean that_present_mostTraceId = true; + if (this_present_mostTraceId || that_present_mostTraceId) { + if (!(this_present_mostTraceId && that_present_mostTraceId)) + return false; + if (this.mostTraceId != that.mostTraceId) + return false; + } + + boolean this_present_leastTraceId = true; + boolean that_present_leastTraceId = true; + if (this_present_leastTraceId || that_present_leastTraceId) { + if (!(this_present_leastTraceId && that_present_leastTraceId)) + return false; + if (this.leastTraceId != that.leastTraceId) + return false; + } + + boolean this_present_spanId = true; + boolean that_present_spanId = true; + if (this_present_spanId || that_present_spanId) { + if (!(this_present_spanId && that_present_spanId)) + return false; + if (this.spanId != that.spanId) + return false; + } + + boolean this_present_parentSpanId = true; + boolean that_present_parentSpanId = true; + if (this_present_parentSpanId || that_present_parentSpanId) { + if (!(this_present_parentSpanId && that_present_parentSpanId)) + return false; + if (this.parentSpanId != that.parentSpanId) + return false; + } + + boolean this_present_startTime = true; + boolean that_present_startTime = true; + if (this_present_startTime || that_present_startTime) { + if (!(this_present_startTime && that_present_startTime)) + return false; + if (this.startTime != that.startTime) + return false; + } + + boolean this_present_elapsed = true; + boolean that_present_elapsed = true; + if (this_present_elapsed || that_present_elapsed) { + if (!(this_present_elapsed && that_present_elapsed)) + return false; + if (this.elapsed != that.elapsed) + return false; + } + + boolean this_present_rpc = true && this.isSetRpc(); + boolean that_present_rpc = true && that.isSetRpc(); + if (this_present_rpc || that_present_rpc) { + if (!(this_present_rpc && that_present_rpc)) + return false; + if (!this.rpc.equals(that.rpc)) + return false; + } + + boolean this_present_serviceName = true && this.isSetServiceName(); + boolean that_present_serviceName = true && that.isSetServiceName(); + if (this_present_serviceName || that_present_serviceName) { + if (!(this_present_serviceName && that_present_serviceName)) + return false; + if (!this.serviceName.equals(that.serviceName)) + return false; + } + + boolean this_present_serviceType = true; + boolean that_present_serviceType = true; + if (this_present_serviceType || that_present_serviceType) { + if (!(this_present_serviceType && that_present_serviceType)) + return false; + if (this.serviceType != that.serviceType) + return false; + } + + boolean this_present_endPoint = true && this.isSetEndPoint(); + boolean that_present_endPoint = true && that.isSetEndPoint(); + if (this_present_endPoint || that_present_endPoint) { + if (!(this_present_endPoint && that_present_endPoint)) + return false; + if (!this.endPoint.equals(that.endPoint)) + return false; + } + + boolean this_present_annotations = true && this.isSetAnnotations(); + boolean that_present_annotations = true && that.isSetAnnotations(); + if (this_present_annotations || that_present_annotations) { + if (!(this_present_annotations && that_present_annotations)) + return false; + if (!this.annotations.equals(that.annotations)) + return false; + } + + boolean this_present_flag = true && this.isSetFlag(); + boolean that_present_flag = true && that.isSetFlag(); + if (this_present_flag || that_present_flag) { + if (!(this_present_flag && that_present_flag)) + return false; + if (this.flag != that.flag) + return false; + } + + boolean this_present_err = true; + boolean that_present_err = true; + if (this_present_err || that_present_err) { + if (!(this_present_err && that_present_err)) + return false; + if (this.err != that.err) + return false; + } + + boolean this_present_subSpanList = true && this.isSetSubSpanList(); + boolean that_present_subSpanList = true && that.isSetSubSpanList(); + if (this_present_subSpanList || that_present_subSpanList) { + if (!(this_present_subSpanList && that_present_subSpanList)) + return false; + if (!this.subSpanList.equals(that.subSpanList)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(Span other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Span typedOther = (Span)other; + + 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(isSetMostTraceId()).compareTo(typedOther.isSetMostTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMostTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, typedOther.mostTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(typedOther.isSetLeastTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLeastTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, typedOther.leastTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(typedOther.isSetSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, typedOther.spanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentSpanId()).compareTo(typedOther.isSetParentSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentSpanId, typedOther.parentSpanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(typedOther.isSetStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, typedOther.startTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetElapsed()).compareTo(typedOther.isSetElapsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetElapsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.elapsed, typedOther.elapsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRpc()).compareTo(typedOther.isSetRpc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRpc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpc, typedOther.rpc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceName()).compareTo(typedOther.isSetServiceName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceName, typedOther.serviceName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(typedOther.isSetServiceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, typedOther.serviceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndPoint()).compareTo(typedOther.isSetEndPoint()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndPoint()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endPoint, typedOther.endPoint); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAnnotations()).compareTo(typedOther.isSetAnnotations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAnnotations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.annotations, typedOther.annotations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFlag()).compareTo(typedOther.isSetFlag()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFlag()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flag, typedOther.flag); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErr()).compareTo(typedOther.isSetErr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, typedOther.err); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSubSpanList()).compareTo(typedOther.isSetSubSpanList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSubSpanList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subSpanList, typedOther.subSpanList); + 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("Span("); + boolean first = true; + + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + if (!first) sb.append(", "); + sb.append("mostTraceId:"); + sb.append(this.mostTraceId); + first = false; + if (!first) sb.append(", "); + sb.append("leastTraceId:"); + sb.append(this.leastTraceId); + first = false; + if (!first) sb.append(", "); + sb.append("spanId:"); + sb.append(this.spanId); + first = false; + if (!first) sb.append(", "); + sb.append("parentSpanId:"); + sb.append(this.parentSpanId); + first = false; + if (!first) sb.append(", "); + sb.append("startTime:"); + sb.append(this.startTime); + first = false; + if (!first) sb.append(", "); + sb.append("elapsed:"); + sb.append(this.elapsed); + first = false; + if (!first) sb.append(", "); + sb.append("rpc:"); + if (this.rpc == null) { + sb.append("null"); + } else { + sb.append(this.rpc); + } + first = false; + if (!first) sb.append(", "); + sb.append("serviceName:"); + if (this.serviceName == null) { + sb.append("null"); + } else { + sb.append(this.serviceName); + } + first = false; + if (!first) sb.append(", "); + sb.append("serviceType:"); + sb.append(this.serviceType); + first = false; + if (!first) sb.append(", "); + sb.append("endPoint:"); + if (this.endPoint == null) { + sb.append("null"); + } else { + sb.append(this.endPoint); + } + first = false; + if (!first) sb.append(", "); + sb.append("annotations:"); + if (this.annotations == null) { + sb.append("null"); + } else { + sb.append(this.annotations); + } + first = false; + if (isSetFlag()) { + if (!first) sb.append(", "); + sb.append("flag:"); + sb.append(this.flag); + first = false; + } + if (!first) sb.append(", "); + sb.append("err:"); + sb.append(this.err); + first = false; + if (isSetSubSpanList()) { + if (!first) sb.append(", "); + sb.append("subSpanList:"); + if (this.subSpanList == null) { + sb.append("null"); + } else { + sb.append(this.subSpanList); + } + 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 SpanStandardSchemeFactory implements SchemeFactory { + public SpanStandardScheme getScheme() { + return new SpanStandardScheme(); + } + } + + private static class SpanStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Span 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: // 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 2: // MOST_TRACE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // LEAST_TRACE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.spanId = iprot.readI64(); + struct.setSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // PARENT_SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.parentSpanId = iprot.readI64(); + struct.setParentSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // ELAPSED + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.elapsed = iprot.readI32(); + struct.setElapsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // RPC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.rpc = iprot.readString(); + struct.setRpcIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // SERVICE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.serviceName = iprot.readString(); + struct.setServiceNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // SERVICE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // END_POINT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endPoint = iprot.readString(); + struct.setEndPointIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // ANNOTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); + struct.annotations = new ArrayList(_list32.size); + for (int _i33 = 0; _i33 < _list32.size; ++_i33) + { + Annotation _elem34; // required + _elem34 = new Annotation(); + _elem34.read(iprot); + struct.annotations.add(_elem34); + } + iprot.readListEnd(); + } + struct.setAnnotationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // FLAG + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.flag = iprot.readI16(); + struct.setFlagIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 14: // ERR + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.err = iprot.readBool(); + struct.setErrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 15: // SUB_SPAN_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list35 = iprot.readListBegin(); + struct.subSpanList = new ArrayList(_list35.size); + for (int _i36 = 0; _i36 < _list35.size; ++_i36) + { + SubSpan _elem37; // required + _elem37 = new SubSpan(); + _elem37.read(iprot); + struct.subSpanList.add(_elem37); + } + iprot.readListEnd(); + } + struct.setSubSpanListIsSet(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, Span struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentId != null) { + oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); + oprot.writeString(struct.agentId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(MOST_TRACE_ID_FIELD_DESC); + oprot.writeI64(struct.mostTraceId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LEAST_TRACE_ID_FIELD_DESC); + oprot.writeI64(struct.leastTraceId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(SPAN_ID_FIELD_DESC); + oprot.writeI64(struct.spanId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(PARENT_SPAN_ID_FIELD_DESC); + oprot.writeI64(struct.parentSpanId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(START_TIME_FIELD_DESC); + oprot.writeI64(struct.startTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(ELAPSED_FIELD_DESC); + oprot.writeI32(struct.elapsed); + oprot.writeFieldEnd(); + if (struct.rpc != null) { + oprot.writeFieldBegin(RPC_FIELD_DESC); + oprot.writeString(struct.rpc); + oprot.writeFieldEnd(); + } + if (struct.serviceName != null) { + oprot.writeFieldBegin(SERVICE_NAME_FIELD_DESC); + oprot.writeString(struct.serviceName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC); + oprot.writeI16(struct.serviceType); + oprot.writeFieldEnd(); + if (struct.endPoint != null) { + oprot.writeFieldBegin(END_POINT_FIELD_DESC); + oprot.writeString(struct.endPoint); + oprot.writeFieldEnd(); + } + if (struct.annotations != null) { + oprot.writeFieldBegin(ANNOTATIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.annotations.size())); + for (Annotation _iter38 : struct.annotations) + { + _iter38.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.isSetFlag()) { + oprot.writeFieldBegin(FLAG_FIELD_DESC); + oprot.writeI16(struct.flag); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(ERR_FIELD_DESC); + oprot.writeBool(struct.err); + oprot.writeFieldEnd(); + if (struct.subSpanList != null) { + if (struct.isSetSubSpanList()) { + oprot.writeFieldBegin(SUB_SPAN_LIST_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.subSpanList.size())); + for (SubSpan _iter39 : struct.subSpanList) + { + _iter39.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SpanTupleSchemeFactory implements SchemeFactory { + public SpanTupleScheme getScheme() { + return new SpanTupleScheme(); + } + } + + private static class SpanTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Span struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetMostTraceId()) { + optionals.set(1); + } + if (struct.isSetLeastTraceId()) { + optionals.set(2); + } + if (struct.isSetSpanId()) { + optionals.set(3); + } + if (struct.isSetParentSpanId()) { + optionals.set(4); + } + if (struct.isSetStartTime()) { + optionals.set(5); + } + if (struct.isSetElapsed()) { + optionals.set(6); + } + if (struct.isSetRpc()) { + optionals.set(7); + } + if (struct.isSetServiceName()) { + optionals.set(8); + } + if (struct.isSetServiceType()) { + optionals.set(9); + } + if (struct.isSetEndPoint()) { + optionals.set(10); + } + if (struct.isSetAnnotations()) { + optionals.set(11); + } + if (struct.isSetFlag()) { + optionals.set(12); + } + if (struct.isSetErr()) { + optionals.set(13); + } + if (struct.isSetSubSpanList()) { + optionals.set(14); + } + oprot.writeBitSet(optionals, 15); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetMostTraceId()) { + oprot.writeI64(struct.mostTraceId); + } + if (struct.isSetLeastTraceId()) { + oprot.writeI64(struct.leastTraceId); + } + if (struct.isSetSpanId()) { + oprot.writeI64(struct.spanId); + } + if (struct.isSetParentSpanId()) { + oprot.writeI64(struct.parentSpanId); + } + if (struct.isSetStartTime()) { + oprot.writeI64(struct.startTime); + } + if (struct.isSetElapsed()) { + oprot.writeI32(struct.elapsed); + } + if (struct.isSetRpc()) { + oprot.writeString(struct.rpc); + } + if (struct.isSetServiceName()) { + oprot.writeString(struct.serviceName); + } + if (struct.isSetServiceType()) { + oprot.writeI16(struct.serviceType); + } + if (struct.isSetEndPoint()) { + oprot.writeString(struct.endPoint); + } + if (struct.isSetAnnotations()) { + { + oprot.writeI32(struct.annotations.size()); + for (Annotation _iter40 : struct.annotations) + { + _iter40.write(oprot); + } + } + } + if (struct.isSetFlag()) { + oprot.writeI16(struct.flag); + } + if (struct.isSetErr()) { + oprot.writeBool(struct.err); + } + if (struct.isSetSubSpanList()) { + { + oprot.writeI32(struct.subSpanList.size()); + for (SubSpan _iter41 : struct.subSpanList) + { + _iter41.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Span struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(15); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } + if (incoming.get(2)) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } + if (incoming.get(3)) { + struct.spanId = iprot.readI64(); + struct.setSpanIdIsSet(true); + } + if (incoming.get(4)) { + struct.parentSpanId = iprot.readI64(); + struct.setParentSpanIdIsSet(true); + } + if (incoming.get(5)) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } + if (incoming.get(6)) { + struct.elapsed = iprot.readI32(); + struct.setElapsedIsSet(true); + } + if (incoming.get(7)) { + struct.rpc = iprot.readString(); + struct.setRpcIsSet(true); + } + if (incoming.get(8)) { + struct.serviceName = iprot.readString(); + struct.setServiceNameIsSet(true); + } + if (incoming.get(9)) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } + if (incoming.get(10)) { + struct.endPoint = iprot.readString(); + struct.setEndPointIsSet(true); + } + if (incoming.get(11)) { + { + org.apache.thrift.protocol.TList _list42 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.annotations = new ArrayList(_list42.size); + for (int _i43 = 0; _i43 < _list42.size; ++_i43) + { + Annotation _elem44; // required + _elem44 = new Annotation(); + _elem44.read(iprot); + struct.annotations.add(_elem44); + } + } + struct.setAnnotationsIsSet(true); + } + if (incoming.get(12)) { + struct.flag = iprot.readI16(); + struct.setFlagIsSet(true); + } + if (incoming.get(13)) { + struct.err = iprot.readBool(); + struct.setErrIsSet(true); + } + if (incoming.get(14)) { + { + org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.subSpanList = new ArrayList(_list45.size); + for (int _i46 = 0; _i46 < _list45.size; ++_i46) + { + SubSpan _elem47; // required + _elem47 = new SubSpan(); + _elem47.read(iprot); + struct.subSpanList.add(_elem47); + } + } + struct.setSubSpanListIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/SqlMetaData.java b/src/main/java/com/profiler/common/dto/thrift/SqlMetaData.java index c602b01d4..a88dc7b65 100644 --- a/src/main/java/com/profiler/common/dto/thrift/SqlMetaData.java +++ b/src/main/java/com/profiler/common/dto/thrift/SqlMetaData.java @@ -1,683 +1,669 @@ -/** - * 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 SqlMetaData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SqlMetaData"); - - 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) 1); - private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("hashCode", org.apache.thrift.protocol.TType.I32, (short) 3); - private static final org.apache.thrift.protocol.TField SQL_FIELD_DESC = new org.apache.thrift.protocol.TField("sql", org.apache.thrift.protocol.TType.STRING, (short) 4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new SqlMetaDataStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SqlMetaDataTupleSchemeFactory()); - } - - private String agentId; // required - private long startTime; // required - private int hashCode; // required - private String sql; // 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 { - AGENT_ID((short) 1, "agentId"), - START_TIME((short) 2, "startTime"), - HASH_CODE((short) 3, "hashCode"), - SQL((short) 4, "sql"); - - 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: // AGENT_ID - return AGENT_ID; - case 2: // START_TIME - return START_TIME; - case 3: // HASH_CODE - return HASH_CODE; - case 4: // SQL - return SQL; - 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 __STARTTIME_ISSET_ID = 0; - private static final int __HASHCODE_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.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.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("hashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.SQL, new org.apache.thrift.meta_data.FieldMetaData("sql", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SqlMetaData.class, metaDataMap); - } - - public SqlMetaData() { - } - - public SqlMetaData( - String agentId, - long startTime, - int hashCode, - String sql) { - this(); - this.agentId = agentId; - this.startTime = startTime; - setStartTimeIsSet(true); - this.hashCode = hashCode; - setHashCodeIsSet(true); - this.sql = sql; - } - - /** - * Performs a deep copy on other. - */ - public SqlMetaData(SqlMetaData other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetAgentId()) { - this.agentId = other.agentId; - } - this.startTime = other.startTime; - this.hashCode = other.hashCode; - if (other.isSetSql()) { - this.sql = other.sql; - } - } - - public SqlMetaData deepCopy() { - return new SqlMetaData(this); - } - - @Override - public void clear() { - this.agentId = null; - setStartTimeIsSet(false); - this.startTime = 0; - setHashCodeIsSet(false); - this.hashCode = 0; - this.sql = 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 long getStartTime() { - return this.startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - setStartTimeIsSet(true); - } - - public void unsetStartTime() { - __isset_bit_vector.clear(__STARTTIME_ISSET_ID); - } - - /** - * Returns true if field startTime is set (has been assigned a value) and false otherwise - */ - public boolean isSetStartTime() { - return __isset_bit_vector.get(__STARTTIME_ISSET_ID); - } - - public void setStartTimeIsSet(boolean value) { - __isset_bit_vector.set(__STARTTIME_ISSET_ID, value); - } - - public int getHashCode() { - return this.hashCode; - } - - public void setHashCode(int hashCode) { - this.hashCode = hashCode; - setHashCodeIsSet(true); - } - - public void unsetHashCode() { - __isset_bit_vector.clear(__HASHCODE_ISSET_ID); - } - - /** - * Returns true if field hashCode is set (has been assigned a value) and false otherwise - */ - public boolean isSetHashCode() { - return __isset_bit_vector.get(__HASHCODE_ISSET_ID); - } - - public void setHashCodeIsSet(boolean value) { - __isset_bit_vector.set(__HASHCODE_ISSET_ID, value); - } - - public String getSql() { - return this.sql; - } - - public void setSql(String sql) { - this.sql = sql; - } - - public void unsetSql() { - this.sql = null; - } - - /** - * Returns true if field sql is set (has been assigned a value) and false otherwise - */ - public boolean isSetSql() { - return this.sql != null; - } - - public void setSqlIsSet(boolean value) { - if (!value) { - this.sql = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AGENT_ID: - if (value == null) { - unsetAgentId(); - } else { - setAgentId((String) value); - } - break; - - case START_TIME: - if (value == null) { - unsetStartTime(); - } else { - setStartTime((Long) value); - } - break; - - case HASH_CODE: - if (value == null) { - unsetHashCode(); - } else { - setHashCode((Integer) value); - } - break; - - case SQL: - if (value == null) { - unsetSql(); - } else { - setSql((String) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AGENT_ID: - return getAgentId(); - - case START_TIME: - return Long.valueOf(getStartTime()); - - case HASH_CODE: - return Integer.valueOf(getHashCode()); - - case SQL: - return getSql(); - - } - 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 AGENT_ID: - return isSetAgentId(); - case START_TIME: - return isSetStartTime(); - case HASH_CODE: - return isSetHashCode(); - case SQL: - return isSetSql(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof SqlMetaData) - return this.equals((SqlMetaData) that); - return false; - } - - public boolean equals(SqlMetaData that) { - if (that == null) - 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_startTime = true; - boolean that_present_startTime = true; - if (this_present_startTime || that_present_startTime) { - if (!(this_present_startTime && that_present_startTime)) - return false; - if (this.startTime != that.startTime) - return false; - } - - boolean this_present_hashCode = true; - boolean that_present_hashCode = true; - if (this_present_hashCode || that_present_hashCode) { - if (!(this_present_hashCode && that_present_hashCode)) - return false; - if (this.hashCode != that.hashCode) - return false; - } - - boolean this_present_sql = true && this.isSetSql(); - boolean that_present_sql = true && that.isSetSql(); - if (this_present_sql || that_present_sql) { - if (!(this_present_sql && that_present_sql)) - return false; - if (!this.sql.equals(that.sql)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(SqlMetaData other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - SqlMetaData typedOther = (SqlMetaData) other; - - 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(isSetStartTime()).compareTo(typedOther.isSetStartTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, typedOther.startTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHashCode()).compareTo(typedOther.isSetHashCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHashCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hashCode, typedOther.hashCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSql()).compareTo(typedOther.isSetSql()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSql()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sql, typedOther.sql); - 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("SqlMetaData("); - boolean first = true; - - sb.append("agentId:"); - if (this.agentId == null) { - sb.append("null"); - } else { - sb.append(this.agentId); - } - first = false; - if (!first) sb.append(", "); - sb.append("startTime:"); - sb.append(this.startTime); - first = false; - if (!first) sb.append(", "); - sb.append("hashCode:"); - sb.append(this.hashCode); - first = false; - if (!first) sb.append(", "); - sb.append("sql:"); - if (this.sql == null) { - sb.append("null"); - } else { - sb.append(this.sql); - } - 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 SqlMetaDataStandardSchemeFactory implements SchemeFactory { - public SqlMetaDataStandardScheme getScheme() { - return new SqlMetaDataStandardScheme(); - } - } - - private static class SqlMetaDataStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, SqlMetaData 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: // 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 2: // START_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // HASH_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.hashCode = iprot.readI32(); - struct.setHashCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // SQL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.sql = iprot.readString(); - struct.setSqlIsSet(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, SqlMetaData struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.agentId != null) { - oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); - oprot.writeString(struct.agentId); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(START_TIME_FIELD_DESC); - oprot.writeI64(struct.startTime); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(HASH_CODE_FIELD_DESC); - oprot.writeI32(struct.hashCode); - oprot.writeFieldEnd(); - if (struct.sql != null) { - oprot.writeFieldBegin(SQL_FIELD_DESC); - oprot.writeString(struct.sql); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class SqlMetaDataTupleSchemeFactory implements SchemeFactory { - public SqlMetaDataTupleScheme getScheme() { - return new SqlMetaDataTupleScheme(); - } - } - - private static class SqlMetaDataTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, SqlMetaData struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAgentId()) { - optionals.set(0); - } - if (struct.isSetStartTime()) { - optionals.set(1); - } - if (struct.isSetHashCode()) { - optionals.set(2); - } - if (struct.isSetSql()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetAgentId()) { - oprot.writeString(struct.agentId); - } - if (struct.isSetStartTime()) { - oprot.writeI64(struct.startTime); - } - if (struct.isSetHashCode()) { - oprot.writeI32(struct.hashCode); - } - if (struct.isSetSql()) { - oprot.writeString(struct.sql); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, SqlMetaData struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.agentId = iprot.readString(); - struct.setAgentIdIsSet(true); - } - if (incoming.get(1)) { - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(true); - } - if (incoming.get(2)) { - struct.hashCode = iprot.readI32(); - struct.setHashCodeIsSet(true); - } - if (incoming.get(3)) { - struct.sql = iprot.readString(); - struct.setSqlIsSet(true); - } - } - } - -} - +/** + * 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 SqlMetaData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SqlMetaData"); + + 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)1); + private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("hashCode", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField SQL_FIELD_DESC = new org.apache.thrift.protocol.TField("sql", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SqlMetaDataStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SqlMetaDataTupleSchemeFactory()); + } + + private String agentId; // required + private long startTime; // required + private int hashCode; // required + private String sql; // 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 { + AGENT_ID((short)1, "agentId"), + START_TIME((short)2, "startTime"), + HASH_CODE((short)3, "hashCode"), + SQL((short)4, "sql"); + + 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: // AGENT_ID + return AGENT_ID; + case 2: // START_TIME + return START_TIME; + case 3: // HASH_CODE + return HASH_CODE; + case 4: // SQL + return SQL; + 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 __STARTTIME_ISSET_ID = 0; + private static final int __HASHCODE_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.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.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("hashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.SQL, new org.apache.thrift.meta_data.FieldMetaData("sql", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SqlMetaData.class, metaDataMap); + } + + public SqlMetaData() { + } + + public SqlMetaData( + String agentId, + long startTime, + int hashCode, + String sql) + { + this(); + this.agentId = agentId; + this.startTime = startTime; + setStartTimeIsSet(true); + this.hashCode = hashCode; + setHashCodeIsSet(true); + this.sql = sql; + } + + /** + * Performs a deep copy on other. + */ + public SqlMetaData(SqlMetaData other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.startTime = other.startTime; + this.hashCode = other.hashCode; + if (other.isSetSql()) { + this.sql = other.sql; + } + } + + public SqlMetaData deepCopy() { + return new SqlMetaData(this); + } + + @Override + public void clear() { + this.agentId = null; + setStartTimeIsSet(false); + this.startTime = 0; + setHashCodeIsSet(false); + this.hashCode = 0; + this.sql = 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 long getStartTime() { + return this.startTime; + } + + public void setStartTime(long startTime) { + this.startTime = startTime; + setStartTimeIsSet(true); + } + + public void unsetStartTime() { + __isset_bit_vector.clear(__STARTTIME_ISSET_ID); + } + + /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ + public boolean isSetStartTime() { + return __isset_bit_vector.get(__STARTTIME_ISSET_ID); + } + + public void setStartTimeIsSet(boolean value) { + __isset_bit_vector.set(__STARTTIME_ISSET_ID, value); + } + + public int getHashCode() { + return this.hashCode; + } + + public void setHashCode(int hashCode) { + this.hashCode = hashCode; + setHashCodeIsSet(true); + } + + public void unsetHashCode() { + __isset_bit_vector.clear(__HASHCODE_ISSET_ID); + } + + /** Returns true if field hashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetHashCode() { + return __isset_bit_vector.get(__HASHCODE_ISSET_ID); + } + + public void setHashCodeIsSet(boolean value) { + __isset_bit_vector.set(__HASHCODE_ISSET_ID, value); + } + + public String getSql() { + return this.sql; + } + + public void setSql(String sql) { + this.sql = sql; + } + + public void unsetSql() { + this.sql = null; + } + + /** Returns true if field sql is set (has been assigned a value) and false otherwise */ + public boolean isSetSql() { + return this.sql != null; + } + + public void setSqlIsSet(boolean value) { + if (!value) { + this.sql = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case START_TIME: + if (value == null) { + unsetStartTime(); + } else { + setStartTime((Long)value); + } + break; + + case HASH_CODE: + if (value == null) { + unsetHashCode(); + } else { + setHashCode((Integer)value); + } + break; + + case SQL: + if (value == null) { + unsetSql(); + } else { + setSql((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case START_TIME: + return Long.valueOf(getStartTime()); + + case HASH_CODE: + return Integer.valueOf(getHashCode()); + + case SQL: + return getSql(); + + } + 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 AGENT_ID: + return isSetAgentId(); + case START_TIME: + return isSetStartTime(); + case HASH_CODE: + return isSetHashCode(); + case SQL: + return isSetSql(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SqlMetaData) + return this.equals((SqlMetaData)that); + return false; + } + + public boolean equals(SqlMetaData that) { + if (that == null) + 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_startTime = true; + boolean that_present_startTime = true; + if (this_present_startTime || that_present_startTime) { + if (!(this_present_startTime && that_present_startTime)) + return false; + if (this.startTime != that.startTime) + return false; + } + + boolean this_present_hashCode = true; + boolean that_present_hashCode = true; + if (this_present_hashCode || that_present_hashCode) { + if (!(this_present_hashCode && that_present_hashCode)) + return false; + if (this.hashCode != that.hashCode) + return false; + } + + boolean this_present_sql = true && this.isSetSql(); + boolean that_present_sql = true && that.isSetSql(); + if (this_present_sql || that_present_sql) { + if (!(this_present_sql && that_present_sql)) + return false; + if (!this.sql.equals(that.sql)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(SqlMetaData other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + SqlMetaData typedOther = (SqlMetaData)other; + + 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(isSetStartTime()).compareTo(typedOther.isSetStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, typedOther.startTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHashCode()).compareTo(typedOther.isSetHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hashCode, typedOther.hashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSql()).compareTo(typedOther.isSetSql()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSql()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sql, typedOther.sql); + 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("SqlMetaData("); + boolean first = true; + + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + if (!first) sb.append(", "); + sb.append("startTime:"); + sb.append(this.startTime); + first = false; + if (!first) sb.append(", "); + sb.append("hashCode:"); + sb.append(this.hashCode); + first = false; + if (!first) sb.append(", "); + sb.append("sql:"); + if (this.sql == null) { + sb.append("null"); + } else { + sb.append(this.sql); + } + 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 SqlMetaDataStandardSchemeFactory implements SchemeFactory { + public SqlMetaDataStandardScheme getScheme() { + return new SqlMetaDataStandardScheme(); + } + } + + private static class SqlMetaDataStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SqlMetaData 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: // 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 2: // START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // HASH_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.hashCode = iprot.readI32(); + struct.setHashCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SQL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.sql = iprot.readString(); + struct.setSqlIsSet(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, SqlMetaData struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentId != null) { + oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); + oprot.writeString(struct.agentId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(START_TIME_FIELD_DESC); + oprot.writeI64(struct.startTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(HASH_CODE_FIELD_DESC); + oprot.writeI32(struct.hashCode); + oprot.writeFieldEnd(); + if (struct.sql != null) { + oprot.writeFieldBegin(SQL_FIELD_DESC); + oprot.writeString(struct.sql); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SqlMetaDataTupleSchemeFactory implements SchemeFactory { + public SqlMetaDataTupleScheme getScheme() { + return new SqlMetaDataTupleScheme(); + } + } + + private static class SqlMetaDataTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SqlMetaData struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetStartTime()) { + optionals.set(1); + } + if (struct.isSetHashCode()) { + optionals.set(2); + } + if (struct.isSetSql()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetStartTime()) { + oprot.writeI64(struct.startTime); + } + if (struct.isSetHashCode()) { + oprot.writeI32(struct.hashCode); + } + if (struct.isSetSql()) { + oprot.writeString(struct.sql); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SqlMetaData struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } + if (incoming.get(2)) { + struct.hashCode = iprot.readI32(); + struct.setHashCodeIsSet(true); + } + if (incoming.get(3)) { + struct.sql = iprot.readString(); + struct.setSqlIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/SubSpan.java b/src/main/java/com/profiler/common/dto/thrift/SubSpan.java index f53980a08..7c6bdc695 100644 --- a/src/main/java/com/profiler/common/dto/thrift/SubSpan.java +++ b/src/main/java/com/profiler/common/dto/thrift/SubSpan.java @@ -1,1612 +1,1584 @@ -/** - * 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 SubSpan implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SubSpan"); - - 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) 1); - private static final org.apache.thrift.protocol.TField MOST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mostTraceId", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField LEAST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leastTraceId", org.apache.thrift.protocol.TType.I64, (short) 3); - private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I64, (short) 4); - private static final org.apache.thrift.protocol.TField SEQUENCE_FIELD_DESC = new org.apache.thrift.protocol.TField("sequence", org.apache.thrift.protocol.TType.I16, (short) 5); - private static final org.apache.thrift.protocol.TField START_ELAPSED_FIELD_DESC = new org.apache.thrift.protocol.TField("startElapsed", org.apache.thrift.protocol.TType.I32, (short) 6); - private static final org.apache.thrift.protocol.TField END_ELAPSED_FIELD_DESC = new org.apache.thrift.protocol.TField("endElapsed", org.apache.thrift.protocol.TType.I32, (short) 7); - private static final org.apache.thrift.protocol.TField RPC_FIELD_DESC = new org.apache.thrift.protocol.TField("rpc", org.apache.thrift.protocol.TType.STRING, (short) 8); - private static final org.apache.thrift.protocol.TField SERVICE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceName", org.apache.thrift.protocol.TType.STRING, (short) 9); - private static final org.apache.thrift.protocol.TField SERVICE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceType", org.apache.thrift.protocol.TType.I16, (short) 10); - private static final org.apache.thrift.protocol.TField END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("endPoint", org.apache.thrift.protocol.TType.STRING, (short) 11); - private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = new org.apache.thrift.protocol.TField("err", org.apache.thrift.protocol.TType.BOOL, (short) 12); - private static final org.apache.thrift.protocol.TField ANNOTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("annotations", org.apache.thrift.protocol.TType.LIST, (short) 13); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new SubSpanStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SubSpanTupleSchemeFactory()); - } - - private String agentId; // optional - private long mostTraceId; // optional - private long leastTraceId; // optional - private long spanId; // optional - private short sequence; // required - private int startElapsed; // required - private int endElapsed; // required - private String rpc; // required - private String serviceName; // required - private short serviceType; // required - private String endPoint; // required - private boolean err; // required - private List annotations; // 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 { - AGENT_ID((short) 1, "agentId"), - MOST_TRACE_ID((short) 2, "mostTraceId"), - LEAST_TRACE_ID((short) 3, "leastTraceId"), - SPAN_ID((short) 4, "spanId"), - SEQUENCE((short) 5, "sequence"), - START_ELAPSED((short) 6, "startElapsed"), - END_ELAPSED((short) 7, "endElapsed"), - RPC((short) 8, "rpc"), - SERVICE_NAME((short) 9, "serviceName"), - SERVICE_TYPE((short) 10, "serviceType"), - END_POINT((short) 11, "endPoint"), - ERR((short) 12, "err"), - ANNOTATIONS((short) 13, "annotations"); - - 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: // AGENT_ID - return AGENT_ID; - case 2: // MOST_TRACE_ID - return MOST_TRACE_ID; - case 3: // LEAST_TRACE_ID - return LEAST_TRACE_ID; - case 4: // SPAN_ID - return SPAN_ID; - case 5: // SEQUENCE - return SEQUENCE; - case 6: // START_ELAPSED - return START_ELAPSED; - case 7: // END_ELAPSED - return END_ELAPSED; - case 8: // RPC - return RPC; - case 9: // SERVICE_NAME - return SERVICE_NAME; - case 10: // SERVICE_TYPE - return SERVICE_TYPE; - case 11: // END_POINT - return END_POINT; - case 12: // ERR - return ERR; - case 13: // ANNOTATIONS - return ANNOTATIONS; - 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 __MOSTTRACEID_ISSET_ID = 0; - private static final int __LEASTTRACEID_ISSET_ID = 1; - private static final int __SPANID_ISSET_ID = 2; - private static final int __SEQUENCE_ISSET_ID = 3; - private static final int __STARTELAPSED_ISSET_ID = 4; - private static final int __ENDELAPSED_ISSET_ID = 5; - private static final int __SERVICETYPE_ISSET_ID = 6; - private static final int __ERR_ISSET_ID = 7; - private BitSet __isset_bit_vector = new BitSet(8); - private _Fields optionals[] = {_Fields.AGENT_ID, _Fields.MOST_TRACE_ID, _Fields.LEAST_TRACE_ID, _Fields.SPAN_ID}; - 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.AGENT_ID, new org.apache.thrift.meta_data.FieldMetaData("agentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MOST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("mostTraceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.LEAST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("leastTraceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("spanId", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.SEQUENCE, new org.apache.thrift.meta_data.FieldMetaData("sequence", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.START_ELAPSED, new org.apache.thrift.meta_data.FieldMetaData("startElapsed", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.END_ELAPSED, new org.apache.thrift.meta_data.FieldMetaData("endElapsed", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.RPC, new org.apache.thrift.meta_data.FieldMetaData("rpc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SERVICE_NAME, new org.apache.thrift.meta_data.FieldMetaData("serviceName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SERVICE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("serviceType", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.END_POINT, new org.apache.thrift.meta_data.FieldMetaData("endPoint", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERR, new org.apache.thrift.meta_data.FieldMetaData("err", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.ANNOTATIONS, new org.apache.thrift.meta_data.FieldMetaData("annotations", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Annotation.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SubSpan.class, metaDataMap); - } - - public SubSpan() { - } - - public SubSpan( - short sequence, - int startElapsed, - int endElapsed, - String rpc, - String serviceName, - short serviceType, - String endPoint, - boolean err, - List annotations) { - this(); - this.sequence = sequence; - setSequenceIsSet(true); - this.startElapsed = startElapsed; - setStartElapsedIsSet(true); - this.endElapsed = endElapsed; - setEndElapsedIsSet(true); - this.rpc = rpc; - this.serviceName = serviceName; - this.serviceType = serviceType; - setServiceTypeIsSet(true); - this.endPoint = endPoint; - this.err = err; - setErrIsSet(true); - this.annotations = annotations; - } - - /** - * Performs a deep copy on other. - */ - public SubSpan(SubSpan other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetAgentId()) { - this.agentId = other.agentId; - } - this.mostTraceId = other.mostTraceId; - this.leastTraceId = other.leastTraceId; - this.spanId = other.spanId; - this.sequence = other.sequence; - this.startElapsed = other.startElapsed; - this.endElapsed = other.endElapsed; - if (other.isSetRpc()) { - this.rpc = other.rpc; - } - if (other.isSetServiceName()) { - this.serviceName = other.serviceName; - } - this.serviceType = other.serviceType; - if (other.isSetEndPoint()) { - this.endPoint = other.endPoint; - } - this.err = other.err; - if (other.isSetAnnotations()) { - List __this__annotations = new ArrayList(); - for (Annotation other_element : other.annotations) { - __this__annotations.add(new Annotation(other_element)); - } - this.annotations = __this__annotations; - } - } - - public SubSpan deepCopy() { - return new SubSpan(this); - } - - @Override - public void clear() { - this.agentId = null; - setMostTraceIdIsSet(false); - this.mostTraceId = 0; - setLeastTraceIdIsSet(false); - this.leastTraceId = 0; - setSpanIdIsSet(false); - this.spanId = 0; - setSequenceIsSet(false); - this.sequence = 0; - setStartElapsedIsSet(false); - this.startElapsed = 0; - setEndElapsedIsSet(false); - this.endElapsed = 0; - this.rpc = null; - this.serviceName = null; - setServiceTypeIsSet(false); - this.serviceType = 0; - this.endPoint = null; - setErrIsSet(false); - this.err = false; - this.annotations = 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 long getMostTraceId() { - return this.mostTraceId; - } - - public void setMostTraceId(long mostTraceId) { - this.mostTraceId = mostTraceId; - setMostTraceIdIsSet(true); - } - - public void unsetMostTraceId() { - __isset_bit_vector.clear(__MOSTTRACEID_ISSET_ID); - } - - /** - * Returns true if field mostTraceId is set (has been assigned a value) and false otherwise - */ - public boolean isSetMostTraceId() { - return __isset_bit_vector.get(__MOSTTRACEID_ISSET_ID); - } - - public void setMostTraceIdIsSet(boolean value) { - __isset_bit_vector.set(__MOSTTRACEID_ISSET_ID, value); - } - - public long getLeastTraceId() { - return this.leastTraceId; - } - - public void setLeastTraceId(long leastTraceId) { - this.leastTraceId = leastTraceId; - setLeastTraceIdIsSet(true); - } - - public void unsetLeastTraceId() { - __isset_bit_vector.clear(__LEASTTRACEID_ISSET_ID); - } - - /** - * Returns true if field leastTraceId is set (has been assigned a value) and false otherwise - */ - public boolean isSetLeastTraceId() { - return __isset_bit_vector.get(__LEASTTRACEID_ISSET_ID); - } - - public void setLeastTraceIdIsSet(boolean value) { - __isset_bit_vector.set(__LEASTTRACEID_ISSET_ID, value); - } - - public long getSpanId() { - return this.spanId; - } - - public void setSpanId(long spanId) { - this.spanId = spanId; - setSpanIdIsSet(true); - } - - public void unsetSpanId() { - __isset_bit_vector.clear(__SPANID_ISSET_ID); - } - - /** - * Returns true if field spanId is set (has been assigned a value) and false otherwise - */ - public boolean isSetSpanId() { - return __isset_bit_vector.get(__SPANID_ISSET_ID); - } - - public void setSpanIdIsSet(boolean value) { - __isset_bit_vector.set(__SPANID_ISSET_ID, value); - } - - public short getSequence() { - return this.sequence; - } - - public void setSequence(short sequence) { - this.sequence = sequence; - setSequenceIsSet(true); - } - - public void unsetSequence() { - __isset_bit_vector.clear(__SEQUENCE_ISSET_ID); - } - - /** - * Returns true if field sequence is set (has been assigned a value) and false otherwise - */ - public boolean isSetSequence() { - return __isset_bit_vector.get(__SEQUENCE_ISSET_ID); - } - - public void setSequenceIsSet(boolean value) { - __isset_bit_vector.set(__SEQUENCE_ISSET_ID, value); - } - - public int getStartElapsed() { - return this.startElapsed; - } - - public void setStartElapsed(int startElapsed) { - this.startElapsed = startElapsed; - setStartElapsedIsSet(true); - } - - public void unsetStartElapsed() { - __isset_bit_vector.clear(__STARTELAPSED_ISSET_ID); - } - - /** - * Returns true if field startElapsed is set (has been assigned a value) and false otherwise - */ - public boolean isSetStartElapsed() { - return __isset_bit_vector.get(__STARTELAPSED_ISSET_ID); - } - - public void setStartElapsedIsSet(boolean value) { - __isset_bit_vector.set(__STARTELAPSED_ISSET_ID, value); - } - - public int getEndElapsed() { - return this.endElapsed; - } - - public void setEndElapsed(int endElapsed) { - this.endElapsed = endElapsed; - setEndElapsedIsSet(true); - } - - public void unsetEndElapsed() { - __isset_bit_vector.clear(__ENDELAPSED_ISSET_ID); - } - - /** - * Returns true if field endElapsed is set (has been assigned a value) and false otherwise - */ - public boolean isSetEndElapsed() { - return __isset_bit_vector.get(__ENDELAPSED_ISSET_ID); - } - - public void setEndElapsedIsSet(boolean value) { - __isset_bit_vector.set(__ENDELAPSED_ISSET_ID, value); - } - - public String getRpc() { - return this.rpc; - } - - public void setRpc(String rpc) { - this.rpc = rpc; - } - - public void unsetRpc() { - this.rpc = null; - } - - /** - * Returns true if field rpc is set (has been assigned a value) and false otherwise - */ - public boolean isSetRpc() { - return this.rpc != null; - } - - public void setRpcIsSet(boolean value) { - if (!value) { - this.rpc = null; - } - } - - public String getServiceName() { - return this.serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public void unsetServiceName() { - this.serviceName = null; - } - - /** - * Returns true if field serviceName is set (has been assigned a value) and false otherwise - */ - public boolean isSetServiceName() { - return this.serviceName != null; - } - - public void setServiceNameIsSet(boolean value) { - if (!value) { - this.serviceName = null; - } - } - - public short getServiceType() { - return this.serviceType; - } - - public void setServiceType(short serviceType) { - this.serviceType = serviceType; - setServiceTypeIsSet(true); - } - - public void unsetServiceType() { - __isset_bit_vector.clear(__SERVICETYPE_ISSET_ID); - } - - /** - * Returns true if field serviceType is set (has been assigned a value) and false otherwise - */ - public boolean isSetServiceType() { - return __isset_bit_vector.get(__SERVICETYPE_ISSET_ID); - } - - public void setServiceTypeIsSet(boolean value) { - __isset_bit_vector.set(__SERVICETYPE_ISSET_ID, value); - } - - public String getEndPoint() { - return this.endPoint; - } - - public void setEndPoint(String endPoint) { - this.endPoint = endPoint; - } - - public void unsetEndPoint() { - this.endPoint = null; - } - - /** - * Returns true if field endPoint is set (has been assigned a value) and false otherwise - */ - public boolean isSetEndPoint() { - return this.endPoint != null; - } - - public void setEndPointIsSet(boolean value) { - if (!value) { - this.endPoint = null; - } - } - - public boolean isErr() { - return this.err; - } - - public void setErr(boolean err) { - this.err = err; - setErrIsSet(true); - } - - public void unsetErr() { - __isset_bit_vector.clear(__ERR_ISSET_ID); - } - - /** - * Returns true if field err is set (has been assigned a value) and false otherwise - */ - public boolean isSetErr() { - return __isset_bit_vector.get(__ERR_ISSET_ID); - } - - public void setErrIsSet(boolean value) { - __isset_bit_vector.set(__ERR_ISSET_ID, value); - } - - public int getAnnotationsSize() { - return (this.annotations == null) ? 0 : this.annotations.size(); - } - - public java.util.Iterator getAnnotationsIterator() { - return (this.annotations == null) ? null : this.annotations.iterator(); - } - - public void addToAnnotations(Annotation elem) { - if (this.annotations == null) { - this.annotations = new ArrayList(); - } - this.annotations.add(elem); - } - - public List getAnnotations() { - return this.annotations; - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - public void unsetAnnotations() { - this.annotations = null; - } - - /** - * Returns true if field annotations is set (has been assigned a value) and false otherwise - */ - public boolean isSetAnnotations() { - return this.annotations != null; - } - - public void setAnnotationsIsSet(boolean value) { - if (!value) { - this.annotations = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AGENT_ID: - if (value == null) { - unsetAgentId(); - } else { - setAgentId((String) value); - } - break; - - case MOST_TRACE_ID: - if (value == null) { - unsetMostTraceId(); - } else { - setMostTraceId((Long) value); - } - break; - - case LEAST_TRACE_ID: - if (value == null) { - unsetLeastTraceId(); - } else { - setLeastTraceId((Long) value); - } - break; - - case SPAN_ID: - if (value == null) { - unsetSpanId(); - } else { - setSpanId((Long) value); - } - break; - - case SEQUENCE: - if (value == null) { - unsetSequence(); - } else { - setSequence((Short) value); - } - break; - - case START_ELAPSED: - if (value == null) { - unsetStartElapsed(); - } else { - setStartElapsed((Integer) value); - } - break; - - case END_ELAPSED: - if (value == null) { - unsetEndElapsed(); - } else { - setEndElapsed((Integer) value); - } - break; - - case RPC: - if (value == null) { - unsetRpc(); - } else { - setRpc((String) value); - } - break; - - case SERVICE_NAME: - if (value == null) { - unsetServiceName(); - } else { - setServiceName((String) value); - } - break; - - case SERVICE_TYPE: - if (value == null) { - unsetServiceType(); - } else { - setServiceType((Short) value); - } - break; - - case END_POINT: - if (value == null) { - unsetEndPoint(); - } else { - setEndPoint((String) value); - } - break; - - case ERR: - if (value == null) { - unsetErr(); - } else { - setErr((Boolean) value); - } - break; - - case ANNOTATIONS: - if (value == null) { - unsetAnnotations(); - } else { - setAnnotations((List) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AGENT_ID: - return getAgentId(); - - case MOST_TRACE_ID: - return Long.valueOf(getMostTraceId()); - - case LEAST_TRACE_ID: - return Long.valueOf(getLeastTraceId()); - - case SPAN_ID: - return Long.valueOf(getSpanId()); - - case SEQUENCE: - return Short.valueOf(getSequence()); - - case START_ELAPSED: - return Integer.valueOf(getStartElapsed()); - - case END_ELAPSED: - return Integer.valueOf(getEndElapsed()); - - case RPC: - return getRpc(); - - case SERVICE_NAME: - return getServiceName(); - - case SERVICE_TYPE: - return Short.valueOf(getServiceType()); - - case END_POINT: - return getEndPoint(); - - case ERR: - return Boolean.valueOf(isErr()); - - case ANNOTATIONS: - return getAnnotations(); - - } - 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 AGENT_ID: - return isSetAgentId(); - case MOST_TRACE_ID: - return isSetMostTraceId(); - case LEAST_TRACE_ID: - return isSetLeastTraceId(); - case SPAN_ID: - return isSetSpanId(); - case SEQUENCE: - return isSetSequence(); - case START_ELAPSED: - return isSetStartElapsed(); - case END_ELAPSED: - return isSetEndElapsed(); - case RPC: - return isSetRpc(); - case SERVICE_NAME: - return isSetServiceName(); - case SERVICE_TYPE: - return isSetServiceType(); - case END_POINT: - return isSetEndPoint(); - case ERR: - return isSetErr(); - case ANNOTATIONS: - return isSetAnnotations(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof SubSpan) - return this.equals((SubSpan) that); - return false; - } - - public boolean equals(SubSpan that) { - if (that == null) - 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_mostTraceId = true && this.isSetMostTraceId(); - boolean that_present_mostTraceId = true && that.isSetMostTraceId(); - if (this_present_mostTraceId || that_present_mostTraceId) { - if (!(this_present_mostTraceId && that_present_mostTraceId)) - return false; - if (this.mostTraceId != that.mostTraceId) - return false; - } - - boolean this_present_leastTraceId = true && this.isSetLeastTraceId(); - boolean that_present_leastTraceId = true && that.isSetLeastTraceId(); - if (this_present_leastTraceId || that_present_leastTraceId) { - if (!(this_present_leastTraceId && that_present_leastTraceId)) - return false; - if (this.leastTraceId != that.leastTraceId) - return false; - } - - boolean this_present_spanId = true && this.isSetSpanId(); - boolean that_present_spanId = true && that.isSetSpanId(); - if (this_present_spanId || that_present_spanId) { - if (!(this_present_spanId && that_present_spanId)) - return false; - if (this.spanId != that.spanId) - return false; - } - - boolean this_present_sequence = true; - boolean that_present_sequence = true; - if (this_present_sequence || that_present_sequence) { - if (!(this_present_sequence && that_present_sequence)) - return false; - if (this.sequence != that.sequence) - return false; - } - - boolean this_present_startElapsed = true; - boolean that_present_startElapsed = true; - if (this_present_startElapsed || that_present_startElapsed) { - if (!(this_present_startElapsed && that_present_startElapsed)) - return false; - if (this.startElapsed != that.startElapsed) - return false; - } - - boolean this_present_endElapsed = true; - boolean that_present_endElapsed = true; - if (this_present_endElapsed || that_present_endElapsed) { - if (!(this_present_endElapsed && that_present_endElapsed)) - return false; - if (this.endElapsed != that.endElapsed) - return false; - } - - boolean this_present_rpc = true && this.isSetRpc(); - boolean that_present_rpc = true && that.isSetRpc(); - if (this_present_rpc || that_present_rpc) { - if (!(this_present_rpc && that_present_rpc)) - return false; - if (!this.rpc.equals(that.rpc)) - return false; - } - - boolean this_present_serviceName = true && this.isSetServiceName(); - boolean that_present_serviceName = true && that.isSetServiceName(); - if (this_present_serviceName || that_present_serviceName) { - if (!(this_present_serviceName && that_present_serviceName)) - return false; - if (!this.serviceName.equals(that.serviceName)) - return false; - } - - boolean this_present_serviceType = true; - boolean that_present_serviceType = true; - if (this_present_serviceType || that_present_serviceType) { - if (!(this_present_serviceType && that_present_serviceType)) - return false; - if (this.serviceType != that.serviceType) - return false; - } - - boolean this_present_endPoint = true && this.isSetEndPoint(); - boolean that_present_endPoint = true && that.isSetEndPoint(); - if (this_present_endPoint || that_present_endPoint) { - if (!(this_present_endPoint && that_present_endPoint)) - return false; - if (!this.endPoint.equals(that.endPoint)) - return false; - } - - boolean this_present_err = true; - boolean that_present_err = true; - if (this_present_err || that_present_err) { - if (!(this_present_err && that_present_err)) - return false; - if (this.err != that.err) - return false; - } - - boolean this_present_annotations = true && this.isSetAnnotations(); - boolean that_present_annotations = true && that.isSetAnnotations(); - if (this_present_annotations || that_present_annotations) { - if (!(this_present_annotations && that_present_annotations)) - return false; - if (!this.annotations.equals(that.annotations)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(SubSpan other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - SubSpan typedOther = (SubSpan) other; - - 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(isSetMostTraceId()).compareTo(typedOther.isSetMostTraceId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMostTraceId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, typedOther.mostTraceId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(typedOther.isSetLeastTraceId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLeastTraceId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, typedOther.leastTraceId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(typedOther.isSetSpanId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSpanId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, typedOther.spanId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSequence()).compareTo(typedOther.isSetSequence()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSequence()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sequence, typedOther.sequence); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStartElapsed()).compareTo(typedOther.isSetStartElapsed()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartElapsed()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startElapsed, typedOther.startElapsed); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEndElapsed()).compareTo(typedOther.isSetEndElapsed()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndElapsed()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endElapsed, typedOther.endElapsed); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRpc()).compareTo(typedOther.isSetRpc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRpc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpc, typedOther.rpc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetServiceName()).compareTo(typedOther.isSetServiceName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServiceName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceName, typedOther.serviceName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(typedOther.isSetServiceType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServiceType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, typedOther.serviceType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEndPoint()).compareTo(typedOther.isSetEndPoint()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndPoint()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endPoint, typedOther.endPoint); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErr()).compareTo(typedOther.isSetErr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, typedOther.err); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetAnnotations()).compareTo(typedOther.isSetAnnotations()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAnnotations()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.annotations, typedOther.annotations); - 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("SubSpan("); - boolean first = true; - - if (isSetAgentId()) { - sb.append("agentId:"); - if (this.agentId == null) { - sb.append("null"); - } else { - sb.append(this.agentId); - } - first = false; - } - if (isSetMostTraceId()) { - if (!first) sb.append(", "); - sb.append("mostTraceId:"); - sb.append(this.mostTraceId); - first = false; - } - if (isSetLeastTraceId()) { - if (!first) sb.append(", "); - sb.append("leastTraceId:"); - sb.append(this.leastTraceId); - first = false; - } - if (isSetSpanId()) { - if (!first) sb.append(", "); - sb.append("spanId:"); - sb.append(this.spanId); - first = false; - } - if (!first) sb.append(", "); - sb.append("sequence:"); - sb.append(this.sequence); - first = false; - if (!first) sb.append(", "); - sb.append("startElapsed:"); - sb.append(this.startElapsed); - first = false; - if (!first) sb.append(", "); - sb.append("endElapsed:"); - sb.append(this.endElapsed); - first = false; - if (!first) sb.append(", "); - sb.append("rpc:"); - if (this.rpc == null) { - sb.append("null"); - } else { - sb.append(this.rpc); - } - first = false; - if (!first) sb.append(", "); - sb.append("serviceName:"); - if (this.serviceName == null) { - sb.append("null"); - } else { - sb.append(this.serviceName); - } - first = false; - if (!first) sb.append(", "); - sb.append("serviceType:"); - sb.append(this.serviceType); - first = false; - if (!first) sb.append(", "); - sb.append("endPoint:"); - if (this.endPoint == null) { - sb.append("null"); - } else { - sb.append(this.endPoint); - } - first = false; - if (!first) sb.append(", "); - sb.append("err:"); - sb.append(this.err); - first = false; - if (!first) sb.append(", "); - sb.append("annotations:"); - if (this.annotations == null) { - sb.append("null"); - } else { - sb.append(this.annotations); - } - 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 SubSpanStandardSchemeFactory implements SchemeFactory { - public SubSpanStandardScheme getScheme() { - return new SubSpanStandardScheme(); - } - } - - private static class SubSpanStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, SubSpan 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: // 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 2: // MOST_TRACE_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.mostTraceId = iprot.readI64(); - struct.setMostTraceIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // LEAST_TRACE_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.leastTraceId = iprot.readI64(); - struct.setLeastTraceIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // SPAN_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.spanId = iprot.readI64(); - struct.setSpanIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // SEQUENCE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.sequence = iprot.readI16(); - struct.setSequenceIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // START_ELAPSED - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.startElapsed = iprot.readI32(); - struct.setStartElapsedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // END_ELAPSED - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.endElapsed = iprot.readI32(); - struct.setEndElapsedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // RPC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.rpc = iprot.readString(); - struct.setRpcIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // SERVICE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.serviceName = iprot.readString(); - struct.setServiceNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // SERVICE_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.serviceType = iprot.readI16(); - struct.setServiceTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // END_POINT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.endPoint = iprot.readString(); - struct.setEndPointIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // ERR - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.err = iprot.readBool(); - struct.setErrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 13: // ANNOTATIONS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); - struct.annotations = new ArrayList(_list24.size); - for (int _i25 = 0; _i25 < _list24.size; ++_i25) { - Annotation _elem26; // required - _elem26 = new Annotation(); - _elem26.read(iprot); - struct.annotations.add(_elem26); - } - iprot.readListEnd(); - } - struct.setAnnotationsIsSet(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, SubSpan struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.agentId != null) { - if (struct.isSetAgentId()) { - oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); - oprot.writeString(struct.agentId); - oprot.writeFieldEnd(); - } - } - if (struct.isSetMostTraceId()) { - oprot.writeFieldBegin(MOST_TRACE_ID_FIELD_DESC); - oprot.writeI64(struct.mostTraceId); - oprot.writeFieldEnd(); - } - if (struct.isSetLeastTraceId()) { - oprot.writeFieldBegin(LEAST_TRACE_ID_FIELD_DESC); - oprot.writeI64(struct.leastTraceId); - oprot.writeFieldEnd(); - } - if (struct.isSetSpanId()) { - oprot.writeFieldBegin(SPAN_ID_FIELD_DESC); - oprot.writeI64(struct.spanId); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SEQUENCE_FIELD_DESC); - oprot.writeI16(struct.sequence); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(START_ELAPSED_FIELD_DESC); - oprot.writeI32(struct.startElapsed); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(END_ELAPSED_FIELD_DESC); - oprot.writeI32(struct.endElapsed); - oprot.writeFieldEnd(); - if (struct.rpc != null) { - oprot.writeFieldBegin(RPC_FIELD_DESC); - oprot.writeString(struct.rpc); - oprot.writeFieldEnd(); - } - if (struct.serviceName != null) { - oprot.writeFieldBegin(SERVICE_NAME_FIELD_DESC); - oprot.writeString(struct.serviceName); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC); - oprot.writeI16(struct.serviceType); - oprot.writeFieldEnd(); - if (struct.endPoint != null) { - oprot.writeFieldBegin(END_POINT_FIELD_DESC); - oprot.writeString(struct.endPoint); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(ERR_FIELD_DESC); - oprot.writeBool(struct.err); - oprot.writeFieldEnd(); - if (struct.annotations != null) { - oprot.writeFieldBegin(ANNOTATIONS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.annotations.size())); - for (Annotation _iter27 : struct.annotations) { - _iter27.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class SubSpanTupleSchemeFactory implements SchemeFactory { - public SubSpanTupleScheme getScheme() { - return new SubSpanTupleScheme(); - } - } - - private static class SubSpanTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, SubSpan struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAgentId()) { - optionals.set(0); - } - if (struct.isSetMostTraceId()) { - optionals.set(1); - } - if (struct.isSetLeastTraceId()) { - optionals.set(2); - } - if (struct.isSetSpanId()) { - optionals.set(3); - } - if (struct.isSetSequence()) { - optionals.set(4); - } - if (struct.isSetStartElapsed()) { - optionals.set(5); - } - if (struct.isSetEndElapsed()) { - optionals.set(6); - } - if (struct.isSetRpc()) { - optionals.set(7); - } - if (struct.isSetServiceName()) { - optionals.set(8); - } - if (struct.isSetServiceType()) { - optionals.set(9); - } - if (struct.isSetEndPoint()) { - optionals.set(10); - } - if (struct.isSetErr()) { - optionals.set(11); - } - if (struct.isSetAnnotations()) { - optionals.set(12); - } - oprot.writeBitSet(optionals, 13); - if (struct.isSetAgentId()) { - oprot.writeString(struct.agentId); - } - if (struct.isSetMostTraceId()) { - oprot.writeI64(struct.mostTraceId); - } - if (struct.isSetLeastTraceId()) { - oprot.writeI64(struct.leastTraceId); - } - if (struct.isSetSpanId()) { - oprot.writeI64(struct.spanId); - } - if (struct.isSetSequence()) { - oprot.writeI16(struct.sequence); - } - if (struct.isSetStartElapsed()) { - oprot.writeI32(struct.startElapsed); - } - if (struct.isSetEndElapsed()) { - oprot.writeI32(struct.endElapsed); - } - if (struct.isSetRpc()) { - oprot.writeString(struct.rpc); - } - if (struct.isSetServiceName()) { - oprot.writeString(struct.serviceName); - } - if (struct.isSetServiceType()) { - oprot.writeI16(struct.serviceType); - } - if (struct.isSetEndPoint()) { - oprot.writeString(struct.endPoint); - } - if (struct.isSetErr()) { - oprot.writeBool(struct.err); - } - if (struct.isSetAnnotations()) { - { - oprot.writeI32(struct.annotations.size()); - for (Annotation _iter28 : struct.annotations) { - _iter28.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, SubSpan struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(13); - if (incoming.get(0)) { - struct.agentId = iprot.readString(); - struct.setAgentIdIsSet(true); - } - if (incoming.get(1)) { - struct.mostTraceId = iprot.readI64(); - struct.setMostTraceIdIsSet(true); - } - if (incoming.get(2)) { - struct.leastTraceId = iprot.readI64(); - struct.setLeastTraceIdIsSet(true); - } - if (incoming.get(3)) { - struct.spanId = iprot.readI64(); - struct.setSpanIdIsSet(true); - } - if (incoming.get(4)) { - struct.sequence = iprot.readI16(); - struct.setSequenceIsSet(true); - } - if (incoming.get(5)) { - struct.startElapsed = iprot.readI32(); - struct.setStartElapsedIsSet(true); - } - if (incoming.get(6)) { - struct.endElapsed = iprot.readI32(); - struct.setEndElapsedIsSet(true); - } - if (incoming.get(7)) { - struct.rpc = iprot.readString(); - struct.setRpcIsSet(true); - } - if (incoming.get(8)) { - struct.serviceName = iprot.readString(); - struct.setServiceNameIsSet(true); - } - if (incoming.get(9)) { - struct.serviceType = iprot.readI16(); - struct.setServiceTypeIsSet(true); - } - if (incoming.get(10)) { - struct.endPoint = iprot.readString(); - struct.setEndPointIsSet(true); - } - if (incoming.get(11)) { - struct.err = iprot.readBool(); - struct.setErrIsSet(true); - } - if (incoming.get(12)) { - { - org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.annotations = new ArrayList(_list29.size); - for (int _i30 = 0; _i30 < _list29.size; ++_i30) { - Annotation _elem31; // required - _elem31 = new Annotation(); - _elem31.read(iprot); - struct.annotations.add(_elem31); - } - } - struct.setAnnotationsIsSet(true); - } - } - } - -} - +/** + * 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 SubSpan implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SubSpan"); + + 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)1); + private static final org.apache.thrift.protocol.TField MOST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mostTraceId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField LEAST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leastTraceId", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField SEQUENCE_FIELD_DESC = new org.apache.thrift.protocol.TField("sequence", org.apache.thrift.protocol.TType.I16, (short)5); + private static final org.apache.thrift.protocol.TField START_ELAPSED_FIELD_DESC = new org.apache.thrift.protocol.TField("startElapsed", org.apache.thrift.protocol.TType.I32, (short)6); + private static final org.apache.thrift.protocol.TField END_ELAPSED_FIELD_DESC = new org.apache.thrift.protocol.TField("endElapsed", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField RPC_FIELD_DESC = new org.apache.thrift.protocol.TField("rpc", org.apache.thrift.protocol.TType.STRING, (short)8); + private static final org.apache.thrift.protocol.TField SERVICE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceName", org.apache.thrift.protocol.TType.STRING, (short)9); + private static final org.apache.thrift.protocol.TField SERVICE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceType", org.apache.thrift.protocol.TType.I16, (short)10); + private static final org.apache.thrift.protocol.TField END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("endPoint", org.apache.thrift.protocol.TType.STRING, (short)11); + private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = new org.apache.thrift.protocol.TField("err", org.apache.thrift.protocol.TType.BOOL, (short)12); + private static final org.apache.thrift.protocol.TField ANNOTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("annotations", org.apache.thrift.protocol.TType.LIST, (short)13); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SubSpanStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SubSpanTupleSchemeFactory()); + } + + private String agentId; // optional + private long mostTraceId; // optional + private long leastTraceId; // optional + private long spanId; // optional + private short sequence; // required + private int startElapsed; // required + private int endElapsed; // required + private String rpc; // required + private String serviceName; // required + private short serviceType; // required + private String endPoint; // required + private boolean err; // required + private List annotations; // 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 { + AGENT_ID((short)1, "agentId"), + MOST_TRACE_ID((short)2, "mostTraceId"), + LEAST_TRACE_ID((short)3, "leastTraceId"), + SPAN_ID((short)4, "spanId"), + SEQUENCE((short)5, "sequence"), + START_ELAPSED((short)6, "startElapsed"), + END_ELAPSED((short)7, "endElapsed"), + RPC((short)8, "rpc"), + SERVICE_NAME((short)9, "serviceName"), + SERVICE_TYPE((short)10, "serviceType"), + END_POINT((short)11, "endPoint"), + ERR((short)12, "err"), + ANNOTATIONS((short)13, "annotations"); + + 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: // AGENT_ID + return AGENT_ID; + case 2: // MOST_TRACE_ID + return MOST_TRACE_ID; + case 3: // LEAST_TRACE_ID + return LEAST_TRACE_ID; + case 4: // SPAN_ID + return SPAN_ID; + case 5: // SEQUENCE + return SEQUENCE; + case 6: // START_ELAPSED + return START_ELAPSED; + case 7: // END_ELAPSED + return END_ELAPSED; + case 8: // RPC + return RPC; + case 9: // SERVICE_NAME + return SERVICE_NAME; + case 10: // SERVICE_TYPE + return SERVICE_TYPE; + case 11: // END_POINT + return END_POINT; + case 12: // ERR + return ERR; + case 13: // ANNOTATIONS + return ANNOTATIONS; + 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 __MOSTTRACEID_ISSET_ID = 0; + private static final int __LEASTTRACEID_ISSET_ID = 1; + private static final int __SPANID_ISSET_ID = 2; + private static final int __SEQUENCE_ISSET_ID = 3; + private static final int __STARTELAPSED_ISSET_ID = 4; + private static final int __ENDELAPSED_ISSET_ID = 5; + private static final int __SERVICETYPE_ISSET_ID = 6; + private static final int __ERR_ISSET_ID = 7; + private BitSet __isset_bit_vector = new BitSet(8); + private _Fields optionals[] = {_Fields.AGENT_ID,_Fields.MOST_TRACE_ID,_Fields.LEAST_TRACE_ID,_Fields.SPAN_ID}; + 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.AGENT_ID, new org.apache.thrift.meta_data.FieldMetaData("agentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MOST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("mostTraceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.LEAST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("leastTraceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("spanId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SEQUENCE, new org.apache.thrift.meta_data.FieldMetaData("sequence", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.START_ELAPSED, new org.apache.thrift.meta_data.FieldMetaData("startElapsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.END_ELAPSED, new org.apache.thrift.meta_data.FieldMetaData("endElapsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.RPC, new org.apache.thrift.meta_data.FieldMetaData("rpc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SERVICE_NAME, new org.apache.thrift.meta_data.FieldMetaData("serviceName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SERVICE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("serviceType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.END_POINT, new org.apache.thrift.meta_data.FieldMetaData("endPoint", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ERR, new org.apache.thrift.meta_data.FieldMetaData("err", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.ANNOTATIONS, new org.apache.thrift.meta_data.FieldMetaData("annotations", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Annotation.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SubSpan.class, metaDataMap); + } + + public SubSpan() { + } + + public SubSpan( + short sequence, + int startElapsed, + int endElapsed, + String rpc, + String serviceName, + short serviceType, + String endPoint, + boolean err, + List annotations) + { + this(); + this.sequence = sequence; + setSequenceIsSet(true); + this.startElapsed = startElapsed; + setStartElapsedIsSet(true); + this.endElapsed = endElapsed; + setEndElapsedIsSet(true); + this.rpc = rpc; + this.serviceName = serviceName; + this.serviceType = serviceType; + setServiceTypeIsSet(true); + this.endPoint = endPoint; + this.err = err; + setErrIsSet(true); + this.annotations = annotations; + } + + /** + * Performs a deep copy on other. + */ + public SubSpan(SubSpan other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.mostTraceId = other.mostTraceId; + this.leastTraceId = other.leastTraceId; + this.spanId = other.spanId; + this.sequence = other.sequence; + this.startElapsed = other.startElapsed; + this.endElapsed = other.endElapsed; + if (other.isSetRpc()) { + this.rpc = other.rpc; + } + if (other.isSetServiceName()) { + this.serviceName = other.serviceName; + } + this.serviceType = other.serviceType; + if (other.isSetEndPoint()) { + this.endPoint = other.endPoint; + } + this.err = other.err; + if (other.isSetAnnotations()) { + List __this__annotations = new ArrayList(); + for (Annotation other_element : other.annotations) { + __this__annotations.add(new Annotation(other_element)); + } + this.annotations = __this__annotations; + } + } + + public SubSpan deepCopy() { + return new SubSpan(this); + } + + @Override + public void clear() { + this.agentId = null; + setMostTraceIdIsSet(false); + this.mostTraceId = 0; + setLeastTraceIdIsSet(false); + this.leastTraceId = 0; + setSpanIdIsSet(false); + this.spanId = 0; + setSequenceIsSet(false); + this.sequence = 0; + setStartElapsedIsSet(false); + this.startElapsed = 0; + setEndElapsedIsSet(false); + this.endElapsed = 0; + this.rpc = null; + this.serviceName = null; + setServiceTypeIsSet(false); + this.serviceType = 0; + this.endPoint = null; + setErrIsSet(false); + this.err = false; + this.annotations = 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 long getMostTraceId() { + return this.mostTraceId; + } + + public void setMostTraceId(long mostTraceId) { + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + } + + public void unsetMostTraceId() { + __isset_bit_vector.clear(__MOSTTRACEID_ISSET_ID); + } + + /** Returns true if field mostTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetMostTraceId() { + return __isset_bit_vector.get(__MOSTTRACEID_ISSET_ID); + } + + public void setMostTraceIdIsSet(boolean value) { + __isset_bit_vector.set(__MOSTTRACEID_ISSET_ID, value); + } + + public long getLeastTraceId() { + return this.leastTraceId; + } + + public void setLeastTraceId(long leastTraceId) { + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + } + + public void unsetLeastTraceId() { + __isset_bit_vector.clear(__LEASTTRACEID_ISSET_ID); + } + + /** Returns true if field leastTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetLeastTraceId() { + return __isset_bit_vector.get(__LEASTTRACEID_ISSET_ID); + } + + public void setLeastTraceIdIsSet(boolean value) { + __isset_bit_vector.set(__LEASTTRACEID_ISSET_ID, value); + } + + public long getSpanId() { + return this.spanId; + } + + public void setSpanId(long spanId) { + this.spanId = spanId; + setSpanIdIsSet(true); + } + + public void unsetSpanId() { + __isset_bit_vector.clear(__SPANID_ISSET_ID); + } + + /** Returns true if field spanId is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanId() { + return __isset_bit_vector.get(__SPANID_ISSET_ID); + } + + public void setSpanIdIsSet(boolean value) { + __isset_bit_vector.set(__SPANID_ISSET_ID, value); + } + + public short getSequence() { + return this.sequence; + } + + public void setSequence(short sequence) { + this.sequence = sequence; + setSequenceIsSet(true); + } + + public void unsetSequence() { + __isset_bit_vector.clear(__SEQUENCE_ISSET_ID); + } + + /** Returns true if field sequence is set (has been assigned a value) and false otherwise */ + public boolean isSetSequence() { + return __isset_bit_vector.get(__SEQUENCE_ISSET_ID); + } + + public void setSequenceIsSet(boolean value) { + __isset_bit_vector.set(__SEQUENCE_ISSET_ID, value); + } + + public int getStartElapsed() { + return this.startElapsed; + } + + public void setStartElapsed(int startElapsed) { + this.startElapsed = startElapsed; + setStartElapsedIsSet(true); + } + + public void unsetStartElapsed() { + __isset_bit_vector.clear(__STARTELAPSED_ISSET_ID); + } + + /** Returns true if field startElapsed is set (has been assigned a value) and false otherwise */ + public boolean isSetStartElapsed() { + return __isset_bit_vector.get(__STARTELAPSED_ISSET_ID); + } + + public void setStartElapsedIsSet(boolean value) { + __isset_bit_vector.set(__STARTELAPSED_ISSET_ID, value); + } + + public int getEndElapsed() { + return this.endElapsed; + } + + public void setEndElapsed(int endElapsed) { + this.endElapsed = endElapsed; + setEndElapsedIsSet(true); + } + + public void unsetEndElapsed() { + __isset_bit_vector.clear(__ENDELAPSED_ISSET_ID); + } + + /** Returns true if field endElapsed is set (has been assigned a value) and false otherwise */ + public boolean isSetEndElapsed() { + return __isset_bit_vector.get(__ENDELAPSED_ISSET_ID); + } + + public void setEndElapsedIsSet(boolean value) { + __isset_bit_vector.set(__ENDELAPSED_ISSET_ID, value); + } + + public String getRpc() { + return this.rpc; + } + + public void setRpc(String rpc) { + this.rpc = rpc; + } + + public void unsetRpc() { + this.rpc = null; + } + + /** Returns true if field rpc is set (has been assigned a value) and false otherwise */ + public boolean isSetRpc() { + return this.rpc != null; + } + + public void setRpcIsSet(boolean value) { + if (!value) { + this.rpc = null; + } + } + + public String getServiceName() { + return this.serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public void unsetServiceName() { + this.serviceName = null; + } + + /** Returns true if field serviceName is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceName() { + return this.serviceName != null; + } + + public void setServiceNameIsSet(boolean value) { + if (!value) { + this.serviceName = null; + } + } + + public short getServiceType() { + return this.serviceType; + } + + public void setServiceType(short serviceType) { + this.serviceType = serviceType; + setServiceTypeIsSet(true); + } + + public void unsetServiceType() { + __isset_bit_vector.clear(__SERVICETYPE_ISSET_ID); + } + + /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceType() { + return __isset_bit_vector.get(__SERVICETYPE_ISSET_ID); + } + + public void setServiceTypeIsSet(boolean value) { + __isset_bit_vector.set(__SERVICETYPE_ISSET_ID, value); + } + + public String getEndPoint() { + return this.endPoint; + } + + public void setEndPoint(String endPoint) { + this.endPoint = endPoint; + } + + public void unsetEndPoint() { + this.endPoint = null; + } + + /** Returns true if field endPoint is set (has been assigned a value) and false otherwise */ + public boolean isSetEndPoint() { + return this.endPoint != null; + } + + public void setEndPointIsSet(boolean value) { + if (!value) { + this.endPoint = null; + } + } + + public boolean isErr() { + return this.err; + } + + public void setErr(boolean err) { + this.err = err; + setErrIsSet(true); + } + + public void unsetErr() { + __isset_bit_vector.clear(__ERR_ISSET_ID); + } + + /** Returns true if field err is set (has been assigned a value) and false otherwise */ + public boolean isSetErr() { + return __isset_bit_vector.get(__ERR_ISSET_ID); + } + + public void setErrIsSet(boolean value) { + __isset_bit_vector.set(__ERR_ISSET_ID, value); + } + + public int getAnnotationsSize() { + return (this.annotations == null) ? 0 : this.annotations.size(); + } + + public java.util.Iterator getAnnotationsIterator() { + return (this.annotations == null) ? null : this.annotations.iterator(); + } + + public void addToAnnotations(Annotation elem) { + if (this.annotations == null) { + this.annotations = new ArrayList(); + } + this.annotations.add(elem); + } + + public List getAnnotations() { + return this.annotations; + } + + public void setAnnotations(List annotations) { + this.annotations = annotations; + } + + public void unsetAnnotations() { + this.annotations = null; + } + + /** Returns true if field annotations is set (has been assigned a value) and false otherwise */ + public boolean isSetAnnotations() { + return this.annotations != null; + } + + public void setAnnotationsIsSet(boolean value) { + if (!value) { + this.annotations = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case MOST_TRACE_ID: + if (value == null) { + unsetMostTraceId(); + } else { + setMostTraceId((Long)value); + } + break; + + case LEAST_TRACE_ID: + if (value == null) { + unsetLeastTraceId(); + } else { + setLeastTraceId((Long)value); + } + break; + + case SPAN_ID: + if (value == null) { + unsetSpanId(); + } else { + setSpanId((Long)value); + } + break; + + case SEQUENCE: + if (value == null) { + unsetSequence(); + } else { + setSequence((Short)value); + } + break; + + case START_ELAPSED: + if (value == null) { + unsetStartElapsed(); + } else { + setStartElapsed((Integer)value); + } + break; + + case END_ELAPSED: + if (value == null) { + unsetEndElapsed(); + } else { + setEndElapsed((Integer)value); + } + break; + + case RPC: + if (value == null) { + unsetRpc(); + } else { + setRpc((String)value); + } + break; + + case SERVICE_NAME: + if (value == null) { + unsetServiceName(); + } else { + setServiceName((String)value); + } + break; + + case SERVICE_TYPE: + if (value == null) { + unsetServiceType(); + } else { + setServiceType((Short)value); + } + break; + + case END_POINT: + if (value == null) { + unsetEndPoint(); + } else { + setEndPoint((String)value); + } + break; + + case ERR: + if (value == null) { + unsetErr(); + } else { + setErr((Boolean)value); + } + break; + + case ANNOTATIONS: + if (value == null) { + unsetAnnotations(); + } else { + setAnnotations((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case MOST_TRACE_ID: + return Long.valueOf(getMostTraceId()); + + case LEAST_TRACE_ID: + return Long.valueOf(getLeastTraceId()); + + case SPAN_ID: + return Long.valueOf(getSpanId()); + + case SEQUENCE: + return Short.valueOf(getSequence()); + + case START_ELAPSED: + return Integer.valueOf(getStartElapsed()); + + case END_ELAPSED: + return Integer.valueOf(getEndElapsed()); + + case RPC: + return getRpc(); + + case SERVICE_NAME: + return getServiceName(); + + case SERVICE_TYPE: + return Short.valueOf(getServiceType()); + + case END_POINT: + return getEndPoint(); + + case ERR: + return Boolean.valueOf(isErr()); + + case ANNOTATIONS: + return getAnnotations(); + + } + 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 AGENT_ID: + return isSetAgentId(); + case MOST_TRACE_ID: + return isSetMostTraceId(); + case LEAST_TRACE_ID: + return isSetLeastTraceId(); + case SPAN_ID: + return isSetSpanId(); + case SEQUENCE: + return isSetSequence(); + case START_ELAPSED: + return isSetStartElapsed(); + case END_ELAPSED: + return isSetEndElapsed(); + case RPC: + return isSetRpc(); + case SERVICE_NAME: + return isSetServiceName(); + case SERVICE_TYPE: + return isSetServiceType(); + case END_POINT: + return isSetEndPoint(); + case ERR: + return isSetErr(); + case ANNOTATIONS: + return isSetAnnotations(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SubSpan) + return this.equals((SubSpan)that); + return false; + } + + public boolean equals(SubSpan that) { + if (that == null) + 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_mostTraceId = true && this.isSetMostTraceId(); + boolean that_present_mostTraceId = true && that.isSetMostTraceId(); + if (this_present_mostTraceId || that_present_mostTraceId) { + if (!(this_present_mostTraceId && that_present_mostTraceId)) + return false; + if (this.mostTraceId != that.mostTraceId) + return false; + } + + boolean this_present_leastTraceId = true && this.isSetLeastTraceId(); + boolean that_present_leastTraceId = true && that.isSetLeastTraceId(); + if (this_present_leastTraceId || that_present_leastTraceId) { + if (!(this_present_leastTraceId && that_present_leastTraceId)) + return false; + if (this.leastTraceId != that.leastTraceId) + return false; + } + + boolean this_present_spanId = true && this.isSetSpanId(); + boolean that_present_spanId = true && that.isSetSpanId(); + if (this_present_spanId || that_present_spanId) { + if (!(this_present_spanId && that_present_spanId)) + return false; + if (this.spanId != that.spanId) + return false; + } + + boolean this_present_sequence = true; + boolean that_present_sequence = true; + if (this_present_sequence || that_present_sequence) { + if (!(this_present_sequence && that_present_sequence)) + return false; + if (this.sequence != that.sequence) + return false; + } + + boolean this_present_startElapsed = true; + boolean that_present_startElapsed = true; + if (this_present_startElapsed || that_present_startElapsed) { + if (!(this_present_startElapsed && that_present_startElapsed)) + return false; + if (this.startElapsed != that.startElapsed) + return false; + } + + boolean this_present_endElapsed = true; + boolean that_present_endElapsed = true; + if (this_present_endElapsed || that_present_endElapsed) { + if (!(this_present_endElapsed && that_present_endElapsed)) + return false; + if (this.endElapsed != that.endElapsed) + return false; + } + + boolean this_present_rpc = true && this.isSetRpc(); + boolean that_present_rpc = true && that.isSetRpc(); + if (this_present_rpc || that_present_rpc) { + if (!(this_present_rpc && that_present_rpc)) + return false; + if (!this.rpc.equals(that.rpc)) + return false; + } + + boolean this_present_serviceName = true && this.isSetServiceName(); + boolean that_present_serviceName = true && that.isSetServiceName(); + if (this_present_serviceName || that_present_serviceName) { + if (!(this_present_serviceName && that_present_serviceName)) + return false; + if (!this.serviceName.equals(that.serviceName)) + return false; + } + + boolean this_present_serviceType = true; + boolean that_present_serviceType = true; + if (this_present_serviceType || that_present_serviceType) { + if (!(this_present_serviceType && that_present_serviceType)) + return false; + if (this.serviceType != that.serviceType) + return false; + } + + boolean this_present_endPoint = true && this.isSetEndPoint(); + boolean that_present_endPoint = true && that.isSetEndPoint(); + if (this_present_endPoint || that_present_endPoint) { + if (!(this_present_endPoint && that_present_endPoint)) + return false; + if (!this.endPoint.equals(that.endPoint)) + return false; + } + + boolean this_present_err = true; + boolean that_present_err = true; + if (this_present_err || that_present_err) { + if (!(this_present_err && that_present_err)) + return false; + if (this.err != that.err) + return false; + } + + boolean this_present_annotations = true && this.isSetAnnotations(); + boolean that_present_annotations = true && that.isSetAnnotations(); + if (this_present_annotations || that_present_annotations) { + if (!(this_present_annotations && that_present_annotations)) + return false; + if (!this.annotations.equals(that.annotations)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(SubSpan other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + SubSpan typedOther = (SubSpan)other; + + 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(isSetMostTraceId()).compareTo(typedOther.isSetMostTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMostTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, typedOther.mostTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(typedOther.isSetLeastTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLeastTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, typedOther.leastTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(typedOther.isSetSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, typedOther.spanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSequence()).compareTo(typedOther.isSetSequence()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSequence()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sequence, typedOther.sequence); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartElapsed()).compareTo(typedOther.isSetStartElapsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartElapsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startElapsed, typedOther.startElapsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndElapsed()).compareTo(typedOther.isSetEndElapsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndElapsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endElapsed, typedOther.endElapsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRpc()).compareTo(typedOther.isSetRpc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRpc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpc, typedOther.rpc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceName()).compareTo(typedOther.isSetServiceName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceName, typedOther.serviceName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(typedOther.isSetServiceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, typedOther.serviceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndPoint()).compareTo(typedOther.isSetEndPoint()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndPoint()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endPoint, typedOther.endPoint); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErr()).compareTo(typedOther.isSetErr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, typedOther.err); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAnnotations()).compareTo(typedOther.isSetAnnotations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAnnotations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.annotations, typedOther.annotations); + 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("SubSpan("); + boolean first = true; + + if (isSetAgentId()) { + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + } + if (isSetMostTraceId()) { + if (!first) sb.append(", "); + sb.append("mostTraceId:"); + sb.append(this.mostTraceId); + first = false; + } + if (isSetLeastTraceId()) { + if (!first) sb.append(", "); + sb.append("leastTraceId:"); + sb.append(this.leastTraceId); + first = false; + } + if (isSetSpanId()) { + if (!first) sb.append(", "); + sb.append("spanId:"); + sb.append(this.spanId); + first = false; + } + if (!first) sb.append(", "); + sb.append("sequence:"); + sb.append(this.sequence); + first = false; + if (!first) sb.append(", "); + sb.append("startElapsed:"); + sb.append(this.startElapsed); + first = false; + if (!first) sb.append(", "); + sb.append("endElapsed:"); + sb.append(this.endElapsed); + first = false; + if (!first) sb.append(", "); + sb.append("rpc:"); + if (this.rpc == null) { + sb.append("null"); + } else { + sb.append(this.rpc); + } + first = false; + if (!first) sb.append(", "); + sb.append("serviceName:"); + if (this.serviceName == null) { + sb.append("null"); + } else { + sb.append(this.serviceName); + } + first = false; + if (!first) sb.append(", "); + sb.append("serviceType:"); + sb.append(this.serviceType); + first = false; + if (!first) sb.append(", "); + sb.append("endPoint:"); + if (this.endPoint == null) { + sb.append("null"); + } else { + sb.append(this.endPoint); + } + first = false; + if (!first) sb.append(", "); + sb.append("err:"); + sb.append(this.err); + first = false; + if (!first) sb.append(", "); + sb.append("annotations:"); + if (this.annotations == null) { + sb.append("null"); + } else { + sb.append(this.annotations); + } + 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 SubSpanStandardSchemeFactory implements SchemeFactory { + public SubSpanStandardScheme getScheme() { + return new SubSpanStandardScheme(); + } + } + + private static class SubSpanStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SubSpan 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: // 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 2: // MOST_TRACE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // LEAST_TRACE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.spanId = iprot.readI64(); + struct.setSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // SEQUENCE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.sequence = iprot.readI16(); + struct.setSequenceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // START_ELAPSED + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.startElapsed = iprot.readI32(); + struct.setStartElapsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // END_ELAPSED + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.endElapsed = iprot.readI32(); + struct.setEndElapsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // RPC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.rpc = iprot.readString(); + struct.setRpcIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // SERVICE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.serviceName = iprot.readString(); + struct.setServiceNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // SERVICE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // END_POINT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endPoint = iprot.readString(); + struct.setEndPointIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // ERR + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.err = iprot.readBool(); + struct.setErrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // ANNOTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); + struct.annotations = new ArrayList(_list24.size); + for (int _i25 = 0; _i25 < _list24.size; ++_i25) + { + Annotation _elem26; // required + _elem26 = new Annotation(); + _elem26.read(iprot); + struct.annotations.add(_elem26); + } + iprot.readListEnd(); + } + struct.setAnnotationsIsSet(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, SubSpan struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentId != null) { + if (struct.isSetAgentId()) { + oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); + oprot.writeString(struct.agentId); + oprot.writeFieldEnd(); + } + } + if (struct.isSetMostTraceId()) { + oprot.writeFieldBegin(MOST_TRACE_ID_FIELD_DESC); + oprot.writeI64(struct.mostTraceId); + oprot.writeFieldEnd(); + } + if (struct.isSetLeastTraceId()) { + oprot.writeFieldBegin(LEAST_TRACE_ID_FIELD_DESC); + oprot.writeI64(struct.leastTraceId); + oprot.writeFieldEnd(); + } + if (struct.isSetSpanId()) { + oprot.writeFieldBegin(SPAN_ID_FIELD_DESC); + oprot.writeI64(struct.spanId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SEQUENCE_FIELD_DESC); + oprot.writeI16(struct.sequence); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(START_ELAPSED_FIELD_DESC); + oprot.writeI32(struct.startElapsed); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(END_ELAPSED_FIELD_DESC); + oprot.writeI32(struct.endElapsed); + oprot.writeFieldEnd(); + if (struct.rpc != null) { + oprot.writeFieldBegin(RPC_FIELD_DESC); + oprot.writeString(struct.rpc); + oprot.writeFieldEnd(); + } + if (struct.serviceName != null) { + oprot.writeFieldBegin(SERVICE_NAME_FIELD_DESC); + oprot.writeString(struct.serviceName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC); + oprot.writeI16(struct.serviceType); + oprot.writeFieldEnd(); + if (struct.endPoint != null) { + oprot.writeFieldBegin(END_POINT_FIELD_DESC); + oprot.writeString(struct.endPoint); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(ERR_FIELD_DESC); + oprot.writeBool(struct.err); + oprot.writeFieldEnd(); + if (struct.annotations != null) { + oprot.writeFieldBegin(ANNOTATIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.annotations.size())); + for (Annotation _iter27 : struct.annotations) + { + _iter27.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SubSpanTupleSchemeFactory implements SchemeFactory { + public SubSpanTupleScheme getScheme() { + return new SubSpanTupleScheme(); + } + } + + private static class SubSpanTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SubSpan struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetMostTraceId()) { + optionals.set(1); + } + if (struct.isSetLeastTraceId()) { + optionals.set(2); + } + if (struct.isSetSpanId()) { + optionals.set(3); + } + if (struct.isSetSequence()) { + optionals.set(4); + } + if (struct.isSetStartElapsed()) { + optionals.set(5); + } + if (struct.isSetEndElapsed()) { + optionals.set(6); + } + if (struct.isSetRpc()) { + optionals.set(7); + } + if (struct.isSetServiceName()) { + optionals.set(8); + } + if (struct.isSetServiceType()) { + optionals.set(9); + } + if (struct.isSetEndPoint()) { + optionals.set(10); + } + if (struct.isSetErr()) { + optionals.set(11); + } + if (struct.isSetAnnotations()) { + optionals.set(12); + } + oprot.writeBitSet(optionals, 13); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetMostTraceId()) { + oprot.writeI64(struct.mostTraceId); + } + if (struct.isSetLeastTraceId()) { + oprot.writeI64(struct.leastTraceId); + } + if (struct.isSetSpanId()) { + oprot.writeI64(struct.spanId); + } + if (struct.isSetSequence()) { + oprot.writeI16(struct.sequence); + } + if (struct.isSetStartElapsed()) { + oprot.writeI32(struct.startElapsed); + } + if (struct.isSetEndElapsed()) { + oprot.writeI32(struct.endElapsed); + } + if (struct.isSetRpc()) { + oprot.writeString(struct.rpc); + } + if (struct.isSetServiceName()) { + oprot.writeString(struct.serviceName); + } + if (struct.isSetServiceType()) { + oprot.writeI16(struct.serviceType); + } + if (struct.isSetEndPoint()) { + oprot.writeString(struct.endPoint); + } + if (struct.isSetErr()) { + oprot.writeBool(struct.err); + } + if (struct.isSetAnnotations()) { + { + oprot.writeI32(struct.annotations.size()); + for (Annotation _iter28 : struct.annotations) + { + _iter28.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SubSpan struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(13); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } + if (incoming.get(2)) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } + if (incoming.get(3)) { + struct.spanId = iprot.readI64(); + struct.setSpanIdIsSet(true); + } + if (incoming.get(4)) { + struct.sequence = iprot.readI16(); + struct.setSequenceIsSet(true); + } + if (incoming.get(5)) { + struct.startElapsed = iprot.readI32(); + struct.setStartElapsedIsSet(true); + } + if (incoming.get(6)) { + struct.endElapsed = iprot.readI32(); + struct.setEndElapsedIsSet(true); + } + if (incoming.get(7)) { + struct.rpc = iprot.readString(); + struct.setRpcIsSet(true); + } + if (incoming.get(8)) { + struct.serviceName = iprot.readString(); + struct.setServiceNameIsSet(true); + } + if (incoming.get(9)) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } + if (incoming.get(10)) { + struct.endPoint = iprot.readString(); + struct.setEndPointIsSet(true); + } + if (incoming.get(11)) { + struct.err = iprot.readBool(); + struct.setErrIsSet(true); + } + if (incoming.get(12)) { + { + org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.annotations = new ArrayList(_list29.size); + for (int _i30 = 0; _i30 < _list29.size; ++_i30) + { + Annotation _elem31; // required + _elem31 = new Annotation(); + _elem31.read(iprot); + struct.annotations.add(_elem31); + } + } + struct.setAnnotationsIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/dto/thrift/SubSpanList.java b/src/main/java/com/profiler/common/dto/thrift/SubSpanList.java index a3c015b1d..069ba27cb 100644 --- a/src/main/java/com/profiler/common/dto/thrift/SubSpanList.java +++ b/src/main/java/com/profiler/common/dto/thrift/SubSpanList.java @@ -1,828 +1,816 @@ -/** - * 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 SubSpanList implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SubSpanList"); - - 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) 1); - private static final org.apache.thrift.protocol.TField MOST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mostTraceId", org.apache.thrift.protocol.TType.I64, (short) 2); - private static final org.apache.thrift.protocol.TField LEAST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leastTraceId", org.apache.thrift.protocol.TType.I64, (short) 3); - private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I64, (short) 4); - private static final org.apache.thrift.protocol.TField SUB_SPAN_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("subSpanList", org.apache.thrift.protocol.TType.LIST, (short) 6); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - - static { - schemes.put(StandardScheme.class, new SubSpanListStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SubSpanListTupleSchemeFactory()); - } - - private String agentId; // required - private long mostTraceId; // required - private long leastTraceId; // required - private long spanId; // required - private List subSpanList; // 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 { - AGENT_ID((short) 1, "agentId"), - MOST_TRACE_ID((short) 2, "mostTraceId"), - LEAST_TRACE_ID((short) 3, "leastTraceId"), - SPAN_ID((short) 4, "spanId"), - SUB_SPAN_LIST((short) 6, "subSpanList"); - - 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: // AGENT_ID - return AGENT_ID; - case 2: // MOST_TRACE_ID - return MOST_TRACE_ID; - case 3: // LEAST_TRACE_ID - return LEAST_TRACE_ID; - case 4: // SPAN_ID - return SPAN_ID; - case 6: // SUB_SPAN_LIST - return SUB_SPAN_LIST; - 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 __MOSTTRACEID_ISSET_ID = 0; - private static final int __LEASTTRACEID_ISSET_ID = 1; - private static final int __SPANID_ISSET_ID = 2; - private BitSet __isset_bit_vector = new BitSet(3); - 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.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.MOST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("mostTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.LEAST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("leastTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("spanId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.SUB_SPAN_LIST, new org.apache.thrift.meta_data.FieldMetaData("subSpanList", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SubSpan.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SubSpanList.class, metaDataMap); - } - - public SubSpanList() { - } - - public SubSpanList( - String agentId, - long mostTraceId, - long leastTraceId, - long spanId, - List subSpanList) { - this(); - this.agentId = agentId; - this.mostTraceId = mostTraceId; - setMostTraceIdIsSet(true); - this.leastTraceId = leastTraceId; - setLeastTraceIdIsSet(true); - this.spanId = spanId; - setSpanIdIsSet(true); - this.subSpanList = subSpanList; - } - - /** - * Performs a deep copy on other. - */ - public SubSpanList(SubSpanList other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetAgentId()) { - this.agentId = other.agentId; - } - this.mostTraceId = other.mostTraceId; - this.leastTraceId = other.leastTraceId; - this.spanId = other.spanId; - if (other.isSetSubSpanList()) { - List __this__subSpanList = new ArrayList(); - for (SubSpan other_element : other.subSpanList) { - __this__subSpanList.add(new SubSpan(other_element)); - } - this.subSpanList = __this__subSpanList; - } - } - - public SubSpanList deepCopy() { - return new SubSpanList(this); - } - - @Override - public void clear() { - this.agentId = null; - setMostTraceIdIsSet(false); - this.mostTraceId = 0; - setLeastTraceIdIsSet(false); - this.leastTraceId = 0; - setSpanIdIsSet(false); - this.spanId = 0; - this.subSpanList = 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 long getMostTraceId() { - return this.mostTraceId; - } - - public void setMostTraceId(long mostTraceId) { - this.mostTraceId = mostTraceId; - setMostTraceIdIsSet(true); - } - - public void unsetMostTraceId() { - __isset_bit_vector.clear(__MOSTTRACEID_ISSET_ID); - } - - /** - * Returns true if field mostTraceId is set (has been assigned a value) and false otherwise - */ - public boolean isSetMostTraceId() { - return __isset_bit_vector.get(__MOSTTRACEID_ISSET_ID); - } - - public void setMostTraceIdIsSet(boolean value) { - __isset_bit_vector.set(__MOSTTRACEID_ISSET_ID, value); - } - - public long getLeastTraceId() { - return this.leastTraceId; - } - - public void setLeastTraceId(long leastTraceId) { - this.leastTraceId = leastTraceId; - setLeastTraceIdIsSet(true); - } - - public void unsetLeastTraceId() { - __isset_bit_vector.clear(__LEASTTRACEID_ISSET_ID); - } - - /** - * Returns true if field leastTraceId is set (has been assigned a value) and false otherwise - */ - public boolean isSetLeastTraceId() { - return __isset_bit_vector.get(__LEASTTRACEID_ISSET_ID); - } - - public void setLeastTraceIdIsSet(boolean value) { - __isset_bit_vector.set(__LEASTTRACEID_ISSET_ID, value); - } - - public long getSpanId() { - return this.spanId; - } - - public void setSpanId(long spanId) { - this.spanId = spanId; - setSpanIdIsSet(true); - } - - public void unsetSpanId() { - __isset_bit_vector.clear(__SPANID_ISSET_ID); - } - - /** - * Returns true if field spanId is set (has been assigned a value) and false otherwise - */ - public boolean isSetSpanId() { - return __isset_bit_vector.get(__SPANID_ISSET_ID); - } - - public void setSpanIdIsSet(boolean value) { - __isset_bit_vector.set(__SPANID_ISSET_ID, value); - } - - public int getSubSpanListSize() { - return (this.subSpanList == null) ? 0 : this.subSpanList.size(); - } - - public java.util.Iterator getSubSpanListIterator() { - return (this.subSpanList == null) ? null : this.subSpanList.iterator(); - } - - public void addToSubSpanList(SubSpan elem) { - if (this.subSpanList == null) { - this.subSpanList = new ArrayList(); - } - this.subSpanList.add(elem); - } - - public List getSubSpanList() { - return this.subSpanList; - } - - public void setSubSpanList(List subSpanList) { - this.subSpanList = subSpanList; - } - - public void unsetSubSpanList() { - this.subSpanList = null; - } - - /** - * Returns true if field subSpanList is set (has been assigned a value) and false otherwise - */ - public boolean isSetSubSpanList() { - return this.subSpanList != null; - } - - public void setSubSpanListIsSet(boolean value) { - if (!value) { - this.subSpanList = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AGENT_ID: - if (value == null) { - unsetAgentId(); - } else { - setAgentId((String) value); - } - break; - - case MOST_TRACE_ID: - if (value == null) { - unsetMostTraceId(); - } else { - setMostTraceId((Long) value); - } - break; - - case LEAST_TRACE_ID: - if (value == null) { - unsetLeastTraceId(); - } else { - setLeastTraceId((Long) value); - } - break; - - case SPAN_ID: - if (value == null) { - unsetSpanId(); - } else { - setSpanId((Long) value); - } - break; - - case SUB_SPAN_LIST: - if (value == null) { - unsetSubSpanList(); - } else { - setSubSpanList((List) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AGENT_ID: - return getAgentId(); - - case MOST_TRACE_ID: - return Long.valueOf(getMostTraceId()); - - case LEAST_TRACE_ID: - return Long.valueOf(getLeastTraceId()); - - case SPAN_ID: - return Long.valueOf(getSpanId()); - - case SUB_SPAN_LIST: - return getSubSpanList(); - - } - 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 AGENT_ID: - return isSetAgentId(); - case MOST_TRACE_ID: - return isSetMostTraceId(); - case LEAST_TRACE_ID: - return isSetLeastTraceId(); - case SPAN_ID: - return isSetSpanId(); - case SUB_SPAN_LIST: - return isSetSubSpanList(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof SubSpanList) - return this.equals((SubSpanList) that); - return false; - } - - public boolean equals(SubSpanList that) { - if (that == null) - 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_mostTraceId = true; - boolean that_present_mostTraceId = true; - if (this_present_mostTraceId || that_present_mostTraceId) { - if (!(this_present_mostTraceId && that_present_mostTraceId)) - return false; - if (this.mostTraceId != that.mostTraceId) - return false; - } - - boolean this_present_leastTraceId = true; - boolean that_present_leastTraceId = true; - if (this_present_leastTraceId || that_present_leastTraceId) { - if (!(this_present_leastTraceId && that_present_leastTraceId)) - return false; - if (this.leastTraceId != that.leastTraceId) - return false; - } - - boolean this_present_spanId = true; - boolean that_present_spanId = true; - if (this_present_spanId || that_present_spanId) { - if (!(this_present_spanId && that_present_spanId)) - return false; - if (this.spanId != that.spanId) - return false; - } - - boolean this_present_subSpanList = true && this.isSetSubSpanList(); - boolean that_present_subSpanList = true && that.isSetSubSpanList(); - if (this_present_subSpanList || that_present_subSpanList) { - if (!(this_present_subSpanList && that_present_subSpanList)) - return false; - if (!this.subSpanList.equals(that.subSpanList)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(SubSpanList other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - SubSpanList typedOther = (SubSpanList) other; - - 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(isSetMostTraceId()).compareTo(typedOther.isSetMostTraceId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMostTraceId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, typedOther.mostTraceId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(typedOther.isSetLeastTraceId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLeastTraceId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, typedOther.leastTraceId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(typedOther.isSetSpanId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSpanId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, typedOther.spanId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSubSpanList()).compareTo(typedOther.isSetSubSpanList()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSubSpanList()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subSpanList, typedOther.subSpanList); - 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("SubSpanList("); - boolean first = true; - - sb.append("agentId:"); - if (this.agentId == null) { - sb.append("null"); - } else { - sb.append(this.agentId); - } - first = false; - if (!first) sb.append(", "); - sb.append("mostTraceId:"); - sb.append(this.mostTraceId); - first = false; - if (!first) sb.append(", "); - sb.append("leastTraceId:"); - sb.append(this.leastTraceId); - first = false; - if (!first) sb.append(", "); - sb.append("spanId:"); - sb.append(this.spanId); - first = false; - if (!first) sb.append(", "); - sb.append("subSpanList:"); - if (this.subSpanList == null) { - sb.append("null"); - } else { - sb.append(this.subSpanList); - } - 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 SubSpanListStandardSchemeFactory implements SchemeFactory { - public SubSpanListStandardScheme getScheme() { - return new SubSpanListStandardScheme(); - } - } - - private static class SubSpanListStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, SubSpanList 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: // 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 2: // MOST_TRACE_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.mostTraceId = iprot.readI64(); - struct.setMostTraceIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // LEAST_TRACE_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.leastTraceId = iprot.readI64(); - struct.setLeastTraceIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // SPAN_ID - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.spanId = iprot.readI64(); - struct.setSpanIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // SUB_SPAN_LIST - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); - struct.subSpanList = new ArrayList(_list48.size); - for (int _i49 = 0; _i49 < _list48.size; ++_i49) { - SubSpan _elem50; // required - _elem50 = new SubSpan(); - _elem50.read(iprot); - struct.subSpanList.add(_elem50); - } - iprot.readListEnd(); - } - struct.setSubSpanListIsSet(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, SubSpanList struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.agentId != null) { - oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); - oprot.writeString(struct.agentId); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(MOST_TRACE_ID_FIELD_DESC); - oprot.writeI64(struct.mostTraceId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LEAST_TRACE_ID_FIELD_DESC); - oprot.writeI64(struct.leastTraceId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(SPAN_ID_FIELD_DESC); - oprot.writeI64(struct.spanId); - oprot.writeFieldEnd(); - if (struct.subSpanList != null) { - oprot.writeFieldBegin(SUB_SPAN_LIST_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.subSpanList.size())); - for (SubSpan _iter51 : struct.subSpanList) { - _iter51.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class SubSpanListTupleSchemeFactory implements SchemeFactory { - public SubSpanListTupleScheme getScheme() { - return new SubSpanListTupleScheme(); - } - } - - private static class SubSpanListTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, SubSpanList struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAgentId()) { - optionals.set(0); - } - if (struct.isSetMostTraceId()) { - optionals.set(1); - } - if (struct.isSetLeastTraceId()) { - optionals.set(2); - } - if (struct.isSetSpanId()) { - optionals.set(3); - } - if (struct.isSetSubSpanList()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetAgentId()) { - oprot.writeString(struct.agentId); - } - if (struct.isSetMostTraceId()) { - oprot.writeI64(struct.mostTraceId); - } - if (struct.isSetLeastTraceId()) { - oprot.writeI64(struct.leastTraceId); - } - if (struct.isSetSpanId()) { - oprot.writeI64(struct.spanId); - } - if (struct.isSetSubSpanList()) { - { - oprot.writeI32(struct.subSpanList.size()); - for (SubSpan _iter52 : struct.subSpanList) { - _iter52.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, SubSpanList struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.agentId = iprot.readString(); - struct.setAgentIdIsSet(true); - } - if (incoming.get(1)) { - struct.mostTraceId = iprot.readI64(); - struct.setMostTraceIdIsSet(true); - } - if (incoming.get(2)) { - struct.leastTraceId = iprot.readI64(); - struct.setLeastTraceIdIsSet(true); - } - if (incoming.get(3)) { - struct.spanId = iprot.readI64(); - struct.setSpanIdIsSet(true); - } - if (incoming.get(4)) { - { - org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.subSpanList = new ArrayList(_list53.size); - for (int _i54 = 0; _i54 < _list53.size; ++_i54) { - SubSpan _elem55; // required - _elem55 = new SubSpan(); - _elem55.read(iprot); - struct.subSpanList.add(_elem55); - } - } - struct.setSubSpanListIsSet(true); - } - } - } - -} - +/** + * 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 SubSpanList implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SubSpanList"); + + 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)1); + private static final org.apache.thrift.protocol.TField MOST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mostTraceId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField LEAST_TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leastTraceId", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField SUB_SPAN_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("subSpanList", org.apache.thrift.protocol.TType.LIST, (short)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SubSpanListStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SubSpanListTupleSchemeFactory()); + } + + private String agentId; // required + private long mostTraceId; // required + private long leastTraceId; // required + private long spanId; // required + private List subSpanList; // 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 { + AGENT_ID((short)1, "agentId"), + MOST_TRACE_ID((short)2, "mostTraceId"), + LEAST_TRACE_ID((short)3, "leastTraceId"), + SPAN_ID((short)4, "spanId"), + SUB_SPAN_LIST((short)6, "subSpanList"); + + 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: // AGENT_ID + return AGENT_ID; + case 2: // MOST_TRACE_ID + return MOST_TRACE_ID; + case 3: // LEAST_TRACE_ID + return LEAST_TRACE_ID; + case 4: // SPAN_ID + return SPAN_ID; + case 6: // SUB_SPAN_LIST + return SUB_SPAN_LIST; + 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 __MOSTTRACEID_ISSET_ID = 0; + private static final int __LEASTTRACEID_ISSET_ID = 1; + private static final int __SPANID_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); + 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.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.MOST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("mostTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.LEAST_TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("leastTraceId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("spanId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SUB_SPAN_LIST, new org.apache.thrift.meta_data.FieldMetaData("subSpanList", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SubSpan.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SubSpanList.class, metaDataMap); + } + + public SubSpanList() { + } + + public SubSpanList( + String agentId, + long mostTraceId, + long leastTraceId, + long spanId, + List subSpanList) + { + this(); + this.agentId = agentId; + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + this.spanId = spanId; + setSpanIdIsSet(true); + this.subSpanList = subSpanList; + } + + /** + * Performs a deep copy on other. + */ + public SubSpanList(SubSpanList other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.mostTraceId = other.mostTraceId; + this.leastTraceId = other.leastTraceId; + this.spanId = other.spanId; + if (other.isSetSubSpanList()) { + List __this__subSpanList = new ArrayList(); + for (SubSpan other_element : other.subSpanList) { + __this__subSpanList.add(new SubSpan(other_element)); + } + this.subSpanList = __this__subSpanList; + } + } + + public SubSpanList deepCopy() { + return new SubSpanList(this); + } + + @Override + public void clear() { + this.agentId = null; + setMostTraceIdIsSet(false); + this.mostTraceId = 0; + setLeastTraceIdIsSet(false); + this.leastTraceId = 0; + setSpanIdIsSet(false); + this.spanId = 0; + this.subSpanList = 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 long getMostTraceId() { + return this.mostTraceId; + } + + public void setMostTraceId(long mostTraceId) { + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + } + + public void unsetMostTraceId() { + __isset_bit_vector.clear(__MOSTTRACEID_ISSET_ID); + } + + /** Returns true if field mostTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetMostTraceId() { + return __isset_bit_vector.get(__MOSTTRACEID_ISSET_ID); + } + + public void setMostTraceIdIsSet(boolean value) { + __isset_bit_vector.set(__MOSTTRACEID_ISSET_ID, value); + } + + public long getLeastTraceId() { + return this.leastTraceId; + } + + public void setLeastTraceId(long leastTraceId) { + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + } + + public void unsetLeastTraceId() { + __isset_bit_vector.clear(__LEASTTRACEID_ISSET_ID); + } + + /** Returns true if field leastTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetLeastTraceId() { + return __isset_bit_vector.get(__LEASTTRACEID_ISSET_ID); + } + + public void setLeastTraceIdIsSet(boolean value) { + __isset_bit_vector.set(__LEASTTRACEID_ISSET_ID, value); + } + + public long getSpanId() { + return this.spanId; + } + + public void setSpanId(long spanId) { + this.spanId = spanId; + setSpanIdIsSet(true); + } + + public void unsetSpanId() { + __isset_bit_vector.clear(__SPANID_ISSET_ID); + } + + /** Returns true if field spanId is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanId() { + return __isset_bit_vector.get(__SPANID_ISSET_ID); + } + + public void setSpanIdIsSet(boolean value) { + __isset_bit_vector.set(__SPANID_ISSET_ID, value); + } + + public int getSubSpanListSize() { + return (this.subSpanList == null) ? 0 : this.subSpanList.size(); + } + + public java.util.Iterator getSubSpanListIterator() { + return (this.subSpanList == null) ? null : this.subSpanList.iterator(); + } + + public void addToSubSpanList(SubSpan elem) { + if (this.subSpanList == null) { + this.subSpanList = new ArrayList(); + } + this.subSpanList.add(elem); + } + + public List getSubSpanList() { + return this.subSpanList; + } + + public void setSubSpanList(List subSpanList) { + this.subSpanList = subSpanList; + } + + public void unsetSubSpanList() { + this.subSpanList = null; + } + + /** Returns true if field subSpanList is set (has been assigned a value) and false otherwise */ + public boolean isSetSubSpanList() { + return this.subSpanList != null; + } + + public void setSubSpanListIsSet(boolean value) { + if (!value) { + this.subSpanList = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case MOST_TRACE_ID: + if (value == null) { + unsetMostTraceId(); + } else { + setMostTraceId((Long)value); + } + break; + + case LEAST_TRACE_ID: + if (value == null) { + unsetLeastTraceId(); + } else { + setLeastTraceId((Long)value); + } + break; + + case SPAN_ID: + if (value == null) { + unsetSpanId(); + } else { + setSpanId((Long)value); + } + break; + + case SUB_SPAN_LIST: + if (value == null) { + unsetSubSpanList(); + } else { + setSubSpanList((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case MOST_TRACE_ID: + return Long.valueOf(getMostTraceId()); + + case LEAST_TRACE_ID: + return Long.valueOf(getLeastTraceId()); + + case SPAN_ID: + return Long.valueOf(getSpanId()); + + case SUB_SPAN_LIST: + return getSubSpanList(); + + } + 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 AGENT_ID: + return isSetAgentId(); + case MOST_TRACE_ID: + return isSetMostTraceId(); + case LEAST_TRACE_ID: + return isSetLeastTraceId(); + case SPAN_ID: + return isSetSpanId(); + case SUB_SPAN_LIST: + return isSetSubSpanList(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SubSpanList) + return this.equals((SubSpanList)that); + return false; + } + + public boolean equals(SubSpanList that) { + if (that == null) + 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_mostTraceId = true; + boolean that_present_mostTraceId = true; + if (this_present_mostTraceId || that_present_mostTraceId) { + if (!(this_present_mostTraceId && that_present_mostTraceId)) + return false; + if (this.mostTraceId != that.mostTraceId) + return false; + } + + boolean this_present_leastTraceId = true; + boolean that_present_leastTraceId = true; + if (this_present_leastTraceId || that_present_leastTraceId) { + if (!(this_present_leastTraceId && that_present_leastTraceId)) + return false; + if (this.leastTraceId != that.leastTraceId) + return false; + } + + boolean this_present_spanId = true; + boolean that_present_spanId = true; + if (this_present_spanId || that_present_spanId) { + if (!(this_present_spanId && that_present_spanId)) + return false; + if (this.spanId != that.spanId) + return false; + } + + boolean this_present_subSpanList = true && this.isSetSubSpanList(); + boolean that_present_subSpanList = true && that.isSetSubSpanList(); + if (this_present_subSpanList || that_present_subSpanList) { + if (!(this_present_subSpanList && that_present_subSpanList)) + return false; + if (!this.subSpanList.equals(that.subSpanList)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(SubSpanList other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + SubSpanList typedOther = (SubSpanList)other; + + 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(isSetMostTraceId()).compareTo(typedOther.isSetMostTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMostTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, typedOther.mostTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(typedOther.isSetLeastTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLeastTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, typedOther.leastTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(typedOther.isSetSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, typedOther.spanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSubSpanList()).compareTo(typedOther.isSetSubSpanList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSubSpanList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subSpanList, typedOther.subSpanList); + 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("SubSpanList("); + boolean first = true; + + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + if (!first) sb.append(", "); + sb.append("mostTraceId:"); + sb.append(this.mostTraceId); + first = false; + if (!first) sb.append(", "); + sb.append("leastTraceId:"); + sb.append(this.leastTraceId); + first = false; + if (!first) sb.append(", "); + sb.append("spanId:"); + sb.append(this.spanId); + first = false; + if (!first) sb.append(", "); + sb.append("subSpanList:"); + if (this.subSpanList == null) { + sb.append("null"); + } else { + sb.append(this.subSpanList); + } + 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 SubSpanListStandardSchemeFactory implements SchemeFactory { + public SubSpanListStandardScheme getScheme() { + return new SubSpanListStandardScheme(); + } + } + + private static class SubSpanListStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SubSpanList 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: // 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 2: // MOST_TRACE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // LEAST_TRACE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.spanId = iprot.readI64(); + struct.setSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // SUB_SPAN_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); + struct.subSpanList = new ArrayList(_list48.size); + for (int _i49 = 0; _i49 < _list48.size; ++_i49) + { + SubSpan _elem50; // required + _elem50 = new SubSpan(); + _elem50.read(iprot); + struct.subSpanList.add(_elem50); + } + iprot.readListEnd(); + } + struct.setSubSpanListIsSet(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, SubSpanList struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentId != null) { + oprot.writeFieldBegin(AGENT_ID_FIELD_DESC); + oprot.writeString(struct.agentId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(MOST_TRACE_ID_FIELD_DESC); + oprot.writeI64(struct.mostTraceId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LEAST_TRACE_ID_FIELD_DESC); + oprot.writeI64(struct.leastTraceId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(SPAN_ID_FIELD_DESC); + oprot.writeI64(struct.spanId); + oprot.writeFieldEnd(); + if (struct.subSpanList != null) { + oprot.writeFieldBegin(SUB_SPAN_LIST_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.subSpanList.size())); + for (SubSpan _iter51 : struct.subSpanList) + { + _iter51.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SubSpanListTupleSchemeFactory implements SchemeFactory { + public SubSpanListTupleScheme getScheme() { + return new SubSpanListTupleScheme(); + } + } + + private static class SubSpanListTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SubSpanList struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetMostTraceId()) { + optionals.set(1); + } + if (struct.isSetLeastTraceId()) { + optionals.set(2); + } + if (struct.isSetSpanId()) { + optionals.set(3); + } + if (struct.isSetSubSpanList()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetMostTraceId()) { + oprot.writeI64(struct.mostTraceId); + } + if (struct.isSetLeastTraceId()) { + oprot.writeI64(struct.leastTraceId); + } + if (struct.isSetSpanId()) { + oprot.writeI64(struct.spanId); + } + if (struct.isSetSubSpanList()) { + { + oprot.writeI32(struct.subSpanList.size()); + for (SubSpan _iter52 : struct.subSpanList) + { + _iter52.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SubSpanList struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } + if (incoming.get(2)) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } + if (incoming.get(3)) { + struct.spanId = iprot.readI64(); + struct.setSpanIdIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.subSpanList = new ArrayList(_list53.size); + for (int _i54 = 0; _i54 < _list53.size; ++_i54) + { + SubSpan _elem55; // required + _elem55 = new SubSpan(); + _elem55.read(iprot); + struct.subSpanList.add(_elem55); + } + } + struct.setSubSpanListIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/profiler/common/util/AnnotationUtils.java b/src/main/java/com/profiler/common/util/AnnotationUtils.java new file mode 100644 index 000000000..ce0c48cbc --- /dev/null +++ b/src/main/java/com/profiler/common/util/AnnotationUtils.java @@ -0,0 +1,81 @@ +package com.profiler.common.util; + +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +import com.profiler.common.AnnotationNames; +import com.profiler.common.ServiceType; +import com.profiler.common.bo.AnnotationBo; +import com.profiler.common.bo.Span; + +public class AnnotationUtils { + + private static final String FORMAT = "yyyy-MM-dd HH:mm:ss SSS"; + + @Deprecated + public static String longToDateStr(long date) { + SimpleDateFormat format = new SimpleDateFormat(FORMAT); + return format.format(new Date(date)); + } + + public static String longLongToUUID(long mostTraceId, long leastTraceId) { + return new UUID(mostTraceId, leastTraceId).toString(); + } + + private static Comparator annotationKeyComparator = new Comparator() { + @Override + public int compare(AnnotationBo a1, AnnotationBo a2) { + return a1.getKey().compareTo(a2.getKey()); + } + }; + + public static void sortAnnotationListByKey(Span span) { + List list = span.getAnnotationBoList(); + Collections.sort(list, annotationKeyComparator); + } + + public static Object getDisplayMethod(Span span) { + List list = span.getAnnotationBoList(); + int index = Collections.binarySearch(list, AnnotationNames.API); + + if (index > -1) { + return list.get(index).getValue(); + } + + if (span.getServiceType() == ServiceType.ARCUS || span.getServiceType() == ServiceType.MEMCACHED) { + return span.getRpc(); // return OperationImpl + } + + return null; + } + + public static Object getDisplayArgument(Span span) { + List list = span.getAnnotationBoList(); + int index = -1; + if (span.getServiceType() == ServiceType.ARCUS || span.getServiceType() == ServiceType.MEMCACHED) { + index = Collections.binarySearch(list, AnnotationNames.ARCUS_COMMAND); + } + + if (span.getServiceType() == ServiceType.HTTP_CLIENT) { + index = Collections.binarySearch(list, AnnotationNames.HTTP_URL); + } + + if (span.getServiceType() == ServiceType.TOMCAT) { + index = Collections.binarySearch(list, AnnotationNames.HTTP_URL); + } + + if (span.getServiceType() == ServiceType.MYSQL) { + index = Collections.binarySearch(list, AnnotationNames.ARGS0); + } + + if (index > -1) { + return list.get(index).getValue(); + } + + return null; + } +}