com.xiaomi.infra.galaxy.sds.thrift.RowEdit 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-5-12")
public class RowEdit implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("RowEdit");
private static final libthrift091.protocol.TField KEYS_FIELD_DESC = new libthrift091.protocol.TField("keys", libthrift091.protocol.TType.MAP, (short)1);
private static final libthrift091.protocol.TField EDITS_FIELD_DESC = new libthrift091.protocol.TField("edits", libthrift091.protocol.TType.MAP, (short)2);
private static final libthrift091.protocol.TField CONSUME_OFFSET_FIELD_DESC = new libthrift091.protocol.TField("consumeOffset", libthrift091.protocol.TType.I64, (short)3);
private static final libthrift091.protocol.TField DELETE_ROW_FIELD_DESC = new libthrift091.protocol.TField("deleteRow", libthrift091.protocol.TType.BOOL, (short)4);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new RowEditStandardSchemeFactory());
schemes.put(TupleScheme.class, new RowEditTupleSchemeFactory());
}
/**
* 增量操作行的主键
*/
public Map keys; // optional
/**
* 增量操作行的属性
*/
public Map edits; // optional
/**
* 增量偏移
*/
public long consumeOffset; // optional
/**
* 是否删除整行
*/
public boolean deleteRow; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
/**
* 增量操作行的主键
*/
KEYS((short)1, "keys"),
/**
* 增量操作行的属性
*/
EDITS((short)2, "edits"),
/**
* 增量偏移
*/
CONSUME_OFFSET((short)3, "consumeOffset"),
/**
* 是否删除整行
*/
DELETE_ROW((short)4, "deleteRow");
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: // KEYS
return KEYS;
case 2: // EDITS
return EDITS;
case 3: // CONSUME_OFFSET
return CONSUME_OFFSET;
case 4: // DELETE_ROW
return DELETE_ROW;
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 __CONSUMEOFFSET_ISSET_ID = 0;
private static final int __DELETEROW_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.KEYS,_Fields.EDITS,_Fields.CONSUME_OFFSET,_Fields.DELETE_ROW};
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.KEYS, new libthrift091.meta_data.FieldMetaData("keys", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.MAP , "Dictionary")));
tmpMap.put(_Fields.EDITS, new libthrift091.meta_data.FieldMetaData("edits", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.MAP , "EditDictionary")));
tmpMap.put(_Fields.CONSUME_OFFSET, new libthrift091.meta_data.FieldMetaData("consumeOffset", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I64)));
tmpMap.put(_Fields.DELETE_ROW, new libthrift091.meta_data.FieldMetaData("deleteRow", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(RowEdit.class, metaDataMap);
}
public RowEdit() {
}
/**
* Performs a deep copy on other.
*/
public RowEdit(RowEdit other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetKeys()) {
this.keys = other.keys;
}
if (other.isSetEdits()) {
this.edits = other.edits;
}
this.consumeOffset = other.consumeOffset;
this.deleteRow = other.deleteRow;
}
public RowEdit deepCopy() {
return new RowEdit(this);
}
@Override
public void clear() {
this.keys = null;
this.edits = null;
setConsumeOffsetIsSet(false);
this.consumeOffset = 0;
setDeleteRowIsSet(false);
this.deleteRow = false;
}
public int getKeysSize() {
return (this.keys == null) ? 0 : this.keys.size();
}
public void putToKeys(String key, Datum val) {
if (this.keys == null) {
this.keys = new HashMap();
}
this.keys.put(key, val);
}
/**
* 增量操作行的主键
*/
public Map getKeys() {
return this.keys;
}
/**
* 增量操作行的主键
*/
public RowEdit setKeys(Map keys) {
this.keys = keys;
return this;
}
public void unsetKeys() {
this.keys = null;
}
/** Returns true if field keys is set (has been assigned a value) and false otherwise */
public boolean isSetKeys() {
return this.keys != null;
}
public void setKeysIsSet(boolean value) {
if (!value) {
this.keys = null;
}
}
public int getEditsSize() {
return (this.edits == null) ? 0 : this.edits.size();
}
public void putToEdits(String key, EditDatum val) {
if (this.edits == null) {
this.edits = new HashMap();
}
this.edits.put(key, val);
}
/**
* 增量操作行的属性
*/
public Map getEdits() {
return this.edits;
}
/**
* 增量操作行的属性
*/
public RowEdit setEdits(Map edits) {
this.edits = edits;
return this;
}
public void unsetEdits() {
this.edits = null;
}
/** Returns true if field edits is set (has been assigned a value) and false otherwise */
public boolean isSetEdits() {
return this.edits != null;
}
public void setEditsIsSet(boolean value) {
if (!value) {
this.edits = null;
}
}
/**
* 增量偏移
*/
public long getConsumeOffset() {
return this.consumeOffset;
}
/**
* 增量偏移
*/
public RowEdit setConsumeOffset(long consumeOffset) {
this.consumeOffset = consumeOffset;
setConsumeOffsetIsSet(true);
return this;
}
public void unsetConsumeOffset() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONSUMEOFFSET_ISSET_ID);
}
/** Returns true if field consumeOffset is set (has been assigned a value) and false otherwise */
public boolean isSetConsumeOffset() {
return EncodingUtils.testBit(__isset_bitfield, __CONSUMEOFFSET_ISSET_ID);
}
public void setConsumeOffsetIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONSUMEOFFSET_ISSET_ID, value);
}
/**
* 是否删除整行
*/
public boolean isDeleteRow() {
return this.deleteRow;
}
/**
* 是否删除整行
*/
public RowEdit setDeleteRow(boolean deleteRow) {
this.deleteRow = deleteRow;
setDeleteRowIsSet(true);
return this;
}
public void unsetDeleteRow() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DELETEROW_ISSET_ID);
}
/** Returns true if field deleteRow is set (has been assigned a value) and false otherwise */
public boolean isSetDeleteRow() {
return EncodingUtils.testBit(__isset_bitfield, __DELETEROW_ISSET_ID);
}
public void setDeleteRowIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DELETEROW_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case KEYS:
if (value == null) {
unsetKeys();
} else {
setKeys((Map)value);
}
break;
case EDITS:
if (value == null) {
unsetEdits();
} else {
setEdits((Map)value);
}
break;
case CONSUME_OFFSET:
if (value == null) {
unsetConsumeOffset();
} else {
setConsumeOffset((Long)value);
}
break;
case DELETE_ROW:
if (value == null) {
unsetDeleteRow();
} else {
setDeleteRow((Boolean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case KEYS:
return getKeys();
case EDITS:
return getEdits();
case CONSUME_OFFSET:
return Long.valueOf(getConsumeOffset());
case DELETE_ROW:
return Boolean.valueOf(isDeleteRow());
}
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 KEYS:
return isSetKeys();
case EDITS:
return isSetEdits();
case CONSUME_OFFSET:
return isSetConsumeOffset();
case DELETE_ROW:
return isSetDeleteRow();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof RowEdit)
return this.equals((RowEdit)that);
return false;
}
public boolean equals(RowEdit that) {
if (that == null)
return false;
boolean this_present_keys = true && this.isSetKeys();
boolean that_present_keys = true && that.isSetKeys();
if (this_present_keys || that_present_keys) {
if (!(this_present_keys && that_present_keys))
return false;
if (!this.keys.equals(that.keys))
return false;
}
boolean this_present_edits = true && this.isSetEdits();
boolean that_present_edits = true && that.isSetEdits();
if (this_present_edits || that_present_edits) {
if (!(this_present_edits && that_present_edits))
return false;
if (!this.edits.equals(that.edits))
return false;
}
boolean this_present_consumeOffset = true && this.isSetConsumeOffset();
boolean that_present_consumeOffset = true && that.isSetConsumeOffset();
if (this_present_consumeOffset || that_present_consumeOffset) {
if (!(this_present_consumeOffset && that_present_consumeOffset))
return false;
if (this.consumeOffset != that.consumeOffset)
return false;
}
boolean this_present_deleteRow = true && this.isSetDeleteRow();
boolean that_present_deleteRow = true && that.isSetDeleteRow();
if (this_present_deleteRow || that_present_deleteRow) {
if (!(this_present_deleteRow && that_present_deleteRow))
return false;
if (this.deleteRow != that.deleteRow)
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy