/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.xiaomi.infra.galaxy.emq.thrift; import libthrift091.scheme.IScheme; import libthrift091.scheme.SchemeFactory; import libthrift091.scheme.StandardScheme; import libthrift091.scheme.TupleScheme; import libthrift091.protocol.TTupleProtocol; import libthrift091.protocol.TProtocolException; import libthrift091.EncodingUtils; import libthrift091.TException; import libthrift091.async.AsyncMethodCallback; import libthrift091.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-21") public class QueryMetricRequest implements libthrift091.TBase<QueryMetricRequest, QueryMetricRequest._Fields>, java.io.Serializable, Cloneable, Comparable<QueryMetricRequest> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("QueryMetricRequest"); private static final libthrift091.protocol.TField QUEUE_NAME_FIELD_DESC = new libthrift091.protocol.TField("queueName", libthrift091.protocol.TType.STRING, (short)1); private static final libthrift091.protocol.TField START_TIME_FIELD_DESC = new libthrift091.protocol.TField("startTime", libthrift091.protocol.TType.I64, (short)2); private static final libthrift091.protocol.TField END_TIME_FIELD_DESC = new libthrift091.protocol.TField("endTime", libthrift091.protocol.TType.I64, (short)3); private static final libthrift091.protocol.TField METRICS_FIELD_DESC = new libthrift091.protocol.TField("metrics", libthrift091.protocol.TType.STRING, (short)4); private static final libthrift091.protocol.TField TAGS_FIELD_DESC = new libthrift091.protocol.TField("tags", libthrift091.protocol.TType.MAP, (short)5); private static final libthrift091.protocol.TField AGGREGATOR_FIELD_DESC = new libthrift091.protocol.TField("aggregator", libthrift091.protocol.TType.STRING, (short)6); private static final libthrift091.protocol.TField DOWNSAMPLE_AGGREGATOR_FIELD_DESC = new libthrift091.protocol.TField("downsampleAggregator", libthrift091.protocol.TType.STRING, (short)7); private static final libthrift091.protocol.TField DOWNSAMPLE_INTERVAL_FIELD_DESC = new libthrift091.protocol.TField("downsampleInterval", libthrift091.protocol.TType.I32, (short)8); private static final libthrift091.protocol.TField DOWNSAMPLE_TIME_UNIT_FIELD_DESC = new libthrift091.protocol.TField("downsampleTimeUnit", libthrift091.protocol.TType.STRING, (short)9); private static final libthrift091.protocol.TField CAL_RATE_FIELD_DESC = new libthrift091.protocol.TField("calRate", libthrift091.protocol.TType.BOOL, (short)10); private static final libthrift091.protocol.TField TAG_NAME_FIELD_DESC = new libthrift091.protocol.TField("tagName", libthrift091.protocol.TType.STRING, (short)11); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new QueryMetricRequestStandardSchemeFactory()); schemes.put(TupleScheme.class, new QueryMetricRequestTupleSchemeFactory()); } public String queueName; // optional public long startTime; // optional public long endTime; // optional /** * metric name * */ public String metrics; // optional /** * tags, reference to opentsdb, * e.g. <"type", ""> * */ public Map<String,String> tags; // optional /** * data aggregator, reference to opentsdb, * e.g. max, avg, min * */ public String aggregator; // optional /** * similar to aggregator above * */ public String downsampleAggregator; // optional public int downsampleInterval; // optional /** * downsample interval unit, reference to opentsdb, * e.g. ms(milliseconds), s(seconds), d(day) * */ public String downsampleTimeUnit; // optional public boolean calRate; // optional public String tagName; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { QUEUE_NAME((short)1, "queueName"), START_TIME((short)2, "startTime"), END_TIME((short)3, "endTime"), /** * metric name * */ METRICS((short)4, "metrics"), /** * tags, reference to opentsdb, * e.g. <"type", ""> * */ TAGS((short)5, "tags"), /** * data aggregator, reference to opentsdb, * e.g. max, avg, min * */ AGGREGATOR((short)6, "aggregator"), /** * similar to aggregator above * */ DOWNSAMPLE_AGGREGATOR((short)7, "downsampleAggregator"), DOWNSAMPLE_INTERVAL((short)8, "downsampleInterval"), /** * downsample interval unit, reference to opentsdb, * e.g. ms(milliseconds), s(seconds), d(day) * */ DOWNSAMPLE_TIME_UNIT((short)9, "downsampleTimeUnit"), CAL_RATE((short)10, "calRate"), TAG_NAME((short)11, "tagName"); 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: // QUEUE_NAME return QUEUE_NAME; case 2: // START_TIME return START_TIME; case 3: // END_TIME return END_TIME; case 4: // METRICS return METRICS; case 5: // TAGS return TAGS; case 6: // AGGREGATOR return AGGREGATOR; case 7: // DOWNSAMPLE_AGGREGATOR return DOWNSAMPLE_AGGREGATOR; case 8: // DOWNSAMPLE_INTERVAL return DOWNSAMPLE_INTERVAL; case 9: // DOWNSAMPLE_TIME_UNIT return DOWNSAMPLE_TIME_UNIT; case 10: // CAL_RATE return CAL_RATE; case 11: // TAG_NAME return TAG_NAME; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __STARTTIME_ISSET_ID = 0; private static final int __ENDTIME_ISSET_ID = 1; private static final int __DOWNSAMPLEINTERVAL_ISSET_ID = 2; private static final int __CALRATE_ISSET_ID = 3; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.QUEUE_NAME,_Fields.START_TIME,_Fields.END_TIME,_Fields.METRICS,_Fields.TAGS,_Fields.AGGREGATOR,_Fields.DOWNSAMPLE_AGGREGATOR,_Fields.DOWNSAMPLE_INTERVAL,_Fields.DOWNSAMPLE_TIME_UNIT,_Fields.CAL_RATE,_Fields.TAG_NAME}; public static final Map<_Fields, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.QUEUE_NAME, new libthrift091.meta_data.FieldMetaData("queueName", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); tmpMap.put(_Fields.START_TIME, new libthrift091.meta_data.FieldMetaData("startTime", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64))); tmpMap.put(_Fields.END_TIME, new libthrift091.meta_data.FieldMetaData("endTime", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64))); tmpMap.put(_Fields.METRICS, new libthrift091.meta_data.FieldMetaData("metrics", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); tmpMap.put(_Fields.TAGS, new libthrift091.meta_data.FieldMetaData("tags", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.MapMetaData(libthrift091.protocol.TType.MAP, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING), new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)))); tmpMap.put(_Fields.AGGREGATOR, new libthrift091.meta_data.FieldMetaData("aggregator", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); tmpMap.put(_Fields.DOWNSAMPLE_AGGREGATOR, new libthrift091.meta_data.FieldMetaData("downsampleAggregator", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); tmpMap.put(_Fields.DOWNSAMPLE_INTERVAL, new libthrift091.meta_data.FieldMetaData("downsampleInterval", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.DOWNSAMPLE_TIME_UNIT, new libthrift091.meta_data.FieldMetaData("downsampleTimeUnit", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); tmpMap.put(_Fields.CAL_RATE, new libthrift091.meta_data.FieldMetaData("calRate", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.BOOL))); tmpMap.put(_Fields.TAG_NAME, new libthrift091.meta_data.FieldMetaData("tagName", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(QueryMetricRequest.class, metaDataMap); } public QueryMetricRequest() { } /** * Performs a deep copy on <i>other</i>. */ public QueryMetricRequest(QueryMetricRequest other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetQueueName()) { this.queueName = other.queueName; } this.startTime = other.startTime; this.endTime = other.endTime; if (other.isSetMetrics()) { this.metrics = other.metrics; } if (other.isSetTags()) { Map<String,String> __this__tags = new HashMap<String,String>(other.tags); this.tags = __this__tags; } if (other.isSetAggregator()) { this.aggregator = other.aggregator; } if (other.isSetDownsampleAggregator()) { this.downsampleAggregator = other.downsampleAggregator; } this.downsampleInterval = other.downsampleInterval; if (other.isSetDownsampleTimeUnit()) { this.downsampleTimeUnit = other.downsampleTimeUnit; } this.calRate = other.calRate; if (other.isSetTagName()) { this.tagName = other.tagName; } } public QueryMetricRequest deepCopy() { return new QueryMetricRequest(this); } @Override public void clear() { this.queueName = null; setStartTimeIsSet(false); this.startTime = 0; setEndTimeIsSet(false); this.endTime = 0; this.metrics = null; this.tags = null; this.aggregator = null; this.downsampleAggregator = null; setDownsampleIntervalIsSet(false); this.downsampleInterval = 0; this.downsampleTimeUnit = null; setCalRateIsSet(false); this.calRate = false; this.tagName = null; } public String getQueueName() { return this.queueName; } public QueryMetricRequest setQueueName(String queueName) { this.queueName = queueName; return this; } public void unsetQueueName() { this.queueName = null; } /** Returns true if field queueName is set (has been assigned a value) and false otherwise */ public boolean isSetQueueName() { return this.queueName != null; } public void setQueueNameIsSet(boolean value) { if (!value) { this.queueName = null; } } public long getStartTime() { return this.startTime; } public QueryMetricRequest setStartTime(long startTime) { this.startTime = startTime; setStartTimeIsSet(true); return this; } public void unsetStartTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); } /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ public boolean isSetStartTime() { return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); } public void setStartTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); } public long getEndTime() { return this.endTime; } public QueryMetricRequest setEndTime(long endTime) { this.endTime = endTime; setEndTimeIsSet(true); return this; } public void unsetEndTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID); } /** Returns true if field endTime is set (has been assigned a value) and false otherwise */ public boolean isSetEndTime() { return EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID); } public void setEndTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value); } /** * metric name * */ public String getMetrics() { return this.metrics; } /** * metric name * */ public QueryMetricRequest setMetrics(String metrics) { this.metrics = metrics; return this; } public void unsetMetrics() { this.metrics = null; } /** Returns true if field metrics is set (has been assigned a value) and false otherwise */ public boolean isSetMetrics() { return this.metrics != null; } public void setMetricsIsSet(boolean value) { if (!value) { this.metrics = null; } } public int getTagsSize() { return (this.tags == null) ? 0 : this.tags.size(); } public void putToTags(String key, String val) { if (this.tags == null) { this.tags = new HashMap<String,String>(); } this.tags.put(key, val); } /** * tags, reference to opentsdb, * e.g. <"type", ""> * */ public Map<String,String> getTags() { return this.tags; } /** * tags, reference to opentsdb, * e.g. <"type", ""> * */ public QueryMetricRequest setTags(Map<String,String> tags) { this.tags = tags; return this; } public void unsetTags() { this.tags = null; } /** Returns true if field tags is set (has been assigned a value) and false otherwise */ public boolean isSetTags() { return this.tags != null; } public void setTagsIsSet(boolean value) { if (!value) { this.tags = null; } } /** * data aggregator, reference to opentsdb, * e.g. max, avg, min * */ public String getAggregator() { return this.aggregator; } /** * data aggregator, reference to opentsdb, * e.g. max, avg, min * */ public QueryMetricRequest setAggregator(String aggregator) { this.aggregator = aggregator; return this; } public void unsetAggregator() { this.aggregator = null; } /** Returns true if field aggregator is set (has been assigned a value) and false otherwise */ public boolean isSetAggregator() { return this.aggregator != null; } public void setAggregatorIsSet(boolean value) { if (!value) { this.aggregator = null; } } /** * similar to aggregator above * */ public String getDownsampleAggregator() { return this.downsampleAggregator; } /** * similar to aggregator above * */ public QueryMetricRequest setDownsampleAggregator(String downsampleAggregator) { this.downsampleAggregator = downsampleAggregator; return this; } public void unsetDownsampleAggregator() { this.downsampleAggregator = null; } /** Returns true if field downsampleAggregator is set (has been assigned a value) and false otherwise */ public boolean isSetDownsampleAggregator() { return this.downsampleAggregator != null; } public void setDownsampleAggregatorIsSet(boolean value) { if (!value) { this.downsampleAggregator = null; } } public int getDownsampleInterval() { return this.downsampleInterval; } public QueryMetricRequest setDownsampleInterval(int downsampleInterval) { this.downsampleInterval = downsampleInterval; setDownsampleIntervalIsSet(true); return this; } public void unsetDownsampleInterval() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DOWNSAMPLEINTERVAL_ISSET_ID); } /** Returns true if field downsampleInterval is set (has been assigned a value) and false otherwise */ public boolean isSetDownsampleInterval() { return EncodingUtils.testBit(__isset_bitfield, __DOWNSAMPLEINTERVAL_ISSET_ID); } public void setDownsampleIntervalIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DOWNSAMPLEINTERVAL_ISSET_ID, value); } /** * downsample interval unit, reference to opentsdb, * e.g. ms(milliseconds), s(seconds), d(day) * */ public String getDownsampleTimeUnit() { return this.downsampleTimeUnit; } /** * downsample interval unit, reference to opentsdb, * e.g. ms(milliseconds), s(seconds), d(day) * */ public QueryMetricRequest setDownsampleTimeUnit(String downsampleTimeUnit) { this.downsampleTimeUnit = downsampleTimeUnit; return this; } public void unsetDownsampleTimeUnit() { this.downsampleTimeUnit = null; } /** Returns true if field downsampleTimeUnit is set (has been assigned a value) and false otherwise */ public boolean isSetDownsampleTimeUnit() { return this.downsampleTimeUnit != null; } public void setDownsampleTimeUnitIsSet(boolean value) { if (!value) { this.downsampleTimeUnit = null; } } public boolean isCalRate() { return this.calRate; } public QueryMetricRequest setCalRate(boolean calRate) { this.calRate = calRate; setCalRateIsSet(true); return this; } public void unsetCalRate() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CALRATE_ISSET_ID); } /** Returns true if field calRate is set (has been assigned a value) and false otherwise */ public boolean isSetCalRate() { return EncodingUtils.testBit(__isset_bitfield, __CALRATE_ISSET_ID); } public void setCalRateIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CALRATE_ISSET_ID, value); } public String getTagName() { return this.tagName; } public QueryMetricRequest setTagName(String tagName) { this.tagName = tagName; return this; } public void unsetTagName() { this.tagName = null; } /** Returns true if field tagName is set (has been assigned a value) and false otherwise */ public boolean isSetTagName() { return this.tagName != null; } public void setTagNameIsSet(boolean value) { if (!value) { this.tagName = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case QUEUE_NAME: if (value == null) { unsetQueueName(); } else { setQueueName((String)value); } break; case START_TIME: if (value == null) { unsetStartTime(); } else { setStartTime((Long)value); } break; case END_TIME: if (value == null) { unsetEndTime(); } else { setEndTime((Long)value); } break; case METRICS: if (value == null) { unsetMetrics(); } else { setMetrics((String)value); } break; case TAGS: if (value == null) { unsetTags(); } else { setTags((Map<String,String>)value); } break; case AGGREGATOR: if (value == null) { unsetAggregator(); } else { setAggregator((String)value); } break; case DOWNSAMPLE_AGGREGATOR: if (value == null) { unsetDownsampleAggregator(); } else { setDownsampleAggregator((String)value); } break; case DOWNSAMPLE_INTERVAL: if (value == null) { unsetDownsampleInterval(); } else { setDownsampleInterval((Integer)value); } break; case DOWNSAMPLE_TIME_UNIT: if (value == null) { unsetDownsampleTimeUnit(); } else { setDownsampleTimeUnit((String)value); } break; case CAL_RATE: if (value == null) { unsetCalRate(); } else { setCalRate((Boolean)value); } break; case TAG_NAME: if (value == null) { unsetTagName(); } else { setTagName((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case QUEUE_NAME: return getQueueName(); case START_TIME: return Long.valueOf(getStartTime()); case END_TIME: return Long.valueOf(getEndTime()); case METRICS: return getMetrics(); case TAGS: return getTags(); case AGGREGATOR: return getAggregator(); case DOWNSAMPLE_AGGREGATOR: return getDownsampleAggregator(); case DOWNSAMPLE_INTERVAL: return Integer.valueOf(getDownsampleInterval()); case DOWNSAMPLE_TIME_UNIT: return getDownsampleTimeUnit(); case CAL_RATE: return Boolean.valueOf(isCalRate()); case TAG_NAME: return getTagName(); } 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 QUEUE_NAME: return isSetQueueName(); case START_TIME: return isSetStartTime(); case END_TIME: return isSetEndTime(); case METRICS: return isSetMetrics(); case TAGS: return isSetTags(); case AGGREGATOR: return isSetAggregator(); case DOWNSAMPLE_AGGREGATOR: return isSetDownsampleAggregator(); case DOWNSAMPLE_INTERVAL: return isSetDownsampleInterval(); case DOWNSAMPLE_TIME_UNIT: return isSetDownsampleTimeUnit(); case CAL_RATE: return isSetCalRate(); case TAG_NAME: return isSetTagName(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof QueryMetricRequest) return this.equals((QueryMetricRequest)that); return false; } public boolean equals(QueryMetricRequest that) { if (that == null) return false; boolean this_present_queueName = true && this.isSetQueueName(); boolean that_present_queueName = true && that.isSetQueueName(); if (this_present_queueName || that_present_queueName) { if (!(this_present_queueName && that_present_queueName)) return false; if (!this.queueName.equals(that.queueName)) return false; } boolean this_present_startTime = true && this.isSetStartTime(); boolean that_present_startTime = true && that.isSetStartTime(); if (this_present_startTime || that_present_startTime) { if (!(this_present_startTime && that_present_startTime)) return false; if (this.startTime != that.startTime) return false; } boolean this_present_endTime = true && this.isSetEndTime(); boolean that_present_endTime = true && that.isSetEndTime(); if (this_present_endTime || that_present_endTime) { if (!(this_present_endTime && that_present_endTime)) return false; if (this.endTime != that.endTime) return false; } boolean this_present_metrics = true && this.isSetMetrics(); boolean that_present_metrics = true && that.isSetMetrics(); if (this_present_metrics || that_present_metrics) { if (!(this_present_metrics && that_present_metrics)) return false; if (!this.metrics.equals(that.metrics)) return false; } boolean this_present_tags = true && this.isSetTags(); boolean that_present_tags = true && that.isSetTags(); if (this_present_tags || that_present_tags) { if (!(this_present_tags && that_present_tags)) return false; if (!this.tags.equals(that.tags)) return false; } boolean this_present_aggregator = true && this.isSetAggregator(); boolean that_present_aggregator = true && that.isSetAggregator(); if (this_present_aggregator || that_present_aggregator) { if (!(this_present_aggregator && that_present_aggregator)) return false; if (!this.aggregator.equals(that.aggregator)) return false; } boolean this_present_downsampleAggregator = true && this.isSetDownsampleAggregator(); boolean that_present_downsampleAggregator = true && that.isSetDownsampleAggregator(); if (this_present_downsampleAggregator || that_present_downsampleAggregator) { if (!(this_present_downsampleAggregator && that_present_downsampleAggregator)) return false; if (!this.downsampleAggregator.equals(that.downsampleAggregator)) return false; } boolean this_present_downsampleInterval = true && this.isSetDownsampleInterval(); boolean that_present_downsampleInterval = true && that.isSetDownsampleInterval(); if (this_present_downsampleInterval || that_present_downsampleInterval) { if (!(this_present_downsampleInterval && that_present_downsampleInterval)) return false; if (this.downsampleInterval != that.downsampleInterval) return false; } boolean this_present_downsampleTimeUnit = true && this.isSetDownsampleTimeUnit(); boolean that_present_downsampleTimeUnit = true && that.isSetDownsampleTimeUnit(); if (this_present_downsampleTimeUnit || that_present_downsampleTimeUnit) { if (!(this_present_downsampleTimeUnit && that_present_downsampleTimeUnit)) return false; if (!this.downsampleTimeUnit.equals(that.downsampleTimeUnit)) return false; } boolean this_present_calRate = true && this.isSetCalRate(); boolean that_present_calRate = true && that.isSetCalRate(); if (this_present_calRate || that_present_calRate) { if (!(this_present_calRate && that_present_calRate)) return false; if (this.calRate != that.calRate) return false; } boolean this_present_tagName = true && this.isSetTagName(); boolean that_present_tagName = true && that.isSetTagName(); if (this_present_tagName || that_present_tagName) { if (!(this_present_tagName && that_present_tagName)) return false; if (!this.tagName.equals(that.tagName)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_queueName = true && (isSetQueueName()); list.add(present_queueName); if (present_queueName) list.add(queueName); boolean present_startTime = true && (isSetStartTime()); list.add(present_startTime); if (present_startTime) list.add(startTime); boolean present_endTime = true && (isSetEndTime()); list.add(present_endTime); if (present_endTime) list.add(endTime); boolean present_metrics = true && (isSetMetrics()); list.add(present_metrics); if (present_metrics) list.add(metrics); boolean present_tags = true && (isSetTags()); list.add(present_tags); if (present_tags) list.add(tags); boolean present_aggregator = true && (isSetAggregator()); list.add(present_aggregator); if (present_aggregator) list.add(aggregator); boolean present_downsampleAggregator = true && (isSetDownsampleAggregator()); list.add(present_downsampleAggregator); if (present_downsampleAggregator) list.add(downsampleAggregator); boolean present_downsampleInterval = true && (isSetDownsampleInterval()); list.add(present_downsampleInterval); if (present_downsampleInterval) list.add(downsampleInterval); boolean present_downsampleTimeUnit = true && (isSetDownsampleTimeUnit()); list.add(present_downsampleTimeUnit); if (present_downsampleTimeUnit) list.add(downsampleTimeUnit); boolean present_calRate = true && (isSetCalRate()); list.add(present_calRate); if (present_calRate) list.add(calRate); boolean present_tagName = true && (isSetTagName()); list.add(present_tagName); if (present_tagName) list.add(tagName); return list.hashCode(); } @Override public int compareTo(QueryMetricRequest other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetQueueName()).compareTo(other.isSetQueueName()); if (lastComparison != 0) { return lastComparison; } if (isSetQueueName()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.queueName, other.queueName); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); if (lastComparison != 0) { return lastComparison; } if (isSetStartTime()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.startTime, other.startTime); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEndTime()).compareTo(other.isSetEndTime()); if (lastComparison != 0) { return lastComparison; } if (isSetEndTime()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.endTime, other.endTime); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMetrics()).compareTo(other.isSetMetrics()); if (lastComparison != 0) { return lastComparison; } if (isSetMetrics()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.metrics, other.metrics); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTags()).compareTo(other.isSetTags()); if (lastComparison != 0) { return lastComparison; } if (isSetTags()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.tags, other.tags); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetAggregator()).compareTo(other.isSetAggregator()); if (lastComparison != 0) { return lastComparison; } if (isSetAggregator()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.aggregator, other.aggregator); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDownsampleAggregator()).compareTo(other.isSetDownsampleAggregator()); if (lastComparison != 0) { return lastComparison; } if (isSetDownsampleAggregator()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.downsampleAggregator, other.downsampleAggregator); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDownsampleInterval()).compareTo(other.isSetDownsampleInterval()); if (lastComparison != 0) { return lastComparison; } if (isSetDownsampleInterval()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.downsampleInterval, other.downsampleInterval); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDownsampleTimeUnit()).compareTo(other.isSetDownsampleTimeUnit()); if (lastComparison != 0) { return lastComparison; } if (isSetDownsampleTimeUnit()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.downsampleTimeUnit, other.downsampleTimeUnit); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCalRate()).compareTo(other.isSetCalRate()); if (lastComparison != 0) { return lastComparison; } if (isSetCalRate()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.calRate, other.calRate); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTagName()).compareTo(other.isSetTagName()); if (lastComparison != 0) { return lastComparison; } if (isSetTagName()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.tagName, other.tagName); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("QueryMetricRequest("); boolean first = true; if (isSetQueueName()) { sb.append("queueName:"); if (this.queueName == null) { sb.append("null"); } else { sb.append(this.queueName); } first = false; } if (isSetStartTime()) { if (!first) sb.append(", "); sb.append("startTime:"); sb.append(this.startTime); first = false; } if (isSetEndTime()) { if (!first) sb.append(", "); sb.append("endTime:"); sb.append(this.endTime); first = false; } if (isSetMetrics()) { if (!first) sb.append(", "); sb.append("metrics:"); if (this.metrics == null) { sb.append("null"); } else { sb.append(this.metrics); } first = false; } if (isSetTags()) { if (!first) sb.append(", "); sb.append("tags:"); if (this.tags == null) { sb.append("null"); } else { sb.append(this.tags); } first = false; } if (isSetAggregator()) { if (!first) sb.append(", "); sb.append("aggregator:"); if (this.aggregator == null) { sb.append("null"); } else { sb.append(this.aggregator); } first = false; } if (isSetDownsampleAggregator()) { if (!first) sb.append(", "); sb.append("downsampleAggregator:"); if (this.downsampleAggregator == null) { sb.append("null"); } else { sb.append(this.downsampleAggregator); } first = false; } if (isSetDownsampleInterval()) { if (!first) sb.append(", "); sb.append("downsampleInterval:"); sb.append(this.downsampleInterval); first = false; } if (isSetDownsampleTimeUnit()) { if (!first) sb.append(", "); sb.append("downsampleTimeUnit:"); if (this.downsampleTimeUnit == null) { sb.append("null"); } else { sb.append(this.downsampleTimeUnit); } first = false; } if (isSetCalRate()) { if (!first) sb.append(", "); sb.append("calRate:"); sb.append(this.calRate); first = false; } if (isSetTagName()) { if (!first) sb.append(", "); sb.append("tagName:"); if (this.tagName == null) { sb.append("null"); } else { sb.append(this.tagName); } first = false; } sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class QueryMetricRequestStandardSchemeFactory implements SchemeFactory { public QueryMetricRequestStandardScheme getScheme() { return new QueryMetricRequestStandardScheme(); } } private static class QueryMetricRequestStandardScheme extends StandardScheme<QueryMetricRequest> { public void read(libthrift091.protocol.TProtocol iprot, QueryMetricRequest struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // QUEUE_NAME if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.queueName = iprot.readString(); struct.setQueueNameIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // START_TIME if (schemeField.type == libthrift091.protocol.TType.I64) { struct.startTime = iprot.readI64(); struct.setStartTimeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // END_TIME if (schemeField.type == libthrift091.protocol.TType.I64) { struct.endTime = iprot.readI64(); struct.setEndTimeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // METRICS if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.metrics = iprot.readString(); struct.setMetricsIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // TAGS if (schemeField.type == libthrift091.protocol.TType.MAP) { { libthrift091.protocol.TMap _map72 = iprot.readMapBegin(); struct.tags = new HashMap<String,String>(2*_map72.size); String _key73; String _val74; for (int _i75 = 0; _i75 < _map72.size; ++_i75) { _key73 = iprot.readString(); _val74 = iprot.readString(); struct.tags.put(_key73, _val74); } iprot.readMapEnd(); } struct.setTagsIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // AGGREGATOR if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.aggregator = iprot.readString(); struct.setAggregatorIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // DOWNSAMPLE_AGGREGATOR if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.downsampleAggregator = iprot.readString(); struct.setDownsampleAggregatorIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // DOWNSAMPLE_INTERVAL if (schemeField.type == libthrift091.protocol.TType.I32) { struct.downsampleInterval = iprot.readI32(); struct.setDownsampleIntervalIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // DOWNSAMPLE_TIME_UNIT if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.downsampleTimeUnit = iprot.readString(); struct.setDownsampleTimeUnitIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // CAL_RATE if (schemeField.type == libthrift091.protocol.TType.BOOL) { struct.calRate = iprot.readBool(); struct.setCalRateIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 11: // TAG_NAME if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.tagName = iprot.readString(); struct.setTagNameIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, QueryMetricRequest struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.queueName != null) { if (struct.isSetQueueName()) { oprot.writeFieldBegin(QUEUE_NAME_FIELD_DESC); oprot.writeString(struct.queueName); oprot.writeFieldEnd(); } } if (struct.isSetStartTime()) { oprot.writeFieldBegin(START_TIME_FIELD_DESC); oprot.writeI64(struct.startTime); oprot.writeFieldEnd(); } if (struct.isSetEndTime()) { oprot.writeFieldBegin(END_TIME_FIELD_DESC); oprot.writeI64(struct.endTime); oprot.writeFieldEnd(); } if (struct.metrics != null) { if (struct.isSetMetrics()) { oprot.writeFieldBegin(METRICS_FIELD_DESC); oprot.writeString(struct.metrics); oprot.writeFieldEnd(); } } if (struct.tags != null) { if (struct.isSetTags()) { oprot.writeFieldBegin(TAGS_FIELD_DESC); { oprot.writeMapBegin(new libthrift091.protocol.TMap(libthrift091.protocol.TType.STRING, libthrift091.protocol.TType.STRING, struct.tags.size())); for (Map.Entry<String, String> _iter76 : struct.tags.entrySet()) { oprot.writeString(_iter76.getKey()); oprot.writeString(_iter76.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } } if (struct.aggregator != null) { if (struct.isSetAggregator()) { oprot.writeFieldBegin(AGGREGATOR_FIELD_DESC); oprot.writeString(struct.aggregator); oprot.writeFieldEnd(); } } if (struct.downsampleAggregator != null) { if (struct.isSetDownsampleAggregator()) { oprot.writeFieldBegin(DOWNSAMPLE_AGGREGATOR_FIELD_DESC); oprot.writeString(struct.downsampleAggregator); oprot.writeFieldEnd(); } } if (struct.isSetDownsampleInterval()) { oprot.writeFieldBegin(DOWNSAMPLE_INTERVAL_FIELD_DESC); oprot.writeI32(struct.downsampleInterval); oprot.writeFieldEnd(); } if (struct.downsampleTimeUnit != null) { if (struct.isSetDownsampleTimeUnit()) { oprot.writeFieldBegin(DOWNSAMPLE_TIME_UNIT_FIELD_DESC); oprot.writeString(struct.downsampleTimeUnit); oprot.writeFieldEnd(); } } if (struct.isSetCalRate()) { oprot.writeFieldBegin(CAL_RATE_FIELD_DESC); oprot.writeBool(struct.calRate); oprot.writeFieldEnd(); } if (struct.tagName != null) { if (struct.isSetTagName()) { oprot.writeFieldBegin(TAG_NAME_FIELD_DESC); oprot.writeString(struct.tagName); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class QueryMetricRequestTupleSchemeFactory implements SchemeFactory { public QueryMetricRequestTupleScheme getScheme() { return new QueryMetricRequestTupleScheme(); } } private static class QueryMetricRequestTupleScheme extends TupleScheme<QueryMetricRequest> { @Override public void write(libthrift091.protocol.TProtocol prot, QueryMetricRequest struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetQueueName()) { optionals.set(0); } if (struct.isSetStartTime()) { optionals.set(1); } if (struct.isSetEndTime()) { optionals.set(2); } if (struct.isSetMetrics()) { optionals.set(3); } if (struct.isSetTags()) { optionals.set(4); } if (struct.isSetAggregator()) { optionals.set(5); } if (struct.isSetDownsampleAggregator()) { optionals.set(6); } if (struct.isSetDownsampleInterval()) { optionals.set(7); } if (struct.isSetDownsampleTimeUnit()) { optionals.set(8); } if (struct.isSetCalRate()) { optionals.set(9); } if (struct.isSetTagName()) { optionals.set(10); } oprot.writeBitSet(optionals, 11); if (struct.isSetQueueName()) { oprot.writeString(struct.queueName); } if (struct.isSetStartTime()) { oprot.writeI64(struct.startTime); } if (struct.isSetEndTime()) { oprot.writeI64(struct.endTime); } if (struct.isSetMetrics()) { oprot.writeString(struct.metrics); } if (struct.isSetTags()) { { oprot.writeI32(struct.tags.size()); for (Map.Entry<String, String> _iter77 : struct.tags.entrySet()) { oprot.writeString(_iter77.getKey()); oprot.writeString(_iter77.getValue()); } } } if (struct.isSetAggregator()) { oprot.writeString(struct.aggregator); } if (struct.isSetDownsampleAggregator()) { oprot.writeString(struct.downsampleAggregator); } if (struct.isSetDownsampleInterval()) { oprot.writeI32(struct.downsampleInterval); } if (struct.isSetDownsampleTimeUnit()) { oprot.writeString(struct.downsampleTimeUnit); } if (struct.isSetCalRate()) { oprot.writeBool(struct.calRate); } if (struct.isSetTagName()) { oprot.writeString(struct.tagName); } } @Override public void read(libthrift091.protocol.TProtocol prot, QueryMetricRequest struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { struct.queueName = iprot.readString(); struct.setQueueNameIsSet(true); } if (incoming.get(1)) { struct.startTime = iprot.readI64(); struct.setStartTimeIsSet(true); } if (incoming.get(2)) { struct.endTime = iprot.readI64(); struct.setEndTimeIsSet(true); } if (incoming.get(3)) { struct.metrics = iprot.readString(); struct.setMetricsIsSet(true); } if (incoming.get(4)) { { libthrift091.protocol.TMap _map78 = new libthrift091.protocol.TMap(libthrift091.protocol.TType.STRING, libthrift091.protocol.TType.STRING, iprot.readI32()); struct.tags = new HashMap<String,String>(2*_map78.size); String _key79; String _val80; for (int _i81 = 0; _i81 < _map78.size; ++_i81) { _key79 = iprot.readString(); _val80 = iprot.readString(); struct.tags.put(_key79, _val80); } } struct.setTagsIsSet(true); } if (incoming.get(5)) { struct.aggregator = iprot.readString(); struct.setAggregatorIsSet(true); } if (incoming.get(6)) { struct.downsampleAggregator = iprot.readString(); struct.setDownsampleAggregatorIsSet(true); } if (incoming.get(7)) { struct.downsampleInterval = iprot.readI32(); struct.setDownsampleIntervalIsSet(true); } if (incoming.get(8)) { struct.downsampleTimeUnit = iprot.readString(); struct.setDownsampleTimeUnitIsSet(true); } if (incoming.get(9)) { struct.calRate = iprot.readBool(); struct.setCalRateIsSet(true); } if (incoming.get(10)) { struct.tagName = iprot.readString(); struct.setTagNameIsSet(true); } } } }