[강운덕] [LUCYSUS-1897] thrift 프로젝트를 잘못 commit하여 위치 이동.

git-svn-id: http://svn.bds.nhncorp.com/pe/pinpoint-thrift/trunk@2274 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2013-09-03 08:02:31 +00:00
parent 000cdba956
commit f175dec268
34 changed files with 20634 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -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<AgentKey, AgentKey._Fields>, java.io.Serializable, Cloneable, Comparable<AgentKey> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<AgentKey> {
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<AgentKey> {
@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);
}
}
}
}
@@ -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<AgentStat, AgentStat._Fields> {
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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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);
}
}
}
File diff suppressed because it is too large Load Diff
@@ -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<ApiMetaData, ApiMetaData._Fields>, java.io.Serializable, Cloneable, Comparable<ApiMetaData> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<ApiMetaData> {
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<ApiMetaData> {
@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);
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -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<RequestDataListThriftDTO, RequestDataListThriftDTO._Fields>, java.io.Serializable, Cloneable, Comparable<RequestDataListThriftDTO> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new RequestDataListThriftDTOStandardSchemeFactory());
schemes.put(TupleScheme.class, new RequestDataListThriftDTOTupleSchemeFactory());
}
private String agentId; // required
private int requestHashCode; // required
private List<RequestDataThriftDTO> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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<RequestDataThriftDTO> requestDataList)
{
this();
this.agentId = agentId;
this.requestHashCode = requestHashCode;
setRequestHashCodeIsSet(true);
this.requestDataList = requestDataList;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public RequestDataListThriftDTO(RequestDataListThriftDTO other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetAgentId()) {
this.agentId = other.agentId;
}
this.requestHashCode = other.requestHashCode;
if (other.isSetRequestDataList()) {
List<RequestDataThriftDTO> __this__requestDataList = new ArrayList<RequestDataThriftDTO>(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<RequestDataThriftDTO> getRequestDataListIterator() {
return (this.requestDataList == null) ? null : this.requestDataList.iterator();
}
public void addToRequestDataList(RequestDataThriftDTO elem) {
if (this.requestDataList == null) {
this.requestDataList = new ArrayList<RequestDataThriftDTO>();
}
this.requestDataList.add(elem);
}
public List<RequestDataThriftDTO> getRequestDataList() {
return this.requestDataList;
}
public void setRequestDataList(List<RequestDataThriftDTO> 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<RequestDataThriftDTO>)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<RequestDataListThriftDTO> {
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<RequestDataThriftDTO>(_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<RequestDataListThriftDTO> {
@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<RequestDataThriftDTO>(_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);
}
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -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<Result, Result._Fields>, java.io.Serializable, Cloneable, Comparable<Result> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<Result> {
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<Result> {
@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);
}
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -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<SqlMetaData, SqlMetaData._Fields>, java.io.Serializable, Cloneable, Comparable<SqlMetaData> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<SqlMetaData> {
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<SqlMetaData> {
@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);
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -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<StatWithG1Collector, StatWithG1Collector._Fields>, java.io.Serializable, Cloneable, Comparable<StatWithG1Collector> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<StatWithG1Collector> {
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<StatWithG1Collector> {
@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);
}
}
}
}
@@ -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<StatWithParallelCollector, StatWithParallelCollector._Fields>, java.io.Serializable, Cloneable, Comparable<StatWithParallelCollector> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<StatWithParallelCollector> {
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<StatWithParallelCollector> {
@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);
}
}
}
}
@@ -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);
}
}
@@ -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;
}
}
@@ -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 +
'}';
}
}
@@ -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());
// }
}
@@ -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));
}
}
@@ -0,0 +1,8 @@
package com.nhn.pinpoint.thrift.io;
class HeaderUtils {
public static boolean validateSignature(byte signature) {
return Header.SIGNATURE == signature;
}
}
@@ -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);
}
}
@@ -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));
}
}
@@ -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;
}
@@ -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 <code>len</code> bytes from the specified byte array
* starting at offset <code>off</code> 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 <code>out.write(buf, 0, count)</code>.
*
* @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 <code>count</code> 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 <code>count</code> 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 <tt>String</tt>
* is a function of the character set, and hence may not be equal to the
* size of the buffer.
* <p/>
* <p> 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 <tt>String</tt> is a function of the charset, and hence may not be
* equal to the length of the byte array.
* <p/>
* <p> 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 </code>charset<code>}
* @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 <tt>ByteArrayOutputStream</tt> has no effect. The methods in
* this class can be called after the stream has been closed without
* generating an <tt>IOException</tt>.
* <p/>
*/
public void close() throws IOException {
}
}
+115
View File
@@ -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<RequestDataThriftDTO> 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
}
+122
View File
@@ -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<Annotation> annotations
15: optional i32 depth
16: optional i32 nextSpanId
20: optional string destinationId
// address주소가 1개일 경우
21: optional list<string> destinationAddress;
// address주소가 2개이상일 경우
//15: optional list<string> 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<Annotation> annotations
16: optional i16 flag = 0
17: optional i32 err
18: optional list<SpanEvent> 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<SpanEvent> 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,
}
@@ -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);
}
}
@@ -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();
}
}
@@ -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());
}
}
@@ -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);
}
}
+3
View File
@@ -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