blob: 09c1df0105a2fdcec97fd854d14513bcf4cc92b3 [file] [log] [blame]
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hive.metastore.api;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)")
@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class SchemaVersion implements org.apache.thrift.TBase<SchemaVersion, SchemaVersion._Fields>, java.io.Serializable, Cloneable, Comparable<SchemaVersion> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SchemaVersion");
private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField CREATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("createdAt", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField COLS_FIELD_DESC = new org.apache.thrift.protocol.TField("cols", org.apache.thrift.protocol.TType.LIST, (short)4);
private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("state", org.apache.thrift.protocol.TType.I32, (short)5);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField SCHEMA_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaText", org.apache.thrift.protocol.TType.STRING, (short)7);
private static final org.apache.thrift.protocol.TField FINGERPRINT_FIELD_DESC = new org.apache.thrift.protocol.TField("fingerprint", org.apache.thrift.protocol.TType.STRING, (short)8);
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)9);
private static final org.apache.thrift.protocol.TField SER_DE_FIELD_DESC = new org.apache.thrift.protocol.TField("serDe", org.apache.thrift.protocol.TType.STRUCT, (short)10);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SchemaVersionStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SchemaVersionTupleSchemeFactory();
private @org.apache.thrift.annotation.Nullable ISchemaName schema; // required
private int version; // required
private long createdAt; // required
private @org.apache.thrift.annotation.Nullable java.util.List<FieldSchema> cols; // required
private @org.apache.thrift.annotation.Nullable SchemaVersionState state; // optional
private @org.apache.thrift.annotation.Nullable java.lang.String description; // optional
private @org.apache.thrift.annotation.Nullable java.lang.String schemaText; // optional
private @org.apache.thrift.annotation.Nullable java.lang.String fingerprint; // optional
private @org.apache.thrift.annotation.Nullable java.lang.String name; // optional
private @org.apache.thrift.annotation.Nullable SerDeInfo serDe; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SCHEMA((short)1, "schema"),
VERSION((short)2, "version"),
CREATED_AT((short)3, "createdAt"),
COLS((short)4, "cols"),
/**
*
* @see SchemaVersionState
*/
STATE((short)5, "state"),
DESCRIPTION((short)6, "description"),
SCHEMA_TEXT((short)7, "schemaText"),
FINGERPRINT((short)8, "fingerprint"),
NAME((short)9, "name"),
SER_DE((short)10, "serDe");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // SCHEMA
return SCHEMA;
case 2: // VERSION
return VERSION;
case 3: // CREATED_AT
return CREATED_AT;
case 4: // COLS
return COLS;
case 5: // STATE
return STATE;
case 6: // DESCRIPTION
return DESCRIPTION;
case 7: // SCHEMA_TEXT
return SCHEMA_TEXT;
case 8: // FINGERPRINT
return FINGERPRINT;
case 9: // NAME
return NAME;
case 10: // SER_DE
return SER_DE;
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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __VERSION_ISSET_ID = 0;
private static final int __CREATEDAT_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.STATE,_Fields.DESCRIPTION,_Fields.SCHEMA_TEXT,_Fields.FINGERPRINT,_Fields.NAME,_Fields.SER_DE};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ISchemaName.class)));
tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.CREATED_AT, new org.apache.thrift.meta_data.FieldMetaData("createdAt", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.COLS, new org.apache.thrift.meta_data.FieldMetaData("cols", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FieldSchema.class))));
tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SchemaVersionState.class)));
tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.SCHEMA_TEXT, new org.apache.thrift.meta_data.FieldMetaData("schemaText", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FINGERPRINT, new org.apache.thrift.meta_data.FieldMetaData("fingerprint", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.SER_DE, new org.apache.thrift.meta_data.FieldMetaData("serDe", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SerDeInfo.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SchemaVersion.class, metaDataMap);
}
public SchemaVersion() {
}
public SchemaVersion(
ISchemaName schema,
int version,
long createdAt,
java.util.List<FieldSchema> cols)
{
this();
this.schema = schema;
this.version = version;
setVersionIsSet(true);
this.createdAt = createdAt;
setCreatedAtIsSet(true);
this.cols = cols;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public SchemaVersion(SchemaVersion other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetSchema()) {
this.schema = new ISchemaName(other.schema);
}
this.version = other.version;
this.createdAt = other.createdAt;
if (other.isSetCols()) {
java.util.List<FieldSchema> __this__cols = new java.util.ArrayList<FieldSchema>(other.cols.size());
for (FieldSchema other_element : other.cols) {
__this__cols.add(new FieldSchema(other_element));
}
this.cols = __this__cols;
}
if (other.isSetState()) {
this.state = other.state;
}
if (other.isSetDescription()) {
this.description = other.description;
}
if (other.isSetSchemaText()) {
this.schemaText = other.schemaText;
}
if (other.isSetFingerprint()) {
this.fingerprint = other.fingerprint;
}
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetSerDe()) {
this.serDe = new SerDeInfo(other.serDe);
}
}
public SchemaVersion deepCopy() {
return new SchemaVersion(this);
}
@Override
public void clear() {
this.schema = null;
setVersionIsSet(false);
this.version = 0;
setCreatedAtIsSet(false);
this.createdAt = 0;
this.cols = null;
this.state = null;
this.description = null;
this.schemaText = null;
this.fingerprint = null;
this.name = null;
this.serDe = null;
}
@org.apache.thrift.annotation.Nullable
public ISchemaName getSchema() {
return this.schema;
}
public void setSchema(@org.apache.thrift.annotation.Nullable ISchemaName schema) {
this.schema = schema;
}
public void unsetSchema() {
this.schema = null;
}
/** Returns true if field schema is set (has been assigned a value) and false otherwise */
public boolean isSetSchema() {
return this.schema != null;
}
public void setSchemaIsSet(boolean value) {
if (!value) {
this.schema = null;
}
}
public int getVersion() {
return this.version;
}
public void setVersion(int version) {
this.version = version;
setVersionIsSet(true);
}
public void unsetVersion() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID);
}
/** Returns true if field version is set (has been assigned a value) and false otherwise */
public boolean isSetVersion() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID);
}
public void setVersionIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value);
}
public long getCreatedAt() {
return this.createdAt;
}
public void setCreatedAt(long createdAt) {
this.createdAt = createdAt;
setCreatedAtIsSet(true);
}
public void unsetCreatedAt() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATEDAT_ISSET_ID);
}
/** Returns true if field createdAt is set (has been assigned a value) and false otherwise */
public boolean isSetCreatedAt() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATEDAT_ISSET_ID);
}
public void setCreatedAtIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATEDAT_ISSET_ID, value);
}
public int getColsSize() {
return (this.cols == null) ? 0 : this.cols.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<FieldSchema> getColsIterator() {
return (this.cols == null) ? null : this.cols.iterator();
}
public void addToCols(FieldSchema elem) {
if (this.cols == null) {
this.cols = new java.util.ArrayList<FieldSchema>();
}
this.cols.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List<FieldSchema> getCols() {
return this.cols;
}
public void setCols(@org.apache.thrift.annotation.Nullable java.util.List<FieldSchema> cols) {
this.cols = cols;
}
public void unsetCols() {
this.cols = null;
}
/** Returns true if field cols is set (has been assigned a value) and false otherwise */
public boolean isSetCols() {
return this.cols != null;
}
public void setColsIsSet(boolean value) {
if (!value) {
this.cols = null;
}
}
/**
*
* @see SchemaVersionState
*/
@org.apache.thrift.annotation.Nullable
public SchemaVersionState getState() {
return this.state;
}
/**
*
* @see SchemaVersionState
*/
public void setState(@org.apache.thrift.annotation.Nullable SchemaVersionState state) {
this.state = state;
}
public void unsetState() {
this.state = null;
}
/** Returns true if field state is set (has been assigned a value) and false otherwise */
public boolean isSetState() {
return this.state != null;
}
public void setStateIsSet(boolean value) {
if (!value) {
this.state = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getDescription() {
return this.description;
}
public void setDescription(@org.apache.thrift.annotation.Nullable java.lang.String description) {
this.description = description;
}
public void unsetDescription() {
this.description = null;
}
/** Returns true if field description is set (has been assigned a value) and false otherwise */
public boolean isSetDescription() {
return this.description != null;
}
public void setDescriptionIsSet(boolean value) {
if (!value) {
this.description = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getSchemaText() {
return this.schemaText;
}
public void setSchemaText(@org.apache.thrift.annotation.Nullable java.lang.String schemaText) {
this.schemaText = schemaText;
}
public void unsetSchemaText() {
this.schemaText = null;
}
/** Returns true if field schemaText is set (has been assigned a value) and false otherwise */
public boolean isSetSchemaText() {
return this.schemaText != null;
}
public void setSchemaTextIsSet(boolean value) {
if (!value) {
this.schemaText = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getFingerprint() {
return this.fingerprint;
}
public void setFingerprint(@org.apache.thrift.annotation.Nullable java.lang.String fingerprint) {
this.fingerprint = fingerprint;
}
public void unsetFingerprint() {
this.fingerprint = null;
}
/** Returns true if field fingerprint is set (has been assigned a value) and false otherwise */
public boolean isSetFingerprint() {
return this.fingerprint != null;
}
public void setFingerprintIsSet(boolean value) {
if (!value) {
this.fingerprint = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getName() {
return this.name;
}
public void setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
this.name = name;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
@org.apache.thrift.annotation.Nullable
public SerDeInfo getSerDe() {
return this.serDe;
}
public void setSerDe(@org.apache.thrift.annotation.Nullable SerDeInfo serDe) {
this.serDe = serDe;
}
public void unsetSerDe() {
this.serDe = null;
}
/** Returns true if field serDe is set (has been assigned a value) and false otherwise */
public boolean isSetSerDe() {
return this.serDe != null;
}
public void setSerDeIsSet(boolean value) {
if (!value) {
this.serDe = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SCHEMA:
if (value == null) {
unsetSchema();
} else {
setSchema((ISchemaName)value);
}
break;
case VERSION:
if (value == null) {
unsetVersion();
} else {
setVersion((java.lang.Integer)value);
}
break;
case CREATED_AT:
if (value == null) {
unsetCreatedAt();
} else {
setCreatedAt((java.lang.Long)value);
}
break;
case COLS:
if (value == null) {
unsetCols();
} else {
setCols((java.util.List<FieldSchema>)value);
}
break;
case STATE:
if (value == null) {
unsetState();
} else {
setState((SchemaVersionState)value);
}
break;
case DESCRIPTION:
if (value == null) {
unsetDescription();
} else {
setDescription((java.lang.String)value);
}
break;
case SCHEMA_TEXT:
if (value == null) {
unsetSchemaText();
} else {
setSchemaText((java.lang.String)value);
}
break;
case FINGERPRINT:
if (value == null) {
unsetFingerprint();
} else {
setFingerprint((java.lang.String)value);
}
break;
case NAME:
if (value == null) {
unsetName();
} else {
setName((java.lang.String)value);
}
break;
case SER_DE:
if (value == null) {
unsetSerDe();
} else {
setSerDe((SerDeInfo)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SCHEMA:
return getSchema();
case VERSION:
return getVersion();
case CREATED_AT:
return getCreatedAt();
case COLS:
return getCols();
case STATE:
return getState();
case DESCRIPTION:
return getDescription();
case SCHEMA_TEXT:
return getSchemaText();
case FINGERPRINT:
return getFingerprint();
case NAME:
return getName();
case SER_DE:
return getSerDe();
}
throw new java.lang.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 java.lang.IllegalArgumentException();
}
switch (field) {
case SCHEMA:
return isSetSchema();
case VERSION:
return isSetVersion();
case CREATED_AT:
return isSetCreatedAt();
case COLS:
return isSetCols();
case STATE:
return isSetState();
case DESCRIPTION:
return isSetDescription();
case SCHEMA_TEXT:
return isSetSchemaText();
case FINGERPRINT:
return isSetFingerprint();
case NAME:
return isSetName();
case SER_DE:
return isSetSerDe();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof SchemaVersion)
return this.equals((SchemaVersion)that);
return false;
}
public boolean equals(SchemaVersion that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_schema = true && this.isSetSchema();
boolean that_present_schema = true && that.isSetSchema();
if (this_present_schema || that_present_schema) {
if (!(this_present_schema && that_present_schema))
return false;
if (!this.schema.equals(that.schema))
return false;
}
boolean this_present_version = true;
boolean that_present_version = true;
if (this_present_version || that_present_version) {
if (!(this_present_version && that_present_version))
return false;
if (this.version != that.version)
return false;
}
boolean this_present_createdAt = true;
boolean that_present_createdAt = true;
if (this_present_createdAt || that_present_createdAt) {
if (!(this_present_createdAt && that_present_createdAt))
return false;
if (this.createdAt != that.createdAt)
return false;
}
boolean this_present_cols = true && this.isSetCols();
boolean that_present_cols = true && that.isSetCols();
if (this_present_cols || that_present_cols) {
if (!(this_present_cols && that_present_cols))
return false;
if (!this.cols.equals(that.cols))
return false;
}
boolean this_present_state = true && this.isSetState();
boolean that_present_state = true && that.isSetState();
if (this_present_state || that_present_state) {
if (!(this_present_state && that_present_state))
return false;
if (!this.state.equals(that.state))
return false;
}
boolean this_present_description = true && this.isSetDescription();
boolean that_present_description = true && that.isSetDescription();
if (this_present_description || that_present_description) {
if (!(this_present_description && that_present_description))
return false;
if (!this.description.equals(that.description))
return false;
}
boolean this_present_schemaText = true && this.isSetSchemaText();
boolean that_present_schemaText = true && that.isSetSchemaText();
if (this_present_schemaText || that_present_schemaText) {
if (!(this_present_schemaText && that_present_schemaText))
return false;
if (!this.schemaText.equals(that.schemaText))
return false;
}
boolean this_present_fingerprint = true && this.isSetFingerprint();
boolean that_present_fingerprint = true && that.isSetFingerprint();
if (this_present_fingerprint || that_present_fingerprint) {
if (!(this_present_fingerprint && that_present_fingerprint))
return false;
if (!this.fingerprint.equals(that.fingerprint))
return false;
}
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_serDe = true && this.isSetSerDe();
boolean that_present_serDe = true && that.isSetSerDe();
if (this_present_serDe || that_present_serDe) {
if (!(this_present_serDe && that_present_serDe))
return false;
if (!this.serDe.equals(that.serDe))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSchema()) ? 131071 : 524287);
if (isSetSchema())
hashCode = hashCode * 8191 + schema.hashCode();
hashCode = hashCode * 8191 + version;
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(createdAt);
hashCode = hashCode * 8191 + ((isSetCols()) ? 131071 : 524287);
if (isSetCols())
hashCode = hashCode * 8191 + cols.hashCode();
hashCode = hashCode * 8191 + ((isSetState()) ? 131071 : 524287);
if (isSetState())
hashCode = hashCode * 8191 + state.getValue();
hashCode = hashCode * 8191 + ((isSetDescription()) ? 131071 : 524287);
if (isSetDescription())
hashCode = hashCode * 8191 + description.hashCode();
hashCode = hashCode * 8191 + ((isSetSchemaText()) ? 131071 : 524287);
if (isSetSchemaText())
hashCode = hashCode * 8191 + schemaText.hashCode();
hashCode = hashCode * 8191 + ((isSetFingerprint()) ? 131071 : 524287);
if (isSetFingerprint())
hashCode = hashCode * 8191 + fingerprint.hashCode();
hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
if (isSetName())
hashCode = hashCode * 8191 + name.hashCode();
hashCode = hashCode * 8191 + ((isSetSerDe()) ? 131071 : 524287);
if (isSetSerDe())
hashCode = hashCode * 8191 + serDe.hashCode();
return hashCode;
}
@Override
public int compareTo(SchemaVersion other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSchema()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, other.schema);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetVersion()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetCreatedAt()).compareTo(other.isSetCreatedAt());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCreatedAt()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdAt, other.createdAt);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetCols()).compareTo(other.isSetCols());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCols()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cols, other.cols);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetState()).compareTo(other.isSetState());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetState()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDescription()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetSchemaText()).compareTo(other.isSetSchemaText());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSchemaText()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaText, other.schemaText);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetFingerprint()).compareTo(other.isSetFingerprint());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFingerprint()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fingerprint, other.fingerprint);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetSerDe()).compareTo(other.isSetSerDe());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSerDe()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serDe, other.serDe);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("SchemaVersion(");
boolean first = true;
sb.append("schema:");
if (this.schema == null) {
sb.append("null");
} else {
sb.append(this.schema);
}
first = false;
if (!first) sb.append(", ");
sb.append("version:");
sb.append(this.version);
first = false;
if (!first) sb.append(", ");
sb.append("createdAt:");
sb.append(this.createdAt);
first = false;
if (!first) sb.append(", ");
sb.append("cols:");
if (this.cols == null) {
sb.append("null");
} else {
sb.append(this.cols);
}
first = false;
if (isSetState()) {
if (!first) sb.append(", ");
sb.append("state:");
if (this.state == null) {
sb.append("null");
} else {
sb.append(this.state);
}
first = false;
}
if (isSetDescription()) {
if (!first) sb.append(", ");
sb.append("description:");
if (this.description == null) {
sb.append("null");
} else {
sb.append(this.description);
}
first = false;
}
if (isSetSchemaText()) {
if (!first) sb.append(", ");
sb.append("schemaText:");
if (this.schemaText == null) {
sb.append("null");
} else {
sb.append(this.schemaText);
}
first = false;
}
if (isSetFingerprint()) {
if (!first) sb.append(", ");
sb.append("fingerprint:");
if (this.fingerprint == null) {
sb.append("null");
} else {
sb.append(this.fingerprint);
}
first = false;
}
if (isSetName()) {
if (!first) sb.append(", ");
sb.append("name:");
if (this.name == null) {
sb.append("null");
} else {
sb.append(this.name);
}
first = false;
}
if (isSetSerDe()) {
if (!first) sb.append(", ");
sb.append("serDe:");
if (this.serDe == null) {
sb.append("null");
} else {
sb.append(this.serDe);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (schema != null) {
schema.validate();
}
if (serDe != null) {
serDe.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class SchemaVersionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public SchemaVersionStandardScheme getScheme() {
return new SchemaVersionStandardScheme();
}
}
private static class SchemaVersionStandardScheme extends org.apache.thrift.scheme.StandardScheme<SchemaVersion> {
public void read(org.apache.thrift.protocol.TProtocol iprot, SchemaVersion struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // SCHEMA
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.schema = new ISchemaName();
struct.schema.read(iprot);
struct.setSchemaIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.version = iprot.readI32();
struct.setVersionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // CREATED_AT
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.createdAt = iprot.readI64();
struct.setCreatedAtIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // COLS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list1128 = iprot.readListBegin();
struct.cols = new java.util.ArrayList<FieldSchema>(_list1128.size);
@org.apache.thrift.annotation.Nullable FieldSchema _elem1129;
for (int _i1130 = 0; _i1130 < _list1128.size; ++_i1130)
{
_elem1129 = new FieldSchema();
_elem1129.read(iprot);
struct.cols.add(_elem1129);
}
iprot.readListEnd();
}
struct.setColsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // STATE
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.state = org.apache.hadoop.hive.metastore.api.SchemaVersionState.findByValue(iprot.readI32());
struct.setStateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // DESCRIPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.description = iprot.readString();
struct.setDescriptionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // SCHEMA_TEXT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.schemaText = iprot.readString();
struct.setSchemaTextIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // FINGERPRINT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.fingerprint = iprot.readString();
struct.setFingerprintIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // SER_DE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.serDe = new SerDeInfo();
struct.serDe.read(iprot);
struct.setSerDeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, SchemaVersion struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.schema != null) {
oprot.writeFieldBegin(SCHEMA_FIELD_DESC);
struct.schema.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(VERSION_FIELD_DESC);
oprot.writeI32(struct.version);
oprot.writeFieldEnd();
oprot.writeFieldBegin(CREATED_AT_FIELD_DESC);
oprot.writeI64(struct.createdAt);
oprot.writeFieldEnd();
if (struct.cols != null) {
oprot.writeFieldBegin(COLS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.cols.size()));
for (FieldSchema _iter1131 : struct.cols)
{
_iter1131.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.state != null) {
if (struct.isSetState()) {
oprot.writeFieldBegin(STATE_FIELD_DESC);
oprot.writeI32(struct.state.getValue());
oprot.writeFieldEnd();
}
}
if (struct.description != null) {
if (struct.isSetDescription()) {
oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
oprot.writeString(struct.description);
oprot.writeFieldEnd();
}
}
if (struct.schemaText != null) {
if (struct.isSetSchemaText()) {
oprot.writeFieldBegin(SCHEMA_TEXT_FIELD_DESC);
oprot.writeString(struct.schemaText);
oprot.writeFieldEnd();
}
}
if (struct.fingerprint != null) {
if (struct.isSetFingerprint()) {
oprot.writeFieldBegin(FINGERPRINT_FIELD_DESC);
oprot.writeString(struct.fingerprint);
oprot.writeFieldEnd();
}
}
if (struct.name != null) {
if (struct.isSetName()) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(struct.name);
oprot.writeFieldEnd();
}
}
if (struct.serDe != null) {
if (struct.isSetSerDe()) {
oprot.writeFieldBegin(SER_DE_FIELD_DESC);
struct.serDe.write(oprot);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class SchemaVersionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public SchemaVersionTupleScheme getScheme() {
return new SchemaVersionTupleScheme();
}
}
private static class SchemaVersionTupleScheme extends org.apache.thrift.scheme.TupleScheme<SchemaVersion> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SchemaVersion struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSchema()) {
optionals.set(0);
}
if (struct.isSetVersion()) {
optionals.set(1);
}
if (struct.isSetCreatedAt()) {
optionals.set(2);
}
if (struct.isSetCols()) {
optionals.set(3);
}
if (struct.isSetState()) {
optionals.set(4);
}
if (struct.isSetDescription()) {
optionals.set(5);
}
if (struct.isSetSchemaText()) {
optionals.set(6);
}
if (struct.isSetFingerprint()) {
optionals.set(7);
}
if (struct.isSetName()) {
optionals.set(8);
}
if (struct.isSetSerDe()) {
optionals.set(9);
}
oprot.writeBitSet(optionals, 10);
if (struct.isSetSchema()) {
struct.schema.write(oprot);
}
if (struct.isSetVersion()) {
oprot.writeI32(struct.version);
}
if (struct.isSetCreatedAt()) {
oprot.writeI64(struct.createdAt);
}
if (struct.isSetCols()) {
{
oprot.writeI32(struct.cols.size());
for (FieldSchema _iter1132 : struct.cols)
{
_iter1132.write(oprot);
}
}
}
if (struct.isSetState()) {
oprot.writeI32(struct.state.getValue());
}
if (struct.isSetDescription()) {
oprot.writeString(struct.description);
}
if (struct.isSetSchemaText()) {
oprot.writeString(struct.schemaText);
}
if (struct.isSetFingerprint()) {
oprot.writeString(struct.fingerprint);
}
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
if (struct.isSetSerDe()) {
struct.serDe.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, SchemaVersion struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(10);
if (incoming.get(0)) {
struct.schema = new ISchemaName();
struct.schema.read(iprot);
struct.setSchemaIsSet(true);
}
if (incoming.get(1)) {
struct.version = iprot.readI32();
struct.setVersionIsSet(true);
}
if (incoming.get(2)) {
struct.createdAt = iprot.readI64();
struct.setCreatedAtIsSet(true);
}
if (incoming.get(3)) {
{
org.apache.thrift.protocol.TList _list1133 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.cols = new java.util.ArrayList<FieldSchema>(_list1133.size);
@org.apache.thrift.annotation.Nullable FieldSchema _elem1134;
for (int _i1135 = 0; _i1135 < _list1133.size; ++_i1135)
{
_elem1134 = new FieldSchema();
_elem1134.read(iprot);
struct.cols.add(_elem1134);
}
}
struct.setColsIsSet(true);
}
if (incoming.get(4)) {
struct.state = org.apache.hadoop.hive.metastore.api.SchemaVersionState.findByValue(iprot.readI32());
struct.setStateIsSet(true);
}
if (incoming.get(5)) {
struct.description = iprot.readString();
struct.setDescriptionIsSet(true);
}
if (incoming.get(6)) {
struct.schemaText = iprot.readString();
struct.setSchemaTextIsSet(true);
}
if (incoming.get(7)) {
struct.fingerprint = iprot.readString();
struct.setFingerprintIsSet(true);
}
if (incoming.get(8)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
}
if (incoming.get(9)) {
struct.serDe = new SerDeInfo();
struct.serDe.read(iprot);
struct.setSerDeIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}