org.apache.hive.service.rpc.thrift.TStatus Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hive.service.rpc.thrift;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.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.3)")
public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus");
private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField INFO_MESSAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("infoMessages", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TStatusStandardSchemeFactory());
schemes.put(TupleScheme.class, new TStatusTupleSchemeFactory());
}
private TStatusCode statusCode; // required
private List infoMessages; // optional
private String sqlState; // optional
private int errorCode; // optional
private String errorMessage; // 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 {
/**
*
* @see TStatusCode
*/
STATUS_CODE((short)1, "statusCode"),
INFO_MESSAGES((short)2, "infoMessages"),
SQL_STATE((short)3, "sqlState"),
ERROR_CODE((short)4, "errorCode"),
ERROR_MESSAGE((short)5, "errorMessage");
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: // STATUS_CODE
return STATUS_CODE;
case 2: // INFO_MESSAGES
return INFO_MESSAGES;
case 3: // SQL_STATE
return SQL_STATE;
case 4: // ERROR_CODE
return ERROR_CODE;
case 5: // ERROR_MESSAGE
return ERROR_MESSAGE;
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 __ERRORCODE_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class)));
tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap);
}
public TStatus() {
}
public TStatus(
TStatusCode statusCode)
{
this();
this.statusCode = statusCode;
}
/**
* Performs a deep copy on other.
*/
public TStatus(TStatus other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetStatusCode()) {
this.statusCode = other.statusCode;
}
if (other.isSetInfoMessages()) {
List __this__infoMessages = new ArrayList(other.infoMessages);
this.infoMessages = __this__infoMessages;
}
if (other.isSetSqlState()) {
this.sqlState = other.sqlState;
}
this.errorCode = other.errorCode;
if (other.isSetErrorMessage()) {
this.errorMessage = other.errorMessage;
}
}
public TStatus deepCopy() {
return new TStatus(this);
}
@Override
public void clear() {
this.statusCode = null;
this.infoMessages = null;
this.sqlState = null;
setErrorCodeIsSet(false);
this.errorCode = 0;
this.errorMessage = null;
}
/**
*
* @see TStatusCode
*/
public TStatusCode getStatusCode() {
return this.statusCode;
}
/**
*
* @see TStatusCode
*/
public void setStatusCode(TStatusCode statusCode) {
this.statusCode = statusCode;
}
public void unsetStatusCode() {
this.statusCode = null;
}
/** Returns true if field statusCode is set (has been assigned a value) and false otherwise */
public boolean isSetStatusCode() {
return this.statusCode != null;
}
public void setStatusCodeIsSet(boolean value) {
if (!value) {
this.statusCode = null;
}
}
public int getInfoMessagesSize() {
return (this.infoMessages == null) ? 0 : this.infoMessages.size();
}
public java.util.Iterator getInfoMessagesIterator() {
return (this.infoMessages == null) ? null : this.infoMessages.iterator();
}
public void addToInfoMessages(String elem) {
if (this.infoMessages == null) {
this.infoMessages = new ArrayList();
}
this.infoMessages.add(elem);
}
public List getInfoMessages() {
return this.infoMessages;
}
public void setInfoMessages(List infoMessages) {
this.infoMessages = infoMessages;
}
public void unsetInfoMessages() {
this.infoMessages = null;
}
/** Returns true if field infoMessages is set (has been assigned a value) and false otherwise */
public boolean isSetInfoMessages() {
return this.infoMessages != null;
}
public void setInfoMessagesIsSet(boolean value) {
if (!value) {
this.infoMessages = null;
}
}
public String getSqlState() {
return this.sqlState;
}
public void setSqlState(String sqlState) {
this.sqlState = sqlState;
}
public void unsetSqlState() {
this.sqlState = null;
}
/** Returns true if field sqlState is set (has been assigned a value) and false otherwise */
public boolean isSetSqlState() {
return this.sqlState != null;
}
public void setSqlStateIsSet(boolean value) {
if (!value) {
this.sqlState = null;
}
}
public int getErrorCode() {
return this.errorCode;
}
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
setErrorCodeIsSet(true);
}
public void unsetErrorCode() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID);
}
/** Returns true if field errorCode is set (has been assigned a value) and false otherwise */
public boolean isSetErrorCode() {
return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID);
}
public void setErrorCodeIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value);
}
public String getErrorMessage() {
return this.errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public void unsetErrorMessage() {
this.errorMessage = null;
}
/** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */
public boolean isSetErrorMessage() {
return this.errorMessage != null;
}
public void setErrorMessageIsSet(boolean value) {
if (!value) {
this.errorMessage = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case STATUS_CODE:
if (value == null) {
unsetStatusCode();
} else {
setStatusCode((TStatusCode)value);
}
break;
case INFO_MESSAGES:
if (value == null) {
unsetInfoMessages();
} else {
setInfoMessages((List)value);
}
break;
case SQL_STATE:
if (value == null) {
unsetSqlState();
} else {
setSqlState((String)value);
}
break;
case ERROR_CODE:
if (value == null) {
unsetErrorCode();
} else {
setErrorCode((Integer)value);
}
break;
case ERROR_MESSAGE:
if (value == null) {
unsetErrorMessage();
} else {
setErrorMessage((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case STATUS_CODE:
return getStatusCode();
case INFO_MESSAGES:
return getInfoMessages();
case SQL_STATE:
return getSqlState();
case ERROR_CODE:
return getErrorCode();
case ERROR_MESSAGE:
return getErrorMessage();
}
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 STATUS_CODE:
return isSetStatusCode();
case INFO_MESSAGES:
return isSetInfoMessages();
case SQL_STATE:
return isSetSqlState();
case ERROR_CODE:
return isSetErrorCode();
case ERROR_MESSAGE:
return isSetErrorMessage();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TStatus)
return this.equals((TStatus)that);
return false;
}
public boolean equals(TStatus that) {
if (that == null)
return false;
boolean this_present_statusCode = true && this.isSetStatusCode();
boolean that_present_statusCode = true && that.isSetStatusCode();
if (this_present_statusCode || that_present_statusCode) {
if (!(this_present_statusCode && that_present_statusCode))
return false;
if (!this.statusCode.equals(that.statusCode))
return false;
}
boolean this_present_infoMessages = true && this.isSetInfoMessages();
boolean that_present_infoMessages = true && that.isSetInfoMessages();
if (this_present_infoMessages || that_present_infoMessages) {
if (!(this_present_infoMessages && that_present_infoMessages))
return false;
if (!this.infoMessages.equals(that.infoMessages))
return false;
}
boolean this_present_sqlState = true && this.isSetSqlState();
boolean that_present_sqlState = true && that.isSetSqlState();
if (this_present_sqlState || that_present_sqlState) {
if (!(this_present_sqlState && that_present_sqlState))
return false;
if (!this.sqlState.equals(that.sqlState))
return false;
}
boolean this_present_errorCode = true && this.isSetErrorCode();
boolean that_present_errorCode = true && that.isSetErrorCode();
if (this_present_errorCode || that_present_errorCode) {
if (!(this_present_errorCode && that_present_errorCode))
return false;
if (this.errorCode != that.errorCode)
return false;
}
boolean this_present_errorMessage = true && this.isSetErrorMessage();
boolean that_present_errorMessage = true && that.isSetErrorMessage();
if (this_present_errorMessage || that_present_errorMessage) {
if (!(this_present_errorMessage && that_present_errorMessage))
return false;
if (!this.errorMessage.equals(that.errorMessage))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy