com.xiaomi.infra.galaxy.sds.thrift.TimeSeriesData Maven / Gradle / Ivy
/**
* 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.sds.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-8-10")
public class TimeSeriesData implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("TimeSeriesData");
private static final libthrift091.protocol.TField TABLE_NAME_FIELD_DESC = new libthrift091.protocol.TField("tableName", libthrift091.protocol.TType.STRING, (short)1);
private static final libthrift091.protocol.TField METRIC_KEY_FIELD_DESC = new libthrift091.protocol.TField("metricKey", libthrift091.protocol.TType.I32, (short)2);
private static final libthrift091.protocol.TField METRIC_TYPE_FIELD_DESC = new libthrift091.protocol.TField("metricType", libthrift091.protocol.TType.I32, (short)3);
private static final libthrift091.protocol.TField DATA_FIELD_DESC = new libthrift091.protocol.TField("data", libthrift091.protocol.TType.MAP, (short)4);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TimeSeriesDataStandardSchemeFactory());
schemes.put(TupleScheme.class, new TimeSeriesDataTupleSchemeFactory());
}
/**
* 表名
*/
public String tableName; // optional
/**
* 统计指标主类型
*
* @see MetricKey
*/
public MetricKey metricKey; // optional
/**
* 统计指标子类型
*
* @see MetricType
*/
public MetricType metricType; // optional
/**
* 统计指标数据时间序列,值为{时间 => 数值}映射
*/
public Map data; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
/**
* 表名
*/
TABLE_NAME((short)1, "tableName"),
/**
* 统计指标主类型
*
* @see MetricKey
*/
METRIC_KEY((short)2, "metricKey"),
/**
* 统计指标子类型
*
* @see MetricType
*/
METRIC_TYPE((short)3, "metricType"),
/**
* 统计指标数据时间序列,值为{时间 => 数值}映射
*/
DATA((short)4, "data");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TABLE_NAME
return TABLE_NAME;
case 2: // METRIC_KEY
return METRIC_KEY;
case 3: // METRIC_TYPE
return METRIC_TYPE;
case 4: // DATA
return DATA;
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 _Fields optionals[] = {_Fields.TABLE_NAME,_Fields.METRIC_KEY,_Fields.METRIC_TYPE,_Fields.DATA};
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.TABLE_NAME, new libthrift091.meta_data.FieldMetaData("tableName", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.METRIC_KEY, new libthrift091.meta_data.FieldMetaData("metricKey", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, MetricKey.class)));
tmpMap.put(_Fields.METRIC_TYPE, new libthrift091.meta_data.FieldMetaData("metricType", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, MetricType.class)));
tmpMap.put(_Fields.DATA, new libthrift091.meta_data.FieldMetaData("data", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.MapMetaData(libthrift091.protocol.TType.MAP,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64),
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.DOUBLE))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(TimeSeriesData.class, metaDataMap);
}
public TimeSeriesData() {
}
/**
* Performs a deep copy on other.
*/
public TimeSeriesData(TimeSeriesData other) {
if (other.isSetTableName()) {
this.tableName = other.tableName;
}
if (other.isSetMetricKey()) {
this.metricKey = other.metricKey;
}
if (other.isSetMetricType()) {
this.metricType = other.metricType;
}
if (other.isSetData()) {
Map __this__data = new HashMap(other.data);
this.data = __this__data;
}
}
public TimeSeriesData deepCopy() {
return new TimeSeriesData(this);
}
@Override
public void clear() {
this.tableName = null;
this.metricKey = null;
this.metricType = null;
this.data = null;
}
/**
* 表名
*/
public String getTableName() {
return this.tableName;
}
/**
* 表名
*/
public TimeSeriesData setTableName(String tableName) {
this.tableName = tableName;
return this;
}
public void unsetTableName() {
this.tableName = null;
}
/** Returns true if field tableName is set (has been assigned a value) and false otherwise */
public boolean isSetTableName() {
return this.tableName != null;
}
public void setTableNameIsSet(boolean value) {
if (!value) {
this.tableName = null;
}
}
/**
* 统计指标主类型
*
* @see MetricKey
*/
public MetricKey getMetricKey() {
return this.metricKey;
}
/**
* 统计指标主类型
*
* @see MetricKey
*/
public TimeSeriesData setMetricKey(MetricKey metricKey) {
this.metricKey = metricKey;
return this;
}
public void unsetMetricKey() {
this.metricKey = null;
}
/** Returns true if field metricKey is set (has been assigned a value) and false otherwise */
public boolean isSetMetricKey() {
return this.metricKey != null;
}
public void setMetricKeyIsSet(boolean value) {
if (!value) {
this.metricKey = null;
}
}
/**
* 统计指标子类型
*
* @see MetricType
*/
public MetricType getMetricType() {
return this.metricType;
}
/**
* 统计指标子类型
*
* @see MetricType
*/
public TimeSeriesData setMetricType(MetricType metricType) {
this.metricType = metricType;
return this;
}
public void unsetMetricType() {
this.metricType = null;
}
/** Returns true if field metricType is set (has been assigned a value) and false otherwise */
public boolean isSetMetricType() {
return this.metricType != null;
}
public void setMetricTypeIsSet(boolean value) {
if (!value) {
this.metricType = null;
}
}
public int getDataSize() {
return (this.data == null) ? 0 : this.data.size();
}
public void putToData(long key, double val) {
if (this.data == null) {
this.data = new HashMap();
}
this.data.put(key, val);
}
/**
* 统计指标数据时间序列,值为{时间 => 数值}映射
*/
public Map getData() {
return this.data;
}
/**
* 统计指标数据时间序列,值为{时间 => 数值}映射
*/
public TimeSeriesData setData(Map data) {
this.data = data;
return this;
}
public void unsetData() {
this.data = null;
}
/** Returns true if field data is set (has been assigned a value) and false otherwise */
public boolean isSetData() {
return this.data != null;
}
public void setDataIsSet(boolean value) {
if (!value) {
this.data = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TABLE_NAME:
if (value == null) {
unsetTableName();
} else {
setTableName((String)value);
}
break;
case METRIC_KEY:
if (value == null) {
unsetMetricKey();
} else {
setMetricKey((MetricKey)value);
}
break;
case METRIC_TYPE:
if (value == null) {
unsetMetricType();
} else {
setMetricType((MetricType)value);
}
break;
case DATA:
if (value == null) {
unsetData();
} else {
setData((Map)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TABLE_NAME:
return getTableName();
case METRIC_KEY:
return getMetricKey();
case METRIC_TYPE:
return getMetricType();
case DATA:
return getData();
}
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 TABLE_NAME:
return isSetTableName();
case METRIC_KEY:
return isSetMetricKey();
case METRIC_TYPE:
return isSetMetricType();
case DATA:
return isSetData();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TimeSeriesData)
return this.equals((TimeSeriesData)that);
return false;
}
public boolean equals(TimeSeriesData that) {
if (that == null)
return false;
boolean this_present_tableName = true && this.isSetTableName();
boolean that_present_tableName = true && that.isSetTableName();
if (this_present_tableName || that_present_tableName) {
if (!(this_present_tableName && that_present_tableName))
return false;
if (!this.tableName.equals(that.tableName))
return false;
}
boolean this_present_metricKey = true && this.isSetMetricKey();
boolean that_present_metricKey = true && that.isSetMetricKey();
if (this_present_metricKey || that_present_metricKey) {
if (!(this_present_metricKey && that_present_metricKey))
return false;
if (!this.metricKey.equals(that.metricKey))
return false;
}
boolean this_present_metricType = true && this.isSetMetricType();
boolean that_present_metricType = true && that.isSetMetricType();
if (this_present_metricType || that_present_metricType) {
if (!(this_present_metricType && that_present_metricType))
return false;
if (!this.metricType.equals(that.metricType))
return false;
}
boolean this_present_data = true && this.isSetData();
boolean that_present_data = true && that.isSetData();
if (this_present_data || that_present_data) {
if (!(this_present_data && that_present_data))
return false;
if (!this.data.equals(that.data))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy