com.xiaomi.infra.galaxy.sds.thrift.LocalSecondaryIndexSpec 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 LocalSecondaryIndexSpec implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("LocalSecondaryIndexSpec");
private static final libthrift091.protocol.TField INDEX_SCHEMA_FIELD_DESC = new libthrift091.protocol.TField("indexSchema", libthrift091.protocol.TType.LIST, (short)1);
private static final libthrift091.protocol.TField PROJECTIONS_FIELD_DESC = new libthrift091.protocol.TField("projections", libthrift091.protocol.TType.LIST, (short)2);
private static final libthrift091.protocol.TField CONSISTENCY_MODE_FIELD_DESC = new libthrift091.protocol.TField("consistencyMode", libthrift091.protocol.TType.I32, (short)3);
private static final libthrift091.protocol.TField UNIQUE_FIELD_DESC = new libthrift091.protocol.TField("unique", libthrift091.protocol.TType.BOOL, (short)4);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new LocalSecondaryIndexSpecStandardSchemeFactory());
schemes.put(TupleScheme.class, new LocalSecondaryIndexSpecTupleSchemeFactory());
}
/**
* 索引定义
*/
public List indexSchema; // optional
/**
* 映射的属性,仅当索引类型为Eager时才可设置
*/
public List projections; // optional
/**
* 索引数据一致性模式
*
* @see SecondaryIndexConsistencyMode
*/
public SecondaryIndexConsistencyMode consistencyMode; // optional
/**
* 是否为唯一索引
*/
public boolean unique; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
/**
* 索引定义
*/
INDEX_SCHEMA((short)1, "indexSchema"),
/**
* 映射的属性,仅当索引类型为Eager时才可设置
*/
PROJECTIONS((short)2, "projections"),
/**
* 索引数据一致性模式
*
* @see SecondaryIndexConsistencyMode
*/
CONSISTENCY_MODE((short)3, "consistencyMode"),
/**
* 是否为唯一索引
*/
UNIQUE((short)4, "unique");
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: // INDEX_SCHEMA
return INDEX_SCHEMA;
case 2: // PROJECTIONS
return PROJECTIONS;
case 3: // CONSISTENCY_MODE
return CONSISTENCY_MODE;
case 4: // UNIQUE
return UNIQUE;
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 __UNIQUE_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.INDEX_SCHEMA,_Fields.PROJECTIONS,_Fields.CONSISTENCY_MODE,_Fields.UNIQUE};
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.INDEX_SCHEMA, new libthrift091.meta_data.FieldMetaData("indexSchema", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.LIST , "IndexSpec")));
tmpMap.put(_Fields.PROJECTIONS, new libthrift091.meta_data.FieldMetaData("projections", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.LIST , "Attributes")));
tmpMap.put(_Fields.CONSISTENCY_MODE, new libthrift091.meta_data.FieldMetaData("consistencyMode", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, SecondaryIndexConsistencyMode.class)));
tmpMap.put(_Fields.UNIQUE, new libthrift091.meta_data.FieldMetaData("unique", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(LocalSecondaryIndexSpec.class, metaDataMap);
}
public LocalSecondaryIndexSpec() {
this.consistencyMode = com.xiaomi.infra.galaxy.sds.thrift.SecondaryIndexConsistencyMode.LAZY;
this.unique = false;
}
/**
* Performs a deep copy on other.
*/
public LocalSecondaryIndexSpec(LocalSecondaryIndexSpec other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetIndexSchema()) {
this.indexSchema = other.indexSchema;
}
if (other.isSetProjections()) {
this.projections = other.projections;
}
if (other.isSetConsistencyMode()) {
this.consistencyMode = other.consistencyMode;
}
this.unique = other.unique;
}
public LocalSecondaryIndexSpec deepCopy() {
return new LocalSecondaryIndexSpec(this);
}
@Override
public void clear() {
this.indexSchema = null;
this.projections = null;
this.consistencyMode = com.xiaomi.infra.galaxy.sds.thrift.SecondaryIndexConsistencyMode.LAZY;
this.unique = false;
}
public int getIndexSchemaSize() {
return (this.indexSchema == null) ? 0 : this.indexSchema.size();
}
public java.util.Iterator getIndexSchemaIterator() {
return (this.indexSchema == null) ? null : this.indexSchema.iterator();
}
public void addToIndexSchema(KeySpec elem) {
if (this.indexSchema == null) {
this.indexSchema = new ArrayList();
}
this.indexSchema.add(elem);
}
/**
* 索引定义
*/
public List getIndexSchema() {
return this.indexSchema;
}
/**
* 索引定义
*/
public LocalSecondaryIndexSpec setIndexSchema(List indexSchema) {
this.indexSchema = indexSchema;
return this;
}
public void unsetIndexSchema() {
this.indexSchema = null;
}
/** Returns true if field indexSchema is set (has been assigned a value) and false otherwise */
public boolean isSetIndexSchema() {
return this.indexSchema != null;
}
public void setIndexSchemaIsSet(boolean value) {
if (!value) {
this.indexSchema = null;
}
}
public int getProjectionsSize() {
return (this.projections == null) ? 0 : this.projections.size();
}
public java.util.Iterator getProjectionsIterator() {
return (this.projections == null) ? null : this.projections.iterator();
}
public void addToProjections(String elem) {
if (this.projections == null) {
this.projections = new ArrayList();
}
this.projections.add(elem);
}
/**
* 映射的属性,仅当索引类型为Eager时才可设置
*/
public List getProjections() {
return this.projections;
}
/**
* 映射的属性,仅当索引类型为Eager时才可设置
*/
public LocalSecondaryIndexSpec setProjections(List projections) {
this.projections = projections;
return this;
}
public void unsetProjections() {
this.projections = null;
}
/** Returns true if field projections is set (has been assigned a value) and false otherwise */
public boolean isSetProjections() {
return this.projections != null;
}
public void setProjectionsIsSet(boolean value) {
if (!value) {
this.projections = null;
}
}
/**
* 索引数据一致性模式
*
* @see SecondaryIndexConsistencyMode
*/
public SecondaryIndexConsistencyMode getConsistencyMode() {
return this.consistencyMode;
}
/**
* 索引数据一致性模式
*
* @see SecondaryIndexConsistencyMode
*/
public LocalSecondaryIndexSpec setConsistencyMode(SecondaryIndexConsistencyMode consistencyMode) {
this.consistencyMode = consistencyMode;
return this;
}
public void unsetConsistencyMode() {
this.consistencyMode = null;
}
/** Returns true if field consistencyMode is set (has been assigned a value) and false otherwise */
public boolean isSetConsistencyMode() {
return this.consistencyMode != null;
}
public void setConsistencyModeIsSet(boolean value) {
if (!value) {
this.consistencyMode = null;
}
}
/**
* 是否为唯一索引
*/
public boolean isUnique() {
return this.unique;
}
/**
* 是否为唯一索引
*/
public LocalSecondaryIndexSpec setUnique(boolean unique) {
this.unique = unique;
setUniqueIsSet(true);
return this;
}
public void unsetUnique() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UNIQUE_ISSET_ID);
}
/** Returns true if field unique is set (has been assigned a value) and false otherwise */
public boolean isSetUnique() {
return EncodingUtils.testBit(__isset_bitfield, __UNIQUE_ISSET_ID);
}
public void setUniqueIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UNIQUE_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case INDEX_SCHEMA:
if (value == null) {
unsetIndexSchema();
} else {
setIndexSchema((List)value);
}
break;
case PROJECTIONS:
if (value == null) {
unsetProjections();
} else {
setProjections((List)value);
}
break;
case CONSISTENCY_MODE:
if (value == null) {
unsetConsistencyMode();
} else {
setConsistencyMode((SecondaryIndexConsistencyMode)value);
}
break;
case UNIQUE:
if (value == null) {
unsetUnique();
} else {
setUnique((Boolean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case INDEX_SCHEMA:
return getIndexSchema();
case PROJECTIONS:
return getProjections();
case CONSISTENCY_MODE:
return getConsistencyMode();
case UNIQUE:
return Boolean.valueOf(isUnique());
}
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 INDEX_SCHEMA:
return isSetIndexSchema();
case PROJECTIONS:
return isSetProjections();
case CONSISTENCY_MODE:
return isSetConsistencyMode();
case UNIQUE:
return isSetUnique();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof LocalSecondaryIndexSpec)
return this.equals((LocalSecondaryIndexSpec)that);
return false;
}
public boolean equals(LocalSecondaryIndexSpec that) {
if (that == null)
return false;
boolean this_present_indexSchema = true && this.isSetIndexSchema();
boolean that_present_indexSchema = true && that.isSetIndexSchema();
if (this_present_indexSchema || that_present_indexSchema) {
if (!(this_present_indexSchema && that_present_indexSchema))
return false;
if (!this.indexSchema.equals(that.indexSchema))
return false;
}
boolean this_present_projections = true && this.isSetProjections();
boolean that_present_projections = true && that.isSetProjections();
if (this_present_projections || that_present_projections) {
if (!(this_present_projections && that_present_projections))
return false;
if (!this.projections.equals(that.projections))
return false;
}
boolean this_present_consistencyMode = true && this.isSetConsistencyMode();
boolean that_present_consistencyMode = true && that.isSetConsistencyMode();
if (this_present_consistencyMode || that_present_consistencyMode) {
if (!(this_present_consistencyMode && that_present_consistencyMode))
return false;
if (!this.consistencyMode.equals(that.consistencyMode))
return false;
}
boolean this_present_unique = true && this.isSetUnique();
boolean that_present_unique = true && that.isSetUnique();
if (this_present_unique || that_present_unique) {
if (!(this_present_unique && that_present_unique))
return false;
if (this.unique != that.unique)
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy