Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* 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.talos.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-11")
public class TopicState implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("TopicState");
private static final libthrift091.protocol.TField CREATE_TIMESTAMP_FIELD_DESC = new libthrift091.protocol.TField("createTimestamp", libthrift091.protocol.TType.I64, (short)1);
private static final libthrift091.protocol.TField TOPIC_STATUS_FIELD_DESC = new libthrift091.protocol.TField("topicStatus", libthrift091.protocol.TType.I32, (short)2);
private static final libthrift091.protocol.TField MESSAGE_NUMBER_FIELD_DESC = new libthrift091.protocol.TField("messageNumber", libthrift091.protocol.TType.I64, (short)3);
private static final libthrift091.protocol.TField MESSAGE_BYTES_FIELD_DESC = new libthrift091.protocol.TField("messageBytes", libthrift091.protocol.TType.I64, (short)4);
private static final libthrift091.protocol.TField PARTITION_STATES_FIELD_DESC = new libthrift091.protocol.TField("partitionStates", libthrift091.protocol.TType.LIST, (short)5);
private static final libthrift091.protocol.TField TOTAL_MESSAGE_NUMBER_FIELD_DESC = new libthrift091.protocol.TField("totalMessageNumber", libthrift091.protocol.TType.I64, (short)6);
private static final libthrift091.protocol.TField TOTAL_MESSAGE_BYTES_FIELD_DESC = new libthrift091.protocol.TField("totalMessageBytes", libthrift091.protocol.TType.I64, (short)7);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TopicStateStandardSchemeFactory());
schemes.put(TupleScheme.class, new TopicStateTupleSchemeFactory());
}
/**
* Create Timestamp for this topic;
*
*/
public long createTimestamp; // required
/**
* Topic status for this topic;
*
*
* @see TopicStatus
*/
public TopicStatus topicStatus; // required
/**
* The message number in this topic(include all partitions);
*
*/
public long messageNumber; // required
/**
* The message bytes in this topic(include all partitions);
*
*/
public long messageBytes; // required
/**
* All partition state for this partition;
*
*/
public List partitionStates; // required
/**
* The total message number of this topic,
* optional for compatible forward
*
*/
public long totalMessageNumber; // optional
/**
* The total message bytes of this topic
* optional for compatible forward
*
*/
public long totalMessageBytes; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
/**
* Create Timestamp for this topic;
*
*/
CREATE_TIMESTAMP((short)1, "createTimestamp"),
/**
* Topic status for this topic;
*
*
* @see TopicStatus
*/
TOPIC_STATUS((short)2, "topicStatus"),
/**
* The message number in this topic(include all partitions);
*
*/
MESSAGE_NUMBER((short)3, "messageNumber"),
/**
* The message bytes in this topic(include all partitions);
*
*/
MESSAGE_BYTES((short)4, "messageBytes"),
/**
* All partition state for this partition;
*
*/
PARTITION_STATES((short)5, "partitionStates"),
/**
* The total message number of this topic,
* optional for compatible forward
*
*/
TOTAL_MESSAGE_NUMBER((short)6, "totalMessageNumber"),
/**
* The total message bytes of this topic
* optional for compatible forward
*
*/
TOTAL_MESSAGE_BYTES((short)7, "totalMessageBytes");
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: // CREATE_TIMESTAMP
return CREATE_TIMESTAMP;
case 2: // TOPIC_STATUS
return TOPIC_STATUS;
case 3: // MESSAGE_NUMBER
return MESSAGE_NUMBER;
case 4: // MESSAGE_BYTES
return MESSAGE_BYTES;
case 5: // PARTITION_STATES
return PARTITION_STATES;
case 6: // TOTAL_MESSAGE_NUMBER
return TOTAL_MESSAGE_NUMBER;
case 7: // TOTAL_MESSAGE_BYTES
return TOTAL_MESSAGE_BYTES;
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 __CREATETIMESTAMP_ISSET_ID = 0;
private static final int __MESSAGENUMBER_ISSET_ID = 1;
private static final int __MESSAGEBYTES_ISSET_ID = 2;
private static final int __TOTALMESSAGENUMBER_ISSET_ID = 3;
private static final int __TOTALMESSAGEBYTES_ISSET_ID = 4;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.TOTAL_MESSAGE_NUMBER,_Fields.TOTAL_MESSAGE_BYTES};
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.CREATE_TIMESTAMP, new libthrift091.meta_data.FieldMetaData("createTimestamp", libthrift091.TFieldRequirementType.REQUIRED,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64)));
tmpMap.put(_Fields.TOPIC_STATUS, new libthrift091.meta_data.FieldMetaData("topicStatus", libthrift091.TFieldRequirementType.REQUIRED,
new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, TopicStatus.class)));
tmpMap.put(_Fields.MESSAGE_NUMBER, new libthrift091.meta_data.FieldMetaData("messageNumber", libthrift091.TFieldRequirementType.REQUIRED,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64)));
tmpMap.put(_Fields.MESSAGE_BYTES, new libthrift091.meta_data.FieldMetaData("messageBytes", libthrift091.TFieldRequirementType.REQUIRED,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64)));
tmpMap.put(_Fields.PARTITION_STATES, new libthrift091.meta_data.FieldMetaData("partitionStates", libthrift091.TFieldRequirementType.REQUIRED,
new libthrift091.meta_data.ListMetaData(libthrift091.protocol.TType.LIST,
new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, PartitionState.class))));
tmpMap.put(_Fields.TOTAL_MESSAGE_NUMBER, new libthrift091.meta_data.FieldMetaData("totalMessageNumber", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64)));
tmpMap.put(_Fields.TOTAL_MESSAGE_BYTES, new libthrift091.meta_data.FieldMetaData("totalMessageBytes", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(TopicState.class, metaDataMap);
}
public TopicState() {
}
public TopicState(
long createTimestamp,
TopicStatus topicStatus,
long messageNumber,
long messageBytes,
List partitionStates)
{
this();
this.createTimestamp = createTimestamp;
setCreateTimestampIsSet(true);
this.topicStatus = topicStatus;
this.messageNumber = messageNumber;
setMessageNumberIsSet(true);
this.messageBytes = messageBytes;
setMessageBytesIsSet(true);
this.partitionStates = partitionStates;
}
/**
* Performs a deep copy on other.
*/
public TopicState(TopicState other) {
__isset_bitfield = other.__isset_bitfield;
this.createTimestamp = other.createTimestamp;
if (other.isSetTopicStatus()) {
this.topicStatus = other.topicStatus;
}
this.messageNumber = other.messageNumber;
this.messageBytes = other.messageBytes;
if (other.isSetPartitionStates()) {
List __this__partitionStates = new ArrayList(other.partitionStates.size());
for (PartitionState other_element : other.partitionStates) {
__this__partitionStates.add(new PartitionState(other_element));
}
this.partitionStates = __this__partitionStates;
}
this.totalMessageNumber = other.totalMessageNumber;
this.totalMessageBytes = other.totalMessageBytes;
}
public TopicState deepCopy() {
return new TopicState(this);
}
@Override
public void clear() {
setCreateTimestampIsSet(false);
this.createTimestamp = 0;
this.topicStatus = null;
setMessageNumberIsSet(false);
this.messageNumber = 0;
setMessageBytesIsSet(false);
this.messageBytes = 0;
this.partitionStates = null;
setTotalMessageNumberIsSet(false);
this.totalMessageNumber = 0;
setTotalMessageBytesIsSet(false);
this.totalMessageBytes = 0;
}
/**
* Create Timestamp for this topic;
*
*/
public long getCreateTimestamp() {
return this.createTimestamp;
}
/**
* Create Timestamp for this topic;
*
*/
public TopicState setCreateTimestamp(long createTimestamp) {
this.createTimestamp = createTimestamp;
setCreateTimestampIsSet(true);
return this;
}
public void unsetCreateTimestamp() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIMESTAMP_ISSET_ID);
}
/** Returns true if field createTimestamp is set (has been assigned a value) and false otherwise */
public boolean isSetCreateTimestamp() {
return EncodingUtils.testBit(__isset_bitfield, __CREATETIMESTAMP_ISSET_ID);
}
public void setCreateTimestampIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIMESTAMP_ISSET_ID, value);
}
/**
* Topic status for this topic;
*
*
* @see TopicStatus
*/
public TopicStatus getTopicStatus() {
return this.topicStatus;
}
/**
* Topic status for this topic;
*
*
* @see TopicStatus
*/
public TopicState setTopicStatus(TopicStatus topicStatus) {
this.topicStatus = topicStatus;
return this;
}
public void unsetTopicStatus() {
this.topicStatus = null;
}
/** Returns true if field topicStatus is set (has been assigned a value) and false otherwise */
public boolean isSetTopicStatus() {
return this.topicStatus != null;
}
public void setTopicStatusIsSet(boolean value) {
if (!value) {
this.topicStatus = null;
}
}
/**
* The message number in this topic(include all partitions);
*
*/
public long getMessageNumber() {
return this.messageNumber;
}
/**
* The message number in this topic(include all partitions);
*
*/
public TopicState setMessageNumber(long messageNumber) {
this.messageNumber = messageNumber;
setMessageNumberIsSet(true);
return this;
}
public void unsetMessageNumber() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MESSAGENUMBER_ISSET_ID);
}
/** Returns true if field messageNumber is set (has been assigned a value) and false otherwise */
public boolean isSetMessageNumber() {
return EncodingUtils.testBit(__isset_bitfield, __MESSAGENUMBER_ISSET_ID);
}
public void setMessageNumberIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MESSAGENUMBER_ISSET_ID, value);
}
/**
* The message bytes in this topic(include all partitions);
*
*/
public long getMessageBytes() {
return this.messageBytes;
}
/**
* The message bytes in this topic(include all partitions);
*
*/
public TopicState setMessageBytes(long messageBytes) {
this.messageBytes = messageBytes;
setMessageBytesIsSet(true);
return this;
}
public void unsetMessageBytes() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MESSAGEBYTES_ISSET_ID);
}
/** Returns true if field messageBytes is set (has been assigned a value) and false otherwise */
public boolean isSetMessageBytes() {
return EncodingUtils.testBit(__isset_bitfield, __MESSAGEBYTES_ISSET_ID);
}
public void setMessageBytesIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MESSAGEBYTES_ISSET_ID, value);
}
public int getPartitionStatesSize() {
return (this.partitionStates == null) ? 0 : this.partitionStates.size();
}
public java.util.Iterator getPartitionStatesIterator() {
return (this.partitionStates == null) ? null : this.partitionStates.iterator();
}
public void addToPartitionStates(PartitionState elem) {
if (this.partitionStates == null) {
this.partitionStates = new ArrayList();
}
this.partitionStates.add(elem);
}
/**
* All partition state for this partition;
*
*/
public List getPartitionStates() {
return this.partitionStates;
}
/**
* All partition state for this partition;
*
*/
public TopicState setPartitionStates(List partitionStates) {
this.partitionStates = partitionStates;
return this;
}
public void unsetPartitionStates() {
this.partitionStates = null;
}
/** Returns true if field partitionStates is set (has been assigned a value) and false otherwise */
public boolean isSetPartitionStates() {
return this.partitionStates != null;
}
public void setPartitionStatesIsSet(boolean value) {
if (!value) {
this.partitionStates = null;
}
}
/**
* The total message number of this topic,
* optional for compatible forward
*
*/
public long getTotalMessageNumber() {
return this.totalMessageNumber;
}
/**
* The total message number of this topic,
* optional for compatible forward
*
*/
public TopicState setTotalMessageNumber(long totalMessageNumber) {
this.totalMessageNumber = totalMessageNumber;
setTotalMessageNumberIsSet(true);
return this;
}
public void unsetTotalMessageNumber() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALMESSAGENUMBER_ISSET_ID);
}
/** Returns true if field totalMessageNumber is set (has been assigned a value) and false otherwise */
public boolean isSetTotalMessageNumber() {
return EncodingUtils.testBit(__isset_bitfield, __TOTALMESSAGENUMBER_ISSET_ID);
}
public void setTotalMessageNumberIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALMESSAGENUMBER_ISSET_ID, value);
}
/**
* The total message bytes of this topic
* optional for compatible forward
*
*/
public long getTotalMessageBytes() {
return this.totalMessageBytes;
}
/**
* The total message bytes of this topic
* optional for compatible forward
*
*/
public TopicState setTotalMessageBytes(long totalMessageBytes) {
this.totalMessageBytes = totalMessageBytes;
setTotalMessageBytesIsSet(true);
return this;
}
public void unsetTotalMessageBytes() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALMESSAGEBYTES_ISSET_ID);
}
/** Returns true if field totalMessageBytes is set (has been assigned a value) and false otherwise */
public boolean isSetTotalMessageBytes() {
return EncodingUtils.testBit(__isset_bitfield, __TOTALMESSAGEBYTES_ISSET_ID);
}
public void setTotalMessageBytesIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALMESSAGEBYTES_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case CREATE_TIMESTAMP:
if (value == null) {
unsetCreateTimestamp();
} else {
setCreateTimestamp((Long)value);
}
break;
case TOPIC_STATUS:
if (value == null) {
unsetTopicStatus();
} else {
setTopicStatus((TopicStatus)value);
}
break;
case MESSAGE_NUMBER:
if (value == null) {
unsetMessageNumber();
} else {
setMessageNumber((Long)value);
}
break;
case MESSAGE_BYTES:
if (value == null) {
unsetMessageBytes();
} else {
setMessageBytes((Long)value);
}
break;
case PARTITION_STATES:
if (value == null) {
unsetPartitionStates();
} else {
setPartitionStates((List)value);
}
break;
case TOTAL_MESSAGE_NUMBER:
if (value == null) {
unsetTotalMessageNumber();
} else {
setTotalMessageNumber((Long)value);
}
break;
case TOTAL_MESSAGE_BYTES:
if (value == null) {
unsetTotalMessageBytes();
} else {
setTotalMessageBytes((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case CREATE_TIMESTAMP:
return Long.valueOf(getCreateTimestamp());
case TOPIC_STATUS:
return getTopicStatus();
case MESSAGE_NUMBER:
return Long.valueOf(getMessageNumber());
case MESSAGE_BYTES:
return Long.valueOf(getMessageBytes());
case PARTITION_STATES:
return getPartitionStates();
case TOTAL_MESSAGE_NUMBER:
return Long.valueOf(getTotalMessageNumber());
case TOTAL_MESSAGE_BYTES:
return Long.valueOf(getTotalMessageBytes());
}
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 CREATE_TIMESTAMP:
return isSetCreateTimestamp();
case TOPIC_STATUS:
return isSetTopicStatus();
case MESSAGE_NUMBER:
return isSetMessageNumber();
case MESSAGE_BYTES:
return isSetMessageBytes();
case PARTITION_STATES:
return isSetPartitionStates();
case TOTAL_MESSAGE_NUMBER:
return isSetTotalMessageNumber();
case TOTAL_MESSAGE_BYTES:
return isSetTotalMessageBytes();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TopicState)
return this.equals((TopicState)that);
return false;
}
public boolean equals(TopicState that) {
if (that == null)
return false;
boolean this_present_createTimestamp = true;
boolean that_present_createTimestamp = true;
if (this_present_createTimestamp || that_present_createTimestamp) {
if (!(this_present_createTimestamp && that_present_createTimestamp))
return false;
if (this.createTimestamp != that.createTimestamp)
return false;
}
boolean this_present_topicStatus = true && this.isSetTopicStatus();
boolean that_present_topicStatus = true && that.isSetTopicStatus();
if (this_present_topicStatus || that_present_topicStatus) {
if (!(this_present_topicStatus && that_present_topicStatus))
return false;
if (!this.topicStatus.equals(that.topicStatus))
return false;
}
boolean this_present_messageNumber = true;
boolean that_present_messageNumber = true;
if (this_present_messageNumber || that_present_messageNumber) {
if (!(this_present_messageNumber && that_present_messageNumber))
return false;
if (this.messageNumber != that.messageNumber)
return false;
}
boolean this_present_messageBytes = true;
boolean that_present_messageBytes = true;
if (this_present_messageBytes || that_present_messageBytes) {
if (!(this_present_messageBytes && that_present_messageBytes))
return false;
if (this.messageBytes != that.messageBytes)
return false;
}
boolean this_present_partitionStates = true && this.isSetPartitionStates();
boolean that_present_partitionStates = true && that.isSetPartitionStates();
if (this_present_partitionStates || that_present_partitionStates) {
if (!(this_present_partitionStates && that_present_partitionStates))
return false;
if (!this.partitionStates.equals(that.partitionStates))
return false;
}
boolean this_present_totalMessageNumber = true && this.isSetTotalMessageNumber();
boolean that_present_totalMessageNumber = true && that.isSetTotalMessageNumber();
if (this_present_totalMessageNumber || that_present_totalMessageNumber) {
if (!(this_present_totalMessageNumber && that_present_totalMessageNumber))
return false;
if (this.totalMessageNumber != that.totalMessageNumber)
return false;
}
boolean this_present_totalMessageBytes = true && this.isSetTotalMessageBytes();
boolean that_present_totalMessageBytes = true && that.isSetTotalMessageBytes();
if (this_present_totalMessageBytes || that_present_totalMessageBytes) {
if (!(this_present_totalMessageBytes && that_present_totalMessageBytes))
return false;
if (this.totalMessageBytes != that.totalMessageBytes)
return false;
}
return true;
}
@Override
public int hashCode() {
List