From f175dec268cdd5e491cbabb5605d2d3fb76c90dd Mon Sep 17 00:00:00 2001 From: Woonduk Kang Date: Tue, 3 Sep 2013 08:02:31 +0000 Subject: [PATCH] =?UTF-8?q?[=EA=B0=95=EC=9A=B4=EB=8D=95]=20[LUCYSUS-1897]?= =?UTF-8?q?=20thrift=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=EB=A5=BC=20?= =?UTF-8?q?=EC=9E=98=EB=AA=BB=20commit=ED=95=98=EC=97=AC=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=9D=B4=EB=8F=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.bds.nhncorp.com/pe/pinpoint-thrift/trunk@2274 84d0f5b1-2673-498c-a247-62c4ff18d310 --- .../nhn/pinpoint/thrift/dto/AgentInfo.java | 1157 ++++++++ .../com/nhn/pinpoint/thrift/dto/AgentKey.java | 584 +++++ .../nhn/pinpoint/thrift/dto/AgentStat.java | 421 +++ .../nhn/pinpoint/thrift/dto/Annotation.java | 1160 ++++++++ .../nhn/pinpoint/thrift/dto/ApiMetaData.java | 769 ++++++ .../pinpoint/thrift/dto/JVMInfoThriftDTO.java | 1418 ++++++++++ .../thrift/dto/RequestDataListThriftDTO.java | 635 +++++ .../thrift/dto/RequestDataThriftDTO.java | 1539 +++++++++++ .../pinpoint/thrift/dto/RequestThriftDTO.java | 2025 ++++++++++++++ .../com/nhn/pinpoint/thrift/dto/Result.java | 485 ++++ .../com/nhn/pinpoint/thrift/dto/Span.java | 2333 +++++++++++++++++ .../nhn/pinpoint/thrift/dto/SpanChunk.java | 1208 +++++++++ .../nhn/pinpoint/thrift/dto/SpanEvent.java | 2040 ++++++++++++++ .../nhn/pinpoint/thrift/dto/SqlMetaData.java | 674 +++++ .../thrift/dto/StatWithCmsCollector.java | 2072 +++++++++++++++ .../thrift/dto/StatWithG1Collector.java | 482 ++++ .../thrift/dto/StatWithParallelCollector.java | 482 ++++ .../nhn/pinpoint/thrift/io/BytesUtils.java | 14 + .../thrift/io/DefaultTBaseLocator.java | 147 ++ .../com/nhn/pinpoint/thrift/io/Header.java | 55 + .../thrift/io/HeaderTBaseDeserializer.java | 110 + .../thrift/io/HeaderTBaseSerializer.java | 116 + .../nhn/pinpoint/thrift/io/HeaderUtils.java | 8 + .../nhn/pinpoint/thrift/io/PacketUtils.java | 18 + .../thrift/io/SafeHeaderTBaseSerializer.java | 112 + .../nhn/pinpoint/thrift/io/TBaseLocator.java | 12 + .../io/UnsafeByteArrayOutputStream.java | 185 ++ src/main/thrift/Pinpoint.thrift | 115 + src/main/thrift/Trace.thrift | 122 + .../thrift/io/HeaderTBaseSerializerTest.java | 44 + .../nhn/pinpoint/thrift/io/HeaderTest.java | 18 + .../pinpoint/thrift/io/HeaderUtilsTest.java | 26 + .../pinpoint/thrift/io/PacketUtilsTest.java | 45 + thrift.properties | 3 + 34 files changed, 20634 insertions(+) create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/AgentInfo.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/AgentKey.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/AgentStat.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/Annotation.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/ApiMetaData.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/JVMInfoThriftDTO.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/RequestDataListThriftDTO.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/RequestDataThriftDTO.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/RequestThriftDTO.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/Result.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/Span.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/SpanChunk.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/SpanEvent.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/SqlMetaData.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/StatWithCmsCollector.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/StatWithG1Collector.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/dto/StatWithParallelCollector.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/BytesUtils.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/DefaultTBaseLocator.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/Header.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseDeserializer.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializer.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/HeaderUtils.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/PacketUtils.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/SafeHeaderTBaseSerializer.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/TBaseLocator.java create mode 100644 src/main/java/com/nhn/pinpoint/thrift/io/UnsafeByteArrayOutputStream.java create mode 100644 src/main/thrift/Pinpoint.thrift create mode 100644 src/main/thrift/Trace.thrift create mode 100644 src/test/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializerTest.java create mode 100644 src/test/java/com/nhn/pinpoint/thrift/io/HeaderTest.java create mode 100644 src/test/java/com/nhn/pinpoint/thrift/io/HeaderUtilsTest.java create mode 100644 src/test/java/com/nhn/pinpoint/thrift/io/PacketUtilsTest.java create mode 100644 thrift.properties diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/AgentInfo.java b/src/main/java/com/nhn/pinpoint/thrift/dto/AgentInfo.java new file mode 100644 index 000000000..28cc1ea12 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/AgentInfo.java @@ -0,0 +1,1157 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AgentInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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 IP_FIELD_DESC = new org.apache.thrift.protocol.TField("ip", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + 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)4); + 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)5); + 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)6); + 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)7); + 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)8); + private static final org.apache.thrift.protocol.TField IDENTIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("identifier", org.apache.thrift.protocol.TType.I16, (short)9); + + 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 ip; // required + private String ports; // required + private String agentId; // required + private String applicationName; // required + private short serviceType; // required + private boolean isAlive; // required + private long timestamp; // required + private short identifier; // 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"), + IP((short)2, "ip"), + PORTS((short)3, "ports"), + AGENT_ID((short)4, "agentId"), + APPLICATION_NAME((short)5, "applicationName"), + SERVICE_TYPE((short)6, "serviceType"), + IS_ALIVE((short)7, "isAlive"), + TIMESTAMP((short)8, "timestamp"), + IDENTIFIER((short)9, "identifier"); + + 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: // IP + return IP; + case 3: // PORTS + return PORTS; + case 4: // AGENT_ID + return AGENT_ID; + case 5: // APPLICATION_NAME + return APPLICATION_NAME; + case 6: // SERVICE_TYPE + return SERVICE_TYPE; + case 7: // IS_ALIVE + return IS_ALIVE; + case 8: // TIMESTAMP + return TIMESTAMP; + case 9: // IDENTIFIER + return IDENTIFIER; + 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 __SERVICETYPE_ISSET_ID = 0; + private static final int __ISALIVE_ISSET_ID = 1; + private static final int __TIMESTAMP_ISSET_ID = 2; + private static final int __IDENTIFIER_ISSET_ID = 3; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.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.IP, new org.apache.thrift.meta_data.FieldMetaData("ip", 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.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.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))); + tmpMap.put(_Fields.IDENTIFIER, new org.apache.thrift.meta_data.FieldMetaData("identifier", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AgentInfo.class, metaDataMap); + } + + public AgentInfo() { + } + + public AgentInfo( + String hostname, + String ip, + String ports, + String agentId, + String applicationName, + short serviceType, + boolean isAlive, + long timestamp, + short identifier) + { + this(); + this.hostname = hostname; + this.ip = ip; + this.ports = ports; + this.agentId = agentId; + this.applicationName = applicationName; + this.serviceType = serviceType; + setServiceTypeIsSet(true); + this.isAlive = isAlive; + setIsAliveIsSet(true); + this.timestamp = timestamp; + setTimestampIsSet(true); + this.identifier = identifier; + setIdentifierIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public AgentInfo(AgentInfo other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetHostname()) { + this.hostname = other.hostname; + } + if (other.isSetIp()) { + this.ip = other.ip; + } + if (other.isSetPorts()) { + this.ports = other.ports; + } + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + if (other.isSetApplicationName()) { + this.applicationName = other.applicationName; + } + this.serviceType = other.serviceType; + this.isAlive = other.isAlive; + this.timestamp = other.timestamp; + this.identifier = other.identifier; + } + + public AgentInfo deepCopy() { + return new AgentInfo(this); + } + + @Override + public void clear() { + this.hostname = null; + this.ip = null; + this.ports = null; + this.agentId = null; + this.applicationName = null; + setServiceTypeIsSet(false); + this.serviceType = 0; + setIsAliveIsSet(false); + this.isAlive = false; + setTimestampIsSet(false); + this.timestamp = 0; + setIdentifierIsSet(false); + this.identifier = 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 getIp() { + return this.ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public void unsetIp() { + this.ip = null; + } + + /** Returns true if field ip is set (has been assigned a value) and false otherwise */ + public boolean isSetIp() { + return this.ip != null; + } + + public void setIpIsSet(boolean value) { + if (!value) { + this.ip = 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 short getServiceType() { + return this.serviceType; + } + + public void setServiceType(short serviceType) { + this.serviceType = serviceType; + setServiceTypeIsSet(true); + } + + public void unsetServiceType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceType() { + return EncodingUtils.testBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + public void setServiceTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SERVICETYPE_ISSET_ID, value); + } + + public boolean isIsAlive() { + return this.isAlive; + } + + public void setIsAlive(boolean isAlive) { + this.isAlive = isAlive; + setIsAliveIsSet(true); + } + + public void unsetIsAlive() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISALIVE_ISSET_ID); + } + + /** Returns true if field isAlive is set (has been assigned a value) and false otherwise */ + public boolean isSetIsAlive() { + return EncodingUtils.testBit(__isset_bitfield, __ISALIVE_ISSET_ID); + } + + public void setIsAliveIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISALIVE_ISSET_ID, value); + } + + public long getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public short getIdentifier() { + return this.identifier; + } + + public void setIdentifier(short identifier) { + this.identifier = identifier; + setIdentifierIsSet(true); + } + + public void unsetIdentifier() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __IDENTIFIER_ISSET_ID); + } + + /** Returns true if field identifier is set (has been assigned a value) and false otherwise */ + public boolean isSetIdentifier() { + return EncodingUtils.testBit(__isset_bitfield, __IDENTIFIER_ISSET_ID); + } + + public void setIdentifierIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __IDENTIFIER_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HOSTNAME: + if (value == null) { + unsetHostname(); + } else { + setHostname((String)value); + } + break; + + case IP: + if (value == null) { + unsetIp(); + } else { + setIp((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 SERVICE_TYPE: + if (value == null) { + unsetServiceType(); + } else { + setServiceType((Short)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; + + case IDENTIFIER: + if (value == null) { + unsetIdentifier(); + } else { + setIdentifier((Short)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HOSTNAME: + return getHostname(); + + case IP: + return getIp(); + + case PORTS: + return getPorts(); + + case AGENT_ID: + return getAgentId(); + + case APPLICATION_NAME: + return getApplicationName(); + + case SERVICE_TYPE: + return Short.valueOf(getServiceType()); + + case IS_ALIVE: + return Boolean.valueOf(isIsAlive()); + + case TIMESTAMP: + return Long.valueOf(getTimestamp()); + + case IDENTIFIER: + return Short.valueOf(getIdentifier()); + + } + 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 IP: + return isSetIp(); + case PORTS: + return isSetPorts(); + case AGENT_ID: + return isSetAgentId(); + case APPLICATION_NAME: + return isSetApplicationName(); + case SERVICE_TYPE: + return isSetServiceType(); + case IS_ALIVE: + return isSetIsAlive(); + case TIMESTAMP: + return isSetTimestamp(); + case IDENTIFIER: + return isSetIdentifier(); + } + 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_ip = true && this.isSetIp(); + boolean that_present_ip = true && that.isSetIp(); + if (this_present_ip || that_present_ip) { + if (!(this_present_ip && that_present_ip)) + return false; + if (!this.ip.equals(that.ip)) + 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_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_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; + } + + boolean this_present_identifier = true; + boolean that_present_identifier = true; + if (this_present_identifier || that_present_identifier) { + if (!(this_present_identifier && that_present_identifier)) + return false; + if (this.identifier != that.identifier) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(AgentInfo other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetHostname()).compareTo(other.isSetHostname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHostname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostname, other.hostname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIp()).compareTo(other.isSetIp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ip, other.ip); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPorts()).compareTo(other.isSetPorts()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPorts()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ports, other.ports); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetApplicationName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(other.isSetServiceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, other.serviceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsAlive()).compareTo(other.isSetIsAlive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsAlive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isAlive, other.isAlive); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIdentifier()).compareTo(other.isSetIdentifier()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIdentifier()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.identifier, other.identifier); + 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("ip:"); + if (this.ip == null) { + sb.append("null"); + } else { + sb.append(this.ip); + } + 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("serviceType:"); + sb.append(this.serviceType); + 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; + if (!first) sb.append(", "); + sb.append("identifier:"); + sb.append(this.identifier); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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: // IP + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ip = iprot.readString(); + struct.setIpIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // 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 4: // 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 5: // 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 6: // 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 7: // 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 8: // 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; + case 9: // IDENTIFIER + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.identifier = iprot.readI16(); + struct.setIdentifierIsSet(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.ip != null) { + oprot.writeFieldBegin(IP_FIELD_DESC); + oprot.writeString(struct.ip); + 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(SERVICE_TYPE_FIELD_DESC); + oprot.writeI16(struct.serviceType); + 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.writeFieldBegin(IDENTIFIER_FIELD_DESC); + oprot.writeI16(struct.identifier); + 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.isSetIp()) { + optionals.set(1); + } + if (struct.isSetPorts()) { + optionals.set(2); + } + if (struct.isSetAgentId()) { + optionals.set(3); + } + if (struct.isSetApplicationName()) { + optionals.set(4); + } + if (struct.isSetServiceType()) { + optionals.set(5); + } + if (struct.isSetIsAlive()) { + optionals.set(6); + } + if (struct.isSetTimestamp()) { + optionals.set(7); + } + if (struct.isSetIdentifier()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetHostname()) { + oprot.writeString(struct.hostname); + } + if (struct.isSetIp()) { + oprot.writeString(struct.ip); + } + if (struct.isSetPorts()) { + oprot.writeString(struct.ports); + } + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetApplicationName()) { + oprot.writeString(struct.applicationName); + } + if (struct.isSetServiceType()) { + oprot.writeI16(struct.serviceType); + } + if (struct.isSetIsAlive()) { + oprot.writeBool(struct.isAlive); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetIdentifier()) { + oprot.writeI16(struct.identifier); + } + } + + @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(9); + if (incoming.get(0)) { + struct.hostname = iprot.readString(); + struct.setHostnameIsSet(true); + } + if (incoming.get(1)) { + struct.ip = iprot.readString(); + struct.setIpIsSet(true); + } + if (incoming.get(2)) { + struct.ports = iprot.readString(); + struct.setPortsIsSet(true); + } + if (incoming.get(3)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(4)) { + struct.applicationName = iprot.readString(); + struct.setApplicationNameIsSet(true); + } + if (incoming.get(5)) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } + if (incoming.get(6)) { + struct.isAlive = iprot.readBool(); + struct.setIsAliveIsSet(true); + } + if (incoming.get(7)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(8)) { + struct.identifier = iprot.readI16(); + struct.setIdentifierIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/AgentKey.java b/src/main/java/com/nhn/pinpoint/thrift/dto/AgentKey.java new file mode 100644 index 000000000..ca283c880 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/AgentKey.java @@ -0,0 +1,584 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AgentKey implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AgentKey"); + + 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 APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField AGENT_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("agentStartTime", org.apache.thrift.protocol.TType.I64, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AgentKeyStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AgentKeyTupleSchemeFactory()); + } + + private String agentId; // required + private String applicationName; // optional + private long agentStartTime; // 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"), + APPLICATION_NAME((short)2, "applicationName"), + AGENT_START_TIME((short)3, "agentStartTime"); + + 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: // APPLICATION_NAME + return APPLICATION_NAME; + case 3: // AGENT_START_TIME + return AGENT_START_TIME; + 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 __AGENTSTARTTIME_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.APPLICATION_NAME}; + 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.APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("applicationName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.AGENT_START_TIME, new org.apache.thrift.meta_data.FieldMetaData("agentStartTime", 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(AgentKey.class, metaDataMap); + } + + public AgentKey() { + } + + public AgentKey( + String agentId, + long agentStartTime) + { + this(); + this.agentId = agentId; + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public AgentKey(AgentKey other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + if (other.isSetApplicationName()) { + this.applicationName = other.applicationName; + } + this.agentStartTime = other.agentStartTime; + } + + public AgentKey deepCopy() { + return new AgentKey(this); + } + + @Override + public void clear() { + this.agentId = null; + this.applicationName = null; + setAgentStartTimeIsSet(false); + this.agentStartTime = 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 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 long getAgentStartTime() { + return this.agentStartTime; + } + + public void setAgentStartTime(long agentStartTime) { + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + } + + public void unsetAgentStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + /** Returns true if field agentStartTime is set (has been assigned a value) and false otherwise */ + public boolean isSetAgentStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + public void setAgentStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AGENTSTARTTIME_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 APPLICATION_NAME: + if (value == null) { + unsetApplicationName(); + } else { + setApplicationName((String)value); + } + break; + + case AGENT_START_TIME: + if (value == null) { + unsetAgentStartTime(); + } else { + setAgentStartTime((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case APPLICATION_NAME: + return getApplicationName(); + + case AGENT_START_TIME: + return Long.valueOf(getAgentStartTime()); + + } + 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 APPLICATION_NAME: + return isSetApplicationName(); + case AGENT_START_TIME: + return isSetAgentStartTime(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof AgentKey) + return this.equals((AgentKey)that); + return false; + } + + public boolean equals(AgentKey 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_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_agentStartTime = true; + boolean that_present_agentStartTime = true; + if (this_present_agentStartTime || that_present_agentStartTime) { + if (!(this_present_agentStartTime && that_present_agentStartTime)) + return false; + if (this.agentStartTime != that.agentStartTime) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(AgentKey other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetApplicationName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAgentStartTime()).compareTo(other.isSetAgentStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentStartTime, other.agentStartTime); + 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("AgentKey("); + boolean first = true; + + sb.append("agentId:"); + if (this.agentId == null) { + sb.append("null"); + } else { + sb.append(this.agentId); + } + first = false; + if (isSetApplicationName()) { + 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("agentStartTime:"); + sb.append(this.agentStartTime); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class AgentKeyStandardSchemeFactory implements SchemeFactory { + public AgentKeyStandardScheme getScheme() { + return new AgentKeyStandardScheme(); + } + } + + private static class AgentKeyStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, AgentKey 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: // 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 3: // AGENT_START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(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, AgentKey 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(); + } + if (struct.applicationName != null) { + if (struct.isSetApplicationName()) { + oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC); + oprot.writeString(struct.applicationName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldBegin(AGENT_START_TIME_FIELD_DESC); + oprot.writeI64(struct.agentStartTime); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class AgentKeyTupleSchemeFactory implements SchemeFactory { + public AgentKeyTupleScheme getScheme() { + return new AgentKeyTupleScheme(); + } + } + + private static class AgentKeyTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, AgentKey struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetApplicationName()) { + optionals.set(1); + } + if (struct.isSetAgentStartTime()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetApplicationName()) { + oprot.writeString(struct.applicationName); + } + if (struct.isSetAgentStartTime()) { + oprot.writeI64(struct.agentStartTime); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, AgentKey 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.applicationName = iprot.readString(); + struct.setApplicationNameIsSet(true); + } + if (incoming.get(2)) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/AgentStat.java b/src/main/java/com/nhn/pinpoint/thrift/dto/AgentStat.java new file mode 100644 index 000000000..4f52b6dce --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/AgentStat.java @@ -0,0 +1,421 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AgentStat extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AgentStat"); + private static final org.apache.thrift.protocol.TField CMS_FIELD_DESC = new org.apache.thrift.protocol.TField("cms", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField G1_FIELD_DESC = new org.apache.thrift.protocol.TField("g1", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField PARALLEL_FIELD_DESC = new org.apache.thrift.protocol.TField("parallel", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + CMS((short)1, "cms"), + G1((short)2, "g1"), + PARALLEL((short)3, "parallel"); + + 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: // CMS + return CMS; + case 2: // G1 + return G1; + case 3: // PARALLEL + return PARALLEL; + 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; + } + } + + 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.CMS, new org.apache.thrift.meta_data.FieldMetaData("cms", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatWithCmsCollector.class))); + tmpMap.put(_Fields.G1, new org.apache.thrift.meta_data.FieldMetaData("g1", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatWithG1Collector.class))); + tmpMap.put(_Fields.PARALLEL, new org.apache.thrift.meta_data.FieldMetaData("parallel", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatWithParallelCollector.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AgentStat.class, metaDataMap); + } + + public AgentStat() { + super(); + } + + public AgentStat(_Fields setField, Object value) { + super(setField, value); + } + + public AgentStat(AgentStat other) { + super(other); + } + public AgentStat deepCopy() { + return new AgentStat(this); + } + + public static AgentStat cms(StatWithCmsCollector value) { + AgentStat x = new AgentStat(); + x.setCms(value); + return x; + } + + public static AgentStat g1(StatWithG1Collector value) { + AgentStat x = new AgentStat(); + x.setG1(value); + return x; + } + + public static AgentStat parallel(StatWithParallelCollector value) { + AgentStat x = new AgentStat(); + x.setParallel(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case CMS: + if (value instanceof StatWithCmsCollector) { + break; + } + throw new ClassCastException("Was expecting value of type StatWithCmsCollector for field 'cms', but got " + value.getClass().getSimpleName()); + case G1: + if (value instanceof StatWithG1Collector) { + break; + } + throw new ClassCastException("Was expecting value of type StatWithG1Collector for field 'g1', but got " + value.getClass().getSimpleName()); + case PARALLEL: + if (value instanceof StatWithParallelCollector) { + break; + } + throw new ClassCastException("Was expecting value of type StatWithParallelCollector for field 'parallel', but got " + value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case CMS: + if (field.type == CMS_FIELD_DESC.type) { + StatWithCmsCollector cms; + cms = new StatWithCmsCollector(); + cms.read(iprot); + return cms; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case G1: + if (field.type == G1_FIELD_DESC.type) { + StatWithG1Collector g1; + g1 = new StatWithG1Collector(); + g1.read(iprot); + return g1; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case PARALLEL: + if (field.type == PARALLEL_FIELD_DESC.type) { + StatWithParallelCollector parallel; + parallel = new StatWithParallelCollector(); + parallel.read(iprot); + return parallel; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case CMS: + StatWithCmsCollector cms = (StatWithCmsCollector)value_; + cms.write(oprot); + return; + case G1: + StatWithG1Collector g1 = (StatWithG1Collector)value_; + g1.write(oprot); + return; + case PARALLEL: + StatWithParallelCollector parallel = (StatWithParallelCollector)value_; + parallel.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case CMS: + StatWithCmsCollector cms; + cms = new StatWithCmsCollector(); + cms.read(iprot); + return cms; + case G1: + StatWithG1Collector g1; + g1 = new StatWithG1Collector(); + g1.read(iprot); + return g1; + case PARALLEL: + StatWithParallelCollector parallel; + parallel = new StatWithParallelCollector(); + parallel.read(iprot); + return parallel; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case CMS: + StatWithCmsCollector cms = (StatWithCmsCollector)value_; + cms.write(oprot); + return; + case G1: + StatWithG1Collector g1 = (StatWithG1Collector)value_; + g1.write(oprot); + return; + case PARALLEL: + StatWithParallelCollector parallel = (StatWithParallelCollector)value_; + parallel.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case CMS: + return CMS_FIELD_DESC; + case G1: + return G1_FIELD_DESC; + case PARALLEL: + return PARALLEL_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public StatWithCmsCollector getCms() { + if (getSetField() == _Fields.CMS) { + return (StatWithCmsCollector)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'cms' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setCms(StatWithCmsCollector value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.CMS; + value_ = value; + } + + public StatWithG1Collector getG1() { + if (getSetField() == _Fields.G1) { + return (StatWithG1Collector)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'g1' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setG1(StatWithG1Collector value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.G1; + value_ = value; + } + + public StatWithParallelCollector getParallel() { + if (getSetField() == _Fields.PARALLEL) { + return (StatWithParallelCollector)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'parallel' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setParallel(StatWithParallelCollector value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.PARALLEL; + value_ = value; + } + + public boolean isSetCms() { + return setField_ == _Fields.CMS; + } + + + public boolean isSetG1() { + return setField_ == _Fields.G1; + } + + + public boolean isSetParallel() { + return setField_ == _Fields.PARALLEL; + } + + + public boolean equals(Object other) { + if (other instanceof AgentStat) { + return equals((AgentStat)other); + } else { + return false; + } + } + + public boolean equals(AgentStat other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(AgentStat other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + /** + * If you'd like this to perform more respectably, use the hashcode generator option. + */ + @Override + public int hashCode() { + return 0; + } + + 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 { + 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); + } + } + + +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/Annotation.java b/src/main/java/com/nhn/pinpoint/thrift/dto/Annotation.java new file mode 100644 index 000000000..a72a62254 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/Annotation.java @@ -0,0 +1,1160 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Annotation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Annotation"); + + private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField BOOL_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("boolValue", org.apache.thrift.protocol.TType.BOOL, (short)3); + private static final org.apache.thrift.protocol.TField INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("intValue", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField LONG_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("longValue", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField SHORT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("shortValue", org.apache.thrift.protocol.TType.I16, (short)6); + private static final org.apache.thrift.protocol.TField DOUBLE_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleValue", org.apache.thrift.protocol.TType.DOUBLE, (short)7); + private static final org.apache.thrift.protocol.TField BINARY_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryValue", org.apache.thrift.protocol.TType.STRING, (short)8); + private static final org.apache.thrift.protocol.TField BYTE_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("byteValue", org.apache.thrift.protocol.TType.BYTE, (short)9); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AnnotationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AnnotationTupleSchemeFactory()); + } + + private int key; // required + private String stringValue; // optional + private boolean boolValue; // optional + private int intValue; // optional + private long longValue; // optional + private short shortValue; // optional + private double doubleValue; // optional + private ByteBuffer binaryValue; // optional + private byte byteValue; // 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"), + STRING_VALUE((short)2, "stringValue"), + BOOL_VALUE((short)3, "boolValue"), + INT_VALUE((short)4, "intValue"), + LONG_VALUE((short)5, "longValue"), + SHORT_VALUE((short)6, "shortValue"), + DOUBLE_VALUE((short)7, "doubleValue"), + BINARY_VALUE((short)8, "binaryValue"), + BYTE_VALUE((short)9, "byteValue"); + + 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: // STRING_VALUE + return STRING_VALUE; + case 3: // BOOL_VALUE + return BOOL_VALUE; + case 4: // INT_VALUE + return INT_VALUE; + case 5: // LONG_VALUE + return LONG_VALUE; + case 6: // SHORT_VALUE + return SHORT_VALUE; + case 7: // DOUBLE_VALUE + return DOUBLE_VALUE; + case 8: // BINARY_VALUE + return BINARY_VALUE; + case 9: // BYTE_VALUE + return BYTE_VALUE; + 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 __KEY_ISSET_ID = 0; + private static final int __BOOLVALUE_ISSET_ID = 1; + private static final int __INTVALUE_ISSET_ID = 2; + private static final int __LONGVALUE_ISSET_ID = 3; + private static final int __SHORTVALUE_ISSET_ID = 4; + private static final int __DOUBLEVALUE_ISSET_ID = 5; + private static final int __BYTEVALUE_ISSET_ID = 6; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.STRING_VALUE,_Fields.BOOL_VALUE,_Fields.INT_VALUE,_Fields.LONG_VALUE,_Fields.SHORT_VALUE,_Fields.DOUBLE_VALUE,_Fields.BINARY_VALUE,_Fields.BYTE_VALUE}; + 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.I32))); + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.BOOL_VALUE, new org.apache.thrift.meta_data.FieldMetaData("boolValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("intValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.LONG_VALUE, new org.apache.thrift.meta_data.FieldMetaData("longValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SHORT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("shortValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.DOUBLE_VALUE, new org.apache.thrift.meta_data.FieldMetaData("doubleValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.BYTE_VALUE, new org.apache.thrift.meta_data.FieldMetaData("byteValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Annotation.class, metaDataMap); + } + + public Annotation() { + } + + public Annotation( + int key) + { + this(); + this.key = key; + setKeyIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public Annotation(Annotation other) { + __isset_bitfield = other.__isset_bitfield; + this.key = other.key; + if (other.isSetStringValue()) { + this.stringValue = other.stringValue; + } + this.boolValue = other.boolValue; + this.intValue = other.intValue; + this.longValue = other.longValue; + this.shortValue = other.shortValue; + this.doubleValue = other.doubleValue; + if (other.isSetBinaryValue()) { + this.binaryValue = org.apache.thrift.TBaseHelper.copyBinary(other.binaryValue); +; + } + this.byteValue = other.byteValue; + } + + public Annotation deepCopy() { + return new Annotation(this); + } + + @Override + public void clear() { + setKeyIsSet(false); + this.key = 0; + this.stringValue = null; + setBoolValueIsSet(false); + this.boolValue = false; + setIntValueIsSet(false); + this.intValue = 0; + setLongValueIsSet(false); + this.longValue = 0; + setShortValueIsSet(false); + this.shortValue = 0; + setDoubleValueIsSet(false); + this.doubleValue = 0.0; + this.binaryValue = null; + setByteValueIsSet(false); + this.byteValue = 0; + } + + public int getKey() { + return this.key; + } + + public void setKey(int key) { + this.key = key; + setKeyIsSet(true); + } + + public void unsetKey() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEY_ISSET_ID); + } + + /** Returns true if field key is set (has been assigned a value) and false otherwise */ + public boolean isSetKey() { + return EncodingUtils.testBit(__isset_bitfield, __KEY_ISSET_ID); + } + + public void setKeyIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEY_ISSET_ID, value); + } + + public String getStringValue() { + return this.stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + public void unsetStringValue() { + this.stringValue = null; + } + + /** Returns true if field stringValue is set (has been assigned a value) and false otherwise */ + public boolean isSetStringValue() { + return this.stringValue != null; + } + + public void setStringValueIsSet(boolean value) { + if (!value) { + this.stringValue = null; + } + } + + public boolean isBoolValue() { + return this.boolValue; + } + + public void setBoolValue(boolean boolValue) { + this.boolValue = boolValue; + setBoolValueIsSet(true); + } + + public void unsetBoolValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BOOLVALUE_ISSET_ID); + } + + /** Returns true if field boolValue is set (has been assigned a value) and false otherwise */ + public boolean isSetBoolValue() { + return EncodingUtils.testBit(__isset_bitfield, __BOOLVALUE_ISSET_ID); + } + + public void setBoolValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BOOLVALUE_ISSET_ID, value); + } + + public int getIntValue() { + return this.intValue; + } + + public void setIntValue(int intValue) { + this.intValue = intValue; + setIntValueIsSet(true); + } + + public void unsetIntValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INTVALUE_ISSET_ID); + } + + /** Returns true if field intValue is set (has been assigned a value) and false otherwise */ + public boolean isSetIntValue() { + return EncodingUtils.testBit(__isset_bitfield, __INTVALUE_ISSET_ID); + } + + public void setIntValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INTVALUE_ISSET_ID, value); + } + + public long getLongValue() { + return this.longValue; + } + + public void setLongValue(long longValue) { + this.longValue = longValue; + setLongValueIsSet(true); + } + + public void unsetLongValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LONGVALUE_ISSET_ID); + } + + /** Returns true if field longValue is set (has been assigned a value) and false otherwise */ + public boolean isSetLongValue() { + return EncodingUtils.testBit(__isset_bitfield, __LONGVALUE_ISSET_ID); + } + + public void setLongValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LONGVALUE_ISSET_ID, value); + } + + public short getShortValue() { + return this.shortValue; + } + + public void setShortValue(short shortValue) { + this.shortValue = shortValue; + setShortValueIsSet(true); + } + + public void unsetShortValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHORTVALUE_ISSET_ID); + } + + /** Returns true if field shortValue is set (has been assigned a value) and false otherwise */ + public boolean isSetShortValue() { + return EncodingUtils.testBit(__isset_bitfield, __SHORTVALUE_ISSET_ID); + } + + public void setShortValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHORTVALUE_ISSET_ID, value); + } + + public double getDoubleValue() { + return this.doubleValue; + } + + public void setDoubleValue(double doubleValue) { + this.doubleValue = doubleValue; + setDoubleValueIsSet(true); + } + + public void unsetDoubleValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DOUBLEVALUE_ISSET_ID); + } + + /** Returns true if field doubleValue is set (has been assigned a value) and false otherwise */ + public boolean isSetDoubleValue() { + return EncodingUtils.testBit(__isset_bitfield, __DOUBLEVALUE_ISSET_ID); + } + + public void setDoubleValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DOUBLEVALUE_ISSET_ID, value); + } + + public byte[] getBinaryValue() { + setBinaryValue(org.apache.thrift.TBaseHelper.rightSize(binaryValue)); + return binaryValue == null ? null : binaryValue.array(); + } + + public ByteBuffer bufferForBinaryValue() { + return binaryValue; + } + + public void setBinaryValue(byte[] binaryValue) { + setBinaryValue(binaryValue == null ? (ByteBuffer)null : ByteBuffer.wrap(binaryValue)); + } + + public void setBinaryValue(ByteBuffer binaryValue) { + this.binaryValue = binaryValue; + } + + public void unsetBinaryValue() { + this.binaryValue = null; + } + + /** Returns true if field binaryValue is set (has been assigned a value) and false otherwise */ + public boolean isSetBinaryValue() { + return this.binaryValue != null; + } + + public void setBinaryValueIsSet(boolean value) { + if (!value) { + this.binaryValue = null; + } + } + + public byte getByteValue() { + return this.byteValue; + } + + public void setByteValue(byte byteValue) { + this.byteValue = byteValue; + setByteValueIsSet(true); + } + + public void unsetByteValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BYTEVALUE_ISSET_ID); + } + + /** Returns true if field byteValue is set (has been assigned a value) and false otherwise */ + public boolean isSetByteValue() { + return EncodingUtils.testBit(__isset_bitfield, __BYTEVALUE_ISSET_ID); + } + + public void setByteValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BYTEVALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case KEY: + if (value == null) { + unsetKey(); + } else { + setKey((Integer)value); + } + break; + + case STRING_VALUE: + if (value == null) { + unsetStringValue(); + } else { + setStringValue((String)value); + } + break; + + case BOOL_VALUE: + if (value == null) { + unsetBoolValue(); + } else { + setBoolValue((Boolean)value); + } + break; + + case INT_VALUE: + if (value == null) { + unsetIntValue(); + } else { + setIntValue((Integer)value); + } + break; + + case LONG_VALUE: + if (value == null) { + unsetLongValue(); + } else { + setLongValue((Long)value); + } + break; + + case SHORT_VALUE: + if (value == null) { + unsetShortValue(); + } else { + setShortValue((Short)value); + } + break; + + case DOUBLE_VALUE: + if (value == null) { + unsetDoubleValue(); + } else { + setDoubleValue((Double)value); + } + break; + + case BINARY_VALUE: + if (value == null) { + unsetBinaryValue(); + } else { + setBinaryValue((ByteBuffer)value); + } + break; + + case BYTE_VALUE: + if (value == null) { + unsetByteValue(); + } else { + setByteValue((Byte)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case KEY: + return Integer.valueOf(getKey()); + + case STRING_VALUE: + return getStringValue(); + + case BOOL_VALUE: + return Boolean.valueOf(isBoolValue()); + + case INT_VALUE: + return Integer.valueOf(getIntValue()); + + case LONG_VALUE: + return Long.valueOf(getLongValue()); + + case SHORT_VALUE: + return Short.valueOf(getShortValue()); + + case DOUBLE_VALUE: + return Double.valueOf(getDoubleValue()); + + case BINARY_VALUE: + return getBinaryValue(); + + case BYTE_VALUE: + return Byte.valueOf(getByteValue()); + + } + 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 STRING_VALUE: + return isSetStringValue(); + case BOOL_VALUE: + return isSetBoolValue(); + case INT_VALUE: + return isSetIntValue(); + case LONG_VALUE: + return isSetLongValue(); + case SHORT_VALUE: + return isSetShortValue(); + case DOUBLE_VALUE: + return isSetDoubleValue(); + case BINARY_VALUE: + return isSetBinaryValue(); + case BYTE_VALUE: + return isSetByteValue(); + } + 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; + boolean that_present_key = true; + if (this_present_key || that_present_key) { + if (!(this_present_key && that_present_key)) + return false; + if (this.key != that.key) + return false; + } + + boolean this_present_stringValue = true && this.isSetStringValue(); + boolean that_present_stringValue = true && that.isSetStringValue(); + if (this_present_stringValue || that_present_stringValue) { + if (!(this_present_stringValue && that_present_stringValue)) + return false; + if (!this.stringValue.equals(that.stringValue)) + return false; + } + + boolean this_present_boolValue = true && this.isSetBoolValue(); + boolean that_present_boolValue = true && that.isSetBoolValue(); + if (this_present_boolValue || that_present_boolValue) { + if (!(this_present_boolValue && that_present_boolValue)) + return false; + if (this.boolValue != that.boolValue) + return false; + } + + boolean this_present_intValue = true && this.isSetIntValue(); + boolean that_present_intValue = true && that.isSetIntValue(); + if (this_present_intValue || that_present_intValue) { + if (!(this_present_intValue && that_present_intValue)) + return false; + if (this.intValue != that.intValue) + return false; + } + + boolean this_present_longValue = true && this.isSetLongValue(); + boolean that_present_longValue = true && that.isSetLongValue(); + if (this_present_longValue || that_present_longValue) { + if (!(this_present_longValue && that_present_longValue)) + return false; + if (this.longValue != that.longValue) + return false; + } + + boolean this_present_shortValue = true && this.isSetShortValue(); + boolean that_present_shortValue = true && that.isSetShortValue(); + if (this_present_shortValue || that_present_shortValue) { + if (!(this_present_shortValue && that_present_shortValue)) + return false; + if (this.shortValue != that.shortValue) + return false; + } + + boolean this_present_doubleValue = true && this.isSetDoubleValue(); + boolean that_present_doubleValue = true && that.isSetDoubleValue(); + if (this_present_doubleValue || that_present_doubleValue) { + if (!(this_present_doubleValue && that_present_doubleValue)) + return false; + if (this.doubleValue != that.doubleValue) + return false; + } + + boolean this_present_binaryValue = true && this.isSetBinaryValue(); + boolean that_present_binaryValue = true && that.isSetBinaryValue(); + if (this_present_binaryValue || that_present_binaryValue) { + if (!(this_present_binaryValue && that_present_binaryValue)) + return false; + if (!this.binaryValue.equals(that.binaryValue)) + return false; + } + + boolean this_present_byteValue = true && this.isSetByteValue(); + boolean that_present_byteValue = true && that.isSetByteValue(); + if (this_present_byteValue || that_present_byteValue) { + if (!(this_present_byteValue && that_present_byteValue)) + return false; + if (this.byteValue != that.byteValue) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(Annotation other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStringValue()).compareTo(other.isSetStringValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStringValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stringValue, other.stringValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBoolValue()).compareTo(other.isSetBoolValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBoolValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.boolValue, other.boolValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIntValue()).compareTo(other.isSetIntValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIntValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.intValue, other.intValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLongValue()).compareTo(other.isSetLongValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLongValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.longValue, other.longValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetShortValue()).compareTo(other.isSetShortValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetShortValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shortValue, other.shortValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDoubleValue()).compareTo(other.isSetDoubleValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDoubleValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.doubleValue, other.doubleValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBinaryValue()).compareTo(other.isSetBinaryValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBinaryValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryValue, other.binaryValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetByteValue()).compareTo(other.isSetByteValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetByteValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.byteValue, other.byteValue); + 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:"); + sb.append(this.key); + first = false; + if (isSetStringValue()) { + if (!first) sb.append(", "); + sb.append("stringValue:"); + if (this.stringValue == null) { + sb.append("null"); + } else { + sb.append(this.stringValue); + } + first = false; + } + if (isSetBoolValue()) { + if (!first) sb.append(", "); + sb.append("boolValue:"); + sb.append(this.boolValue); + first = false; + } + if (isSetIntValue()) { + if (!first) sb.append(", "); + sb.append("intValue:"); + sb.append(this.intValue); + first = false; + } + if (isSetLongValue()) { + if (!first) sb.append(", "); + sb.append("longValue:"); + sb.append(this.longValue); + first = false; + } + if (isSetShortValue()) { + if (!first) sb.append(", "); + sb.append("shortValue:"); + sb.append(this.shortValue); + first = false; + } + if (isSetDoubleValue()) { + if (!first) sb.append(", "); + sb.append("doubleValue:"); + sb.append(this.doubleValue); + first = false; + } + if (isSetBinaryValue()) { + if (!first) sb.append(", "); + sb.append("binaryValue:"); + if (this.binaryValue == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.binaryValue, sb); + } + first = false; + } + if (isSetByteValue()) { + if (!first) sb.append(", "); + sb.append("byteValue:"); + sb.append(this.byteValue); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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.I32) { + struct.key = iprot.readI32(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STRING_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stringValue = iprot.readString(); + struct.setStringValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // BOOL_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.boolValue = iprot.readBool(); + struct.setBoolValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // INT_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.intValue = iprot.readI32(); + struct.setIntValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // LONG_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.longValue = iprot.readI64(); + struct.setLongValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // SHORT_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.shortValue = iprot.readI16(); + struct.setShortValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // DOUBLE_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.doubleValue = iprot.readDouble(); + struct.setDoubleValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // BINARY_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.binaryValue = iprot.readBinary(); + struct.setBinaryValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // BYTE_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { + struct.byteValue = iprot.readByte(); + struct.setByteValueIsSet(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); + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeI32(struct.key); + oprot.writeFieldEnd(); + if (struct.stringValue != null) { + if (struct.isSetStringValue()) { + oprot.writeFieldBegin(STRING_VALUE_FIELD_DESC); + oprot.writeString(struct.stringValue); + oprot.writeFieldEnd(); + } + } + if (struct.isSetBoolValue()) { + oprot.writeFieldBegin(BOOL_VALUE_FIELD_DESC); + oprot.writeBool(struct.boolValue); + oprot.writeFieldEnd(); + } + if (struct.isSetIntValue()) { + oprot.writeFieldBegin(INT_VALUE_FIELD_DESC); + oprot.writeI32(struct.intValue); + oprot.writeFieldEnd(); + } + if (struct.isSetLongValue()) { + oprot.writeFieldBegin(LONG_VALUE_FIELD_DESC); + oprot.writeI64(struct.longValue); + oprot.writeFieldEnd(); + } + if (struct.isSetShortValue()) { + oprot.writeFieldBegin(SHORT_VALUE_FIELD_DESC); + oprot.writeI16(struct.shortValue); + oprot.writeFieldEnd(); + } + if (struct.isSetDoubleValue()) { + oprot.writeFieldBegin(DOUBLE_VALUE_FIELD_DESC); + oprot.writeDouble(struct.doubleValue); + oprot.writeFieldEnd(); + } + if (struct.binaryValue != null) { + if (struct.isSetBinaryValue()) { + oprot.writeFieldBegin(BINARY_VALUE_FIELD_DESC); + oprot.writeBinary(struct.binaryValue); + oprot.writeFieldEnd(); + } + } + if (struct.isSetByteValue()) { + oprot.writeFieldBegin(BYTE_VALUE_FIELD_DESC); + oprot.writeByte(struct.byteValue); + 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.isSetStringValue()) { + optionals.set(1); + } + if (struct.isSetBoolValue()) { + optionals.set(2); + } + if (struct.isSetIntValue()) { + optionals.set(3); + } + if (struct.isSetLongValue()) { + optionals.set(4); + } + if (struct.isSetShortValue()) { + optionals.set(5); + } + if (struct.isSetDoubleValue()) { + optionals.set(6); + } + if (struct.isSetBinaryValue()) { + optionals.set(7); + } + if (struct.isSetByteValue()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetKey()) { + oprot.writeI32(struct.key); + } + if (struct.isSetStringValue()) { + oprot.writeString(struct.stringValue); + } + if (struct.isSetBoolValue()) { + oprot.writeBool(struct.boolValue); + } + if (struct.isSetIntValue()) { + oprot.writeI32(struct.intValue); + } + if (struct.isSetLongValue()) { + oprot.writeI64(struct.longValue); + } + if (struct.isSetShortValue()) { + oprot.writeI16(struct.shortValue); + } + if (struct.isSetDoubleValue()) { + oprot.writeDouble(struct.doubleValue); + } + if (struct.isSetBinaryValue()) { + oprot.writeBinary(struct.binaryValue); + } + if (struct.isSetByteValue()) { + oprot.writeByte(struct.byteValue); + } + } + + @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(9); + if (incoming.get(0)) { + struct.key = iprot.readI32(); + struct.setKeyIsSet(true); + } + if (incoming.get(1)) { + struct.stringValue = iprot.readString(); + struct.setStringValueIsSet(true); + } + if (incoming.get(2)) { + struct.boolValue = iprot.readBool(); + struct.setBoolValueIsSet(true); + } + if (incoming.get(3)) { + struct.intValue = iprot.readI32(); + struct.setIntValueIsSet(true); + } + if (incoming.get(4)) { + struct.longValue = iprot.readI64(); + struct.setLongValueIsSet(true); + } + if (incoming.get(5)) { + struct.shortValue = iprot.readI16(); + struct.setShortValueIsSet(true); + } + if (incoming.get(6)) { + struct.doubleValue = iprot.readDouble(); + struct.setDoubleValueIsSet(true); + } + if (incoming.get(7)) { + struct.binaryValue = iprot.readBinary(); + struct.setBinaryValueIsSet(true); + } + if (incoming.get(8)) { + struct.byteValue = iprot.readByte(); + struct.setByteValueIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/ApiMetaData.java b/src/main/java/com/nhn/pinpoint/thrift/dto/ApiMetaData.java new file mode 100644 index 000000000..e0f98fee5 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/ApiMetaData.java @@ -0,0 +1,769 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ApiMetaData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ApiMetaData"); + + 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 AGENT_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("agentStartTime", org.apache.thrift.protocol.TType.I64, (short)2); + 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)4); + private static final org.apache.thrift.protocol.TField API_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("apiInfo", org.apache.thrift.protocol.TType.STRING, (short)5); + 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)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ApiMetaDataStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ApiMetaDataTupleSchemeFactory()); + } + + private String agentId; // required + private long agentStartTime; // required + private int apiId; // required + private String apiInfo; // required + 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 { + AGENT_ID((short)1, "agentId"), + AGENT_START_TIME((short)2, "agentStartTime"), + API_ID((short)4, "apiId"), + API_INFO((short)5, "apiInfo"), + LINE((short)6, "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: // AGENT_ID + return AGENT_ID; + case 2: // AGENT_START_TIME + return AGENT_START_TIME; + case 4: // API_ID + return API_ID; + case 5: // API_INFO + return API_INFO; + case 6: // 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 __AGENTSTARTTIME_ISSET_ID = 0; + private static final int __APIID_ISSET_ID = 1; + private static final int __LINE_ISSET_ID = 2; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_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.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.AGENT_START_TIME, new org.apache.thrift.meta_data.FieldMetaData("agentStartTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.API_ID, new org.apache.thrift.meta_data.FieldMetaData("apiId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.API_INFO, new org.apache.thrift.meta_data.FieldMetaData("apiInfo", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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(ApiMetaData.class, metaDataMap); + } + + public ApiMetaData() { + } + + public ApiMetaData( + String agentId, + long agentStartTime, + int apiId, + String apiInfo) + { + this(); + this.agentId = agentId; + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + this.apiId = apiId; + setApiIdIsSet(true); + this.apiInfo = apiInfo; + } + + /** + * Performs a deep copy on other. + */ + public ApiMetaData(ApiMetaData other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.agentStartTime = other.agentStartTime; + this.apiId = other.apiId; + if (other.isSetApiInfo()) { + this.apiInfo = other.apiInfo; + } + this.line = other.line; + } + + public ApiMetaData deepCopy() { + return new ApiMetaData(this); + } + + @Override + public void clear() { + this.agentId = null; + setAgentStartTimeIsSet(false); + this.agentStartTime = 0; + setApiIdIsSet(false); + this.apiId = 0; + this.apiInfo = null; + setLineIsSet(false); + this.line = 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 getAgentStartTime() { + return this.agentStartTime; + } + + public void setAgentStartTime(long agentStartTime) { + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + } + + public void unsetAgentStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + /** Returns true if field agentStartTime is set (has been assigned a value) and false otherwise */ + public boolean isSetAgentStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + public void setAgentStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID, value); + } + + public int getApiId() { + return this.apiId; + } + + public void setApiId(int apiId) { + this.apiId = apiId; + setApiIdIsSet(true); + } + + public void unsetApiId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __APIID_ISSET_ID); + } + + /** Returns true if field apiId is set (has been assigned a value) and false otherwise */ + public boolean isSetApiId() { + return EncodingUtils.testBit(__isset_bitfield, __APIID_ISSET_ID); + } + + public void setApiIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __APIID_ISSET_ID, value); + } + + public String getApiInfo() { + return this.apiInfo; + } + + public void setApiInfo(String apiInfo) { + this.apiInfo = apiInfo; + } + + public void unsetApiInfo() { + this.apiInfo = null; + } + + /** Returns true if field apiInfo is set (has been assigned a value) and false otherwise */ + public boolean isSetApiInfo() { + return this.apiInfo != null; + } + + public void setApiInfoIsSet(boolean value) { + if (!value) { + this.apiInfo = null; + } + } + + public int getLine() { + return this.line; + } + + public void setLine(int line) { + this.line = line; + setLineIsSet(true); + } + + public void unsetLine() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LINE_ISSET_ID); + } + + /** Returns true if field line is set (has been assigned a value) and false otherwise */ + public boolean isSetLine() { + return EncodingUtils.testBit(__isset_bitfield, __LINE_ISSET_ID); + } + + public void setLineIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LINE_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 AGENT_START_TIME: + if (value == null) { + unsetAgentStartTime(); + } else { + setAgentStartTime((Long)value); + } + break; + + case API_ID: + if (value == null) { + unsetApiId(); + } else { + setApiId((Integer)value); + } + break; + + case API_INFO: + if (value == null) { + unsetApiInfo(); + } else { + setApiInfo((String)value); + } + break; + + case LINE: + if (value == null) { + unsetLine(); + } else { + setLine((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case AGENT_START_TIME: + return Long.valueOf(getAgentStartTime()); + + case API_ID: + return Integer.valueOf(getApiId()); + + case API_INFO: + return getApiInfo(); + + 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 AGENT_ID: + return isSetAgentId(); + case AGENT_START_TIME: + return isSetAgentStartTime(); + case API_ID: + return isSetApiId(); + case API_INFO: + return isSetApiInfo(); + case LINE: + return isSetLine(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ApiMetaData) + return this.equals((ApiMetaData)that); + return false; + } + + public boolean equals(ApiMetaData 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_agentStartTime = true; + boolean that_present_agentStartTime = true; + if (this_present_agentStartTime || that_present_agentStartTime) { + if (!(this_present_agentStartTime && that_present_agentStartTime)) + return false; + if (this.agentStartTime != that.agentStartTime) + return false; + } + + boolean this_present_apiId = true; + boolean that_present_apiId = true; + 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_apiInfo = true && this.isSetApiInfo(); + boolean that_present_apiInfo = true && that.isSetApiInfo(); + if (this_present_apiInfo || that_present_apiInfo) { + if (!(this_present_apiInfo && that_present_apiInfo)) + return false; + if (!this.apiInfo.equals(that.apiInfo)) + 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; + } + + @Override + public int compareTo(ApiMetaData other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAgentStartTime()).compareTo(other.isSetAgentStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentStartTime, other.agentStartTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetApiId()).compareTo(other.isSetApiId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetApiId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.apiId, other.apiId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetApiInfo()).compareTo(other.isSetApiInfo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetApiInfo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.apiInfo, other.apiInfo); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLine()).compareTo(other.isSetLine()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLine()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.line, other.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("ApiMetaData("); + 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("agentStartTime:"); + sb.append(this.agentStartTime); + first = false; + if (!first) sb.append(", "); + sb.append("apiId:"); + sb.append(this.apiId); + first = false; + if (!first) sb.append(", "); + sb.append("apiInfo:"); + if (this.apiInfo == null) { + sb.append("null"); + } else { + sb.append(this.apiInfo); + } + 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 + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ApiMetaDataStandardSchemeFactory implements SchemeFactory { + public ApiMetaDataStandardScheme getScheme() { + return new ApiMetaDataStandardScheme(); + } + } + + private static class ApiMetaDataStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ApiMetaData 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: // AGENT_START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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 5: // API_INFO + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.apiInfo = iprot.readString(); + struct.setApiInfoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // 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, ApiMetaData 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(AGENT_START_TIME_FIELD_DESC); + oprot.writeI64(struct.agentStartTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(API_ID_FIELD_DESC); + oprot.writeI32(struct.apiId); + oprot.writeFieldEnd(); + if (struct.apiInfo != null) { + oprot.writeFieldBegin(API_INFO_FIELD_DESC); + oprot.writeString(struct.apiInfo); + oprot.writeFieldEnd(); + } + if (struct.isSetLine()) { + oprot.writeFieldBegin(LINE_FIELD_DESC); + oprot.writeI32(struct.line); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ApiMetaDataTupleSchemeFactory implements SchemeFactory { + public ApiMetaDataTupleScheme getScheme() { + return new ApiMetaDataTupleScheme(); + } + } + + private static class ApiMetaDataTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ApiMetaData struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetAgentStartTime()) { + optionals.set(1); + } + if (struct.isSetApiId()) { + optionals.set(2); + } + if (struct.isSetApiInfo()) { + optionals.set(3); + } + if (struct.isSetLine()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetAgentStartTime()) { + oprot.writeI64(struct.agentStartTime); + } + if (struct.isSetApiId()) { + oprot.writeI32(struct.apiId); + } + if (struct.isSetApiInfo()) { + oprot.writeString(struct.apiInfo); + } + if (struct.isSetLine()) { + oprot.writeI32(struct.line); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ApiMetaData 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.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } + if (incoming.get(2)) { + struct.apiId = iprot.readI32(); + struct.setApiIdIsSet(true); + } + if (incoming.get(3)) { + struct.apiInfo = iprot.readString(); + struct.setApiInfoIsSet(true); + } + if (incoming.get(4)) { + struct.line = iprot.readI32(); + struct.setLineIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/JVMInfoThriftDTO.java b/src/main/java/com/nhn/pinpoint/thrift/dto/JVMInfoThriftDTO.java new file mode 100644 index 000000000..3d8ce87e3 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/JVMInfoThriftDTO.java @@ -0,0 +1,1418 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class JVMInfoThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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 short __isset_bitfield = 0; + 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_bitfield = other.__isset_bitfield; + 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATATIME_ISSET_ID); + } + + /** Returns true if field dataTime is set (has been assigned a value) and false otherwise */ + public boolean isSetDataTime() { + return EncodingUtils.testBit(__isset_bitfield, __DATATIME_ISSET_ID); + } + + public void setDataTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATATIME_ISSET_ID, value); + } + + public int getActiveThreadCount() { + return this.activeThreadCount; + } + + public void setActiveThreadCount(int activeThreadCount) { + this.activeThreadCount = activeThreadCount; + setActiveThreadCountIsSet(true); + } + + public void unsetActiveThreadCount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACTIVETHREADCOUNT_ISSET_ID); + } + + /** Returns true if field activeThreadCount is set (has been assigned a value) and false otherwise */ + public boolean isSetActiveThreadCount() { + return EncodingUtils.testBit(__isset_bitfield, __ACTIVETHREADCOUNT_ISSET_ID); + } + + public void setActiveThreadCountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACTIVETHREADCOUNT_ISSET_ID, value); + } + + public long getGc1Count() { + return this.gc1Count; + } + + public void setGc1Count(long gc1Count) { + this.gc1Count = gc1Count; + setGc1CountIsSet(true); + } + + public void unsetGc1Count() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GC1COUNT_ISSET_ID); + } + + /** Returns true if field gc1Count is set (has been assigned a value) and false otherwise */ + public boolean isSetGc1Count() { + return EncodingUtils.testBit(__isset_bitfield, __GC1COUNT_ISSET_ID); + } + + public void setGc1CountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GC1COUNT_ISSET_ID, value); + } + + public long getGc1Time() { + return this.gc1Time; + } + + public void setGc1Time(long gc1Time) { + this.gc1Time = gc1Time; + setGc1TimeIsSet(true); + } + + public void unsetGc1Time() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GC1TIME_ISSET_ID); + } + + /** Returns true if field gc1Time is set (has been assigned a value) and false otherwise */ + public boolean isSetGc1Time() { + return EncodingUtils.testBit(__isset_bitfield, __GC1TIME_ISSET_ID); + } + + public void setGc1TimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GC1TIME_ISSET_ID, value); + } + + public long getGc2Count() { + return this.gc2Count; + } + + public void setGc2Count(long gc2Count) { + this.gc2Count = gc2Count; + setGc2CountIsSet(true); + } + + public void unsetGc2Count() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GC2COUNT_ISSET_ID); + } + + /** Returns true if field gc2Count is set (has been assigned a value) and false otherwise */ + public boolean isSetGc2Count() { + return EncodingUtils.testBit(__isset_bitfield, __GC2COUNT_ISSET_ID); + } + + public void setGc2CountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GC2COUNT_ISSET_ID, value); + } + + public long getGc2Time() { + return this.gc2Time; + } + + public void setGc2Time(long gc2Time) { + this.gc2Time = gc2Time; + setGc2TimeIsSet(true); + } + + public void unsetGc2Time() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GC2TIME_ISSET_ID); + } + + /** Returns true if field gc2Time is set (has been assigned a value) and false otherwise */ + public boolean isSetGc2Time() { + return EncodingUtils.testBit(__isset_bitfield, __GC2TIME_ISSET_ID); + } + + public void setGc2TimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GC2TIME_ISSET_ID, value); + } + + public long getHeapUsed() { + return this.heapUsed; + } + + public void setHeapUsed(long heapUsed) { + this.heapUsed = heapUsed; + setHeapUsedIsSet(true); + } + + public void unsetHeapUsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HEAPUSED_ISSET_ID); + } + + /** Returns true if field heapUsed is set (has been assigned a value) and false otherwise */ + public boolean isSetHeapUsed() { + return EncodingUtils.testBit(__isset_bitfield, __HEAPUSED_ISSET_ID); + } + + public void setHeapUsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HEAPUSED_ISSET_ID, value); + } + + public long getHeapCommitted() { + return this.heapCommitted; + } + + public void setHeapCommitted(long heapCommitted) { + this.heapCommitted = heapCommitted; + setHeapCommittedIsSet(true); + } + + public void unsetHeapCommitted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HEAPCOMMITTED_ISSET_ID); + } + + /** Returns true if field heapCommitted is set (has been assigned a value) and false otherwise */ + public boolean isSetHeapCommitted() { + return EncodingUtils.testBit(__isset_bitfield, __HEAPCOMMITTED_ISSET_ID); + } + + public void setHeapCommittedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HEAPCOMMITTED_ISSET_ID, value); + } + + public long getNonHeapUsed() { + return this.nonHeapUsed; + } + + public void setNonHeapUsed(long nonHeapUsed) { + this.nonHeapUsed = nonHeapUsed; + setNonHeapUsedIsSet(true); + } + + public void unsetNonHeapUsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NONHEAPUSED_ISSET_ID); + } + + /** Returns true if field nonHeapUsed is set (has been assigned a value) and false otherwise */ + public boolean isSetNonHeapUsed() { + return EncodingUtils.testBit(__isset_bitfield, __NONHEAPUSED_ISSET_ID); + } + + public void setNonHeapUsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NONHEAPUSED_ISSET_ID, value); + } + + public long getNonHeapCommitted() { + return this.nonHeapCommitted; + } + + public void setNonHeapCommitted(long nonHeapCommitted) { + this.nonHeapCommitted = nonHeapCommitted; + setNonHeapCommittedIsSet(true); + } + + public void unsetNonHeapCommitted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NONHEAPCOMMITTED_ISSET_ID); + } + + /** Returns true if field nonHeapCommitted is set (has been assigned a value) and false otherwise */ + public boolean isSetNonHeapCommitted() { + return EncodingUtils.testBit(__isset_bitfield, __NONHEAPCOMMITTED_ISSET_ID); + } + + public void setNonHeapCommittedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NONHEAPCOMMITTED_ISSET_ID, value); + } + + public double getProcessCPUTime() { + return this.processCPUTime; + } + + public void setProcessCPUTime(double processCPUTime) { + this.processCPUTime = processCPUTime; + setProcessCPUTimeIsSet(true); + } + + public void unsetProcessCPUTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROCESSCPUTIME_ISSET_ID); + } + + /** Returns true if field processCPUTime is set (has been assigned a value) and false otherwise */ + public boolean isSetProcessCPUTime() { + return EncodingUtils.testBit(__isset_bitfield, __PROCESSCPUTIME_ISSET_ID); + } + + public void setProcessCPUTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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; + } + + @Override + public int compareTo(JVMInfoThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataTime()).compareTo(other.isSetDataTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, other.dataTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetActiveThreadCount()).compareTo(other.isSetActiveThreadCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetActiveThreadCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.activeThreadCount, other.activeThreadCount); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc1Count()).compareTo(other.isSetGc1Count()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc1Count()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc1Count, other.gc1Count); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc1Time()).compareTo(other.isSetGc1Time()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc1Time()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc1Time, other.gc1Time); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc2Count()).compareTo(other.isSetGc2Count()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc2Count()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc2Count, other.gc2Count); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGc2Time()).compareTo(other.isSetGc2Time()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGc2Time()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc2Time, other.gc2Time); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHeapUsed()).compareTo(other.isSetHeapUsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHeapUsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heapUsed, other.heapUsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHeapCommitted()).compareTo(other.isSetHeapCommitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHeapCommitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heapCommitted, other.heapCommitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNonHeapUsed()).compareTo(other.isSetNonHeapUsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNonHeapUsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonHeapUsed, other.nonHeapUsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNonHeapCommitted()).compareTo(other.isSetNonHeapCommitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNonHeapCommitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonHeapCommitted, other.nonHeapCommitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProcessCPUTime()).compareTo(other.isSetProcessCPUTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProcessCPUTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.processCPUTime, other.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 + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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/nhn/pinpoint/thrift/dto/RequestDataListThriftDTO.java b/src/main/java/com/nhn/pinpoint/thrift/dto/RequestDataListThriftDTO.java new file mode 100644 index 000000000..a2ececa06 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/RequestDataListThriftDTO.java @@ -0,0 +1,635 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RequestDataListThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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 byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.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_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.requestHashCode = other.requestHashCode; + if (other.isSetRequestDataList()) { + List __this__requestDataList = new ArrayList(other.requestDataList.size()); + 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTHASHCODE_ISSET_ID); + } + + /** Returns true if field requestHashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestHashCode() { + return EncodingUtils.testBit(__isset_bitfield, __REQUESTHASHCODE_ISSET_ID); + } + + public void setRequestHashCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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; + } + + @Override + public int compareTo(RequestDataListThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestHashCode()).compareTo(other.isSetRequestHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestHashCode, other.requestHashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestDataList()).compareTo(other.isSetRequestDataList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestDataList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestDataList, other.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 + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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; + _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; + _elem7 = new RequestDataThriftDTO(); + _elem7.read(iprot); + struct.requestDataList.add(_elem7); + } + } + struct.setRequestDataListIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/RequestDataThriftDTO.java b/src/main/java/com/nhn/pinpoint/thrift/dto/RequestDataThriftDTO.java new file mode 100644 index 000000000..27f445938 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/RequestDataThriftDTO.java @@ -0,0 +1,1539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RequestDataThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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 short __isset_bitfield = 0; + 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_bitfield = other.__isset_bitfield; + 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATATYPE_ISSET_ID); + } + + /** Returns true if field dataType is set (has been assigned a value) and false otherwise */ + public boolean isSetDataType() { + return EncodingUtils.testBit(__isset_bitfield, __DATATYPE_ISSET_ID); + } + + public void setDataTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATATYPE_ISSET_ID, value); + } + + public long getDataTime() { + return this.dataTime; + } + + public void setDataTime(long dataTime) { + this.dataTime = dataTime; + setDataTimeIsSet(true); + } + + public void unsetDataTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATATIME_ISSET_ID); + } + + /** Returns true if field dataTime is set (has been assigned a value) and false otherwise */ + public boolean isSetDataTime() { + return EncodingUtils.testBit(__isset_bitfield, __DATATIME_ISSET_ID); + } + + public void setDataTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATATIME_ISSET_ID, value); + } + + public int getDataHashCode() { + return this.dataHashCode; + } + + public void setDataHashCode(int dataHashCode) { + this.dataHashCode = dataHashCode; + setDataHashCodeIsSet(true); + } + + public void unsetDataHashCode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATAHASHCODE_ISSET_ID); + } + + /** Returns true if field dataHashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetDataHashCode() { + return EncodingUtils.testBit(__isset_bitfield, __DATAHASHCODE_ISSET_ID); + } + + public void setDataHashCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRAINT1_ISSET_ID); + } + + /** Returns true if field extraInt1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt1() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRAINT1_ISSET_ID); + } + + public void setExtraInt1IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRAINT1_ISSET_ID, value); + } + + public int getExtraInt2() { + return this.extraInt2; + } + + public void setExtraInt2(int extraInt2) { + this.extraInt2 = extraInt2; + setExtraInt2IsSet(true); + } + + public void unsetExtraInt2() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRAINT2_ISSET_ID); + } + + /** Returns true if field extraInt2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt2() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRAINT2_ISSET_ID); + } + + public void setExtraInt2IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRAINT2_ISSET_ID, value); + } + + public int getExtraInt3() { + return this.extraInt3; + } + + public void setExtraInt3(int extraInt3) { + this.extraInt3 = extraInt3; + setExtraInt3IsSet(true); + } + + public void unsetExtraInt3() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRAINT3_ISSET_ID); + } + + /** Returns true if field extraInt3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt3() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRAINT3_ISSET_ID); + } + + public void setExtraInt3IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRAINT3_ISSET_ID, value); + } + + public long getExtraLong1() { + return this.extraLong1; + } + + public void setExtraLong1(long extraLong1) { + this.extraLong1 = extraLong1; + setExtraLong1IsSet(true); + } + + public void unsetExtraLong1() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRALONG1_ISSET_ID); + } + + /** Returns true if field extraLong1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong1() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRALONG1_ISSET_ID); + } + + public void setExtraLong1IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRALONG1_ISSET_ID, value); + } + + public long getExtraLong2() { + return this.extraLong2; + } + + public void setExtraLong2(long extraLong2) { + this.extraLong2 = extraLong2; + setExtraLong2IsSet(true); + } + + public void unsetExtraLong2() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRALONG2_ISSET_ID); + } + + /** Returns true if field extraLong2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong2() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRALONG2_ISSET_ID); + } + + public void setExtraLong2IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRALONG2_ISSET_ID, value); + } + + public long getExtraLong3() { + return this.extraLong3; + } + + public void setExtraLong3(long extraLong3) { + this.extraLong3 = extraLong3; + setExtraLong3IsSet(true); + } + + public void unsetExtraLong3() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRALONG3_ISSET_ID); + } + + /** Returns true if field extraLong3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong3() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRALONG3_ISSET_ID); + } + + public void setExtraLong3IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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; + } + + @Override + public int compareTo(RequestDataThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetDataType()).compareTo(other.isSetDataType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, other.dataType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataTime()).compareTo(other.isSetDataTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, other.dataTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataHashCode()).compareTo(other.isSetDataHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataHashCode, other.dataHashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataString()).compareTo(other.isSetDataString()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataString()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataString, other.dataString); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData1()).compareTo(other.isSetExtraData1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData1, other.extraData1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData2()).compareTo(other.isSetExtraData2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData2, other.extraData2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData3()).compareTo(other.isSetExtraData3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData3, other.extraData3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt1()).compareTo(other.isSetExtraInt1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt1, other.extraInt1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt2()).compareTo(other.isSetExtraInt2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt2, other.extraInt2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt3()).compareTo(other.isSetExtraInt3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt3, other.extraInt3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong1()).compareTo(other.isSetExtraLong1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong1, other.extraLong1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong2()).compareTo(other.isSetExtraLong2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong2, other.extraLong2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong3()).compareTo(other.isSetExtraLong3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong3, other.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 + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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/nhn/pinpoint/thrift/dto/RequestThriftDTO.java b/src/main/java/com/nhn/pinpoint/thrift/dto/RequestThriftDTO.java new file mode 100644 index 000000000..af4e93d2d --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/RequestThriftDTO.java @@ -0,0 +1,2025 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RequestThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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 short __isset_bitfield = 0; + 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_bitfield = other.__isset_bitfield; + 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTHASHCODE_ISSET_ID); + } + + /** Returns true if field requestHashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestHashCode() { + return EncodingUtils.testBit(__isset_bitfield, __REQUESTHASHCODE_ISSET_ID); + } + + public void setRequestHashCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTHASHCODE_ISSET_ID, value); + } + + public int getDataType() { + return this.dataType; + } + + public void setDataType(int dataType) { + this.dataType = dataType; + setDataTypeIsSet(true); + } + + public void unsetDataType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATATYPE_ISSET_ID); + } + + /** Returns true if field dataType is set (has been assigned a value) and false otherwise */ + public boolean isSetDataType() { + return EncodingUtils.testBit(__isset_bitfield, __DATATYPE_ISSET_ID); + } + + public void setDataTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATATYPE_ISSET_ID, value); + } + + public long getDataTime() { + return this.dataTime; + } + + public void setDataTime(long dataTime) { + this.dataTime = dataTime; + setDataTimeIsSet(true); + } + + public void unsetDataTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATATIME_ISSET_ID); + } + + /** Returns true if field dataTime is set (has been assigned a value) and false otherwise */ + public boolean isSetDataTime() { + return EncodingUtils.testBit(__isset_bitfield, __DATATIME_ISSET_ID); + } + + public void setDataTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATATIME_ISSET_ID, value); + } + + public long getThreadCPUTime() { + return this.threadCPUTime; + } + + public void setThreadCPUTime(long threadCPUTime) { + this.threadCPUTime = threadCPUTime; + setThreadCPUTimeIsSet(true); + } + + public void unsetThreadCPUTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __THREADCPUTIME_ISSET_ID); + } + + /** Returns true if field threadCPUTime is set (has been assigned a value) and false otherwise */ + public boolean isSetThreadCPUTime() { + return EncodingUtils.testBit(__isset_bitfield, __THREADCPUTIME_ISSET_ID); + } + + public void setThreadCPUTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __THREADCPUTIME_ISSET_ID, value); + } + + public long getThreadUserTime() { + return this.threadUserTime; + } + + public void setThreadUserTime(long threadUserTime) { + this.threadUserTime = threadUserTime; + setThreadUserTimeIsSet(true); + } + + public void unsetThreadUserTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __THREADUSERTIME_ISSET_ID); + } + + /** Returns true if field threadUserTime is set (has been assigned a value) and false otherwise */ + public boolean isSetThreadUserTime() { + return EncodingUtils.testBit(__isset_bitfield, __THREADUSERTIME_ISSET_ID); + } + + public void setThreadUserTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRAINT1_ISSET_ID); + } + + /** Returns true if field extraInt1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt1() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRAINT1_ISSET_ID); + } + + public void setExtraInt1IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRAINT1_ISSET_ID, value); + } + + public int getExtraInt2() { + return this.extraInt2; + } + + public void setExtraInt2(int extraInt2) { + this.extraInt2 = extraInt2; + setExtraInt2IsSet(true); + } + + public void unsetExtraInt2() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRAINT2_ISSET_ID); + } + + /** Returns true if field extraInt2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt2() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRAINT2_ISSET_ID); + } + + public void setExtraInt2IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRAINT2_ISSET_ID, value); + } + + public int getExtraInt3() { + return this.extraInt3; + } + + public void setExtraInt3(int extraInt3) { + this.extraInt3 = extraInt3; + setExtraInt3IsSet(true); + } + + public void unsetExtraInt3() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRAINT3_ISSET_ID); + } + + /** Returns true if field extraInt3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraInt3() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRAINT3_ISSET_ID); + } + + public void setExtraInt3IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRAINT3_ISSET_ID, value); + } + + public long getExtraLong1() { + return this.extraLong1; + } + + public void setExtraLong1(long extraLong1) { + this.extraLong1 = extraLong1; + setExtraLong1IsSet(true); + } + + public void unsetExtraLong1() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRALONG1_ISSET_ID); + } + + /** Returns true if field extraLong1 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong1() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRALONG1_ISSET_ID); + } + + public void setExtraLong1IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRALONG1_ISSET_ID, value); + } + + public long getExtraLong2() { + return this.extraLong2; + } + + public void setExtraLong2(long extraLong2) { + this.extraLong2 = extraLong2; + setExtraLong2IsSet(true); + } + + public void unsetExtraLong2() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRALONG2_ISSET_ID); + } + + /** Returns true if field extraLong2 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong2() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRALONG2_ISSET_ID); + } + + public void setExtraLong2IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXTRALONG2_ISSET_ID, value); + } + + public long getExtraLong3() { + return this.extraLong3; + } + + public void setExtraLong3(long extraLong3) { + this.extraLong3 = extraLong3; + setExtraLong3IsSet(true); + } + + public void unsetExtraLong3() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXTRALONG3_ISSET_ID); + } + + /** Returns true if field extraLong3 is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraLong3() { + return EncodingUtils.testBit(__isset_bitfield, __EXTRALONG3_ISSET_ID); + } + + public void setExtraLong3IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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; + } + + @Override + public int compareTo(RequestThriftDTO other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestHashCode()).compareTo(other.isSetRequestHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestHashCode, other.requestHashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataType()).compareTo(other.isSetDataType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, other.dataType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataTime()).compareTo(other.isSetDataTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTime, other.dataTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetThreadCPUTime()).compareTo(other.isSetThreadCPUTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetThreadCPUTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threadCPUTime, other.threadCPUTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetThreadUserTime()).compareTo(other.isSetThreadUserTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetThreadUserTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threadUserTime, other.threadUserTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestID()).compareTo(other.isSetRequestID()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestID()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestID, other.requestID); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRequestURL()).compareTo(other.isSetRequestURL()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestURL()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestURL, other.requestURL); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetClientIP()).compareTo(other.isSetClientIP()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClientIP()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientIP, other.clientIP); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData1()).compareTo(other.isSetExtraData1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData1, other.extraData1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData2()).compareTo(other.isSetExtraData2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData2, other.extraData2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraData3()).compareTo(other.isSetExtraData3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraData3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraData3, other.extraData3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt1()).compareTo(other.isSetExtraInt1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt1, other.extraInt1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt2()).compareTo(other.isSetExtraInt2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt2, other.extraInt2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraInt3()).compareTo(other.isSetExtraInt3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraInt3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraInt3, other.extraInt3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong1()).compareTo(other.isSetExtraLong1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong1, other.extraLong1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong2()).compareTo(other.isSetExtraLong2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong2, other.extraLong2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetExtraLong3()).compareTo(other.isSetExtraLong3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraLong3()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraLong3, other.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 + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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/nhn/pinpoint/thrift/dto/Result.java b/src/main/java/com/nhn/pinpoint/thrift/dto/Result.java new file mode 100644 index 000000000..2f44f7cf9 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/Result.java @@ -0,0 +1,485 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)1); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ResultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ResultTupleSchemeFactory()); + } + + private boolean success; // required + private String message; // 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 { + SUCCESS((short)1, "success"), + MESSAGE((short)2, "message"); + + 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: // SUCCESS + return SUCCESS; + case 2: // MESSAGE + return MESSAGE; + 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 __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.MESSAGE}; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Result.class, metaDataMap); + } + + public Result() { + } + + public Result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public Result(Result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public Result deepCopy() { + return new Result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.message = null; + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String message) { + this.message = message; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + case MESSAGE: + return getMessage(); + + } + 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 SUCCESS: + return isSetSuccess(); + case MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Result) + return this.equals((Result)that); + return false; + } + + public boolean equals(Result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(Result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + 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("Result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (isSetMessage()) { + if (!first) sb.append(", "); + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ResultStandardSchemeFactory implements SchemeFactory { + public ResultStandardScheme getScheme() { + return new ResultStandardScheme(); + } + } + + private static class ResultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Result 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: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(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, Result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + if (struct.message != null) { + if (struct.isSetMessage()) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ResultTupleSchemeFactory implements SchemeFactory { + public ResultTupleScheme getScheme() { + return new ResultTupleScheme(); + } + } + + private static class ResultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetMessage()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/Span.java b/src/main/java/com/nhn/pinpoint/thrift/dto/Span.java new file mode 100644 index 000000000..cd013b800 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/Span.java @@ -0,0 +1,2333 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Span implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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 APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField AGENT_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("agentStartTime", org.apache.thrift.protocol.TType.I64, (short)3); + 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)4); + 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)5); + private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I32, (short)6); + 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.I32, (short)7); + 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)8); + 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)9); + 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)10); + 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)12); + 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)13); + private static final org.apache.thrift.protocol.TField REMOTE_ADDR_FIELD_DESC = new org.apache.thrift.protocol.TField("remoteAddr", org.apache.thrift.protocol.TType.STRING, (short)14); + 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)15); + 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)16); + private static final org.apache.thrift.protocol.TField ERR_FIELD_DESC = new org.apache.thrift.protocol.TField("err", org.apache.thrift.protocol.TType.I32, (short)17); + private static final org.apache.thrift.protocol.TField SPAN_EVENT_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("spanEventList", org.apache.thrift.protocol.TType.LIST, (short)18); + private static final org.apache.thrift.protocol.TField PARENT_APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentApplicationName", org.apache.thrift.protocol.TType.STRING, (short)19); + private static final org.apache.thrift.protocol.TField PARENT_APPLICATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("parentApplicationType", org.apache.thrift.protocol.TType.I16, (short)20); + private static final org.apache.thrift.protocol.TField ACCEPTOR_HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("acceptorHost", org.apache.thrift.protocol.TType.STRING, (short)21); + + 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 String applicationName; // required + private long agentStartTime; // required + private long mostTraceId; // required + private long leastTraceId; // required + private int spanId; // required + private int parentSpanId; // optional + private long startTime; // required + private int elapsed; // required + private String rpc; // optional + private short serviceType; // required + private String endPoint; // optional + private String remoteAddr; // optional + private List annotations; // required + private short flag; // optional + private int err; // optional + private List spanEventList; // optional + private String parentApplicationName; // optional + private short parentApplicationType; // optional + private String acceptorHost; // 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"), + APPLICATION_NAME((short)2, "applicationName"), + AGENT_START_TIME((short)3, "agentStartTime"), + MOST_TRACE_ID((short)4, "mostTraceId"), + LEAST_TRACE_ID((short)5, "leastTraceId"), + SPAN_ID((short)6, "spanId"), + PARENT_SPAN_ID((short)7, "parentSpanId"), + START_TIME((short)8, "startTime"), + ELAPSED((short)9, "elapsed"), + RPC((short)10, "rpc"), + SERVICE_TYPE((short)12, "serviceType"), + END_POINT((short)13, "endPoint"), + REMOTE_ADDR((short)14, "remoteAddr"), + ANNOTATIONS((short)15, "annotations"), + FLAG((short)16, "flag"), + ERR((short)17, "err"), + SPAN_EVENT_LIST((short)18, "spanEventList"), + PARENT_APPLICATION_NAME((short)19, "parentApplicationName"), + PARENT_APPLICATION_TYPE((short)20, "parentApplicationType"), + ACCEPTOR_HOST((short)21, "acceptorHost"); + + 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: // APPLICATION_NAME + return APPLICATION_NAME; + case 3: // AGENT_START_TIME + return AGENT_START_TIME; + case 4: // MOST_TRACE_ID + return MOST_TRACE_ID; + case 5: // LEAST_TRACE_ID + return LEAST_TRACE_ID; + case 6: // SPAN_ID + return SPAN_ID; + case 7: // PARENT_SPAN_ID + return PARENT_SPAN_ID; + case 8: // START_TIME + return START_TIME; + case 9: // ELAPSED + return ELAPSED; + case 10: // RPC + return RPC; + case 12: // SERVICE_TYPE + return SERVICE_TYPE; + case 13: // END_POINT + return END_POINT; + case 14: // REMOTE_ADDR + return REMOTE_ADDR; + case 15: // ANNOTATIONS + return ANNOTATIONS; + case 16: // FLAG + return FLAG; + case 17: // ERR + return ERR; + case 18: // SPAN_EVENT_LIST + return SPAN_EVENT_LIST; + case 19: // PARENT_APPLICATION_NAME + return PARENT_APPLICATION_NAME; + case 20: // PARENT_APPLICATION_TYPE + return PARENT_APPLICATION_TYPE; + case 21: // ACCEPTOR_HOST + return ACCEPTOR_HOST; + 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 __AGENTSTARTTIME_ISSET_ID = 0; + private static final int __MOSTTRACEID_ISSET_ID = 1; + private static final int __LEASTTRACEID_ISSET_ID = 2; + private static final int __SPANID_ISSET_ID = 3; + private static final int __PARENTSPANID_ISSET_ID = 4; + private static final int __STARTTIME_ISSET_ID = 5; + private static final int __ELAPSED_ISSET_ID = 6; + private static final int __SERVICETYPE_ISSET_ID = 7; + private static final int __FLAG_ISSET_ID = 8; + private static final int __ERR_ISSET_ID = 9; + private static final int __PARENTAPPLICATIONTYPE_ISSET_ID = 10; + private short __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.PARENT_SPAN_ID,_Fields.RPC,_Fields.END_POINT,_Fields.REMOTE_ADDR,_Fields.FLAG,_Fields.ERR,_Fields.SPAN_EVENT_LIST,_Fields.PARENT_APPLICATION_NAME,_Fields.PARENT_APPLICATION_TYPE,_Fields.ACCEPTOR_HOST}; + 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.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.AGENT_START_TIME, new org.apache.thrift.meta_data.FieldMetaData("agentStartTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + 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.I32))); + tmpMap.put(_Fields.PARENT_SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("parentSpanId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + 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.OPTIONAL, + 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.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.REMOTE_ADDR, new org.apache.thrift.meta_data.FieldMetaData("remoteAddr", org.apache.thrift.TFieldRequirementType.OPTIONAL, + 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.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.SPAN_EVENT_LIST, new org.apache.thrift.meta_data.FieldMetaData("spanEventList", 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, SpanEvent.class)))); + tmpMap.put(_Fields.PARENT_APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentApplicationName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PARENT_APPLICATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("parentApplicationType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.ACCEPTOR_HOST, new org.apache.thrift.meta_data.FieldMetaData("acceptorHost", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Span.class, metaDataMap); + } + + public Span() { + this.parentSpanId = -1; + + this.flag = (short)0; + + } + + public Span( + String agentId, + String applicationName, + long agentStartTime, + long mostTraceId, + long leastTraceId, + int spanId, + long startTime, + int elapsed, + short serviceType, + List annotations) + { + this(); + this.agentId = agentId; + this.applicationName = applicationName; + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + this.spanId = spanId; + setSpanIdIsSet(true); + this.startTime = startTime; + setStartTimeIsSet(true); + this.elapsed = elapsed; + setElapsedIsSet(true); + this.serviceType = serviceType; + setServiceTypeIsSet(true); + this.annotations = annotations; + } + + /** + * Performs a deep copy on other. + */ + public Span(Span other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + if (other.isSetApplicationName()) { + this.applicationName = other.applicationName; + } + this.agentStartTime = other.agentStartTime; + 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; + } + this.serviceType = other.serviceType; + if (other.isSetEndPoint()) { + this.endPoint = other.endPoint; + } + if (other.isSetRemoteAddr()) { + this.remoteAddr = other.remoteAddr; + } + if (other.isSetAnnotations()) { + List __this__annotations = new ArrayList(other.annotations.size()); + 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.isSetSpanEventList()) { + List __this__spanEventList = new ArrayList(other.spanEventList.size()); + for (SpanEvent other_element : other.spanEventList) { + __this__spanEventList.add(new SpanEvent(other_element)); + } + this.spanEventList = __this__spanEventList; + } + if (other.isSetParentApplicationName()) { + this.parentApplicationName = other.parentApplicationName; + } + this.parentApplicationType = other.parentApplicationType; + if (other.isSetAcceptorHost()) { + this.acceptorHost = other.acceptorHost; + } + } + + public Span deepCopy() { + return new Span(this); + } + + @Override + public void clear() { + this.agentId = null; + this.applicationName = null; + setAgentStartTimeIsSet(false); + this.agentStartTime = 0; + setMostTraceIdIsSet(false); + this.mostTraceId = 0; + setLeastTraceIdIsSet(false); + this.leastTraceId = 0; + setSpanIdIsSet(false); + this.spanId = 0; + this.parentSpanId = -1; + + setStartTimeIsSet(false); + this.startTime = 0; + setElapsedIsSet(false); + this.elapsed = 0; + this.rpc = null; + setServiceTypeIsSet(false); + this.serviceType = 0; + this.endPoint = null; + this.remoteAddr = null; + this.annotations = null; + this.flag = (short)0; + + setErrIsSet(false); + this.err = 0; + this.spanEventList = null; + this.parentApplicationName = null; + setParentApplicationTypeIsSet(false); + this.parentApplicationType = 0; + this.acceptorHost = 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 long getAgentStartTime() { + return this.agentStartTime; + } + + public void setAgentStartTime(long agentStartTime) { + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + } + + public void unsetAgentStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + /** Returns true if field agentStartTime is set (has been assigned a value) and false otherwise */ + public boolean isSetAgentStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + public void setAgentStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID, value); + } + + public long getMostTraceId() { + return this.mostTraceId; + } + + public void setMostTraceId(long mostTraceId) { + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + } + + public void unsetMostTraceId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID); + } + + /** Returns true if field mostTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetMostTraceId() { + return EncodingUtils.testBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID); + } + + public void setMostTraceIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID, value); + } + + public long getLeastTraceId() { + return this.leastTraceId; + } + + public void setLeastTraceId(long leastTraceId) { + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + } + + public void unsetLeastTraceId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID); + } + + /** Returns true if field leastTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetLeastTraceId() { + return EncodingUtils.testBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID); + } + + public void setLeastTraceIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID, value); + } + + public int getSpanId() { + return this.spanId; + } + + public void setSpanId(int spanId) { + this.spanId = spanId; + setSpanIdIsSet(true); + } + + public void unsetSpanId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SPANID_ISSET_ID); + } + + /** Returns true if field spanId is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanId() { + return EncodingUtils.testBit(__isset_bitfield, __SPANID_ISSET_ID); + } + + public void setSpanIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SPANID_ISSET_ID, value); + } + + public int getParentSpanId() { + return this.parentSpanId; + } + + public void setParentSpanId(int parentSpanId) { + this.parentSpanId = parentSpanId; + setParentSpanIdIsSet(true); + } + + public void unsetParentSpanId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARENTSPANID_ISSET_ID); + } + + /** Returns true if field parentSpanId is set (has been assigned a value) and false otherwise */ + public boolean isSetParentSpanId() { + return EncodingUtils.testBit(__isset_bitfield, __PARENTSPANID_ISSET_ID); + } + + public void setParentSpanIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARENTSPANID_ISSET_ID, value); + } + + public long getStartTime() { + return this.startTime; + } + + public void setStartTime(long startTime) { + this.startTime = startTime; + setStartTimeIsSet(true); + } + + public void unsetStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ + public boolean isSetStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + public void setStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); + } + + public int getElapsed() { + return this.elapsed; + } + + public void setElapsed(int elapsed) { + this.elapsed = elapsed; + setElapsedIsSet(true); + } + + public void unsetElapsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ELAPSED_ISSET_ID); + } + + /** Returns true if field elapsed is set (has been assigned a value) and false otherwise */ + public boolean isSetElapsed() { + return EncodingUtils.testBit(__isset_bitfield, __ELAPSED_ISSET_ID); + } + + public void setElapsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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 short getServiceType() { + return this.serviceType; + } + + public void setServiceType(short serviceType) { + this.serviceType = serviceType; + setServiceTypeIsSet(true); + } + + public void unsetServiceType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceType() { + return EncodingUtils.testBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + public void setServiceTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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 String getRemoteAddr() { + return this.remoteAddr; + } + + public void setRemoteAddr(String remoteAddr) { + this.remoteAddr = remoteAddr; + } + + public void unsetRemoteAddr() { + this.remoteAddr = null; + } + + /** Returns true if field remoteAddr is set (has been assigned a value) and false otherwise */ + public boolean isSetRemoteAddr() { + return this.remoteAddr != null; + } + + public void setRemoteAddrIsSet(boolean value) { + if (!value) { + this.remoteAddr = 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FLAG_ISSET_ID); + } + + /** Returns true if field flag is set (has been assigned a value) and false otherwise */ + public boolean isSetFlag() { + return EncodingUtils.testBit(__isset_bitfield, __FLAG_ISSET_ID); + } + + public void setFlagIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FLAG_ISSET_ID, value); + } + + public int getErr() { + return this.err; + } + + public void setErr(int err) { + this.err = err; + setErrIsSet(true); + } + + public void unsetErr() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERR_ISSET_ID); + } + + /** Returns true if field err is set (has been assigned a value) and false otherwise */ + public boolean isSetErr() { + return EncodingUtils.testBit(__isset_bitfield, __ERR_ISSET_ID); + } + + public void setErrIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERR_ISSET_ID, value); + } + + public int getSpanEventListSize() { + return (this.spanEventList == null) ? 0 : this.spanEventList.size(); + } + + public java.util.Iterator getSpanEventListIterator() { + return (this.spanEventList == null) ? null : this.spanEventList.iterator(); + } + + public void addToSpanEventList(SpanEvent elem) { + if (this.spanEventList == null) { + this.spanEventList = new ArrayList(); + } + this.spanEventList.add(elem); + } + + public List getSpanEventList() { + return this.spanEventList; + } + + public void setSpanEventList(List spanEventList) { + this.spanEventList = spanEventList; + } + + public void unsetSpanEventList() { + this.spanEventList = null; + } + + /** Returns true if field spanEventList is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanEventList() { + return this.spanEventList != null; + } + + public void setSpanEventListIsSet(boolean value) { + if (!value) { + this.spanEventList = null; + } + } + + public String getParentApplicationName() { + return this.parentApplicationName; + } + + public void setParentApplicationName(String parentApplicationName) { + this.parentApplicationName = parentApplicationName; + } + + public void unsetParentApplicationName() { + this.parentApplicationName = null; + } + + /** Returns true if field parentApplicationName is set (has been assigned a value) and false otherwise */ + public boolean isSetParentApplicationName() { + return this.parentApplicationName != null; + } + + public void setParentApplicationNameIsSet(boolean value) { + if (!value) { + this.parentApplicationName = null; + } + } + + public short getParentApplicationType() { + return this.parentApplicationType; + } + + public void setParentApplicationType(short parentApplicationType) { + this.parentApplicationType = parentApplicationType; + setParentApplicationTypeIsSet(true); + } + + public void unsetParentApplicationType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARENTAPPLICATIONTYPE_ISSET_ID); + } + + /** Returns true if field parentApplicationType is set (has been assigned a value) and false otherwise */ + public boolean isSetParentApplicationType() { + return EncodingUtils.testBit(__isset_bitfield, __PARENTAPPLICATIONTYPE_ISSET_ID); + } + + public void setParentApplicationTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARENTAPPLICATIONTYPE_ISSET_ID, value); + } + + public String getAcceptorHost() { + return this.acceptorHost; + } + + public void setAcceptorHost(String acceptorHost) { + this.acceptorHost = acceptorHost; + } + + public void unsetAcceptorHost() { + this.acceptorHost = null; + } + + /** Returns true if field acceptorHost is set (has been assigned a value) and false otherwise */ + public boolean isSetAcceptorHost() { + return this.acceptorHost != null; + } + + public void setAcceptorHostIsSet(boolean value) { + if (!value) { + this.acceptorHost = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + 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 AGENT_START_TIME: + if (value == null) { + unsetAgentStartTime(); + } else { + setAgentStartTime((Long)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((Integer)value); + } + break; + + case PARENT_SPAN_ID: + if (value == null) { + unsetParentSpanId(); + } else { + setParentSpanId((Integer)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_TYPE: + if (value == null) { + unsetServiceType(); + } else { + setServiceType((Short)value); + } + break; + + case END_POINT: + if (value == null) { + unsetEndPoint(); + } else { + setEndPoint((String)value); + } + break; + + case REMOTE_ADDR: + if (value == null) { + unsetRemoteAddr(); + } else { + setRemoteAddr((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((Integer)value); + } + break; + + case SPAN_EVENT_LIST: + if (value == null) { + unsetSpanEventList(); + } else { + setSpanEventList((List)value); + } + break; + + case PARENT_APPLICATION_NAME: + if (value == null) { + unsetParentApplicationName(); + } else { + setParentApplicationName((String)value); + } + break; + + case PARENT_APPLICATION_TYPE: + if (value == null) { + unsetParentApplicationType(); + } else { + setParentApplicationType((Short)value); + } + break; + + case ACCEPTOR_HOST: + if (value == null) { + unsetAcceptorHost(); + } else { + setAcceptorHost((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case APPLICATION_NAME: + return getApplicationName(); + + case AGENT_START_TIME: + return Long.valueOf(getAgentStartTime()); + + case MOST_TRACE_ID: + return Long.valueOf(getMostTraceId()); + + case LEAST_TRACE_ID: + return Long.valueOf(getLeastTraceId()); + + case SPAN_ID: + return Integer.valueOf(getSpanId()); + + case PARENT_SPAN_ID: + return Integer.valueOf(getParentSpanId()); + + case START_TIME: + return Long.valueOf(getStartTime()); + + case ELAPSED: + return Integer.valueOf(getElapsed()); + + case RPC: + return getRpc(); + + case SERVICE_TYPE: + return Short.valueOf(getServiceType()); + + case END_POINT: + return getEndPoint(); + + case REMOTE_ADDR: + return getRemoteAddr(); + + case ANNOTATIONS: + return getAnnotations(); + + case FLAG: + return Short.valueOf(getFlag()); + + case ERR: + return Integer.valueOf(getErr()); + + case SPAN_EVENT_LIST: + return getSpanEventList(); + + case PARENT_APPLICATION_NAME: + return getParentApplicationName(); + + case PARENT_APPLICATION_TYPE: + return Short.valueOf(getParentApplicationType()); + + case ACCEPTOR_HOST: + return getAcceptorHost(); + + } + 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 APPLICATION_NAME: + return isSetApplicationName(); + case AGENT_START_TIME: + return isSetAgentStartTime(); + 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_TYPE: + return isSetServiceType(); + case END_POINT: + return isSetEndPoint(); + case REMOTE_ADDR: + return isSetRemoteAddr(); + case ANNOTATIONS: + return isSetAnnotations(); + case FLAG: + return isSetFlag(); + case ERR: + return isSetErr(); + case SPAN_EVENT_LIST: + return isSetSpanEventList(); + case PARENT_APPLICATION_NAME: + return isSetParentApplicationName(); + case PARENT_APPLICATION_TYPE: + return isSetParentApplicationType(); + case ACCEPTOR_HOST: + return isSetAcceptorHost(); + } + 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_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_agentStartTime = true; + boolean that_present_agentStartTime = true; + if (this_present_agentStartTime || that_present_agentStartTime) { + if (!(this_present_agentStartTime && that_present_agentStartTime)) + return false; + if (this.agentStartTime != that.agentStartTime) + 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 && this.isSetParentSpanId(); + boolean that_present_parentSpanId = true && that.isSetParentSpanId(); + 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_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_remoteAddr = true && this.isSetRemoteAddr(); + boolean that_present_remoteAddr = true && that.isSetRemoteAddr(); + if (this_present_remoteAddr || that_present_remoteAddr) { + if (!(this_present_remoteAddr && that_present_remoteAddr)) + return false; + if (!this.remoteAddr.equals(that.remoteAddr)) + 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 && this.isSetErr(); + boolean that_present_err = true && that.isSetErr(); + 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_spanEventList = true && this.isSetSpanEventList(); + boolean that_present_spanEventList = true && that.isSetSpanEventList(); + if (this_present_spanEventList || that_present_spanEventList) { + if (!(this_present_spanEventList && that_present_spanEventList)) + return false; + if (!this.spanEventList.equals(that.spanEventList)) + return false; + } + + boolean this_present_parentApplicationName = true && this.isSetParentApplicationName(); + boolean that_present_parentApplicationName = true && that.isSetParentApplicationName(); + if (this_present_parentApplicationName || that_present_parentApplicationName) { + if (!(this_present_parentApplicationName && that_present_parentApplicationName)) + return false; + if (!this.parentApplicationName.equals(that.parentApplicationName)) + return false; + } + + boolean this_present_parentApplicationType = true && this.isSetParentApplicationType(); + boolean that_present_parentApplicationType = true && that.isSetParentApplicationType(); + if (this_present_parentApplicationType || that_present_parentApplicationType) { + if (!(this_present_parentApplicationType && that_present_parentApplicationType)) + return false; + if (this.parentApplicationType != that.parentApplicationType) + return false; + } + + boolean this_present_acceptorHost = true && this.isSetAcceptorHost(); + boolean that_present_acceptorHost = true && that.isSetAcceptorHost(); + if (this_present_acceptorHost || that_present_acceptorHost) { + if (!(this_present_acceptorHost && that_present_acceptorHost)) + return false; + if (!this.acceptorHost.equals(that.acceptorHost)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(Span other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetApplicationName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAgentStartTime()).compareTo(other.isSetAgentStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentStartTime, other.agentStartTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMostTraceId()).compareTo(other.isSetMostTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMostTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, other.mostTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(other.isSetLeastTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLeastTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, other.leastTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(other.isSetSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, other.spanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentSpanId()).compareTo(other.isSetParentSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentSpanId, other.parentSpanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetElapsed()).compareTo(other.isSetElapsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetElapsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.elapsed, other.elapsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRpc()).compareTo(other.isSetRpc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRpc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpc, other.rpc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(other.isSetServiceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, other.serviceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndPoint()).compareTo(other.isSetEndPoint()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndPoint()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endPoint, other.endPoint); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRemoteAddr()).compareTo(other.isSetRemoteAddr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRemoteAddr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.remoteAddr, other.remoteAddr); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAnnotations()).compareTo(other.isSetAnnotations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAnnotations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.annotations, other.annotations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFlag()).compareTo(other.isSetFlag()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFlag()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flag, other.flag); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErr()).compareTo(other.isSetErr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.err, other.err); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanEventList()).compareTo(other.isSetSpanEventList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanEventList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanEventList, other.spanEventList); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentApplicationName()).compareTo(other.isSetParentApplicationName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentApplicationName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentApplicationName, other.parentApplicationName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentApplicationType()).compareTo(other.isSetParentApplicationType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentApplicationType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentApplicationType, other.parentApplicationType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAcceptorHost()).compareTo(other.isSetAcceptorHost()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAcceptorHost()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acceptorHost, other.acceptorHost); + 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("applicationName:"); + if (this.applicationName == null) { + sb.append("null"); + } else { + sb.append(this.applicationName); + } + first = false; + if (!first) sb.append(", "); + sb.append("agentStartTime:"); + sb.append(this.agentStartTime); + 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 (isSetParentSpanId()) { + 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 (isSetRpc()) { + 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("serviceType:"); + sb.append(this.serviceType); + first = false; + if (isSetEndPoint()) { + if (!first) sb.append(", "); + sb.append("endPoint:"); + if (this.endPoint == null) { + sb.append("null"); + } else { + sb.append(this.endPoint); + } + first = false; + } + if (isSetRemoteAddr()) { + if (!first) sb.append(", "); + sb.append("remoteAddr:"); + if (this.remoteAddr == null) { + sb.append("null"); + } else { + sb.append(this.remoteAddr); + } + 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 (isSetErr()) { + if (!first) sb.append(", "); + sb.append("err:"); + sb.append(this.err); + first = false; + } + if (isSetSpanEventList()) { + if (!first) sb.append(", "); + sb.append("spanEventList:"); + if (this.spanEventList == null) { + sb.append("null"); + } else { + sb.append(this.spanEventList); + } + first = false; + } + if (isSetParentApplicationName()) { + if (!first) sb.append(", "); + sb.append("parentApplicationName:"); + if (this.parentApplicationName == null) { + sb.append("null"); + } else { + sb.append(this.parentApplicationName); + } + first = false; + } + if (isSetParentApplicationType()) { + if (!first) sb.append(", "); + sb.append("parentApplicationType:"); + sb.append(this.parentApplicationType); + first = false; + } + if (isSetAcceptorHost()) { + if (!first) sb.append(", "); + sb.append("acceptorHost:"); + if (this.acceptorHost == null) { + sb.append("null"); + } else { + sb.append(this.acceptorHost); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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: // 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 3: // AGENT_START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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 5: // 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 6: // SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.spanId = iprot.readI32(); + struct.setSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // PARENT_SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.parentSpanId = iprot.readI32(); + struct.setParentSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // 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 9: // 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 10: // 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 12: // 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 13: // 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 14: // REMOTE_ADDR + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.remoteAddr = iprot.readString(); + struct.setRemoteAddrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 15: // ANNOTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.annotations = new ArrayList(_list16.size); + for (int _i17 = 0; _i17 < _list16.size; ++_i17) + { + Annotation _elem18; + _elem18 = new Annotation(); + _elem18.read(iprot); + struct.annotations.add(_elem18); + } + iprot.readListEnd(); + } + struct.setAnnotationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 16: // 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 17: // ERR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.err = iprot.readI32(); + struct.setErrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 18: // SPAN_EVENT_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list19 = iprot.readListBegin(); + struct.spanEventList = new ArrayList(_list19.size); + for (int _i20 = 0; _i20 < _list19.size; ++_i20) + { + SpanEvent _elem21; + _elem21 = new SpanEvent(); + _elem21.read(iprot); + struct.spanEventList.add(_elem21); + } + iprot.readListEnd(); + } + struct.setSpanEventListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 19: // PARENT_APPLICATION_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentApplicationName = iprot.readString(); + struct.setParentApplicationNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 20: // PARENT_APPLICATION_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.parentApplicationType = iprot.readI16(); + struct.setParentApplicationTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 21: // ACCEPTOR_HOST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.acceptorHost = iprot.readString(); + struct.setAcceptorHostIsSet(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(); + } + if (struct.applicationName != null) { + oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC); + oprot.writeString(struct.applicationName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(AGENT_START_TIME_FIELD_DESC); + oprot.writeI64(struct.agentStartTime); + 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.writeI32(struct.spanId); + oprot.writeFieldEnd(); + if (struct.isSetParentSpanId()) { + oprot.writeFieldBegin(PARENT_SPAN_ID_FIELD_DESC); + oprot.writeI32(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) { + if (struct.isSetRpc()) { + oprot.writeFieldBegin(RPC_FIELD_DESC); + oprot.writeString(struct.rpc); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC); + oprot.writeI16(struct.serviceType); + oprot.writeFieldEnd(); + if (struct.endPoint != null) { + if (struct.isSetEndPoint()) { + oprot.writeFieldBegin(END_POINT_FIELD_DESC); + oprot.writeString(struct.endPoint); + oprot.writeFieldEnd(); + } + } + if (struct.remoteAddr != null) { + if (struct.isSetRemoteAddr()) { + oprot.writeFieldBegin(REMOTE_ADDR_FIELD_DESC); + oprot.writeString(struct.remoteAddr); + 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 _iter22 : struct.annotations) + { + _iter22.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.isSetFlag()) { + oprot.writeFieldBegin(FLAG_FIELD_DESC); + oprot.writeI16(struct.flag); + oprot.writeFieldEnd(); + } + if (struct.isSetErr()) { + oprot.writeFieldBegin(ERR_FIELD_DESC); + oprot.writeI32(struct.err); + oprot.writeFieldEnd(); + } + if (struct.spanEventList != null) { + if (struct.isSetSpanEventList()) { + oprot.writeFieldBegin(SPAN_EVENT_LIST_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.spanEventList.size())); + for (SpanEvent _iter23 : struct.spanEventList) + { + _iter23.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.parentApplicationName != null) { + if (struct.isSetParentApplicationName()) { + oprot.writeFieldBegin(PARENT_APPLICATION_NAME_FIELD_DESC); + oprot.writeString(struct.parentApplicationName); + oprot.writeFieldEnd(); + } + } + if (struct.isSetParentApplicationType()) { + oprot.writeFieldBegin(PARENT_APPLICATION_TYPE_FIELD_DESC); + oprot.writeI16(struct.parentApplicationType); + oprot.writeFieldEnd(); + } + if (struct.acceptorHost != null) { + if (struct.isSetAcceptorHost()) { + oprot.writeFieldBegin(ACCEPTOR_HOST_FIELD_DESC); + oprot.writeString(struct.acceptorHost); + 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.isSetApplicationName()) { + optionals.set(1); + } + if (struct.isSetAgentStartTime()) { + optionals.set(2); + } + if (struct.isSetMostTraceId()) { + optionals.set(3); + } + if (struct.isSetLeastTraceId()) { + optionals.set(4); + } + if (struct.isSetSpanId()) { + optionals.set(5); + } + if (struct.isSetParentSpanId()) { + optionals.set(6); + } + if (struct.isSetStartTime()) { + optionals.set(7); + } + if (struct.isSetElapsed()) { + optionals.set(8); + } + if (struct.isSetRpc()) { + optionals.set(9); + } + if (struct.isSetServiceType()) { + optionals.set(10); + } + if (struct.isSetEndPoint()) { + optionals.set(11); + } + if (struct.isSetRemoteAddr()) { + optionals.set(12); + } + if (struct.isSetAnnotations()) { + optionals.set(13); + } + if (struct.isSetFlag()) { + optionals.set(14); + } + if (struct.isSetErr()) { + optionals.set(15); + } + if (struct.isSetSpanEventList()) { + optionals.set(16); + } + if (struct.isSetParentApplicationName()) { + optionals.set(17); + } + if (struct.isSetParentApplicationType()) { + optionals.set(18); + } + if (struct.isSetAcceptorHost()) { + optionals.set(19); + } + oprot.writeBitSet(optionals, 20); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetApplicationName()) { + oprot.writeString(struct.applicationName); + } + if (struct.isSetAgentStartTime()) { + oprot.writeI64(struct.agentStartTime); + } + if (struct.isSetMostTraceId()) { + oprot.writeI64(struct.mostTraceId); + } + if (struct.isSetLeastTraceId()) { + oprot.writeI64(struct.leastTraceId); + } + if (struct.isSetSpanId()) { + oprot.writeI32(struct.spanId); + } + if (struct.isSetParentSpanId()) { + oprot.writeI32(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.isSetServiceType()) { + oprot.writeI16(struct.serviceType); + } + if (struct.isSetEndPoint()) { + oprot.writeString(struct.endPoint); + } + if (struct.isSetRemoteAddr()) { + oprot.writeString(struct.remoteAddr); + } + if (struct.isSetAnnotations()) { + { + oprot.writeI32(struct.annotations.size()); + for (Annotation _iter24 : struct.annotations) + { + _iter24.write(oprot); + } + } + } + if (struct.isSetFlag()) { + oprot.writeI16(struct.flag); + } + if (struct.isSetErr()) { + oprot.writeI32(struct.err); + } + if (struct.isSetSpanEventList()) { + { + oprot.writeI32(struct.spanEventList.size()); + for (SpanEvent _iter25 : struct.spanEventList) + { + _iter25.write(oprot); + } + } + } + if (struct.isSetParentApplicationName()) { + oprot.writeString(struct.parentApplicationName); + } + if (struct.isSetParentApplicationType()) { + oprot.writeI16(struct.parentApplicationType); + } + if (struct.isSetAcceptorHost()) { + oprot.writeString(struct.acceptorHost); + } + } + + @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(20); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.applicationName = iprot.readString(); + struct.setApplicationNameIsSet(true); + } + if (incoming.get(2)) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } + if (incoming.get(3)) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } + if (incoming.get(4)) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } + if (incoming.get(5)) { + struct.spanId = iprot.readI32(); + struct.setSpanIdIsSet(true); + } + if (incoming.get(6)) { + struct.parentSpanId = iprot.readI32(); + struct.setParentSpanIdIsSet(true); + } + if (incoming.get(7)) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } + if (incoming.get(8)) { + struct.elapsed = iprot.readI32(); + struct.setElapsedIsSet(true); + } + if (incoming.get(9)) { + struct.rpc = iprot.readString(); + struct.setRpcIsSet(true); + } + if (incoming.get(10)) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } + if (incoming.get(11)) { + struct.endPoint = iprot.readString(); + struct.setEndPointIsSet(true); + } + if (incoming.get(12)) { + struct.remoteAddr = iprot.readString(); + struct.setRemoteAddrIsSet(true); + } + if (incoming.get(13)) { + { + org.apache.thrift.protocol.TList _list26 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.annotations = new ArrayList(_list26.size); + for (int _i27 = 0; _i27 < _list26.size; ++_i27) + { + Annotation _elem28; + _elem28 = new Annotation(); + _elem28.read(iprot); + struct.annotations.add(_elem28); + } + } + struct.setAnnotationsIsSet(true); + } + if (incoming.get(14)) { + struct.flag = iprot.readI16(); + struct.setFlagIsSet(true); + } + if (incoming.get(15)) { + struct.err = iprot.readI32(); + struct.setErrIsSet(true); + } + if (incoming.get(16)) { + { + org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.spanEventList = new ArrayList(_list29.size); + for (int _i30 = 0; _i30 < _list29.size; ++_i30) + { + SpanEvent _elem31; + _elem31 = new SpanEvent(); + _elem31.read(iprot); + struct.spanEventList.add(_elem31); + } + } + struct.setSpanEventListIsSet(true); + } + if (incoming.get(17)) { + struct.parentApplicationName = iprot.readString(); + struct.setParentApplicationNameIsSet(true); + } + if (incoming.get(18)) { + struct.parentApplicationType = iprot.readI16(); + struct.setParentApplicationTypeIsSet(true); + } + if (incoming.get(19)) { + struct.acceptorHost = iprot.readString(); + struct.setAcceptorHostIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/SpanChunk.java b/src/main/java/com/nhn/pinpoint/thrift/dto/SpanChunk.java new file mode 100644 index 000000000..7d534e4c4 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/SpanChunk.java @@ -0,0 +1,1208 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SpanChunk implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpanChunk"); + + 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 APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField AGENT_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("agentStartTime", org.apache.thrift.protocol.TType.I64, (short)3); + 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)4); + 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)5); + 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)6); + private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I32, (short)7); + 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)8); + private static final org.apache.thrift.protocol.TField SPAN_EVENT_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("spanEventList", org.apache.thrift.protocol.TType.LIST, (short)9); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SpanChunkStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SpanChunkTupleSchemeFactory()); + } + + private String agentId; // required + private String applicationName; // required + private long agentStartTime; // required + private short serviceType; // required + private long mostTraceId; // required + private long leastTraceId; // required + private int spanId; // required + private String endPoint; // optional + private List spanEventList; // 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"), + APPLICATION_NAME((short)2, "applicationName"), + AGENT_START_TIME((short)3, "agentStartTime"), + SERVICE_TYPE((short)4, "serviceType"), + MOST_TRACE_ID((short)5, "mostTraceId"), + LEAST_TRACE_ID((short)6, "leastTraceId"), + SPAN_ID((short)7, "spanId"), + END_POINT((short)8, "endPoint"), + SPAN_EVENT_LIST((short)9, "spanEventList"); + + 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: // APPLICATION_NAME + return APPLICATION_NAME; + case 3: // AGENT_START_TIME + return AGENT_START_TIME; + case 4: // SERVICE_TYPE + return SERVICE_TYPE; + case 5: // MOST_TRACE_ID + return MOST_TRACE_ID; + case 6: // LEAST_TRACE_ID + return LEAST_TRACE_ID; + case 7: // SPAN_ID + return SPAN_ID; + case 8: // END_POINT + return END_POINT; + case 9: // SPAN_EVENT_LIST + return SPAN_EVENT_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 __AGENTSTARTTIME_ISSET_ID = 0; + private static final int __SERVICETYPE_ISSET_ID = 1; + private static final int __MOSTTRACEID_ISSET_ID = 2; + private static final int __LEASTTRACEID_ISSET_ID = 3; + private static final int __SPANID_ISSET_ID = 4; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.END_POINT}; + 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.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.AGENT_START_TIME, new org.apache.thrift.meta_data.FieldMetaData("agentStartTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + 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.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.I32))); + tmpMap.put(_Fields.END_POINT, new org.apache.thrift.meta_data.FieldMetaData("endPoint", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SPAN_EVENT_LIST, new org.apache.thrift.meta_data.FieldMetaData("spanEventList", 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, SpanEvent.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpanChunk.class, metaDataMap); + } + + public SpanChunk() { + } + + public SpanChunk( + String agentId, + String applicationName, + long agentStartTime, + short serviceType, + long mostTraceId, + long leastTraceId, + int spanId, + List spanEventList) + { + this(); + this.agentId = agentId; + this.applicationName = applicationName; + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + this.serviceType = serviceType; + setServiceTypeIsSet(true); + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + this.spanId = spanId; + setSpanIdIsSet(true); + this.spanEventList = spanEventList; + } + + /** + * Performs a deep copy on other. + */ + public SpanChunk(SpanChunk other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + if (other.isSetApplicationName()) { + this.applicationName = other.applicationName; + } + this.agentStartTime = other.agentStartTime; + this.serviceType = other.serviceType; + this.mostTraceId = other.mostTraceId; + this.leastTraceId = other.leastTraceId; + this.spanId = other.spanId; + if (other.isSetEndPoint()) { + this.endPoint = other.endPoint; + } + if (other.isSetSpanEventList()) { + List __this__spanEventList = new ArrayList(other.spanEventList.size()); + for (SpanEvent other_element : other.spanEventList) { + __this__spanEventList.add(new SpanEvent(other_element)); + } + this.spanEventList = __this__spanEventList; + } + } + + public SpanChunk deepCopy() { + return new SpanChunk(this); + } + + @Override + public void clear() { + this.agentId = null; + this.applicationName = null; + setAgentStartTimeIsSet(false); + this.agentStartTime = 0; + setServiceTypeIsSet(false); + this.serviceType = 0; + setMostTraceIdIsSet(false); + this.mostTraceId = 0; + setLeastTraceIdIsSet(false); + this.leastTraceId = 0; + setSpanIdIsSet(false); + this.spanId = 0; + this.endPoint = null; + this.spanEventList = 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 long getAgentStartTime() { + return this.agentStartTime; + } + + public void setAgentStartTime(long agentStartTime) { + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + } + + public void unsetAgentStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + /** Returns true if field agentStartTime is set (has been assigned a value) and false otherwise */ + public boolean isSetAgentStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + public void setAgentStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID, value); + } + + public short getServiceType() { + return this.serviceType; + } + + public void setServiceType(short serviceType) { + this.serviceType = serviceType; + setServiceTypeIsSet(true); + } + + public void unsetServiceType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceType() { + return EncodingUtils.testBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + public void setServiceTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SERVICETYPE_ISSET_ID, value); + } + + public long getMostTraceId() { + return this.mostTraceId; + } + + public void setMostTraceId(long mostTraceId) { + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + } + + public void unsetMostTraceId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID); + } + + /** Returns true if field mostTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetMostTraceId() { + return EncodingUtils.testBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID); + } + + public void setMostTraceIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID, value); + } + + public long getLeastTraceId() { + return this.leastTraceId; + } + + public void setLeastTraceId(long leastTraceId) { + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + } + + public void unsetLeastTraceId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID); + } + + /** Returns true if field leastTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetLeastTraceId() { + return EncodingUtils.testBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID); + } + + public void setLeastTraceIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID, value); + } + + public int getSpanId() { + return this.spanId; + } + + public void setSpanId(int spanId) { + this.spanId = spanId; + setSpanIdIsSet(true); + } + + public void unsetSpanId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SPANID_ISSET_ID); + } + + /** Returns true if field spanId is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanId() { + return EncodingUtils.testBit(__isset_bitfield, __SPANID_ISSET_ID); + } + + public void setSpanIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SPANID_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 getSpanEventListSize() { + return (this.spanEventList == null) ? 0 : this.spanEventList.size(); + } + + public java.util.Iterator getSpanEventListIterator() { + return (this.spanEventList == null) ? null : this.spanEventList.iterator(); + } + + public void addToSpanEventList(SpanEvent elem) { + if (this.spanEventList == null) { + this.spanEventList = new ArrayList(); + } + this.spanEventList.add(elem); + } + + public List getSpanEventList() { + return this.spanEventList; + } + + public void setSpanEventList(List spanEventList) { + this.spanEventList = spanEventList; + } + + public void unsetSpanEventList() { + this.spanEventList = null; + } + + /** Returns true if field spanEventList is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanEventList() { + return this.spanEventList != null; + } + + public void setSpanEventListIsSet(boolean value) { + if (!value) { + this.spanEventList = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + 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 AGENT_START_TIME: + if (value == null) { + unsetAgentStartTime(); + } else { + setAgentStartTime((Long)value); + } + break; + + case SERVICE_TYPE: + if (value == null) { + unsetServiceType(); + } else { + setServiceType((Short)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((Integer)value); + } + break; + + case END_POINT: + if (value == null) { + unsetEndPoint(); + } else { + setEndPoint((String)value); + } + break; + + case SPAN_EVENT_LIST: + if (value == null) { + unsetSpanEventList(); + } else { + setSpanEventList((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case APPLICATION_NAME: + return getApplicationName(); + + case AGENT_START_TIME: + return Long.valueOf(getAgentStartTime()); + + case SERVICE_TYPE: + return Short.valueOf(getServiceType()); + + case MOST_TRACE_ID: + return Long.valueOf(getMostTraceId()); + + case LEAST_TRACE_ID: + return Long.valueOf(getLeastTraceId()); + + case SPAN_ID: + return Integer.valueOf(getSpanId()); + + case END_POINT: + return getEndPoint(); + + case SPAN_EVENT_LIST: + return getSpanEventList(); + + } + 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 APPLICATION_NAME: + return isSetApplicationName(); + case AGENT_START_TIME: + return isSetAgentStartTime(); + case SERVICE_TYPE: + return isSetServiceType(); + case MOST_TRACE_ID: + return isSetMostTraceId(); + case LEAST_TRACE_ID: + return isSetLeastTraceId(); + case SPAN_ID: + return isSetSpanId(); + case END_POINT: + return isSetEndPoint(); + case SPAN_EVENT_LIST: + return isSetSpanEventList(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SpanChunk) + return this.equals((SpanChunk)that); + return false; + } + + public boolean equals(SpanChunk 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_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_agentStartTime = true; + boolean that_present_agentStartTime = true; + if (this_present_agentStartTime || that_present_agentStartTime) { + if (!(this_present_agentStartTime && that_present_agentStartTime)) + return false; + if (this.agentStartTime != that.agentStartTime) + 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_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_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_spanEventList = true && this.isSetSpanEventList(); + boolean that_present_spanEventList = true && that.isSetSpanEventList(); + if (this_present_spanEventList || that_present_spanEventList) { + if (!(this_present_spanEventList && that_present_spanEventList)) + return false; + if (!this.spanEventList.equals(that.spanEventList)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(SpanChunk other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetApplicationName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAgentStartTime()).compareTo(other.isSetAgentStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentStartTime, other.agentStartTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(other.isSetServiceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, other.serviceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMostTraceId()).compareTo(other.isSetMostTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMostTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, other.mostTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(other.isSetLeastTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLeastTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, other.leastTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(other.isSetSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, other.spanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndPoint()).compareTo(other.isSetEndPoint()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndPoint()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endPoint, other.endPoint); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanEventList()).compareTo(other.isSetSpanEventList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanEventList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanEventList, other.spanEventList); + 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("SpanChunk("); + 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("applicationName:"); + if (this.applicationName == null) { + sb.append("null"); + } else { + sb.append(this.applicationName); + } + first = false; + if (!first) sb.append(", "); + sb.append("agentStartTime:"); + sb.append(this.agentStartTime); + first = false; + if (!first) sb.append(", "); + sb.append("serviceType:"); + sb.append(this.serviceType); + 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 (isSetEndPoint()) { + 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("spanEventList:"); + if (this.spanEventList == null) { + sb.append("null"); + } else { + sb.append(this.spanEventList); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class SpanChunkStandardSchemeFactory implements SchemeFactory { + public SpanChunkStandardScheme getScheme() { + return new SpanChunkStandardScheme(); + } + } + + private static class SpanChunkStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SpanChunk 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: // 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 3: // AGENT_START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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 5: // 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 6: // 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 7: // SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.spanId = iprot.readI32(); + struct.setSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // 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 9: // SPAN_EVENT_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); + struct.spanEventList = new ArrayList(_list32.size); + for (int _i33 = 0; _i33 < _list32.size; ++_i33) + { + SpanEvent _elem34; + _elem34 = new SpanEvent(); + _elem34.read(iprot); + struct.spanEventList.add(_elem34); + } + iprot.readListEnd(); + } + struct.setSpanEventListIsSet(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, SpanChunk 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(); + } + if (struct.applicationName != null) { + oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC); + oprot.writeString(struct.applicationName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(AGENT_START_TIME_FIELD_DESC); + oprot.writeI64(struct.agentStartTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC); + oprot.writeI16(struct.serviceType); + 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.writeI32(struct.spanId); + oprot.writeFieldEnd(); + if (struct.endPoint != null) { + if (struct.isSetEndPoint()) { + oprot.writeFieldBegin(END_POINT_FIELD_DESC); + oprot.writeString(struct.endPoint); + oprot.writeFieldEnd(); + } + } + if (struct.spanEventList != null) { + oprot.writeFieldBegin(SPAN_EVENT_LIST_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.spanEventList.size())); + for (SpanEvent _iter35 : struct.spanEventList) + { + _iter35.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SpanChunkTupleSchemeFactory implements SchemeFactory { + public SpanChunkTupleScheme getScheme() { + return new SpanChunkTupleScheme(); + } + } + + private static class SpanChunkTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SpanChunk struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetApplicationName()) { + optionals.set(1); + } + if (struct.isSetAgentStartTime()) { + optionals.set(2); + } + if (struct.isSetServiceType()) { + optionals.set(3); + } + if (struct.isSetMostTraceId()) { + optionals.set(4); + } + if (struct.isSetLeastTraceId()) { + optionals.set(5); + } + if (struct.isSetSpanId()) { + optionals.set(6); + } + if (struct.isSetEndPoint()) { + optionals.set(7); + } + if (struct.isSetSpanEventList()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetApplicationName()) { + oprot.writeString(struct.applicationName); + } + if (struct.isSetAgentStartTime()) { + oprot.writeI64(struct.agentStartTime); + } + if (struct.isSetServiceType()) { + oprot.writeI16(struct.serviceType); + } + if (struct.isSetMostTraceId()) { + oprot.writeI64(struct.mostTraceId); + } + if (struct.isSetLeastTraceId()) { + oprot.writeI64(struct.leastTraceId); + } + if (struct.isSetSpanId()) { + oprot.writeI32(struct.spanId); + } + if (struct.isSetEndPoint()) { + oprot.writeString(struct.endPoint); + } + if (struct.isSetSpanEventList()) { + { + oprot.writeI32(struct.spanEventList.size()); + for (SpanEvent _iter36 : struct.spanEventList) + { + _iter36.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SpanChunk struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(9); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.applicationName = iprot.readString(); + struct.setApplicationNameIsSet(true); + } + if (incoming.get(2)) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } + if (incoming.get(3)) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } + if (incoming.get(4)) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } + if (incoming.get(5)) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } + if (incoming.get(6)) { + struct.spanId = iprot.readI32(); + struct.setSpanIdIsSet(true); + } + if (incoming.get(7)) { + struct.endPoint = iprot.readString(); + struct.setEndPointIsSet(true); + } + if (incoming.get(8)) { + { + org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.spanEventList = new ArrayList(_list37.size); + for (int _i38 = 0; _i38 < _list37.size; ++_i38) + { + SpanEvent _elem39; + _elem39 = new SpanEvent(); + _elem39.read(iprot); + struct.spanEventList.add(_elem39); + } + } + struct.setSpanEventListIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/SpanEvent.java b/src/main/java/com/nhn/pinpoint/thrift/dto/SpanEvent.java new file mode 100644 index 000000000..45c90425c --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/SpanEvent.java @@ -0,0 +1,2040 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SpanEvent implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpanEvent"); + + private static final org.apache.thrift.protocol.TField AGENT_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("agentKey", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField PARENT_SERVICE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("parentServiceType", org.apache.thrift.protocol.TType.I16, (short)17); + private static final org.apache.thrift.protocol.TField PARENT_END_POINT_FIELD_DESC = new org.apache.thrift.protocol.TField("parentEndPoint", org.apache.thrift.protocol.TType.STRING, (short)18); + 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)4); + 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)5); + private static final org.apache.thrift.protocol.TField SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("spanId", org.apache.thrift.protocol.TType.I32, (short)6); + 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)7); + 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)8); + 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)9); + 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)10); + 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)12); + 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)13); + 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)14); + private static final org.apache.thrift.protocol.TField DEPTH_FIELD_DESC = new org.apache.thrift.protocol.TField("depth", org.apache.thrift.protocol.TType.I32, (short)15); + private static final org.apache.thrift.protocol.TField NEXT_SPAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("nextSpanId", org.apache.thrift.protocol.TType.I32, (short)16); + private static final org.apache.thrift.protocol.TField DESTINATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("destinationId", org.apache.thrift.protocol.TType.STRING, (short)20); + private static final org.apache.thrift.protocol.TField DESTINATION_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("destinationAddress", org.apache.thrift.protocol.TType.LIST, (short)21); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SpanEventStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SpanEventTupleSchemeFactory()); + } + + private AgentKey agentKey; // optional + private short parentServiceType; // optional + private String parentEndPoint; // optional + private long mostTraceId; // optional + private long leastTraceId; // optional + private int spanId; // optional + private short sequence; // required + private int startElapsed; // required + private int endElapsed; // required + private String rpc; // optional + private short serviceType; // required + private String endPoint; // optional + private List annotations; // required + private int depth; // optional + private int nextSpanId; // optional + private String destinationId; // optional + private List destinationAddress; // 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_KEY((short)1, "agentKey"), + PARENT_SERVICE_TYPE((short)17, "parentServiceType"), + PARENT_END_POINT((short)18, "parentEndPoint"), + MOST_TRACE_ID((short)4, "mostTraceId"), + LEAST_TRACE_ID((short)5, "leastTraceId"), + SPAN_ID((short)6, "spanId"), + SEQUENCE((short)7, "sequence"), + START_ELAPSED((short)8, "startElapsed"), + END_ELAPSED((short)9, "endElapsed"), + RPC((short)10, "rpc"), + SERVICE_TYPE((short)12, "serviceType"), + END_POINT((short)13, "endPoint"), + ANNOTATIONS((short)14, "annotations"), + DEPTH((short)15, "depth"), + NEXT_SPAN_ID((short)16, "nextSpanId"), + DESTINATION_ID((short)20, "destinationId"), + DESTINATION_ADDRESS((short)21, "destinationAddress"); + + 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_KEY + return AGENT_KEY; + case 17: // PARENT_SERVICE_TYPE + return PARENT_SERVICE_TYPE; + case 18: // PARENT_END_POINT + return PARENT_END_POINT; + case 4: // MOST_TRACE_ID + return MOST_TRACE_ID; + case 5: // LEAST_TRACE_ID + return LEAST_TRACE_ID; + case 6: // SPAN_ID + return SPAN_ID; + case 7: // SEQUENCE + return SEQUENCE; + case 8: // START_ELAPSED + return START_ELAPSED; + case 9: // END_ELAPSED + return END_ELAPSED; + case 10: // RPC + return RPC; + case 12: // SERVICE_TYPE + return SERVICE_TYPE; + case 13: // END_POINT + return END_POINT; + case 14: // ANNOTATIONS + return ANNOTATIONS; + case 15: // DEPTH + return DEPTH; + case 16: // NEXT_SPAN_ID + return NEXT_SPAN_ID; + case 20: // DESTINATION_ID + return DESTINATION_ID; + case 21: // DESTINATION_ADDRESS + return DESTINATION_ADDRESS; + 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 __PARENTSERVICETYPE_ISSET_ID = 0; + private static final int __MOSTTRACEID_ISSET_ID = 1; + private static final int __LEASTTRACEID_ISSET_ID = 2; + private static final int __SPANID_ISSET_ID = 3; + private static final int __SEQUENCE_ISSET_ID = 4; + private static final int __STARTELAPSED_ISSET_ID = 5; + private static final int __ENDELAPSED_ISSET_ID = 6; + private static final int __SERVICETYPE_ISSET_ID = 7; + private static final int __DEPTH_ISSET_ID = 8; + private static final int __NEXTSPANID_ISSET_ID = 9; + private short __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.AGENT_KEY,_Fields.PARENT_SERVICE_TYPE,_Fields.PARENT_END_POINT,_Fields.MOST_TRACE_ID,_Fields.LEAST_TRACE_ID,_Fields.SPAN_ID,_Fields.RPC,_Fields.END_POINT,_Fields.DEPTH,_Fields.NEXT_SPAN_ID,_Fields.DESTINATION_ID,_Fields.DESTINATION_ADDRESS}; + 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_KEY, new org.apache.thrift.meta_data.FieldMetaData("agentKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AgentKey.class))); + tmpMap.put(_Fields.PARENT_SERVICE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("parentServiceType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.PARENT_END_POINT, new org.apache.thrift.meta_data.FieldMetaData("parentEndPoint", 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.I32))); + 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.OPTIONAL, + 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.OPTIONAL, + 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.DEPTH, new org.apache.thrift.meta_data.FieldMetaData("depth", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NEXT_SPAN_ID, new org.apache.thrift.meta_data.FieldMetaData("nextSpanId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.DESTINATION_ID, new org.apache.thrift.meta_data.FieldMetaData("destinationId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DESTINATION_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("destinationAddress", 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)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpanEvent.class, metaDataMap); + } + + public SpanEvent() { + } + + public SpanEvent( + short sequence, + int startElapsed, + int endElapsed, + short serviceType, + List annotations) + { + this(); + this.sequence = sequence; + setSequenceIsSet(true); + this.startElapsed = startElapsed; + setStartElapsedIsSet(true); + this.endElapsed = endElapsed; + setEndElapsedIsSet(true); + this.serviceType = serviceType; + setServiceTypeIsSet(true); + this.annotations = annotations; + } + + /** + * Performs a deep copy on other. + */ + public SpanEvent(SpanEvent other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentKey()) { + this.agentKey = new AgentKey(other.agentKey); + } + this.parentServiceType = other.parentServiceType; + if (other.isSetParentEndPoint()) { + this.parentEndPoint = other.parentEndPoint; + } + 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; + } + this.serviceType = other.serviceType; + if (other.isSetEndPoint()) { + this.endPoint = other.endPoint; + } + if (other.isSetAnnotations()) { + List __this__annotations = new ArrayList(other.annotations.size()); + for (Annotation other_element : other.annotations) { + __this__annotations.add(new Annotation(other_element)); + } + this.annotations = __this__annotations; + } + this.depth = other.depth; + this.nextSpanId = other.nextSpanId; + if (other.isSetDestinationId()) { + this.destinationId = other.destinationId; + } + if (other.isSetDestinationAddress()) { + List __this__destinationAddress = new ArrayList(other.destinationAddress); + this.destinationAddress = __this__destinationAddress; + } + } + + public SpanEvent deepCopy() { + return new SpanEvent(this); + } + + @Override + public void clear() { + this.agentKey = null; + setParentServiceTypeIsSet(false); + this.parentServiceType = 0; + this.parentEndPoint = 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; + setServiceTypeIsSet(false); + this.serviceType = 0; + this.endPoint = null; + this.annotations = null; + setDepthIsSet(false); + this.depth = 0; + setNextSpanIdIsSet(false); + this.nextSpanId = 0; + this.destinationId = null; + this.destinationAddress = null; + } + + public AgentKey getAgentKey() { + return this.agentKey; + } + + public void setAgentKey(AgentKey agentKey) { + this.agentKey = agentKey; + } + + public void unsetAgentKey() { + this.agentKey = null; + } + + /** Returns true if field agentKey is set (has been assigned a value) and false otherwise */ + public boolean isSetAgentKey() { + return this.agentKey != null; + } + + public void setAgentKeyIsSet(boolean value) { + if (!value) { + this.agentKey = null; + } + } + + public short getParentServiceType() { + return this.parentServiceType; + } + + public void setParentServiceType(short parentServiceType) { + this.parentServiceType = parentServiceType; + setParentServiceTypeIsSet(true); + } + + public void unsetParentServiceType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARENTSERVICETYPE_ISSET_ID); + } + + /** Returns true if field parentServiceType is set (has been assigned a value) and false otherwise */ + public boolean isSetParentServiceType() { + return EncodingUtils.testBit(__isset_bitfield, __PARENTSERVICETYPE_ISSET_ID); + } + + public void setParentServiceTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARENTSERVICETYPE_ISSET_ID, value); + } + + public String getParentEndPoint() { + return this.parentEndPoint; + } + + public void setParentEndPoint(String parentEndPoint) { + this.parentEndPoint = parentEndPoint; + } + + public void unsetParentEndPoint() { + this.parentEndPoint = null; + } + + /** Returns true if field parentEndPoint is set (has been assigned a value) and false otherwise */ + public boolean isSetParentEndPoint() { + return this.parentEndPoint != null; + } + + public void setParentEndPointIsSet(boolean value) { + if (!value) { + this.parentEndPoint = null; + } + } + + public long getMostTraceId() { + return this.mostTraceId; + } + + public void setMostTraceId(long mostTraceId) { + this.mostTraceId = mostTraceId; + setMostTraceIdIsSet(true); + } + + public void unsetMostTraceId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID); + } + + /** Returns true if field mostTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetMostTraceId() { + return EncodingUtils.testBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID); + } + + public void setMostTraceIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MOSTTRACEID_ISSET_ID, value); + } + + public long getLeastTraceId() { + return this.leastTraceId; + } + + public void setLeastTraceId(long leastTraceId) { + this.leastTraceId = leastTraceId; + setLeastTraceIdIsSet(true); + } + + public void unsetLeastTraceId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID); + } + + /** Returns true if field leastTraceId is set (has been assigned a value) and false otherwise */ + public boolean isSetLeastTraceId() { + return EncodingUtils.testBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID); + } + + public void setLeastTraceIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LEASTTRACEID_ISSET_ID, value); + } + + public int getSpanId() { + return this.spanId; + } + + public void setSpanId(int spanId) { + this.spanId = spanId; + setSpanIdIsSet(true); + } + + public void unsetSpanId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SPANID_ISSET_ID); + } + + /** Returns true if field spanId is set (has been assigned a value) and false otherwise */ + public boolean isSetSpanId() { + return EncodingUtils.testBit(__isset_bitfield, __SPANID_ISSET_ID); + } + + public void setSpanIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SPANID_ISSET_ID, value); + } + + public short getSequence() { + return this.sequence; + } + + public void setSequence(short sequence) { + this.sequence = sequence; + setSequenceIsSet(true); + } + + public void unsetSequence() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SEQUENCE_ISSET_ID); + } + + /** Returns true if field sequence is set (has been assigned a value) and false otherwise */ + public boolean isSetSequence() { + return EncodingUtils.testBit(__isset_bitfield, __SEQUENCE_ISSET_ID); + } + + public void setSequenceIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SEQUENCE_ISSET_ID, value); + } + + public int getStartElapsed() { + return this.startElapsed; + } + + public void setStartElapsed(int startElapsed) { + this.startElapsed = startElapsed; + setStartElapsedIsSet(true); + } + + public void unsetStartElapsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTELAPSED_ISSET_ID); + } + + /** Returns true if field startElapsed is set (has been assigned a value) and false otherwise */ + public boolean isSetStartElapsed() { + return EncodingUtils.testBit(__isset_bitfield, __STARTELAPSED_ISSET_ID); + } + + public void setStartElapsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTELAPSED_ISSET_ID, value); + } + + public int getEndElapsed() { + return this.endElapsed; + } + + public void setEndElapsed(int endElapsed) { + this.endElapsed = endElapsed; + setEndElapsedIsSet(true); + } + + public void unsetEndElapsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDELAPSED_ISSET_ID); + } + + /** Returns true if field endElapsed is set (has been assigned a value) and false otherwise */ + public boolean isSetEndElapsed() { + return EncodingUtils.testBit(__isset_bitfield, __ENDELAPSED_ISSET_ID); + } + + public void setEndElapsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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 short getServiceType() { + return this.serviceType; + } + + public void setServiceType(short serviceType) { + this.serviceType = serviceType; + setServiceTypeIsSet(true); + } + + public void unsetServiceType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */ + public boolean isSetServiceType() { + return EncodingUtils.testBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + } + + public void setServiceTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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 int getDepth() { + return this.depth; + } + + public void setDepth(int depth) { + this.depth = depth; + setDepthIsSet(true); + } + + public void unsetDepth() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPTH_ISSET_ID); + } + + /** Returns true if field depth is set (has been assigned a value) and false otherwise */ + public boolean isSetDepth() { + return EncodingUtils.testBit(__isset_bitfield, __DEPTH_ISSET_ID); + } + + public void setDepthIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPTH_ISSET_ID, value); + } + + public int getNextSpanId() { + return this.nextSpanId; + } + + public void setNextSpanId(int nextSpanId) { + this.nextSpanId = nextSpanId; + setNextSpanIdIsSet(true); + } + + public void unsetNextSpanId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NEXTSPANID_ISSET_ID); + } + + /** Returns true if field nextSpanId is set (has been assigned a value) and false otherwise */ + public boolean isSetNextSpanId() { + return EncodingUtils.testBit(__isset_bitfield, __NEXTSPANID_ISSET_ID); + } + + public void setNextSpanIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NEXTSPANID_ISSET_ID, value); + } + + public String getDestinationId() { + return this.destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + + public void unsetDestinationId() { + this.destinationId = null; + } + + /** Returns true if field destinationId is set (has been assigned a value) and false otherwise */ + public boolean isSetDestinationId() { + return this.destinationId != null; + } + + public void setDestinationIdIsSet(boolean value) { + if (!value) { + this.destinationId = null; + } + } + + public int getDestinationAddressSize() { + return (this.destinationAddress == null) ? 0 : this.destinationAddress.size(); + } + + public java.util.Iterator getDestinationAddressIterator() { + return (this.destinationAddress == null) ? null : this.destinationAddress.iterator(); + } + + public void addToDestinationAddress(String elem) { + if (this.destinationAddress == null) { + this.destinationAddress = new ArrayList(); + } + this.destinationAddress.add(elem); + } + + public List getDestinationAddress() { + return this.destinationAddress; + } + + public void setDestinationAddress(List destinationAddress) { + this.destinationAddress = destinationAddress; + } + + public void unsetDestinationAddress() { + this.destinationAddress = null; + } + + /** Returns true if field destinationAddress is set (has been assigned a value) and false otherwise */ + public boolean isSetDestinationAddress() { + return this.destinationAddress != null; + } + + public void setDestinationAddressIsSet(boolean value) { + if (!value) { + this.destinationAddress = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_KEY: + if (value == null) { + unsetAgentKey(); + } else { + setAgentKey((AgentKey)value); + } + break; + + case PARENT_SERVICE_TYPE: + if (value == null) { + unsetParentServiceType(); + } else { + setParentServiceType((Short)value); + } + break; + + case PARENT_END_POINT: + if (value == null) { + unsetParentEndPoint(); + } else { + setParentEndPoint((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((Integer)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_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 DEPTH: + if (value == null) { + unsetDepth(); + } else { + setDepth((Integer)value); + } + break; + + case NEXT_SPAN_ID: + if (value == null) { + unsetNextSpanId(); + } else { + setNextSpanId((Integer)value); + } + break; + + case DESTINATION_ID: + if (value == null) { + unsetDestinationId(); + } else { + setDestinationId((String)value); + } + break; + + case DESTINATION_ADDRESS: + if (value == null) { + unsetDestinationAddress(); + } else { + setDestinationAddress((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_KEY: + return getAgentKey(); + + case PARENT_SERVICE_TYPE: + return Short.valueOf(getParentServiceType()); + + case PARENT_END_POINT: + return getParentEndPoint(); + + case MOST_TRACE_ID: + return Long.valueOf(getMostTraceId()); + + case LEAST_TRACE_ID: + return Long.valueOf(getLeastTraceId()); + + case SPAN_ID: + return Integer.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_TYPE: + return Short.valueOf(getServiceType()); + + case END_POINT: + return getEndPoint(); + + case ANNOTATIONS: + return getAnnotations(); + + case DEPTH: + return Integer.valueOf(getDepth()); + + case NEXT_SPAN_ID: + return Integer.valueOf(getNextSpanId()); + + case DESTINATION_ID: + return getDestinationId(); + + case DESTINATION_ADDRESS: + return getDestinationAddress(); + + } + 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_KEY: + return isSetAgentKey(); + case PARENT_SERVICE_TYPE: + return isSetParentServiceType(); + case PARENT_END_POINT: + return isSetParentEndPoint(); + 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_TYPE: + return isSetServiceType(); + case END_POINT: + return isSetEndPoint(); + case ANNOTATIONS: + return isSetAnnotations(); + case DEPTH: + return isSetDepth(); + case NEXT_SPAN_ID: + return isSetNextSpanId(); + case DESTINATION_ID: + return isSetDestinationId(); + case DESTINATION_ADDRESS: + return isSetDestinationAddress(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SpanEvent) + return this.equals((SpanEvent)that); + return false; + } + + public boolean equals(SpanEvent that) { + if (that == null) + return false; + + boolean this_present_agentKey = true && this.isSetAgentKey(); + boolean that_present_agentKey = true && that.isSetAgentKey(); + if (this_present_agentKey || that_present_agentKey) { + if (!(this_present_agentKey && that_present_agentKey)) + return false; + if (!this.agentKey.equals(that.agentKey)) + return false; + } + + boolean this_present_parentServiceType = true && this.isSetParentServiceType(); + boolean that_present_parentServiceType = true && that.isSetParentServiceType(); + if (this_present_parentServiceType || that_present_parentServiceType) { + if (!(this_present_parentServiceType && that_present_parentServiceType)) + return false; + if (this.parentServiceType != that.parentServiceType) + return false; + } + + boolean this_present_parentEndPoint = true && this.isSetParentEndPoint(); + boolean that_present_parentEndPoint = true && that.isSetParentEndPoint(); + if (this_present_parentEndPoint || that_present_parentEndPoint) { + if (!(this_present_parentEndPoint && that_present_parentEndPoint)) + return false; + if (!this.parentEndPoint.equals(that.parentEndPoint)) + 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_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_depth = true && this.isSetDepth(); + boolean that_present_depth = true && that.isSetDepth(); + if (this_present_depth || that_present_depth) { + if (!(this_present_depth && that_present_depth)) + return false; + if (this.depth != that.depth) + return false; + } + + boolean this_present_nextSpanId = true && this.isSetNextSpanId(); + boolean that_present_nextSpanId = true && that.isSetNextSpanId(); + if (this_present_nextSpanId || that_present_nextSpanId) { + if (!(this_present_nextSpanId && that_present_nextSpanId)) + return false; + if (this.nextSpanId != that.nextSpanId) + return false; + } + + boolean this_present_destinationId = true && this.isSetDestinationId(); + boolean that_present_destinationId = true && that.isSetDestinationId(); + if (this_present_destinationId || that_present_destinationId) { + if (!(this_present_destinationId && that_present_destinationId)) + return false; + if (!this.destinationId.equals(that.destinationId)) + return false; + } + + boolean this_present_destinationAddress = true && this.isSetDestinationAddress(); + boolean that_present_destinationAddress = true && that.isSetDestinationAddress(); + if (this_present_destinationAddress || that_present_destinationAddress) { + if (!(this_present_destinationAddress && that_present_destinationAddress)) + return false; + if (!this.destinationAddress.equals(that.destinationAddress)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(SpanEvent other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentKey()).compareTo(other.isSetAgentKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentKey, other.agentKey); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentServiceType()).compareTo(other.isSetParentServiceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentServiceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentServiceType, other.parentServiceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentEndPoint()).compareTo(other.isSetParentEndPoint()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentEndPoint()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentEndPoint, other.parentEndPoint); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMostTraceId()).compareTo(other.isSetMostTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMostTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mostTraceId, other.mostTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLeastTraceId()).compareTo(other.isSetLeastTraceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLeastTraceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leastTraceId, other.leastTraceId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSpanId()).compareTo(other.isSetSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spanId, other.spanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSequence()).compareTo(other.isSetSequence()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSequence()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sequence, other.sequence); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartElapsed()).compareTo(other.isSetStartElapsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartElapsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startElapsed, other.startElapsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndElapsed()).compareTo(other.isSetEndElapsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndElapsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endElapsed, other.endElapsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRpc()).compareTo(other.isSetRpc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRpc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpc, other.rpc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(other.isSetServiceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServiceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, other.serviceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndPoint()).compareTo(other.isSetEndPoint()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndPoint()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endPoint, other.endPoint); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAnnotations()).compareTo(other.isSetAnnotations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAnnotations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.annotations, other.annotations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDepth()).compareTo(other.isSetDepth()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDepth()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.depth, other.depth); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNextSpanId()).compareTo(other.isSetNextSpanId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNextSpanId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nextSpanId, other.nextSpanId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDestinationId()).compareTo(other.isSetDestinationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDestinationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.destinationId, other.destinationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDestinationAddress()).compareTo(other.isSetDestinationAddress()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDestinationAddress()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.destinationAddress, other.destinationAddress); + 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("SpanEvent("); + boolean first = true; + + if (isSetAgentKey()) { + sb.append("agentKey:"); + if (this.agentKey == null) { + sb.append("null"); + } else { + sb.append(this.agentKey); + } + first = false; + } + if (isSetParentServiceType()) { + if (!first) sb.append(", "); + sb.append("parentServiceType:"); + sb.append(this.parentServiceType); + first = false; + } + if (isSetParentEndPoint()) { + if (!first) sb.append(", "); + sb.append("parentEndPoint:"); + if (this.parentEndPoint == null) { + sb.append("null"); + } else { + sb.append(this.parentEndPoint); + } + 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 (isSetRpc()) { + 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("serviceType:"); + sb.append(this.serviceType); + first = false; + if (isSetEndPoint()) { + 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 (isSetDepth()) { + if (!first) sb.append(", "); + sb.append("depth:"); + sb.append(this.depth); + first = false; + } + if (isSetNextSpanId()) { + if (!first) sb.append(", "); + sb.append("nextSpanId:"); + sb.append(this.nextSpanId); + first = false; + } + if (isSetDestinationId()) { + if (!first) sb.append(", "); + sb.append("destinationId:"); + if (this.destinationId == null) { + sb.append("null"); + } else { + sb.append(this.destinationId); + } + first = false; + } + if (isSetDestinationAddress()) { + if (!first) sb.append(", "); + sb.append("destinationAddress:"); + if (this.destinationAddress == null) { + sb.append("null"); + } else { + sb.append(this.destinationAddress); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (agentKey != null) { + agentKey.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class SpanEventStandardSchemeFactory implements SchemeFactory { + public SpanEventStandardScheme getScheme() { + return new SpanEventStandardScheme(); + } + } + + private static class SpanEventStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SpanEvent 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_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.agentKey = new AgentKey(); + struct.agentKey.read(iprot); + struct.setAgentKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 17: // PARENT_SERVICE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.parentServiceType = iprot.readI16(); + struct.setParentServiceTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 18: // PARENT_END_POINT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentEndPoint = iprot.readString(); + struct.setParentEndPointIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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 5: // 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 6: // SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.spanId = iprot.readI32(); + struct.setSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // 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 8: // 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 9: // 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 10: // 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 12: // 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 13: // 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 14: // ANNOTATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.annotations = new ArrayList(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + Annotation _elem2; + _elem2 = new Annotation(); + _elem2.read(iprot); + struct.annotations.add(_elem2); + } + iprot.readListEnd(); + } + struct.setAnnotationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 15: // DEPTH + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.depth = iprot.readI32(); + struct.setDepthIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 16: // NEXT_SPAN_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.nextSpanId = iprot.readI32(); + struct.setNextSpanIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 20: // DESTINATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.destinationId = iprot.readString(); + struct.setDestinationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 21: // DESTINATION_ADDRESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); + struct.destinationAddress = new ArrayList(_list3.size); + for (int _i4 = 0; _i4 < _list3.size; ++_i4) + { + String _elem5; + _elem5 = iprot.readString(); + struct.destinationAddress.add(_elem5); + } + iprot.readListEnd(); + } + struct.setDestinationAddressIsSet(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, SpanEvent struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.agentKey != null) { + if (struct.isSetAgentKey()) { + oprot.writeFieldBegin(AGENT_KEY_FIELD_DESC); + struct.agentKey.write(oprot); + 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.writeI32(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) { + if (struct.isSetRpc()) { + oprot.writeFieldBegin(RPC_FIELD_DESC); + oprot.writeString(struct.rpc); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC); + oprot.writeI16(struct.serviceType); + oprot.writeFieldEnd(); + if (struct.endPoint != null) { + if (struct.isSetEndPoint()) { + 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 _iter6 : struct.annotations) + { + _iter6.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.isSetDepth()) { + oprot.writeFieldBegin(DEPTH_FIELD_DESC); + oprot.writeI32(struct.depth); + oprot.writeFieldEnd(); + } + if (struct.isSetNextSpanId()) { + oprot.writeFieldBegin(NEXT_SPAN_ID_FIELD_DESC); + oprot.writeI32(struct.nextSpanId); + oprot.writeFieldEnd(); + } + if (struct.isSetParentServiceType()) { + oprot.writeFieldBegin(PARENT_SERVICE_TYPE_FIELD_DESC); + oprot.writeI16(struct.parentServiceType); + oprot.writeFieldEnd(); + } + if (struct.parentEndPoint != null) { + if (struct.isSetParentEndPoint()) { + oprot.writeFieldBegin(PARENT_END_POINT_FIELD_DESC); + oprot.writeString(struct.parentEndPoint); + oprot.writeFieldEnd(); + } + } + if (struct.destinationId != null) { + if (struct.isSetDestinationId()) { + oprot.writeFieldBegin(DESTINATION_ID_FIELD_DESC); + oprot.writeString(struct.destinationId); + oprot.writeFieldEnd(); + } + } + if (struct.destinationAddress != null) { + if (struct.isSetDestinationAddress()) { + oprot.writeFieldBegin(DESTINATION_ADDRESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.destinationAddress.size())); + for (String _iter7 : struct.destinationAddress) + { + oprot.writeString(_iter7); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SpanEventTupleSchemeFactory implements SchemeFactory { + public SpanEventTupleScheme getScheme() { + return new SpanEventTupleScheme(); + } + } + + private static class SpanEventTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SpanEvent struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentKey()) { + optionals.set(0); + } + if (struct.isSetParentServiceType()) { + optionals.set(1); + } + if (struct.isSetParentEndPoint()) { + optionals.set(2); + } + if (struct.isSetMostTraceId()) { + optionals.set(3); + } + if (struct.isSetLeastTraceId()) { + optionals.set(4); + } + if (struct.isSetSpanId()) { + optionals.set(5); + } + if (struct.isSetSequence()) { + optionals.set(6); + } + if (struct.isSetStartElapsed()) { + optionals.set(7); + } + if (struct.isSetEndElapsed()) { + optionals.set(8); + } + if (struct.isSetRpc()) { + optionals.set(9); + } + if (struct.isSetServiceType()) { + optionals.set(10); + } + if (struct.isSetEndPoint()) { + optionals.set(11); + } + if (struct.isSetAnnotations()) { + optionals.set(12); + } + if (struct.isSetDepth()) { + optionals.set(13); + } + if (struct.isSetNextSpanId()) { + optionals.set(14); + } + if (struct.isSetDestinationId()) { + optionals.set(15); + } + if (struct.isSetDestinationAddress()) { + optionals.set(16); + } + oprot.writeBitSet(optionals, 17); + if (struct.isSetAgentKey()) { + struct.agentKey.write(oprot); + } + if (struct.isSetParentServiceType()) { + oprot.writeI16(struct.parentServiceType); + } + if (struct.isSetParentEndPoint()) { + oprot.writeString(struct.parentEndPoint); + } + if (struct.isSetMostTraceId()) { + oprot.writeI64(struct.mostTraceId); + } + if (struct.isSetLeastTraceId()) { + oprot.writeI64(struct.leastTraceId); + } + if (struct.isSetSpanId()) { + oprot.writeI32(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.isSetServiceType()) { + oprot.writeI16(struct.serviceType); + } + if (struct.isSetEndPoint()) { + oprot.writeString(struct.endPoint); + } + if (struct.isSetAnnotations()) { + { + oprot.writeI32(struct.annotations.size()); + for (Annotation _iter8 : struct.annotations) + { + _iter8.write(oprot); + } + } + } + if (struct.isSetDepth()) { + oprot.writeI32(struct.depth); + } + if (struct.isSetNextSpanId()) { + oprot.writeI32(struct.nextSpanId); + } + if (struct.isSetDestinationId()) { + oprot.writeString(struct.destinationId); + } + if (struct.isSetDestinationAddress()) { + { + oprot.writeI32(struct.destinationAddress.size()); + for (String _iter9 : struct.destinationAddress) + { + oprot.writeString(_iter9); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SpanEvent struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(17); + if (incoming.get(0)) { + struct.agentKey = new AgentKey(); + struct.agentKey.read(iprot); + struct.setAgentKeyIsSet(true); + } + if (incoming.get(1)) { + struct.parentServiceType = iprot.readI16(); + struct.setParentServiceTypeIsSet(true); + } + if (incoming.get(2)) { + struct.parentEndPoint = iprot.readString(); + struct.setParentEndPointIsSet(true); + } + if (incoming.get(3)) { + struct.mostTraceId = iprot.readI64(); + struct.setMostTraceIdIsSet(true); + } + if (incoming.get(4)) { + struct.leastTraceId = iprot.readI64(); + struct.setLeastTraceIdIsSet(true); + } + if (incoming.get(5)) { + struct.spanId = iprot.readI32(); + struct.setSpanIdIsSet(true); + } + if (incoming.get(6)) { + struct.sequence = iprot.readI16(); + struct.setSequenceIsSet(true); + } + if (incoming.get(7)) { + struct.startElapsed = iprot.readI32(); + struct.setStartElapsedIsSet(true); + } + if (incoming.get(8)) { + struct.endElapsed = iprot.readI32(); + struct.setEndElapsedIsSet(true); + } + if (incoming.get(9)) { + struct.rpc = iprot.readString(); + struct.setRpcIsSet(true); + } + if (incoming.get(10)) { + struct.serviceType = iprot.readI16(); + struct.setServiceTypeIsSet(true); + } + if (incoming.get(11)) { + struct.endPoint = iprot.readString(); + struct.setEndPointIsSet(true); + } + if (incoming.get(12)) { + { + org.apache.thrift.protocol.TList _list10 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.annotations = new ArrayList(_list10.size); + for (int _i11 = 0; _i11 < _list10.size; ++_i11) + { + Annotation _elem12; + _elem12 = new Annotation(); + _elem12.read(iprot); + struct.annotations.add(_elem12); + } + } + struct.setAnnotationsIsSet(true); + } + if (incoming.get(13)) { + struct.depth = iprot.readI32(); + struct.setDepthIsSet(true); + } + if (incoming.get(14)) { + struct.nextSpanId = iprot.readI32(); + struct.setNextSpanIdIsSet(true); + } + if (incoming.get(15)) { + struct.destinationId = iprot.readString(); + struct.setDestinationIdIsSet(true); + } + if (incoming.get(16)) { + { + org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.destinationAddress = new ArrayList(_list13.size); + for (int _i14 = 0; _i14 < _list13.size; ++_i14) + { + String _elem15; + _elem15 = iprot.readString(); + struct.destinationAddress.add(_elem15); + } + } + struct.setDestinationAddressIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/SqlMetaData.java b/src/main/java/com/nhn/pinpoint/thrift/dto/SqlMetaData.java new file mode 100644 index 000000000..ec91b267c --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/SqlMetaData.java @@ -0,0 +1,674 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SqlMetaData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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 AGENT_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("agentStartTime", 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)4); + 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)5); + + 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 agentStartTime; // 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"), + AGENT_START_TIME((short)2, "agentStartTime"), + HASH_CODE((short)4, "hashCode"), + SQL((short)5, "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: // AGENT_START_TIME + return AGENT_START_TIME; + case 4: // HASH_CODE + return HASH_CODE; + case 5: // 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 __AGENTSTARTTIME_ISSET_ID = 0; + private static final int __HASHCODE_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.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.AGENT_START_TIME, new org.apache.thrift.meta_data.FieldMetaData("agentStartTime", 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 agentStartTime, + int hashCode, + String sql) + { + this(); + this.agentId = agentId; + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + this.hashCode = hashCode; + setHashCodeIsSet(true); + this.sql = sql; + } + + /** + * Performs a deep copy on other. + */ + public SqlMetaData(SqlMetaData other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.agentStartTime = other.agentStartTime; + 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; + setAgentStartTimeIsSet(false); + this.agentStartTime = 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 getAgentStartTime() { + return this.agentStartTime; + } + + public void setAgentStartTime(long agentStartTime) { + this.agentStartTime = agentStartTime; + setAgentStartTimeIsSet(true); + } + + public void unsetAgentStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + /** Returns true if field agentStartTime is set (has been assigned a value) and false otherwise */ + public boolean isSetAgentStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID); + } + + public void setAgentStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AGENTSTARTTIME_ISSET_ID, value); + } + + public int getHashCode() { + return this.hashCode; + } + + public void setHashCode(int hashCode) { + this.hashCode = hashCode; + setHashCodeIsSet(true); + } + + public void unsetHashCode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASHCODE_ISSET_ID); + } + + /** Returns true if field hashCode is set (has been assigned a value) and false otherwise */ + public boolean isSetHashCode() { + return EncodingUtils.testBit(__isset_bitfield, __HASHCODE_ISSET_ID); + } + + public void setHashCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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 AGENT_START_TIME: + if (value == null) { + unsetAgentStartTime(); + } else { + setAgentStartTime((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 AGENT_START_TIME: + return Long.valueOf(getAgentStartTime()); + + 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 AGENT_START_TIME: + return isSetAgentStartTime(); + 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_agentStartTime = true; + boolean that_present_agentStartTime = true; + if (this_present_agentStartTime || that_present_agentStartTime) { + if (!(this_present_agentStartTime && that_present_agentStartTime)) + return false; + if (this.agentStartTime != that.agentStartTime) + 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; + } + + @Override + public int compareTo(SqlMetaData other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAgentStartTime()).compareTo(other.isSetAgentStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentStartTime, other.agentStartTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHashCode()).compareTo(other.isSetHashCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHashCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hashCode, other.hashCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSql()).compareTo(other.isSetSql()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSql()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sql, other.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("agentStartTime:"); + sb.append(this.agentStartTime); + 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 + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class 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: // AGENT_START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // 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 5: // 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(AGENT_START_TIME_FIELD_DESC); + oprot.writeI64(struct.agentStartTime); + 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.isSetAgentStartTime()) { + 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.isSetAgentStartTime()) { + oprot.writeI64(struct.agentStartTime); + } + 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.agentStartTime = iprot.readI64(); + struct.setAgentStartTimeIsSet(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/nhn/pinpoint/thrift/dto/StatWithCmsCollector.java b/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithCmsCollector.java new file mode 100644 index 000000000..658fa1702 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithCmsCollector.java @@ -0,0 +1,2072 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StatWithCmsCollector implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StatWithCmsCollector"); + + 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 TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_TOTAL_INIT_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryTotalInit", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_TOTAL_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryTotalUsed", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_TOTAL_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryTotalCommitted", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_TOTAL_MAX_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryTotalMax", org.apache.thrift.protocol.TType.I64, (short)6); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_HEAP_INIT_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryHeapInit", org.apache.thrift.protocol.TType.I64, (short)7); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_HEAP_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryHeapUsed", org.apache.thrift.protocol.TType.I64, (short)8); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_HEAP_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryHeapCommitted", org.apache.thrift.protocol.TType.I64, (short)9); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_HEAP_MAX_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryHeapMax", org.apache.thrift.protocol.TType.I64, (short)10); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_NON_HEAP_INIT_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryNonHeapInit", org.apache.thrift.protocol.TType.I64, (short)11); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_NON_HEAP_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryNonHeapUsed", org.apache.thrift.protocol.TType.I64, (short)12); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_NON_HEAP_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryNonHeapCommitted", org.apache.thrift.protocol.TType.I64, (short)13); + private static final org.apache.thrift.protocol.TField JVM_MEMORY_NON_HEAP_MAX_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmMemoryNonHeapMax", org.apache.thrift.protocol.TType.I64, (short)14); + private static final org.apache.thrift.protocol.TField JVM_GC_PAR_NEW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmGcParNewCount", org.apache.thrift.protocol.TType.I64, (short)15); + private static final org.apache.thrift.protocol.TField JVM_GC_PAR_NEW_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmGcParNewTime", org.apache.thrift.protocol.TType.I64, (short)16); + private static final org.apache.thrift.protocol.TField JVM_GC_CMS_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmGcCmsCount", org.apache.thrift.protocol.TType.I64, (short)17); + private static final org.apache.thrift.protocol.TField JVM_GC_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmGcTime", org.apache.thrift.protocol.TType.I64, (short)18); + private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)200); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new StatWithCmsCollectorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new StatWithCmsCollectorTupleSchemeFactory()); + } + + private String agentId; // required + private long timestamp; // required + private long jvmMemoryTotalInit; // required + private long jvmMemoryTotalUsed; // required + private long jvmMemoryTotalCommitted; // required + private long jvmMemoryTotalMax; // required + private long jvmMemoryHeapInit; // required + private long jvmMemoryHeapUsed; // required + private long jvmMemoryHeapCommitted; // required + private long jvmMemoryHeapMax; // required + private long jvmMemoryNonHeapInit; // required + private long jvmMemoryNonHeapUsed; // required + private long jvmMemoryNonHeapCommitted; // required + private long jvmMemoryNonHeapMax; // required + private long jvmGcParNewCount; // required + private long jvmGcParNewTime; // required + private long jvmGcCmsCount; // required + private long jvmGcTime; // required + private String metadata; // 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"), + TIMESTAMP((short)2, "timestamp"), + JVM_MEMORY_TOTAL_INIT((short)3, "jvmMemoryTotalInit"), + JVM_MEMORY_TOTAL_USED((short)4, "jvmMemoryTotalUsed"), + JVM_MEMORY_TOTAL_COMMITTED((short)5, "jvmMemoryTotalCommitted"), + JVM_MEMORY_TOTAL_MAX((short)6, "jvmMemoryTotalMax"), + JVM_MEMORY_HEAP_INIT((short)7, "jvmMemoryHeapInit"), + JVM_MEMORY_HEAP_USED((short)8, "jvmMemoryHeapUsed"), + JVM_MEMORY_HEAP_COMMITTED((short)9, "jvmMemoryHeapCommitted"), + JVM_MEMORY_HEAP_MAX((short)10, "jvmMemoryHeapMax"), + JVM_MEMORY_NON_HEAP_INIT((short)11, "jvmMemoryNonHeapInit"), + JVM_MEMORY_NON_HEAP_USED((short)12, "jvmMemoryNonHeapUsed"), + JVM_MEMORY_NON_HEAP_COMMITTED((short)13, "jvmMemoryNonHeapCommitted"), + JVM_MEMORY_NON_HEAP_MAX((short)14, "jvmMemoryNonHeapMax"), + JVM_GC_PAR_NEW_COUNT((short)15, "jvmGcParNewCount"), + JVM_GC_PAR_NEW_TIME((short)16, "jvmGcParNewTime"), + JVM_GC_CMS_COUNT((short)17, "jvmGcCmsCount"), + JVM_GC_TIME((short)18, "jvmGcTime"), + METADATA((short)200, "metadata"); + + 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: // TIMESTAMP + return TIMESTAMP; + case 3: // JVM_MEMORY_TOTAL_INIT + return JVM_MEMORY_TOTAL_INIT; + case 4: // JVM_MEMORY_TOTAL_USED + return JVM_MEMORY_TOTAL_USED; + case 5: // JVM_MEMORY_TOTAL_COMMITTED + return JVM_MEMORY_TOTAL_COMMITTED; + case 6: // JVM_MEMORY_TOTAL_MAX + return JVM_MEMORY_TOTAL_MAX; + case 7: // JVM_MEMORY_HEAP_INIT + return JVM_MEMORY_HEAP_INIT; + case 8: // JVM_MEMORY_HEAP_USED + return JVM_MEMORY_HEAP_USED; + case 9: // JVM_MEMORY_HEAP_COMMITTED + return JVM_MEMORY_HEAP_COMMITTED; + case 10: // JVM_MEMORY_HEAP_MAX + return JVM_MEMORY_HEAP_MAX; + case 11: // JVM_MEMORY_NON_HEAP_INIT + return JVM_MEMORY_NON_HEAP_INIT; + case 12: // JVM_MEMORY_NON_HEAP_USED + return JVM_MEMORY_NON_HEAP_USED; + case 13: // JVM_MEMORY_NON_HEAP_COMMITTED + return JVM_MEMORY_NON_HEAP_COMMITTED; + case 14: // JVM_MEMORY_NON_HEAP_MAX + return JVM_MEMORY_NON_HEAP_MAX; + case 15: // JVM_GC_PAR_NEW_COUNT + return JVM_GC_PAR_NEW_COUNT; + case 16: // JVM_GC_PAR_NEW_TIME + return JVM_GC_PAR_NEW_TIME; + case 17: // JVM_GC_CMS_COUNT + return JVM_GC_CMS_COUNT; + case 18: // JVM_GC_TIME + return JVM_GC_TIME; + case 200: // METADATA + return METADATA; + 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 __TIMESTAMP_ISSET_ID = 0; + private static final int __JVMMEMORYTOTALINIT_ISSET_ID = 1; + private static final int __JVMMEMORYTOTALUSED_ISSET_ID = 2; + private static final int __JVMMEMORYTOTALCOMMITTED_ISSET_ID = 3; + private static final int __JVMMEMORYTOTALMAX_ISSET_ID = 4; + private static final int __JVMMEMORYHEAPINIT_ISSET_ID = 5; + private static final int __JVMMEMORYHEAPUSED_ISSET_ID = 6; + private static final int __JVMMEMORYHEAPCOMMITTED_ISSET_ID = 7; + private static final int __JVMMEMORYHEAPMAX_ISSET_ID = 8; + private static final int __JVMMEMORYNONHEAPINIT_ISSET_ID = 9; + private static final int __JVMMEMORYNONHEAPUSED_ISSET_ID = 10; + private static final int __JVMMEMORYNONHEAPCOMMITTED_ISSET_ID = 11; + private static final int __JVMMEMORYNONHEAPMAX_ISSET_ID = 12; + private static final int __JVMGCPARNEWCOUNT_ISSET_ID = 13; + private static final int __JVMGCPARNEWTIME_ISSET_ID = 14; + private static final int __JVMGCCMSCOUNT_ISSET_ID = 15; + private static final int __JVMGCTIME_ISSET_ID = 16; + private int __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.METADATA}; + 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.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))); + tmpMap.put(_Fields.JVM_MEMORY_TOTAL_INIT, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryTotalInit", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_TOTAL_USED, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryTotalUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_TOTAL_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryTotalCommitted", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_TOTAL_MAX, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryTotalMax", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_HEAP_INIT, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryHeapInit", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_HEAP_USED, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryHeapUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_HEAP_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryHeapCommitted", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_HEAP_MAX, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryHeapMax", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_NON_HEAP_INIT, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryNonHeapInit", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_NON_HEAP_USED, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryNonHeapUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_NON_HEAP_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryNonHeapCommitted", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_MEMORY_NON_HEAP_MAX, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryNonHeapMax", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_GC_PAR_NEW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("jvmGcParNewCount", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_GC_PAR_NEW_TIME, new org.apache.thrift.meta_data.FieldMetaData("jvmGcParNewTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_GC_CMS_COUNT, new org.apache.thrift.meta_data.FieldMetaData("jvmGcCmsCount", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.JVM_GC_TIME, new org.apache.thrift.meta_data.FieldMetaData("jvmGcTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StatWithCmsCollector.class, metaDataMap); + } + + public StatWithCmsCollector() { + } + + public StatWithCmsCollector( + String agentId, + long timestamp, + long jvmMemoryTotalInit, + long jvmMemoryTotalUsed, + long jvmMemoryTotalCommitted, + long jvmMemoryTotalMax, + long jvmMemoryHeapInit, + long jvmMemoryHeapUsed, + long jvmMemoryHeapCommitted, + long jvmMemoryHeapMax, + long jvmMemoryNonHeapInit, + long jvmMemoryNonHeapUsed, + long jvmMemoryNonHeapCommitted, + long jvmMemoryNonHeapMax, + long jvmGcParNewCount, + long jvmGcParNewTime, + long jvmGcCmsCount, + long jvmGcTime) + { + this(); + this.agentId = agentId; + this.timestamp = timestamp; + setTimestampIsSet(true); + this.jvmMemoryTotalInit = jvmMemoryTotalInit; + setJvmMemoryTotalInitIsSet(true); + this.jvmMemoryTotalUsed = jvmMemoryTotalUsed; + setJvmMemoryTotalUsedIsSet(true); + this.jvmMemoryTotalCommitted = jvmMemoryTotalCommitted; + setJvmMemoryTotalCommittedIsSet(true); + this.jvmMemoryTotalMax = jvmMemoryTotalMax; + setJvmMemoryTotalMaxIsSet(true); + this.jvmMemoryHeapInit = jvmMemoryHeapInit; + setJvmMemoryHeapInitIsSet(true); + this.jvmMemoryHeapUsed = jvmMemoryHeapUsed; + setJvmMemoryHeapUsedIsSet(true); + this.jvmMemoryHeapCommitted = jvmMemoryHeapCommitted; + setJvmMemoryHeapCommittedIsSet(true); + this.jvmMemoryHeapMax = jvmMemoryHeapMax; + setJvmMemoryHeapMaxIsSet(true); + this.jvmMemoryNonHeapInit = jvmMemoryNonHeapInit; + setJvmMemoryNonHeapInitIsSet(true); + this.jvmMemoryNonHeapUsed = jvmMemoryNonHeapUsed; + setJvmMemoryNonHeapUsedIsSet(true); + this.jvmMemoryNonHeapCommitted = jvmMemoryNonHeapCommitted; + setJvmMemoryNonHeapCommittedIsSet(true); + this.jvmMemoryNonHeapMax = jvmMemoryNonHeapMax; + setJvmMemoryNonHeapMaxIsSet(true); + this.jvmGcParNewCount = jvmGcParNewCount; + setJvmGcParNewCountIsSet(true); + this.jvmGcParNewTime = jvmGcParNewTime; + setJvmGcParNewTimeIsSet(true); + this.jvmGcCmsCount = jvmGcCmsCount; + setJvmGcCmsCountIsSet(true); + this.jvmGcTime = jvmGcTime; + setJvmGcTimeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public StatWithCmsCollector(StatWithCmsCollector other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.timestamp = other.timestamp; + this.jvmMemoryTotalInit = other.jvmMemoryTotalInit; + this.jvmMemoryTotalUsed = other.jvmMemoryTotalUsed; + this.jvmMemoryTotalCommitted = other.jvmMemoryTotalCommitted; + this.jvmMemoryTotalMax = other.jvmMemoryTotalMax; + this.jvmMemoryHeapInit = other.jvmMemoryHeapInit; + this.jvmMemoryHeapUsed = other.jvmMemoryHeapUsed; + this.jvmMemoryHeapCommitted = other.jvmMemoryHeapCommitted; + this.jvmMemoryHeapMax = other.jvmMemoryHeapMax; + this.jvmMemoryNonHeapInit = other.jvmMemoryNonHeapInit; + this.jvmMemoryNonHeapUsed = other.jvmMemoryNonHeapUsed; + this.jvmMemoryNonHeapCommitted = other.jvmMemoryNonHeapCommitted; + this.jvmMemoryNonHeapMax = other.jvmMemoryNonHeapMax; + this.jvmGcParNewCount = other.jvmGcParNewCount; + this.jvmGcParNewTime = other.jvmGcParNewTime; + this.jvmGcCmsCount = other.jvmGcCmsCount; + this.jvmGcTime = other.jvmGcTime; + if (other.isSetMetadata()) { + this.metadata = other.metadata; + } + } + + public StatWithCmsCollector deepCopy() { + return new StatWithCmsCollector(this); + } + + @Override + public void clear() { + this.agentId = null; + setTimestampIsSet(false); + this.timestamp = 0; + setJvmMemoryTotalInitIsSet(false); + this.jvmMemoryTotalInit = 0; + setJvmMemoryTotalUsedIsSet(false); + this.jvmMemoryTotalUsed = 0; + setJvmMemoryTotalCommittedIsSet(false); + this.jvmMemoryTotalCommitted = 0; + setJvmMemoryTotalMaxIsSet(false); + this.jvmMemoryTotalMax = 0; + setJvmMemoryHeapInitIsSet(false); + this.jvmMemoryHeapInit = 0; + setJvmMemoryHeapUsedIsSet(false); + this.jvmMemoryHeapUsed = 0; + setJvmMemoryHeapCommittedIsSet(false); + this.jvmMemoryHeapCommitted = 0; + setJvmMemoryHeapMaxIsSet(false); + this.jvmMemoryHeapMax = 0; + setJvmMemoryNonHeapInitIsSet(false); + this.jvmMemoryNonHeapInit = 0; + setJvmMemoryNonHeapUsedIsSet(false); + this.jvmMemoryNonHeapUsed = 0; + setJvmMemoryNonHeapCommittedIsSet(false); + this.jvmMemoryNonHeapCommitted = 0; + setJvmMemoryNonHeapMaxIsSet(false); + this.jvmMemoryNonHeapMax = 0; + setJvmGcParNewCountIsSet(false); + this.jvmGcParNewCount = 0; + setJvmGcParNewTimeIsSet(false); + this.jvmGcParNewTime = 0; + setJvmGcCmsCountIsSet(false); + this.jvmGcCmsCount = 0; + setJvmGcTimeIsSet(false); + this.jvmGcTime = 0; + this.metadata = 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 getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + } + + public long getJvmMemoryTotalInit() { + return this.jvmMemoryTotalInit; + } + + public void setJvmMemoryTotalInit(long jvmMemoryTotalInit) { + this.jvmMemoryTotalInit = jvmMemoryTotalInit; + setJvmMemoryTotalInitIsSet(true); + } + + public void unsetJvmMemoryTotalInit() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYTOTALINIT_ISSET_ID); + } + + /** Returns true if field jvmMemoryTotalInit is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryTotalInit() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYTOTALINIT_ISSET_ID); + } + + public void setJvmMemoryTotalInitIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYTOTALINIT_ISSET_ID, value); + } + + public long getJvmMemoryTotalUsed() { + return this.jvmMemoryTotalUsed; + } + + public void setJvmMemoryTotalUsed(long jvmMemoryTotalUsed) { + this.jvmMemoryTotalUsed = jvmMemoryTotalUsed; + setJvmMemoryTotalUsedIsSet(true); + } + + public void unsetJvmMemoryTotalUsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYTOTALUSED_ISSET_ID); + } + + /** Returns true if field jvmMemoryTotalUsed is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryTotalUsed() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYTOTALUSED_ISSET_ID); + } + + public void setJvmMemoryTotalUsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYTOTALUSED_ISSET_ID, value); + } + + public long getJvmMemoryTotalCommitted() { + return this.jvmMemoryTotalCommitted; + } + + public void setJvmMemoryTotalCommitted(long jvmMemoryTotalCommitted) { + this.jvmMemoryTotalCommitted = jvmMemoryTotalCommitted; + setJvmMemoryTotalCommittedIsSet(true); + } + + public void unsetJvmMemoryTotalCommitted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYTOTALCOMMITTED_ISSET_ID); + } + + /** Returns true if field jvmMemoryTotalCommitted is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryTotalCommitted() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYTOTALCOMMITTED_ISSET_ID); + } + + public void setJvmMemoryTotalCommittedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYTOTALCOMMITTED_ISSET_ID, value); + } + + public long getJvmMemoryTotalMax() { + return this.jvmMemoryTotalMax; + } + + public void setJvmMemoryTotalMax(long jvmMemoryTotalMax) { + this.jvmMemoryTotalMax = jvmMemoryTotalMax; + setJvmMemoryTotalMaxIsSet(true); + } + + public void unsetJvmMemoryTotalMax() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYTOTALMAX_ISSET_ID); + } + + /** Returns true if field jvmMemoryTotalMax is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryTotalMax() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYTOTALMAX_ISSET_ID); + } + + public void setJvmMemoryTotalMaxIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYTOTALMAX_ISSET_ID, value); + } + + public long getJvmMemoryHeapInit() { + return this.jvmMemoryHeapInit; + } + + public void setJvmMemoryHeapInit(long jvmMemoryHeapInit) { + this.jvmMemoryHeapInit = jvmMemoryHeapInit; + setJvmMemoryHeapInitIsSet(true); + } + + public void unsetJvmMemoryHeapInit() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPINIT_ISSET_ID); + } + + /** Returns true if field jvmMemoryHeapInit is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryHeapInit() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPINIT_ISSET_ID); + } + + public void setJvmMemoryHeapInitIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPINIT_ISSET_ID, value); + } + + public long getJvmMemoryHeapUsed() { + return this.jvmMemoryHeapUsed; + } + + public void setJvmMemoryHeapUsed(long jvmMemoryHeapUsed) { + this.jvmMemoryHeapUsed = jvmMemoryHeapUsed; + setJvmMemoryHeapUsedIsSet(true); + } + + public void unsetJvmMemoryHeapUsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID); + } + + /** Returns true if field jvmMemoryHeapUsed is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryHeapUsed() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID); + } + + public void setJvmMemoryHeapUsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID, value); + } + + public long getJvmMemoryHeapCommitted() { + return this.jvmMemoryHeapCommitted; + } + + public void setJvmMemoryHeapCommitted(long jvmMemoryHeapCommitted) { + this.jvmMemoryHeapCommitted = jvmMemoryHeapCommitted; + setJvmMemoryHeapCommittedIsSet(true); + } + + public void unsetJvmMemoryHeapCommitted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPCOMMITTED_ISSET_ID); + } + + /** Returns true if field jvmMemoryHeapCommitted is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryHeapCommitted() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPCOMMITTED_ISSET_ID); + } + + public void setJvmMemoryHeapCommittedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPCOMMITTED_ISSET_ID, value); + } + + public long getJvmMemoryHeapMax() { + return this.jvmMemoryHeapMax; + } + + public void setJvmMemoryHeapMax(long jvmMemoryHeapMax) { + this.jvmMemoryHeapMax = jvmMemoryHeapMax; + setJvmMemoryHeapMaxIsSet(true); + } + + public void unsetJvmMemoryHeapMax() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID); + } + + /** Returns true if field jvmMemoryHeapMax is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryHeapMax() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID); + } + + public void setJvmMemoryHeapMaxIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID, value); + } + + public long getJvmMemoryNonHeapInit() { + return this.jvmMemoryNonHeapInit; + } + + public void setJvmMemoryNonHeapInit(long jvmMemoryNonHeapInit) { + this.jvmMemoryNonHeapInit = jvmMemoryNonHeapInit; + setJvmMemoryNonHeapInitIsSet(true); + } + + public void unsetJvmMemoryNonHeapInit() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPINIT_ISSET_ID); + } + + /** Returns true if field jvmMemoryNonHeapInit is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryNonHeapInit() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPINIT_ISSET_ID); + } + + public void setJvmMemoryNonHeapInitIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPINIT_ISSET_ID, value); + } + + public long getJvmMemoryNonHeapUsed() { + return this.jvmMemoryNonHeapUsed; + } + + public void setJvmMemoryNonHeapUsed(long jvmMemoryNonHeapUsed) { + this.jvmMemoryNonHeapUsed = jvmMemoryNonHeapUsed; + setJvmMemoryNonHeapUsedIsSet(true); + } + + public void unsetJvmMemoryNonHeapUsed() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID); + } + + /** Returns true if field jvmMemoryNonHeapUsed is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryNonHeapUsed() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID); + } + + public void setJvmMemoryNonHeapUsedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID, value); + } + + public long getJvmMemoryNonHeapCommitted() { + return this.jvmMemoryNonHeapCommitted; + } + + public void setJvmMemoryNonHeapCommitted(long jvmMemoryNonHeapCommitted) { + this.jvmMemoryNonHeapCommitted = jvmMemoryNonHeapCommitted; + setJvmMemoryNonHeapCommittedIsSet(true); + } + + public void unsetJvmMemoryNonHeapCommitted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPCOMMITTED_ISSET_ID); + } + + /** Returns true if field jvmMemoryNonHeapCommitted is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryNonHeapCommitted() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPCOMMITTED_ISSET_ID); + } + + public void setJvmMemoryNonHeapCommittedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPCOMMITTED_ISSET_ID, value); + } + + public long getJvmMemoryNonHeapMax() { + return this.jvmMemoryNonHeapMax; + } + + public void setJvmMemoryNonHeapMax(long jvmMemoryNonHeapMax) { + this.jvmMemoryNonHeapMax = jvmMemoryNonHeapMax; + setJvmMemoryNonHeapMaxIsSet(true); + } + + public void unsetJvmMemoryNonHeapMax() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID); + } + + /** Returns true if field jvmMemoryNonHeapMax is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmMemoryNonHeapMax() { + return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID); + } + + public void setJvmMemoryNonHeapMaxIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID, value); + } + + public long getJvmGcParNewCount() { + return this.jvmGcParNewCount; + } + + public void setJvmGcParNewCount(long jvmGcParNewCount) { + this.jvmGcParNewCount = jvmGcParNewCount; + setJvmGcParNewCountIsSet(true); + } + + public void unsetJvmGcParNewCount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCPARNEWCOUNT_ISSET_ID); + } + + /** Returns true if field jvmGcParNewCount is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmGcParNewCount() { + return EncodingUtils.testBit(__isset_bitfield, __JVMGCPARNEWCOUNT_ISSET_ID); + } + + public void setJvmGcParNewCountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCPARNEWCOUNT_ISSET_ID, value); + } + + public long getJvmGcParNewTime() { + return this.jvmGcParNewTime; + } + + public void setJvmGcParNewTime(long jvmGcParNewTime) { + this.jvmGcParNewTime = jvmGcParNewTime; + setJvmGcParNewTimeIsSet(true); + } + + public void unsetJvmGcParNewTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCPARNEWTIME_ISSET_ID); + } + + /** Returns true if field jvmGcParNewTime is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmGcParNewTime() { + return EncodingUtils.testBit(__isset_bitfield, __JVMGCPARNEWTIME_ISSET_ID); + } + + public void setJvmGcParNewTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCPARNEWTIME_ISSET_ID, value); + } + + public long getJvmGcCmsCount() { + return this.jvmGcCmsCount; + } + + public void setJvmGcCmsCount(long jvmGcCmsCount) { + this.jvmGcCmsCount = jvmGcCmsCount; + setJvmGcCmsCountIsSet(true); + } + + public void unsetJvmGcCmsCount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCCMSCOUNT_ISSET_ID); + } + + /** Returns true if field jvmGcCmsCount is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmGcCmsCount() { + return EncodingUtils.testBit(__isset_bitfield, __JVMGCCMSCOUNT_ISSET_ID); + } + + public void setJvmGcCmsCountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCCMSCOUNT_ISSET_ID, value); + } + + public long getJvmGcTime() { + return this.jvmGcTime; + } + + public void setJvmGcTime(long jvmGcTime) { + this.jvmGcTime = jvmGcTime; + setJvmGcTimeIsSet(true); + } + + public void unsetJvmGcTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCTIME_ISSET_ID); + } + + /** Returns true if field jvmGcTime is set (has been assigned a value) and false otherwise */ + public boolean isSetJvmGcTime() { + return EncodingUtils.testBit(__isset_bitfield, __JVMGCTIME_ISSET_ID); + } + + public void setJvmGcTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCTIME_ISSET_ID, value); + } + + public String getMetadata() { + return this.metadata; + } + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + public void unsetMetadata() { + this.metadata = null; + } + + /** Returns true if field metadata is set (has been assigned a value) and false otherwise */ + public boolean isSetMetadata() { + return this.metadata != null; + } + + public void setMetadataIsSet(boolean value) { + if (!value) { + this.metadata = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AGENT_ID: + if (value == null) { + unsetAgentId(); + } else { + setAgentId((String)value); + } + break; + + case TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + case JVM_MEMORY_TOTAL_INIT: + if (value == null) { + unsetJvmMemoryTotalInit(); + } else { + setJvmMemoryTotalInit((Long)value); + } + break; + + case JVM_MEMORY_TOTAL_USED: + if (value == null) { + unsetJvmMemoryTotalUsed(); + } else { + setJvmMemoryTotalUsed((Long)value); + } + break; + + case JVM_MEMORY_TOTAL_COMMITTED: + if (value == null) { + unsetJvmMemoryTotalCommitted(); + } else { + setJvmMemoryTotalCommitted((Long)value); + } + break; + + case JVM_MEMORY_TOTAL_MAX: + if (value == null) { + unsetJvmMemoryTotalMax(); + } else { + setJvmMemoryTotalMax((Long)value); + } + break; + + case JVM_MEMORY_HEAP_INIT: + if (value == null) { + unsetJvmMemoryHeapInit(); + } else { + setJvmMemoryHeapInit((Long)value); + } + break; + + case JVM_MEMORY_HEAP_USED: + if (value == null) { + unsetJvmMemoryHeapUsed(); + } else { + setJvmMemoryHeapUsed((Long)value); + } + break; + + case JVM_MEMORY_HEAP_COMMITTED: + if (value == null) { + unsetJvmMemoryHeapCommitted(); + } else { + setJvmMemoryHeapCommitted((Long)value); + } + break; + + case JVM_MEMORY_HEAP_MAX: + if (value == null) { + unsetJvmMemoryHeapMax(); + } else { + setJvmMemoryHeapMax((Long)value); + } + break; + + case JVM_MEMORY_NON_HEAP_INIT: + if (value == null) { + unsetJvmMemoryNonHeapInit(); + } else { + setJvmMemoryNonHeapInit((Long)value); + } + break; + + case JVM_MEMORY_NON_HEAP_USED: + if (value == null) { + unsetJvmMemoryNonHeapUsed(); + } else { + setJvmMemoryNonHeapUsed((Long)value); + } + break; + + case JVM_MEMORY_NON_HEAP_COMMITTED: + if (value == null) { + unsetJvmMemoryNonHeapCommitted(); + } else { + setJvmMemoryNonHeapCommitted((Long)value); + } + break; + + case JVM_MEMORY_NON_HEAP_MAX: + if (value == null) { + unsetJvmMemoryNonHeapMax(); + } else { + setJvmMemoryNonHeapMax((Long)value); + } + break; + + case JVM_GC_PAR_NEW_COUNT: + if (value == null) { + unsetJvmGcParNewCount(); + } else { + setJvmGcParNewCount((Long)value); + } + break; + + case JVM_GC_PAR_NEW_TIME: + if (value == null) { + unsetJvmGcParNewTime(); + } else { + setJvmGcParNewTime((Long)value); + } + break; + + case JVM_GC_CMS_COUNT: + if (value == null) { + unsetJvmGcCmsCount(); + } else { + setJvmGcCmsCount((Long)value); + } + break; + + case JVM_GC_TIME: + if (value == null) { + unsetJvmGcTime(); + } else { + setJvmGcTime((Long)value); + } + break; + + case METADATA: + if (value == null) { + unsetMetadata(); + } else { + setMetadata((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + case TIMESTAMP: + return Long.valueOf(getTimestamp()); + + case JVM_MEMORY_TOTAL_INIT: + return Long.valueOf(getJvmMemoryTotalInit()); + + case JVM_MEMORY_TOTAL_USED: + return Long.valueOf(getJvmMemoryTotalUsed()); + + case JVM_MEMORY_TOTAL_COMMITTED: + return Long.valueOf(getJvmMemoryTotalCommitted()); + + case JVM_MEMORY_TOTAL_MAX: + return Long.valueOf(getJvmMemoryTotalMax()); + + case JVM_MEMORY_HEAP_INIT: + return Long.valueOf(getJvmMemoryHeapInit()); + + case JVM_MEMORY_HEAP_USED: + return Long.valueOf(getJvmMemoryHeapUsed()); + + case JVM_MEMORY_HEAP_COMMITTED: + return Long.valueOf(getJvmMemoryHeapCommitted()); + + case JVM_MEMORY_HEAP_MAX: + return Long.valueOf(getJvmMemoryHeapMax()); + + case JVM_MEMORY_NON_HEAP_INIT: + return Long.valueOf(getJvmMemoryNonHeapInit()); + + case JVM_MEMORY_NON_HEAP_USED: + return Long.valueOf(getJvmMemoryNonHeapUsed()); + + case JVM_MEMORY_NON_HEAP_COMMITTED: + return Long.valueOf(getJvmMemoryNonHeapCommitted()); + + case JVM_MEMORY_NON_HEAP_MAX: + return Long.valueOf(getJvmMemoryNonHeapMax()); + + case JVM_GC_PAR_NEW_COUNT: + return Long.valueOf(getJvmGcParNewCount()); + + case JVM_GC_PAR_NEW_TIME: + return Long.valueOf(getJvmGcParNewTime()); + + case JVM_GC_CMS_COUNT: + return Long.valueOf(getJvmGcCmsCount()); + + case JVM_GC_TIME: + return Long.valueOf(getJvmGcTime()); + + case METADATA: + return getMetadata(); + + } + 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 TIMESTAMP: + return isSetTimestamp(); + case JVM_MEMORY_TOTAL_INIT: + return isSetJvmMemoryTotalInit(); + case JVM_MEMORY_TOTAL_USED: + return isSetJvmMemoryTotalUsed(); + case JVM_MEMORY_TOTAL_COMMITTED: + return isSetJvmMemoryTotalCommitted(); + case JVM_MEMORY_TOTAL_MAX: + return isSetJvmMemoryTotalMax(); + case JVM_MEMORY_HEAP_INIT: + return isSetJvmMemoryHeapInit(); + case JVM_MEMORY_HEAP_USED: + return isSetJvmMemoryHeapUsed(); + case JVM_MEMORY_HEAP_COMMITTED: + return isSetJvmMemoryHeapCommitted(); + case JVM_MEMORY_HEAP_MAX: + return isSetJvmMemoryHeapMax(); + case JVM_MEMORY_NON_HEAP_INIT: + return isSetJvmMemoryNonHeapInit(); + case JVM_MEMORY_NON_HEAP_USED: + return isSetJvmMemoryNonHeapUsed(); + case JVM_MEMORY_NON_HEAP_COMMITTED: + return isSetJvmMemoryNonHeapCommitted(); + case JVM_MEMORY_NON_HEAP_MAX: + return isSetJvmMemoryNonHeapMax(); + case JVM_GC_PAR_NEW_COUNT: + return isSetJvmGcParNewCount(); + case JVM_GC_PAR_NEW_TIME: + return isSetJvmGcParNewTime(); + case JVM_GC_CMS_COUNT: + return isSetJvmGcCmsCount(); + case JVM_GC_TIME: + return isSetJvmGcTime(); + case METADATA: + return isSetMetadata(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof StatWithCmsCollector) + return this.equals((StatWithCmsCollector)that); + return false; + } + + public boolean equals(StatWithCmsCollector 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_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; + } + + boolean this_present_jvmMemoryTotalInit = true; + boolean that_present_jvmMemoryTotalInit = true; + if (this_present_jvmMemoryTotalInit || that_present_jvmMemoryTotalInit) { + if (!(this_present_jvmMemoryTotalInit && that_present_jvmMemoryTotalInit)) + return false; + if (this.jvmMemoryTotalInit != that.jvmMemoryTotalInit) + return false; + } + + boolean this_present_jvmMemoryTotalUsed = true; + boolean that_present_jvmMemoryTotalUsed = true; + if (this_present_jvmMemoryTotalUsed || that_present_jvmMemoryTotalUsed) { + if (!(this_present_jvmMemoryTotalUsed && that_present_jvmMemoryTotalUsed)) + return false; + if (this.jvmMemoryTotalUsed != that.jvmMemoryTotalUsed) + return false; + } + + boolean this_present_jvmMemoryTotalCommitted = true; + boolean that_present_jvmMemoryTotalCommitted = true; + if (this_present_jvmMemoryTotalCommitted || that_present_jvmMemoryTotalCommitted) { + if (!(this_present_jvmMemoryTotalCommitted && that_present_jvmMemoryTotalCommitted)) + return false; + if (this.jvmMemoryTotalCommitted != that.jvmMemoryTotalCommitted) + return false; + } + + boolean this_present_jvmMemoryTotalMax = true; + boolean that_present_jvmMemoryTotalMax = true; + if (this_present_jvmMemoryTotalMax || that_present_jvmMemoryTotalMax) { + if (!(this_present_jvmMemoryTotalMax && that_present_jvmMemoryTotalMax)) + return false; + if (this.jvmMemoryTotalMax != that.jvmMemoryTotalMax) + return false; + } + + boolean this_present_jvmMemoryHeapInit = true; + boolean that_present_jvmMemoryHeapInit = true; + if (this_present_jvmMemoryHeapInit || that_present_jvmMemoryHeapInit) { + if (!(this_present_jvmMemoryHeapInit && that_present_jvmMemoryHeapInit)) + return false; + if (this.jvmMemoryHeapInit != that.jvmMemoryHeapInit) + return false; + } + + boolean this_present_jvmMemoryHeapUsed = true; + boolean that_present_jvmMemoryHeapUsed = true; + if (this_present_jvmMemoryHeapUsed || that_present_jvmMemoryHeapUsed) { + if (!(this_present_jvmMemoryHeapUsed && that_present_jvmMemoryHeapUsed)) + return false; + if (this.jvmMemoryHeapUsed != that.jvmMemoryHeapUsed) + return false; + } + + boolean this_present_jvmMemoryHeapCommitted = true; + boolean that_present_jvmMemoryHeapCommitted = true; + if (this_present_jvmMemoryHeapCommitted || that_present_jvmMemoryHeapCommitted) { + if (!(this_present_jvmMemoryHeapCommitted && that_present_jvmMemoryHeapCommitted)) + return false; + if (this.jvmMemoryHeapCommitted != that.jvmMemoryHeapCommitted) + return false; + } + + boolean this_present_jvmMemoryHeapMax = true; + boolean that_present_jvmMemoryHeapMax = true; + if (this_present_jvmMemoryHeapMax || that_present_jvmMemoryHeapMax) { + if (!(this_present_jvmMemoryHeapMax && that_present_jvmMemoryHeapMax)) + return false; + if (this.jvmMemoryHeapMax != that.jvmMemoryHeapMax) + return false; + } + + boolean this_present_jvmMemoryNonHeapInit = true; + boolean that_present_jvmMemoryNonHeapInit = true; + if (this_present_jvmMemoryNonHeapInit || that_present_jvmMemoryNonHeapInit) { + if (!(this_present_jvmMemoryNonHeapInit && that_present_jvmMemoryNonHeapInit)) + return false; + if (this.jvmMemoryNonHeapInit != that.jvmMemoryNonHeapInit) + return false; + } + + boolean this_present_jvmMemoryNonHeapUsed = true; + boolean that_present_jvmMemoryNonHeapUsed = true; + if (this_present_jvmMemoryNonHeapUsed || that_present_jvmMemoryNonHeapUsed) { + if (!(this_present_jvmMemoryNonHeapUsed && that_present_jvmMemoryNonHeapUsed)) + return false; + if (this.jvmMemoryNonHeapUsed != that.jvmMemoryNonHeapUsed) + return false; + } + + boolean this_present_jvmMemoryNonHeapCommitted = true; + boolean that_present_jvmMemoryNonHeapCommitted = true; + if (this_present_jvmMemoryNonHeapCommitted || that_present_jvmMemoryNonHeapCommitted) { + if (!(this_present_jvmMemoryNonHeapCommitted && that_present_jvmMemoryNonHeapCommitted)) + return false; + if (this.jvmMemoryNonHeapCommitted != that.jvmMemoryNonHeapCommitted) + return false; + } + + boolean this_present_jvmMemoryNonHeapMax = true; + boolean that_present_jvmMemoryNonHeapMax = true; + if (this_present_jvmMemoryNonHeapMax || that_present_jvmMemoryNonHeapMax) { + if (!(this_present_jvmMemoryNonHeapMax && that_present_jvmMemoryNonHeapMax)) + return false; + if (this.jvmMemoryNonHeapMax != that.jvmMemoryNonHeapMax) + return false; + } + + boolean this_present_jvmGcParNewCount = true; + boolean that_present_jvmGcParNewCount = true; + if (this_present_jvmGcParNewCount || that_present_jvmGcParNewCount) { + if (!(this_present_jvmGcParNewCount && that_present_jvmGcParNewCount)) + return false; + if (this.jvmGcParNewCount != that.jvmGcParNewCount) + return false; + } + + boolean this_present_jvmGcParNewTime = true; + boolean that_present_jvmGcParNewTime = true; + if (this_present_jvmGcParNewTime || that_present_jvmGcParNewTime) { + if (!(this_present_jvmGcParNewTime && that_present_jvmGcParNewTime)) + return false; + if (this.jvmGcParNewTime != that.jvmGcParNewTime) + return false; + } + + boolean this_present_jvmGcCmsCount = true; + boolean that_present_jvmGcCmsCount = true; + if (this_present_jvmGcCmsCount || that_present_jvmGcCmsCount) { + if (!(this_present_jvmGcCmsCount && that_present_jvmGcCmsCount)) + return false; + if (this.jvmGcCmsCount != that.jvmGcCmsCount) + return false; + } + + boolean this_present_jvmGcTime = true; + boolean that_present_jvmGcTime = true; + if (this_present_jvmGcTime || that_present_jvmGcTime) { + if (!(this_present_jvmGcTime && that_present_jvmGcTime)) + return false; + if (this.jvmGcTime != that.jvmGcTime) + return false; + } + + boolean this_present_metadata = true && this.isSetMetadata(); + boolean that_present_metadata = true && that.isSetMetadata(); + if (this_present_metadata || that_present_metadata) { + if (!(this_present_metadata && that_present_metadata)) + return false; + if (!this.metadata.equals(that.metadata)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(StatWithCmsCollector other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryTotalInit()).compareTo(other.isSetJvmMemoryTotalInit()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryTotalInit()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryTotalInit, other.jvmMemoryTotalInit); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryTotalUsed()).compareTo(other.isSetJvmMemoryTotalUsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryTotalUsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryTotalUsed, other.jvmMemoryTotalUsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryTotalCommitted()).compareTo(other.isSetJvmMemoryTotalCommitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryTotalCommitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryTotalCommitted, other.jvmMemoryTotalCommitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryTotalMax()).compareTo(other.isSetJvmMemoryTotalMax()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryTotalMax()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryTotalMax, other.jvmMemoryTotalMax); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryHeapInit()).compareTo(other.isSetJvmMemoryHeapInit()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryHeapInit()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryHeapInit, other.jvmMemoryHeapInit); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryHeapUsed()).compareTo(other.isSetJvmMemoryHeapUsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryHeapUsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryHeapUsed, other.jvmMemoryHeapUsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryHeapCommitted()).compareTo(other.isSetJvmMemoryHeapCommitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryHeapCommitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryHeapCommitted, other.jvmMemoryHeapCommitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryHeapMax()).compareTo(other.isSetJvmMemoryHeapMax()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryHeapMax()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryHeapMax, other.jvmMemoryHeapMax); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryNonHeapInit()).compareTo(other.isSetJvmMemoryNonHeapInit()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryNonHeapInit()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryNonHeapInit, other.jvmMemoryNonHeapInit); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryNonHeapUsed()).compareTo(other.isSetJvmMemoryNonHeapUsed()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryNonHeapUsed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryNonHeapUsed, other.jvmMemoryNonHeapUsed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryNonHeapCommitted()).compareTo(other.isSetJvmMemoryNonHeapCommitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryNonHeapCommitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryNonHeapCommitted, other.jvmMemoryNonHeapCommitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmMemoryNonHeapMax()).compareTo(other.isSetJvmMemoryNonHeapMax()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmMemoryNonHeapMax()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmMemoryNonHeapMax, other.jvmMemoryNonHeapMax); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmGcParNewCount()).compareTo(other.isSetJvmGcParNewCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmGcParNewCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmGcParNewCount, other.jvmGcParNewCount); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmGcParNewTime()).compareTo(other.isSetJvmGcParNewTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmGcParNewTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmGcParNewTime, other.jvmGcParNewTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmGcCmsCount()).compareTo(other.isSetJvmGcCmsCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmGcCmsCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmGcCmsCount, other.jvmGcCmsCount); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJvmGcTime()).compareTo(other.isSetJvmGcTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJvmGcTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jvmGcTime, other.jvmGcTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMetadata()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata); + 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("StatWithCmsCollector("); + 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("timestamp:"); + sb.append(this.timestamp); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryTotalInit:"); + sb.append(this.jvmMemoryTotalInit); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryTotalUsed:"); + sb.append(this.jvmMemoryTotalUsed); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryTotalCommitted:"); + sb.append(this.jvmMemoryTotalCommitted); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryTotalMax:"); + sb.append(this.jvmMemoryTotalMax); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryHeapInit:"); + sb.append(this.jvmMemoryHeapInit); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryHeapUsed:"); + sb.append(this.jvmMemoryHeapUsed); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryHeapCommitted:"); + sb.append(this.jvmMemoryHeapCommitted); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryHeapMax:"); + sb.append(this.jvmMemoryHeapMax); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryNonHeapInit:"); + sb.append(this.jvmMemoryNonHeapInit); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryNonHeapUsed:"); + sb.append(this.jvmMemoryNonHeapUsed); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryNonHeapCommitted:"); + sb.append(this.jvmMemoryNonHeapCommitted); + first = false; + if (!first) sb.append(", "); + sb.append("jvmMemoryNonHeapMax:"); + sb.append(this.jvmMemoryNonHeapMax); + first = false; + if (!first) sb.append(", "); + sb.append("jvmGcParNewCount:"); + sb.append(this.jvmGcParNewCount); + first = false; + if (!first) sb.append(", "); + sb.append("jvmGcParNewTime:"); + sb.append(this.jvmGcParNewTime); + first = false; + if (!first) sb.append(", "); + sb.append("jvmGcCmsCount:"); + sb.append(this.jvmGcCmsCount); + first = false; + if (!first) sb.append(", "); + sb.append("jvmGcTime:"); + sb.append(this.jvmGcTime); + first = false; + if (isSetMetadata()) { + if (!first) sb.append(", "); + sb.append("metadata:"); + if (this.metadata == null) { + sb.append("null"); + } else { + sb.append(this.metadata); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class StatWithCmsCollectorStandardSchemeFactory implements SchemeFactory { + public StatWithCmsCollectorStandardScheme getScheme() { + return new StatWithCmsCollectorStandardScheme(); + } + } + + private static class StatWithCmsCollectorStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, StatWithCmsCollector 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: // 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; + case 3: // JVM_MEMORY_TOTAL_INIT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryTotalInit = iprot.readI64(); + struct.setJvmMemoryTotalInitIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // JVM_MEMORY_TOTAL_USED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryTotalUsed = iprot.readI64(); + struct.setJvmMemoryTotalUsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // JVM_MEMORY_TOTAL_COMMITTED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryTotalCommitted = iprot.readI64(); + struct.setJvmMemoryTotalCommittedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // JVM_MEMORY_TOTAL_MAX + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryTotalMax = iprot.readI64(); + struct.setJvmMemoryTotalMaxIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // JVM_MEMORY_HEAP_INIT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryHeapInit = iprot.readI64(); + struct.setJvmMemoryHeapInitIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // JVM_MEMORY_HEAP_USED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryHeapUsed = iprot.readI64(); + struct.setJvmMemoryHeapUsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // JVM_MEMORY_HEAP_COMMITTED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryHeapCommitted = iprot.readI64(); + struct.setJvmMemoryHeapCommittedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // JVM_MEMORY_HEAP_MAX + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryHeapMax = iprot.readI64(); + struct.setJvmMemoryHeapMaxIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // JVM_MEMORY_NON_HEAP_INIT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryNonHeapInit = iprot.readI64(); + struct.setJvmMemoryNonHeapInitIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // JVM_MEMORY_NON_HEAP_USED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryNonHeapUsed = iprot.readI64(); + struct.setJvmMemoryNonHeapUsedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // JVM_MEMORY_NON_HEAP_COMMITTED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryNonHeapCommitted = iprot.readI64(); + struct.setJvmMemoryNonHeapCommittedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 14: // JVM_MEMORY_NON_HEAP_MAX + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmMemoryNonHeapMax = iprot.readI64(); + struct.setJvmMemoryNonHeapMaxIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 15: // JVM_GC_PAR_NEW_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmGcParNewCount = iprot.readI64(); + struct.setJvmGcParNewCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 16: // JVM_GC_PAR_NEW_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmGcParNewTime = iprot.readI64(); + struct.setJvmGcParNewTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 17: // JVM_GC_CMS_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmGcCmsCount = iprot.readI64(); + struct.setJvmGcCmsCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 18: // JVM_GC_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.jvmGcTime = iprot.readI64(); + struct.setJvmGcTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 200: // METADATA + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.metadata = iprot.readString(); + struct.setMetadataIsSet(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, StatWithCmsCollector 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(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_TOTAL_INIT_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryTotalInit); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_TOTAL_USED_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryTotalUsed); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_TOTAL_COMMITTED_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryTotalCommitted); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_TOTAL_MAX_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryTotalMax); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_HEAP_INIT_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryHeapInit); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_HEAP_USED_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryHeapUsed); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_HEAP_COMMITTED_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryHeapCommitted); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_HEAP_MAX_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryHeapMax); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_NON_HEAP_INIT_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryNonHeapInit); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_NON_HEAP_USED_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryNonHeapUsed); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_NON_HEAP_COMMITTED_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryNonHeapCommitted); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_MEMORY_NON_HEAP_MAX_FIELD_DESC); + oprot.writeI64(struct.jvmMemoryNonHeapMax); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_GC_PAR_NEW_COUNT_FIELD_DESC); + oprot.writeI64(struct.jvmGcParNewCount); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_GC_PAR_NEW_TIME_FIELD_DESC); + oprot.writeI64(struct.jvmGcParNewTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_GC_CMS_COUNT_FIELD_DESC); + oprot.writeI64(struct.jvmGcCmsCount); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(JVM_GC_TIME_FIELD_DESC); + oprot.writeI64(struct.jvmGcTime); + oprot.writeFieldEnd(); + if (struct.metadata != null) { + if (struct.isSetMetadata()) { + oprot.writeFieldBegin(METADATA_FIELD_DESC); + oprot.writeString(struct.metadata); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class StatWithCmsCollectorTupleSchemeFactory implements SchemeFactory { + public StatWithCmsCollectorTupleScheme getScheme() { + return new StatWithCmsCollectorTupleScheme(); + } + } + + private static class StatWithCmsCollectorTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, StatWithCmsCollector struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + if (struct.isSetJvmMemoryTotalInit()) { + optionals.set(2); + } + if (struct.isSetJvmMemoryTotalUsed()) { + optionals.set(3); + } + if (struct.isSetJvmMemoryTotalCommitted()) { + optionals.set(4); + } + if (struct.isSetJvmMemoryTotalMax()) { + optionals.set(5); + } + if (struct.isSetJvmMemoryHeapInit()) { + optionals.set(6); + } + if (struct.isSetJvmMemoryHeapUsed()) { + optionals.set(7); + } + if (struct.isSetJvmMemoryHeapCommitted()) { + optionals.set(8); + } + if (struct.isSetJvmMemoryHeapMax()) { + optionals.set(9); + } + if (struct.isSetJvmMemoryNonHeapInit()) { + optionals.set(10); + } + if (struct.isSetJvmMemoryNonHeapUsed()) { + optionals.set(11); + } + if (struct.isSetJvmMemoryNonHeapCommitted()) { + optionals.set(12); + } + if (struct.isSetJvmMemoryNonHeapMax()) { + optionals.set(13); + } + if (struct.isSetJvmGcParNewCount()) { + optionals.set(14); + } + if (struct.isSetJvmGcParNewTime()) { + optionals.set(15); + } + if (struct.isSetJvmGcCmsCount()) { + optionals.set(16); + } + if (struct.isSetJvmGcTime()) { + optionals.set(17); + } + if (struct.isSetMetadata()) { + optionals.set(18); + } + oprot.writeBitSet(optionals, 19); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetJvmMemoryTotalInit()) { + oprot.writeI64(struct.jvmMemoryTotalInit); + } + if (struct.isSetJvmMemoryTotalUsed()) { + oprot.writeI64(struct.jvmMemoryTotalUsed); + } + if (struct.isSetJvmMemoryTotalCommitted()) { + oprot.writeI64(struct.jvmMemoryTotalCommitted); + } + if (struct.isSetJvmMemoryTotalMax()) { + oprot.writeI64(struct.jvmMemoryTotalMax); + } + if (struct.isSetJvmMemoryHeapInit()) { + oprot.writeI64(struct.jvmMemoryHeapInit); + } + if (struct.isSetJvmMemoryHeapUsed()) { + oprot.writeI64(struct.jvmMemoryHeapUsed); + } + if (struct.isSetJvmMemoryHeapCommitted()) { + oprot.writeI64(struct.jvmMemoryHeapCommitted); + } + if (struct.isSetJvmMemoryHeapMax()) { + oprot.writeI64(struct.jvmMemoryHeapMax); + } + if (struct.isSetJvmMemoryNonHeapInit()) { + oprot.writeI64(struct.jvmMemoryNonHeapInit); + } + if (struct.isSetJvmMemoryNonHeapUsed()) { + oprot.writeI64(struct.jvmMemoryNonHeapUsed); + } + if (struct.isSetJvmMemoryNonHeapCommitted()) { + oprot.writeI64(struct.jvmMemoryNonHeapCommitted); + } + if (struct.isSetJvmMemoryNonHeapMax()) { + oprot.writeI64(struct.jvmMemoryNonHeapMax); + } + if (struct.isSetJvmGcParNewCount()) { + oprot.writeI64(struct.jvmGcParNewCount); + } + if (struct.isSetJvmGcParNewTime()) { + oprot.writeI64(struct.jvmGcParNewTime); + } + if (struct.isSetJvmGcCmsCount()) { + oprot.writeI64(struct.jvmGcCmsCount); + } + if (struct.isSetJvmGcTime()) { + oprot.writeI64(struct.jvmGcTime); + } + if (struct.isSetMetadata()) { + oprot.writeString(struct.metadata); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, StatWithCmsCollector struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(19); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { + struct.jvmMemoryTotalInit = iprot.readI64(); + struct.setJvmMemoryTotalInitIsSet(true); + } + if (incoming.get(3)) { + struct.jvmMemoryTotalUsed = iprot.readI64(); + struct.setJvmMemoryTotalUsedIsSet(true); + } + if (incoming.get(4)) { + struct.jvmMemoryTotalCommitted = iprot.readI64(); + struct.setJvmMemoryTotalCommittedIsSet(true); + } + if (incoming.get(5)) { + struct.jvmMemoryTotalMax = iprot.readI64(); + struct.setJvmMemoryTotalMaxIsSet(true); + } + if (incoming.get(6)) { + struct.jvmMemoryHeapInit = iprot.readI64(); + struct.setJvmMemoryHeapInitIsSet(true); + } + if (incoming.get(7)) { + struct.jvmMemoryHeapUsed = iprot.readI64(); + struct.setJvmMemoryHeapUsedIsSet(true); + } + if (incoming.get(8)) { + struct.jvmMemoryHeapCommitted = iprot.readI64(); + struct.setJvmMemoryHeapCommittedIsSet(true); + } + if (incoming.get(9)) { + struct.jvmMemoryHeapMax = iprot.readI64(); + struct.setJvmMemoryHeapMaxIsSet(true); + } + if (incoming.get(10)) { + struct.jvmMemoryNonHeapInit = iprot.readI64(); + struct.setJvmMemoryNonHeapInitIsSet(true); + } + if (incoming.get(11)) { + struct.jvmMemoryNonHeapUsed = iprot.readI64(); + struct.setJvmMemoryNonHeapUsedIsSet(true); + } + if (incoming.get(12)) { + struct.jvmMemoryNonHeapCommitted = iprot.readI64(); + struct.setJvmMemoryNonHeapCommittedIsSet(true); + } + if (incoming.get(13)) { + struct.jvmMemoryNonHeapMax = iprot.readI64(); + struct.setJvmMemoryNonHeapMaxIsSet(true); + } + if (incoming.get(14)) { + struct.jvmGcParNewCount = iprot.readI64(); + struct.setJvmGcParNewCountIsSet(true); + } + if (incoming.get(15)) { + struct.jvmGcParNewTime = iprot.readI64(); + struct.setJvmGcParNewTimeIsSet(true); + } + if (incoming.get(16)) { + struct.jvmGcCmsCount = iprot.readI64(); + struct.setJvmGcCmsCountIsSet(true); + } + if (incoming.get(17)) { + struct.jvmGcTime = iprot.readI64(); + struct.setJvmGcTimeIsSet(true); + } + if (incoming.get(18)) { + struct.metadata = iprot.readString(); + struct.setMetadataIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithG1Collector.java b/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithG1Collector.java new file mode 100644 index 000000000..45433a3e1 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithG1Collector.java @@ -0,0 +1,482 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StatWithG1Collector implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StatWithG1Collector"); + + 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 TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new StatWithG1CollectorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new StatWithG1CollectorTupleSchemeFactory()); + } + + private String agentId; // 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 { + AGENT_ID((short)1, "agentId"), + TIMESTAMP((short)2, "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: // AGENT_ID + return AGENT_ID; + case 2: // 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 __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.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.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(StatWithG1Collector.class, metaDataMap); + } + + public StatWithG1Collector() { + } + + public StatWithG1Collector( + String agentId, + long timestamp) + { + this(); + this.agentId = agentId; + this.timestamp = timestamp; + setTimestampIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public StatWithG1Collector(StatWithG1Collector other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.timestamp = other.timestamp; + } + + public StatWithG1Collector deepCopy() { + return new StatWithG1Collector(this); + } + + @Override + public void clear() { + this.agentId = null; + setTimestampIsSet(false); + this.timestamp = 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 getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_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 TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + 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 AGENT_ID: + return isSetAgentId(); + case TIMESTAMP: + return isSetTimestamp(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof StatWithG1Collector) + return this.equals((StatWithG1Collector)that); + return false; + } + + public boolean equals(StatWithG1Collector 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_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; + } + + @Override + public int compareTo(StatWithG1Collector other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.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("StatWithG1Collector("); + 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("timestamp:"); + sb.append(this.timestamp); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class StatWithG1CollectorStandardSchemeFactory implements SchemeFactory { + public StatWithG1CollectorStandardScheme getScheme() { + return new StatWithG1CollectorStandardScheme(); + } + } + + private static class StatWithG1CollectorStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, StatWithG1Collector 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: // 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, StatWithG1Collector 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(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class StatWithG1CollectorTupleSchemeFactory implements SchemeFactory { + public StatWithG1CollectorTupleScheme getScheme() { + return new StatWithG1CollectorTupleScheme(); + } + } + + private static class StatWithG1CollectorTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, StatWithG1Collector struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, StatWithG1Collector struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithParallelCollector.java b/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithParallelCollector.java new file mode 100644 index 000000000..2c3f77e5a --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/dto/StatWithParallelCollector.java @@ -0,0 +1,482 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.nhn.pinpoint.thrift.dto; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StatWithParallelCollector implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StatWithParallelCollector"); + + 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 TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new StatWithParallelCollectorStandardSchemeFactory()); + schemes.put(TupleScheme.class, new StatWithParallelCollectorTupleSchemeFactory()); + } + + private String agentId; // 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 { + AGENT_ID((short)1, "agentId"), + TIMESTAMP((short)2, "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: // AGENT_ID + return AGENT_ID; + case 2: // 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 __TIMESTAMP_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.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.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(StatWithParallelCollector.class, metaDataMap); + } + + public StatWithParallelCollector() { + } + + public StatWithParallelCollector( + String agentId, + long timestamp) + { + this(); + this.agentId = agentId; + this.timestamp = timestamp; + setTimestampIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public StatWithParallelCollector(StatWithParallelCollector other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAgentId()) { + this.agentId = other.agentId; + } + this.timestamp = other.timestamp; + } + + public StatWithParallelCollector deepCopy() { + return new StatWithParallelCollector(this); + } + + @Override + public void clear() { + this.agentId = null; + setTimestampIsSet(false); + this.timestamp = 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 getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + setTimestampIsSet(true); + } + + public void unsetTimestamp() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ + public boolean isSetTimestamp() { + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + } + + public void setTimestampIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_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 TIMESTAMP: + if (value == null) { + unsetTimestamp(); + } else { + setTimestamp((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AGENT_ID: + return getAgentId(); + + 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 AGENT_ID: + return isSetAgentId(); + case TIMESTAMP: + return isSetTimestamp(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof StatWithParallelCollector) + return this.equals((StatWithParallelCollector)that); + return false; + } + + public boolean equals(StatWithParallelCollector 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_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; + } + + @Override + public int compareTo(StatWithParallelCollector other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAgentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTimestamp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.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("StatWithParallelCollector("); + 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("timestamp:"); + sb.append(this.timestamp); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class StatWithParallelCollectorStandardSchemeFactory implements SchemeFactory { + public StatWithParallelCollectorStandardScheme getScheme() { + return new StatWithParallelCollectorStandardScheme(); + } + } + + private static class StatWithParallelCollectorStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, StatWithParallelCollector 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: // 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, StatWithParallelCollector 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(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class StatWithParallelCollectorTupleSchemeFactory implements SchemeFactory { + public StatWithParallelCollectorTupleScheme getScheme() { + return new StatWithParallelCollectorTupleScheme(); + } + } + + private static class StatWithParallelCollectorTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, StatWithParallelCollector struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAgentId()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetAgentId()) { + oprot.writeString(struct.agentId); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, StatWithParallelCollector struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.agentId = iprot.readString(); + struct.setAgentIdIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + } + } + +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/BytesUtils.java b/src/main/java/com/nhn/pinpoint/thrift/io/BytesUtils.java new file mode 100644 index 000000000..1b94a33dc --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/BytesUtils.java @@ -0,0 +1,14 @@ +package com.nhn.pinpoint.thrift.io; + +/** + * + */ +class BytesUtils { + public static byte writeShort1(final short value) { + return (byte) (value >> 8); + } + + public static byte writeShort2(final short value) { + return (byte) (value); + } +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/DefaultTBaseLocator.java b/src/main/java/com/nhn/pinpoint/thrift/io/DefaultTBaseLocator.java new file mode 100644 index 000000000..fb3f107ce --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/DefaultTBaseLocator.java @@ -0,0 +1,147 @@ +package com.nhn.pinpoint.thrift.io; + +import com.nhn.pinpoint.thrift.dto.*; +import org.apache.thrift.TBase; +import org.apache.thrift.TException; + +class DefaultTBaseLocator implements TBaseLocator { + + private static final short JVM_INFO_THRIFT_DTO = 10; + private static final Header JVM_INFO_THRIFT_HEADER = createHeader(JVM_INFO_THRIFT_DTO); + + private static final short REQUEST_DATA_LIST_THRIFT_DTO = 20; + private static final Header REQUEST_DATA_LIST_THRIFT_HEADER = createHeader(REQUEST_DATA_LIST_THRIFT_DTO); + + private static final short REQUEST_THRIFT_DTO = 30; + private static final Header REQUEST_THRIFT_HEADER = createHeader(REQUEST_THRIFT_DTO); + + + private static final short SPAN = 40; + private static final Header SPAN_HEADER = createHeader(SPAN); + + private static final short AGENT_INFO = 50; + private static final Header AGENT_INFO_HEADER = createHeader(AGENT_INFO); + + private static final short AGENT_STAT = 55; + private static final Header AGENT_STAT_HEADER = createHeader(AGENT_STAT); + + private static final short SPANEVENT = 60; + private static final Header SPANEVENT_HEADER = createHeader(SPANEVENT); + + private static final short SPANCHUNK = 70; + private static final Header SPANCHUNK_HEADER = createHeader(SPANCHUNK); + + + private static final short SQLMETADATA = 300; + private static final Header SQLMETADATA_HEADER = createHeader(SQLMETADATA); + + private static final short APIMETADATA = 310; + private static final Header APIMETADATA_HEADER = createHeader(APIMETADATA); + + private static final short RESULT = 320; + private static final Header RESULT_HEADER = createHeader(RESULT); + + @Override + public TBase tBaseLookup(short type) throws TException { + switch (type) { + case JVM_INFO_THRIFT_DTO: + return new JVMInfoThriftDTO(); + case REQUEST_DATA_LIST_THRIFT_DTO: + return new RequestDataListThriftDTO(); + case REQUEST_THRIFT_DTO: + return new RequestThriftDTO(); + case SPAN: + return new Span(); + case AGENT_INFO: + return new AgentInfo(); + case AGENT_STAT: + return new AgentStat(); + case SPANEVENT: + return new SpanEvent(); + case SPANCHUNK: + return new SpanChunk(); + case SQLMETADATA: + return new SqlMetaData(); + case APIMETADATA: + return new ApiMetaData(); + case RESULT: + return new Result(); + } + throw new TException("Unsupported type:" + type); + } + + private short typeLookup(TBase tbase) throws TException { + if (tbase instanceof Span) { + return SPAN; + } + if (tbase instanceof SpanChunk) { + return SPANCHUNK; + } + if (tbase instanceof SpanEvent) { + return SPANEVENT; + } + if (tbase instanceof JVMInfoThriftDTO) { + return JVM_INFO_THRIFT_DTO; + } + if (tbase instanceof RequestDataListThriftDTO) { + return REQUEST_DATA_LIST_THRIFT_DTO; + } + if (tbase instanceof RequestThriftDTO) { + return REQUEST_THRIFT_DTO; + } + if (tbase instanceof AgentInfo) { + return AGENT_INFO; + } + if (tbase instanceof AgentStat) { + return AGENT_STAT; + } + if (tbase instanceof SqlMetaData) { + return SQLMETADATA; + } + if (tbase instanceof ApiMetaData) { + return APIMETADATA; + } + if (tbase instanceof Result) { + return RESULT; + } + throw new TException("Unsupported Type" + tbase.getClass()); + } + + public Header headerLookup(TBase tbase) throws TException { + if (tbase == null) { + throw new IllegalArgumentException("tbase must not be null"); + } + short type = typeLookup(tbase); + switch (type) { + case JVM_INFO_THRIFT_DTO: + return JVM_INFO_THRIFT_HEADER; + case REQUEST_DATA_LIST_THRIFT_DTO: + return REQUEST_DATA_LIST_THRIFT_HEADER; + case REQUEST_THRIFT_DTO: + return REQUEST_THRIFT_HEADER; + case SPAN: + return SPAN_HEADER; + case AGENT_INFO: + return AGENT_INFO_HEADER; + case AGENT_STAT: + return AGENT_STAT_HEADER; + case SPANEVENT: + return SPANEVENT_HEADER; + case SPANCHUNK: + return SPANCHUNK_HEADER; + case SQLMETADATA: + return SQLMETADATA_HEADER; + case APIMETADATA: + return APIMETADATA_HEADER; + case RESULT: + return RESULT_HEADER; + } + throw new TException("Unsupported type:" + tbase.getClass()); + } + + private static Header createHeader(short type) { + Header header = new Header(); + header.setType(type); + return header; + } +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/Header.java b/src/main/java/com/nhn/pinpoint/thrift/io/Header.java new file mode 100644 index 000000000..c56886ac7 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/Header.java @@ -0,0 +1,55 @@ +package com.nhn.pinpoint.thrift.io; + +public class Header { + + public static final byte SIGNATURE = (byte) 0xef; + + public static final int HEADER_SIZE = 4; + + private byte signature = SIGNATURE; + private byte version = 0x10; + private short type = 0; + + public Header() { + } + + public Header(byte signature, byte version, short type) { + this.signature = signature; + this.version = version; + this.type = type; + } + + public byte getSignature() { + return signature; + } + + public void setSignature(byte signature) { + this.signature = signature; + } + + public byte getVersion() { + return version; + } + + public void setVersion(byte version) { + this.version = version; + } + + public short getType() { + return type; + } + + public void setType(short type) { + this.type = type; + } + + @Override + public String toString() { + return "Header{" + + "signature=" + signature + + ", version=" + version + + ", type=" + type + + '}'; + } +} + diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseDeserializer.java b/src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseDeserializer.java new file mode 100644 index 000000000..356e3b329 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseDeserializer.java @@ -0,0 +1,110 @@ +package com.nhn.pinpoint.thrift.io; + +import org.apache.thrift.TBase; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TCompactProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.transport.TMemoryInputTransport; + +public class HeaderTBaseDeserializer { + + private final TProtocol protocol_; + private final TMemoryInputTransport trans_; + + private static final TBaseLocator DEFAULT_TBASE_LOCATOR = new DefaultTBaseLocator(); + private final TBaseLocator locator = DEFAULT_TBASE_LOCATOR; + /** + * Create a new TDeserializer that uses the TBinaryProtocol by default. + */ + public HeaderTBaseDeserializer() { +// this(new TBinaryProtocol.Factory()); + this(new TCompactProtocol.Factory()); + } + + /** + * Create a new TDeserializer. It will use the TProtocol specified by the + * factory that is passed in. + * + * @param protocolFactory Factory to create a protocol + */ + public HeaderTBaseDeserializer(TProtocolFactory protocolFactory) { + trans_ = new TMemoryInputTransport(); + protocol_ = protocolFactory.getProtocol(trans_); + } + + /** + * Deserialize the Thrift object from a byte array. + * + * @param bytes The array to read from + */ + public TBase deserialize(byte[] bytes) throws TException { + try { + trans_.reset(bytes); + Header header = readHeader(); + validate(header); + TBase base = locator.tBaseLookup(header.getType()); + base.read(protocol_); + return base; + } finally { + trans_.clear(); + protocol_.reset(); + } + } + + private void validate(Header header) throws TException { + boolean accepted = HeaderUtils.validateSignature(header.getSignature()); + if (!accepted) { + throw new TException("Invalid Signature:" + header); + } + } + + private Header readHeader() throws TException { + byte signature = protocol_.readByte(); + byte version = protocol_.readByte(); + // 프로토콜 변경에 관계 없이 고정 사이즈의 데이터로 인코딩 하도록 변경. + byte type1 = protocol_.readByte(); + byte type2 = protocol_.readByte(); + final short type = bytesToShort(type1, type2); + return new Header(signature, version, type); + } + + private short bytesToShort(final byte byte1, final byte byte2) { + return (short) (((byte1 & 0xff) << 8) | ((byte2 & 0xff))); + } + + /** + * Deserialize the Thrift object from a Java string, using a specified + * character set for decoding. + * + * @param base + * The object to read into + * @param data + * The string to read from + * @param charset + * Valid JVM charset + */ + // public void deserialize(TBase base, String data, String charset) throws + // TException { + // try { + // deserialize(base, data.getBytes(charset)); + // } catch (UnsupportedEncodingException uex) { + // throw new TException("JVM DOES NOT SUPPORT ENCODING: " + charset); + // } finally { + // protocol_.reset(); + // } + // } + + /** + * Deserialize the Thrift object from a Java string, using the default JVM + * charset encoding. + * + * @param base + * The object to read into + * @param data + * The string to read from + */ + // public void fromString(TBase base, String data) throws TException { + // deserialize(base, data.getBytes()); + // } +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializer.java b/src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializer.java new file mode 100644 index 000000000..6e7af30bb --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializer.java @@ -0,0 +1,116 @@ +package com.nhn.pinpoint.thrift.io; + + +import org.apache.thrift.TBase; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TCompactProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.transport.TIOStreamTransport; + +import java.io.UnsupportedEncodingException; + +/** + * Generic utility for easily serializing objects into a byte array or Java + * String. + */ +public class HeaderTBaseSerializer { + + /** + * This is the byte array that data is actually serialized into + */ + // udp 패킷 사이즈에 최대 맞춤. + private final UnsafeByteArrayOutputStream baos_ = new UnsafeByteArrayOutputStream(1024 * 64); + + /** + * This transport wraps that byte array + */ + private final TIOStreamTransport transport_ = new TIOStreamTransport(baos_); + + /** + * Internal protocol used for serializing objects. + */ + private TProtocol protocol_; + + private static final TBaseLocator DEFAULT_TBASE_LOCATOR = new DefaultTBaseLocator(); + + /** + * Create a new TSerializer that uses the TBinaryProtocol by default. + */ + public HeaderTBaseSerializer() { + + this(new TCompactProtocol.Factory(), DEFAULT_TBASE_LOCATOR); + } + + private TBaseLocator locator; + + /** + * Create a new TSerializer. It will use the TProtocol specified by the + * factory that is passed in. + * + * @param protocolFactory Factory to create a protocol + */ + public HeaderTBaseSerializer(TProtocolFactory protocolFactory, TBaseLocator locator) { + protocol_ = protocolFactory.getProtocol(transport_); + this.locator = locator; + } + + /** + * Serialize the Thrift object into a byte array. The process is simple, + * just clear the byte array output, write the object into it, and grab the + * raw bytes. + * + * @param base The object to serialize + * @return Serialized object in byte[] format + */ + public byte[] serialize(TBase base) throws TException { + final Header header = locator.headerLookup(base); + baos_.reset(); + writeHeader(header); + base.write(protocol_); +// return baos_.toByteArray(); + return baos_.getInterBuffer(); + } + + public int getInterBufferSize() { + + return baos_.size(); + } + + private void writeHeader(Header header) throws TException { + protocol_.writeByte(header.getSignature()); + protocol_.writeByte(header.getVersion()); + // 프로토콜 변경에 관계 없이 고정 사이즈의 데이터로 인코딩 하도록 변경. + short type = header.getType(); + protocol_.writeByte(BytesUtils.writeShort1(type)); + protocol_.writeByte(BytesUtils.writeShort2(type)); + } + + + /** + * Serialize the Thrift object into a Java string, using a specified + * character set for encoding. + * + * @param base The object to serialize + * @param charset Valid JVM charset + * @return Serialized object as a String + */ + public String toString(TBase base, String charset) throws TException { + try { + return new String(serialize(base), charset); + } catch (UnsupportedEncodingException uex) { + throw new TException("JVM DOES NOT SUPPORT ENCODING: " + charset); + } + } + + /** + * Serialize the Thrift object into a Java string, using the default JVM + * charset encoding. + * + * @param base The object to serialize + * @return Serialized object as a String + */ + public String toString(TBase base) throws TException { + return new String(serialize(base)); + } +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/HeaderUtils.java b/src/main/java/com/nhn/pinpoint/thrift/io/HeaderUtils.java new file mode 100644 index 000000000..a83fb709b --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/HeaderUtils.java @@ -0,0 +1,8 @@ +package com.nhn.pinpoint.thrift.io; + + +class HeaderUtils { + public static boolean validateSignature(byte signature) { + return Header.SIGNATURE == signature; + } +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/PacketUtils.java b/src/main/java/com/nhn/pinpoint/thrift/io/PacketUtils.java new file mode 100644 index 000000000..619e2bcd2 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/PacketUtils.java @@ -0,0 +1,18 @@ +package com.nhn.pinpoint.thrift.io; + +import java.net.DatagramPacket; +import java.util.Arrays; + +public class PacketUtils { + + public static byte[] sliceData(DatagramPacket packet, int startOffset) { + int packetLength = packet.getLength(); + int packetOffset = packet.getOffset(); + byte[] source = packet.getData(); + return Arrays.copyOfRange(source, packetOffset + startOffset, packetLength); + } + + public static byte[] sliceData(byte[] packet, int startOffset, int length) { + return Arrays.copyOfRange(packet, startOffset, length); + } +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/SafeHeaderTBaseSerializer.java b/src/main/java/com/nhn/pinpoint/thrift/io/SafeHeaderTBaseSerializer.java new file mode 100644 index 000000000..01b81385a --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/SafeHeaderTBaseSerializer.java @@ -0,0 +1,112 @@ +package com.nhn.pinpoint.thrift.io; + +import org.apache.thrift.TBase; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TCompactProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.transport.TIOStreamTransport; + +import java.io.ByteArrayOutputStream; +import java.io.UnsupportedEncodingException; + +/** + * Generic utility for easily serializing objects into a byte array or Java + * String. + */ +public class SafeHeaderTBaseSerializer { + + /** + * This is the byte array that data is actually serialized into + */ + // udp 패킷 사이즈에 최대 맞춤. + private final ByteArrayOutputStream baos_ = new ByteArrayOutputStream(1024 * 4); + + /** + * This transport wraps that byte array + */ + private final TIOStreamTransport transport_ = new TIOStreamTransport(baos_); + + /** + * Internal protocol used for serializing objects. + */ + private TProtocol protocol_; + + /** + * Create a new TSerializer that uses the TBinaryProtocol by default. + */ + public SafeHeaderTBaseSerializer() { + + this(new TCompactProtocol.Factory(), new DefaultTBaseLocator()); + } + + private TBaseLocator locator; + + /** + * Create a new TSerializer. It will use the TProtocol specified by the + * factory that is passed in. + * + * @param protocolFactory Factory to create a protocol + */ + public SafeHeaderTBaseSerializer(TProtocolFactory protocolFactory, TBaseLocator locator) { + protocol_ = protocolFactory.getProtocol(transport_); + this.locator = locator; + } + + /** + * Serialize the Thrift object into a byte array. The process is simple, + * just clear the byte array output, write the object into it, and grab the + * raw bytes. + * + * @param base The object to serialize + * @return Serialized object in byte[] format + */ + public byte[] serialize(TBase base) throws TException { + final Header header = locator.headerLookup(base); + baos_.reset(); + writeHeader(header); + base.write(protocol_); + return baos_.toByteArray(); + } + + public int getInterBufferSize() { + + return baos_.size(); + } + + private void writeHeader(Header header) throws TException { + protocol_.writeByte(header.getSignature()); + protocol_.writeByte(header.getVersion()); + // 프로토콜 변경에 관계 없이 고정 사이즈의 데이터로 인코딩 하도록 변경. + short type = header.getType(); + protocol_.writeByte(BytesUtils.writeShort1(type)); + protocol_.writeByte(BytesUtils.writeShort2(type)); + } + + /** + * Serialize the Thrift object into a Java string, using a specified + * character set for encoding. + * + * @param base The object to serialize + * @param charset Valid JVM charset + * @return Serialized object as a String + */ + public String toString(TBase base, String charset) throws TException { + try { + return new String(serialize(base), charset); + } catch (UnsupportedEncodingException uex) { + throw new TException("JVM DOES NOT SUPPORT ENCODING: " + charset); + } + } + + /** + * Serialize the Thrift object into a Java string, using the default JVM + * charset encoding. + * + * @param base The object to serialize + * @return Serialized object as a String + */ + public String toString(TBase base) throws TException { + return new String(serialize(base)); + } +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/TBaseLocator.java b/src/main/java/com/nhn/pinpoint/thrift/io/TBaseLocator.java new file mode 100644 index 000000000..cfa5443dc --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/TBaseLocator.java @@ -0,0 +1,12 @@ +package com.nhn.pinpoint.thrift.io; + +import org.apache.thrift.TBase; +import org.apache.thrift.TException; + +public interface TBaseLocator { + TBase tBaseLookup(short type) throws TException; + +// short typeLookup(TBase tbase) throws TException; + + Header headerLookup(TBase dto) throws TException; +} diff --git a/src/main/java/com/nhn/pinpoint/thrift/io/UnsafeByteArrayOutputStream.java b/src/main/java/com/nhn/pinpoint/thrift/io/UnsafeByteArrayOutputStream.java new file mode 100644 index 000000000..6e14ff221 --- /dev/null +++ b/src/main/java/com/nhn/pinpoint/thrift/io/UnsafeByteArrayOutputStream.java @@ -0,0 +1,185 @@ +package com.nhn.pinpoint.thrift.io; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.util.Arrays; + +/** + * + */ +public class UnsafeByteArrayOutputStream extends OutputStream { + + /** + * The buffer where data is stored. + */ + protected byte buf[]; + + /** + * The number of valid bytes in the buffer. + */ + protected int count; + + /** + * Creates a new byte array output stream. The buffer capacity is + * initially 32 bytes, though its size increases if necessary. + */ + public UnsafeByteArrayOutputStream() { + this(32); + } + + /** + * Creates a new byte array output stream, with a buffer capacity of + * the specified size, in bytes. + * + * @param size the initial size. + * @throws IllegalArgumentException if size is negative. + */ + public UnsafeByteArrayOutputStream(int size) { + if (size < 0) { + throw new IllegalArgumentException("Negative initial size: " + + size); + } + buf = new byte[size]; + } + + /** + * Writes the specified byte to this byte array output stream. + * + * @param b the byte to be written. + */ + public void write(int b) { + int newcount = count + 1; + if (newcount > buf.length) { + buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount)); + } + buf[count] = (byte) b; + count = newcount; + } + + /** + * Writes len bytes from the specified byte array + * starting at offset off to this byte array output stream. + * + * @param b the data. + * @param off the start offset in the data. + * @param len the number of bytes to write. + */ + public void write(byte b[], int off, int len) { + if ((off < 0) || (off > b.length) || (len < 0) || + ((off + len) > b.length) || ((off + len) < 0)) { + throw new IndexOutOfBoundsException(); + } else if (len == 0) { + return; + } + int newcount = count + len; + if (newcount > buf.length) { + buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount)); + } + System.arraycopy(b, off, buf, count, len); + count = newcount; + } + + /** + * Writes the complete contents of this byte array output stream to + * the specified output stream argument, as if by calling the output + * stream's write method using out.write(buf, 0, count). + * + * @param out the output stream to which to write the data. + * @throws java.io.IOException if an I/O error occurs. + */ + public void writeTo(OutputStream out) throws IOException { + out.write(buf, 0, count); + } + + /** + * Resets the count field of this byte array output + * stream to zero, so that all currently accumulated output in the + * output stream is discarded. The output stream can be used again, + * reusing the already allocated buffer space. + * + * @see java.io.ByteArrayInputStream#count + */ + public void reset() { + count = 0; + } + + /** + * Creates a newly allocated byte array. Its size is the current + * size of this output stream and the valid contents of the buffer + * have been copied into it. + * + * @return the current contents of this output stream, as a byte array. + * @see java.io.ByteArrayOutputStream#size() + */ + public byte toByteArray()[] { + return Arrays.copyOf(buf, count); + } + + public byte[] getInterBuffer() { + return buf; + } + + /** + * Returns the current size of the buffer. + * + * @return the value of the count field, which is the number + * of valid bytes in this output stream. + * @see java.io.ByteArrayOutputStream#count + */ + public int size() { + return count; + } + + /** + * Converts the buffer's contents into a string decoding bytes using the + * platform's default character set. The length of the new String + * is a function of the character set, and hence may not be equal to the + * size of the buffer. + *

+ *

This method always replaces malformed-input and unmappable-character + * sequences with the default replacement string for the platform's + * default character set. The {@linkplain java.nio.charset.CharsetDecoder} + * class should be used when more control over the decoding process is + * required. + * + * @return String decoded from the buffer's contents. + * @since JDK1.1 + */ + public String toString() { + return new String(buf, 0, count); + } + + /** + * Converts the buffer's contents into a string by decoding the bytes using + * the specified {@link java.nio.charset.Charset charsetName}. The length of + * the new String is a function of the charset, and hence may not be + * equal to the length of the byte array. + *

+ *

This method always replaces malformed-input and unmappable-character + * sequences with this charset's default replacement string. The {@link + * java.nio.charset.CharsetDecoder} class should be used when more control + * over the decoding process is required. + * + * @param charsetName the name of a supported + * {@linkplain java.nio.charset.Charset charset} + * @return String decoded from the buffer's contents. + * @throws java.io.UnsupportedEncodingException + * If the named charset is not supported + * @since JDK1.1 + */ + public String toString(String charsetName) + throws UnsupportedEncodingException { + return new String(buf, 0, count, charsetName); + } + + + /** + * Closing a ByteArrayOutputStream has no effect. The methods in + * this class can be called after the stream has been closed without + * generating an IOException. + *

+ */ + public void close() throws IOException { + } +} diff --git a/src/main/thrift/Pinpoint.thrift b/src/main/thrift/Pinpoint.thrift new file mode 100644 index 000000000..6e30da912 --- /dev/null +++ b/src/main/thrift/Pinpoint.thrift @@ -0,0 +1,115 @@ +namespace java com.nhn.pinpoint.thrift.dto + +struct AgentInfo { + 1: string hostname + 2: string ip + 3: string ports + 4: string agentId + 5: string applicationName + 6: i16 serviceType + 7: bool isAlive + 8: i64 timestamp + 9: i16 identifier +} + +struct StatWithCmsCollector { + 1: string agentId + 2: i64 timestamp + 3: i64 jvmMemoryTotalInit + 4: i64 jvmMemoryTotalUsed + 5: i64 jvmMemoryTotalCommitted + 6: i64 jvmMemoryTotalMax + 7: i64 jvmMemoryHeapInit + 8: i64 jvmMemoryHeapUsed + 9: i64 jvmMemoryHeapCommitted + 10: i64 jvmMemoryHeapMax + 11: i64 jvmMemoryNonHeapInit + 12: i64 jvmMemoryNonHeapUsed + 13: i64 jvmMemoryNonHeapCommitted + 14: i64 jvmMemoryNonHeapMax + 15: i64 jvmGcParNewCount + 16: i64 jvmGcParNewTime + 17: i64 jvmGcCmsCount + 18: i64 jvmGcTime + 200: optional string metadata +} + +struct StatWithG1Collector { + 1: string agentId + 2: i64 timestamp +} + +struct StatWithParallelCollector { + 1: string agentId + 2: i64 timestamp +} + +union AgentStat { + 1: StatWithCmsCollector cms + 2: StatWithG1Collector g1 + 3: StatWithParallelCollector parallel +} + +struct JVMInfoThriftDTO { + 1: string agentId, + 2: i64 dataTime, + 3: i32 activeThreadCount, + 4: optional i64 gc1Count, + 5: optional i64 gc1Time, + 6: optional i64 gc2Count, + 7: optional i64 gc2Time, + 8: i64 heapUsed, + 9: i64 heapCommitted, + 10: i64 nonHeapUsed, + 11: i64 nonHeapCommitted, + 12: optional double processCPUTime +} + +struct RequestDataThriftDTO { + 1: i32 dataType, + 2: i64 dataTime, + 3: optional i32 dataHashCode, + 4: optional string dataString, + 5: optional string extraData1, + 6: optional string extraData2, + 7: optional string extraData3, + 8: optional i32 extraInt1, + 9: optional i32 extraInt2, + 10: optional i32 extraInt3, + 11: optional i64 extraLong1, + 12: optional i64 extraLong2, + 13: optional i64 extraLong3 +} + +struct RequestDataListThriftDTO { + 1: string agentId, + 2: i32 requestHashCode, + 3: list requestDataList +} + +struct RequestThriftDTO { + 1: string agentId, + 2: i32 requestHashCode, + 3: i32 dataType, + 4: i64 dataTime, + 5: i64 threadCPUTime, + 6: i64 threadUserTime, + 7: optional string requestID, + 8: optional string requestURL, + 9: optional string clientIP, + 10: optional string extraData1, + 11: optional string extraData2, + 12: optional string extraData3, + 13: optional i32 extraInt1, + 14: optional i32 extraInt2, + 15: optional i32 extraInt3, + 16: optional i64 extraLong1, + 17: optional i64 extraLong2, + 18: optional i64 extraLong3 +} + +struct Result { + 1: bool success + 2: optional string message +} + diff --git a/src/main/thrift/Trace.thrift b/src/main/thrift/Trace.thrift new file mode 100644 index 000000000..1550f8e8d --- /dev/null +++ b/src/main/thrift/Trace.thrift @@ -0,0 +1,122 @@ +namespace java com.nhn.pinpoint.thrift.dto + +struct Annotation { + 1: i32 key, + + 2: optional string stringValue + 3: optional bool boolValue; + 4: optional i32 intValue; + 5: optional i64 longValue; + 6: optional i16 shortValue + 7: optional double doubleValue; + 8: optional binary binaryValue; + 9: optional byte byteValue; +} + +struct AgentKey { + 1: string agentId; + 2: optional string applicationName; + 3: i64 agentStartTime; +} + +struct SpanEvent { + // spanEvent의 agentKey는 매우 특별한 경우에만 생성되므로 필드사이즈를 줄이기 위해 별도 객체로 분리. + 1: optional AgentKey agentKey; + + 17: optional i16 parentServiceType + 18: optional string parentEndPoint + + + 4: optional i64 mostTraceId + 5: optional i64 leastTraceId + + 6: optional i32 spanId + 7: i16 sequence + + 8: i32 startElapsed + 9: i32 endElapsed + + 10: optional string rpc + 12: i16 serviceType + 13: optional string endPoint + + 14: list annotations + + 15: optional i32 depth + 16: optional i32 nextSpanId + + 20: optional string destinationId + // address주소가 1개일 경우 + 21: optional list destinationAddress; + // address주소가 2개이상일 경우 + //15: optional list destinationAddressList; +} + +struct Span { + + 1: string agentId + 2: string applicationName + 3: i64 agentStartTime + + 4: i64 mostTraceId + 5: i64 leastTraceId + + 6: i32 spanId + 7: optional i32 parentSpanId = -1 + + 8: i64 startTime + 9: i32 elapsed + + 10: optional string rpc + + 12: i16 serviceType + 13: optional string endPoint + 14: optional string remoteAddr + + 15: list annotations + 16: optional i16 flag = 0 + + 17: optional i32 err + + 18: optional list spanEventList + + 19: optional string parentApplicationName + 20: optional i16 parentApplicationType + 21: optional string acceptorHost +} + +struct SpanChunk { + 1: string agentId + 2: string applicationName + 3: i64 agentStartTime + + 4: i16 serviceType + + 5: i64 mostTraceId + 6: i64 leastTraceId + + 7: i32 spanId + + 8: optional string endPoint + + 9: list spanEventList +} + +struct SqlMetaData { + + 1: string agentId + 2: i64 agentStartTime + + 4: i32 hashCode + 5: string sql; +} + + +struct ApiMetaData { + 1: string agentId + 2: i64 agentStartTime + + 4: i32 apiId, + 5: string apiInfo, + 6: optional i32 line, +} \ No newline at end of file diff --git a/src/test/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializerTest.java b/src/test/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializerTest.java new file mode 100644 index 000000000..f8270d014 --- /dev/null +++ b/src/test/java/com/nhn/pinpoint/thrift/io/HeaderTBaseSerializerTest.java @@ -0,0 +1,44 @@ +package com.nhn.pinpoint.thrift.io; + +import com.nhn.pinpoint.thrift.dto.JVMInfoThriftDTO; +import org.junit.Assert; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; + +public class HeaderTBaseSerializerTest { + private final Logger logger = LoggerFactory.getLogger(HeaderTBaseSerializerTest.class.getName()); + + + @Test + public void testSerialize() throws Exception { + HeaderTBaseSerializer serializer = new HeaderTBaseSerializer(); + + Header header = new Header(); + // 10 을 JVMInfoThriftDTO type + header.setType((short) 10); + + JVMInfoThriftDTO jvmInfoThriftDTO = new JVMInfoThriftDTO(); + int activeThreadount = 10; + jvmInfoThriftDTO.setActiveThreadCount(activeThreadount); + String agentId = "agentId"; + jvmInfoThriftDTO.setAgentId(agentId); + byte[] serialize = serializer.serialize(jvmInfoThriftDTO); + dump(serialize); + + HeaderTBaseDeserializer deserializer = new HeaderTBaseDeserializer(); + TBaseLocator locator = new DefaultTBaseLocator(); + JVMInfoThriftDTO deserialize = (JVMInfoThriftDTO) deserializer.deserialize(serialize); + logger.info("deserialize:" + deserialize.getClass()); + + Assert.assertEquals(deserialize.getActiveThreadCount(), activeThreadount); + Assert.assertEquals(deserialize.getAgentId(), agentId); + } + + public void dump(byte[] data) { + String s = Arrays.toString(data); + logger.info("size:"+ data.length + " data:" + s); + } +} diff --git a/src/test/java/com/nhn/pinpoint/thrift/io/HeaderTest.java b/src/test/java/com/nhn/pinpoint/thrift/io/HeaderTest.java new file mode 100644 index 000000000..009bfc3f9 --- /dev/null +++ b/src/test/java/com/nhn/pinpoint/thrift/io/HeaderTest.java @@ -0,0 +1,18 @@ +package com.nhn.pinpoint.thrift.io; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class HeaderTest { + + private final Logger logger = LoggerFactory.getLogger(Header.class.getName()); + + + public void testGetSignature() throws Exception { + Header header = new Header(); + byte signature = header.getSignature(); + short type = header.getType(); + byte version = header.getVersion(); + } +} diff --git a/src/test/java/com/nhn/pinpoint/thrift/io/HeaderUtilsTest.java b/src/test/java/com/nhn/pinpoint/thrift/io/HeaderUtilsTest.java new file mode 100644 index 000000000..999f266be --- /dev/null +++ b/src/test/java/com/nhn/pinpoint/thrift/io/HeaderUtilsTest.java @@ -0,0 +1,26 @@ +package com.nhn.pinpoint.thrift.io; + +import org.apache.thrift.TException; +import org.junit.Assert; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class HeaderUtilsTest { + + private final Logger logger = LoggerFactory.getLogger(this.getClass().getName()); + + @Test + public void validateSignature() throws TException { + Header header = new Header(); + Assert.assertTrue(HeaderUtils.validateSignature(header.getSignature())); + + + Header error = new Header((byte) 0x11, (byte) 0x20, (short) 1); + Assert.assertTrue(!HeaderUtils.validateSignature(error.getSignature())); + + + logger.info(header.toString()); + } + +} diff --git a/src/test/java/com/nhn/pinpoint/thrift/io/PacketUtilsTest.java b/src/test/java/com/nhn/pinpoint/thrift/io/PacketUtilsTest.java new file mode 100644 index 000000000..619470b84 --- /dev/null +++ b/src/test/java/com/nhn/pinpoint/thrift/io/PacketUtilsTest.java @@ -0,0 +1,45 @@ +package com.nhn.pinpoint.thrift.io; + + +import org.junit.Assert; +import org.junit.Test; + +import java.net.DatagramPacket; +import java.util.Arrays; + +public class PacketUtilsTest { + @Test + public void testSliceData1() throws Exception { + DatagramPacket packet = createPacket(10); + packet.setLength(5); + + + byte[] bytes1 = PacketUtils.sliceData(packet, 0); + Assert.assertEquals(bytes1.length, 5); + } + + @Test + public void testSliceData2() throws Exception { + DatagramPacket packet = createPacket(10); + Arrays.fill(packet.getData(), 1, 8, (byte)'a'); + + byte[] bytes1 = PacketUtils.sliceData(packet, 0); + Assert.assertArrayEquals(bytes1, packet.getData()); + } + + + @Test + public void testSliceData3() throws Exception { + DatagramPacket packet = createPacket(10); + Arrays.fill(packet.getData(), 1, 8, (byte)'a'); + packet.setLength(4); + + byte[] bytes1 = PacketUtils.sliceData(packet, 0); + Assert.assertArrayEquals(bytes1, Arrays.copyOf(packet.getData(), 4)); + } + + private DatagramPacket createPacket(int size) { + byte[] bytes = new byte[size]; + return new DatagramPacket(bytes, 0, bytes.length); + } +} diff --git a/thrift.properties b/thrift.properties new file mode 100644 index 000000000..3099003dc --- /dev/null +++ b/thrift.properties @@ -0,0 +1,3 @@ +#windows +thrift.executable.property=${basedir}/src/compiler/thrift-0.9.1 +#thrift.executable.property=/Users/netspider/Documents/workspace_pinpoint/pinpoint-testbed/thrift-0.8.0/compiler/cpp/thrift