com.xiaomi.infra.galaxy.sds.thrift.CommittedOffset 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-3-25")
public class CommittedOffset implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("CommittedOffset");
private static final libthrift091.protocol.TField COMMITTED_DATA_OFFSET_FIELD_DESC = new libthrift091.protocol.TField("committedDataOffset", libthrift091.protocol.TType.MAP, (short)1);
private static final libthrift091.protocol.TField DATA_COMMIT_FINISHED_FIELD_DESC = new libthrift091.protocol.TField("dataCommitFinished", libthrift091.protocol.TType.BOOL, (short)2);
private static final libthrift091.protocol.TField COMMITTED_EDIT_OFFSET_FIELD_DESC = new libthrift091.protocol.TField("committedEditOffset", libthrift091.protocol.TType.I64, (short)3);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new CommittedOffsetStandardSchemeFactory());
schemes.put(TupleScheme.class, new CommittedOffsetTupleSchemeFactory());
}
/**
* 当前存量数据已确认的消费偏移
*/
public Map committedDataOffset; // optional
/**
* 存量数据是否确认消费完毕
*/
public boolean dataCommitFinished; // optional
/**
* 当前增量数据已确认的消费偏移
*/
public long committedEditOffset; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
/**
* 当前存量数据已确认的消费偏移
*/
COMMITTED_DATA_OFFSET((short)1, "committedDataOffset"),
/**
* 存量数据是否确认消费完毕
*/
DATA_COMMIT_FINISHED((short)2, "dataCommitFinished"),
/**
* 当前增量数据已确认的消费偏移
*/
COMMITTED_EDIT_OFFSET((short)3, "committedEditOffset");
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: // COMMITTED_DATA_OFFSET
return COMMITTED_DATA_OFFSET;
case 2: // DATA_COMMIT_FINISHED
return DATA_COMMIT_FINISHED;
case 3: // COMMITTED_EDIT_OFFSET
return COMMITTED_EDIT_OFFSET;
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 __DATACOMMITFINISHED_ISSET_ID = 0;
private static final int __COMMITTEDEDITOFFSET_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.COMMITTED_DATA_OFFSET,_Fields.DATA_COMMIT_FINISHED,_Fields.COMMITTED_EDIT_OFFSET};
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.COMMITTED_DATA_OFFSET, new libthrift091.meta_data.FieldMetaData("committedDataOffset", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.MAP , "Dictionary")));
tmpMap.put(_Fields.DATA_COMMIT_FINISHED, new libthrift091.meta_data.FieldMetaData("dataCommitFinished", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.BOOL)));
tmpMap.put(_Fields.COMMITTED_EDIT_OFFSET, new libthrift091.meta_data.FieldMetaData("committedEditOffset", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(CommittedOffset.class, metaDataMap);
}
public CommittedOffset() {
}
/**
* Performs a deep copy on other.
*/
public CommittedOffset(CommittedOffset other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetCommittedDataOffset()) {
this.committedDataOffset = other.committedDataOffset;
}
this.dataCommitFinished = other.dataCommitFinished;
this.committedEditOffset = other.committedEditOffset;
}
public CommittedOffset deepCopy() {
return new CommittedOffset(this);
}
@Override
public void clear() {
this.committedDataOffset = null;
setDataCommitFinishedIsSet(false);
this.dataCommitFinished = false;
setCommittedEditOffsetIsSet(false);
this.committedEditOffset = 0;
}
public int getCommittedDataOffsetSize() {
return (this.committedDataOffset == null) ? 0 : this.committedDataOffset.size();
}
public void putToCommittedDataOffset(String key, Datum val) {
if (this.committedDataOffset == null) {
this.committedDataOffset = new HashMap();
}
this.committedDataOffset.put(key, val);
}
/**
* 当前存量数据已确认的消费偏移
*/
public Map getCommittedDataOffset() {
return this.committedDataOffset;
}
/**
* 当前存量数据已确认的消费偏移
*/
public CommittedOffset setCommittedDataOffset(Map committedDataOffset) {
this.committedDataOffset = committedDataOffset;
return this;
}
public void unsetCommittedDataOffset() {
this.committedDataOffset = null;
}
/** Returns true if field committedDataOffset is set (has been assigned a value) and false otherwise */
public boolean isSetCommittedDataOffset() {
return this.committedDataOffset != null;
}
public void setCommittedDataOffsetIsSet(boolean value) {
if (!value) {
this.committedDataOffset = null;
}
}
/**
* 存量数据是否确认消费完毕
*/
public boolean isDataCommitFinished() {
return this.dataCommitFinished;
}
/**
* 存量数据是否确认消费完毕
*/
public CommittedOffset setDataCommitFinished(boolean dataCommitFinished) {
this.dataCommitFinished = dataCommitFinished;
setDataCommitFinishedIsSet(true);
return this;
}
public void unsetDataCommitFinished() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATACOMMITFINISHED_ISSET_ID);
}
/** Returns true if field dataCommitFinished is set (has been assigned a value) and false otherwise */
public boolean isSetDataCommitFinished() {
return EncodingUtils.testBit(__isset_bitfield, __DATACOMMITFINISHED_ISSET_ID);
}
public void setDataCommitFinishedIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATACOMMITFINISHED_ISSET_ID, value);
}
/**
* 当前增量数据已确认的消费偏移
*/
public long getCommittedEditOffset() {
return this.committedEditOffset;
}
/**
* 当前增量数据已确认的消费偏移
*/
public CommittedOffset setCommittedEditOffset(long committedEditOffset) {
this.committedEditOffset = committedEditOffset;
setCommittedEditOffsetIsSet(true);
return this;
}
public void unsetCommittedEditOffset() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COMMITTEDEDITOFFSET_ISSET_ID);
}
/** Returns true if field committedEditOffset is set (has been assigned a value) and false otherwise */
public boolean isSetCommittedEditOffset() {
return EncodingUtils.testBit(__isset_bitfield, __COMMITTEDEDITOFFSET_ISSET_ID);
}
public void setCommittedEditOffsetIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COMMITTEDEDITOFFSET_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case COMMITTED_DATA_OFFSET:
if (value == null) {
unsetCommittedDataOffset();
} else {
setCommittedDataOffset((Map)value);
}
break;
case DATA_COMMIT_FINISHED:
if (value == null) {
unsetDataCommitFinished();
} else {
setDataCommitFinished((Boolean)value);
}
break;
case COMMITTED_EDIT_OFFSET:
if (value == null) {
unsetCommittedEditOffset();
} else {
setCommittedEditOffset((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case COMMITTED_DATA_OFFSET:
return getCommittedDataOffset();
case DATA_COMMIT_FINISHED:
return Boolean.valueOf(isDataCommitFinished());
case COMMITTED_EDIT_OFFSET:
return Long.valueOf(getCommittedEditOffset());
}
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 COMMITTED_DATA_OFFSET:
return isSetCommittedDataOffset();
case DATA_COMMIT_FINISHED:
return isSetDataCommitFinished();
case COMMITTED_EDIT_OFFSET:
return isSetCommittedEditOffset();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof CommittedOffset)
return this.equals((CommittedOffset)that);
return false;
}
public boolean equals(CommittedOffset that) {
if (that == null)
return false;
boolean this_present_committedDataOffset = true && this.isSetCommittedDataOffset();
boolean that_present_committedDataOffset = true && that.isSetCommittedDataOffset();
if (this_present_committedDataOffset || that_present_committedDataOffset) {
if (!(this_present_committedDataOffset && that_present_committedDataOffset))
return false;
if (!this.committedDataOffset.equals(that.committedDataOffset))
return false;
}
boolean this_present_dataCommitFinished = true && this.isSetDataCommitFinished();
boolean that_present_dataCommitFinished = true && that.isSetDataCommitFinished();
if (this_present_dataCommitFinished || that_present_dataCommitFinished) {
if (!(this_present_dataCommitFinished && that_present_dataCommitFinished))
return false;
if (this.dataCommitFinished != that.dataCommitFinished)
return false;
}
boolean this_present_committedEditOffset = true && this.isSetCommittedEditOffset();
boolean that_present_committedEditOffset = true && that.isSetCommittedEditOffset();
if (this_present_committedEditOffset || that_present_committedEditOffset) {
if (!(this_present_committedEditOffset && that_present_committedEditOffset))
return false;
if (this.committedEditOffset != that.committedEditOffset)
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy