org.apache.hive.service.rpc.thrift.TOpenSessionReq 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 TOpenSessionReq 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("TOpenSessionReq");
private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TOpenSessionReqStandardSchemeFactory());
schemes.put(TupleScheme.class, new TOpenSessionReqTupleSchemeFactory());
}
private TProtocolVersion client_protocol; // required
private String username; // optional
private String password; // optional
private Map configuration; // 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 TProtocolVersion
*/
CLIENT_PROTOCOL((short)1, "client_protocol"),
USERNAME((short)2, "username"),
PASSWORD((short)3, "password"),
CONFIGURATION((short)4, "configuration");
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: // CLIENT_PROTOCOL
return CLIENT_PROTOCOL;
case 2: // USERNAME
return USERNAME;
case 3: // PASSWORD
return PASSWORD;
case 4: // CONFIGURATION
return CONFIGURATION;
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 _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION};
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.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class)));
tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap);
}
public TOpenSessionReq() {
this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10;
}
public TOpenSessionReq(
TProtocolVersion client_protocol)
{
this();
this.client_protocol = client_protocol;
}
/**
* Performs a deep copy on other.
*/
public TOpenSessionReq(TOpenSessionReq other) {
if (other.isSetClient_protocol()) {
this.client_protocol = other.client_protocol;
}
if (other.isSetUsername()) {
this.username = other.username;
}
if (other.isSetPassword()) {
this.password = other.password;
}
if (other.isSetConfiguration()) {
Map __this__configuration = new HashMap(other.configuration);
this.configuration = __this__configuration;
}
}
public TOpenSessionReq deepCopy() {
return new TOpenSessionReq(this);
}
@Override
public void clear() {
this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10;
this.username = null;
this.password = null;
this.configuration = null;
}
/**
*
* @see TProtocolVersion
*/
public TProtocolVersion getClient_protocol() {
return this.client_protocol;
}
/**
*
* @see TProtocolVersion
*/
public void setClient_protocol(TProtocolVersion client_protocol) {
this.client_protocol = client_protocol;
}
public void unsetClient_protocol() {
this.client_protocol = null;
}
/** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */
public boolean isSetClient_protocol() {
return this.client_protocol != null;
}
public void setClient_protocolIsSet(boolean value) {
if (!value) {
this.client_protocol = null;
}
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been assigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public void unsetPassword() {
this.password = null;
}
/** Returns true if field password is set (has been assigned a value) and false otherwise */
public boolean isSetPassword() {
return this.password != null;
}
public void setPasswordIsSet(boolean value) {
if (!value) {
this.password = null;
}
}
public int getConfigurationSize() {
return (this.configuration == null) ? 0 : this.configuration.size();
}
public void putToConfiguration(String key, String val) {
if (this.configuration == null) {
this.configuration = new HashMap();
}
this.configuration.put(key, val);
}
public Map getConfiguration() {
return this.configuration;
}
public void setConfiguration(Map configuration) {
this.configuration = configuration;
}
public void unsetConfiguration() {
this.configuration = null;
}
/** Returns true if field configuration is set (has been assigned a value) and false otherwise */
public boolean isSetConfiguration() {
return this.configuration != null;
}
public void setConfigurationIsSet(boolean value) {
if (!value) {
this.configuration = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case CLIENT_PROTOCOL:
if (value == null) {
unsetClient_protocol();
} else {
setClient_protocol((TProtocolVersion)value);
}
break;
case USERNAME:
if (value == null) {
unsetUsername();
} else {
setUsername((String)value);
}
break;
case PASSWORD:
if (value == null) {
unsetPassword();
} else {
setPassword((String)value);
}
break;
case CONFIGURATION:
if (value == null) {
unsetConfiguration();
} else {
setConfiguration((Map)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case CLIENT_PROTOCOL:
return getClient_protocol();
case USERNAME:
return getUsername();
case PASSWORD:
return getPassword();
case CONFIGURATION:
return getConfiguration();
}
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 CLIENT_PROTOCOL:
return isSetClient_protocol();
case USERNAME:
return isSetUsername();
case PASSWORD:
return isSetPassword();
case CONFIGURATION:
return isSetConfiguration();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TOpenSessionReq)
return this.equals((TOpenSessionReq)that);
return false;
}
public boolean equals(TOpenSessionReq that) {
if (that == null)
return false;
boolean this_present_client_protocol = true && this.isSetClient_protocol();
boolean that_present_client_protocol = true && that.isSetClient_protocol();
if (this_present_client_protocol || that_present_client_protocol) {
if (!(this_present_client_protocol && that_present_client_protocol))
return false;
if (!this.client_protocol.equals(that.client_protocol))
return false;
}
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
boolean this_present_password = true && this.isSetPassword();
boolean that_present_password = true && that.isSetPassword();
if (this_present_password || that_present_password) {
if (!(this_present_password && that_present_password))
return false;
if (!this.password.equals(that.password))
return false;
}
boolean this_present_configuration = true && this.isSetConfiguration();
boolean that_present_configuration = true && that.isSetConfiguration();
if (this_present_configuration || that_present_configuration) {
if (!(this_present_configuration && that_present_configuration))
return false;
if (!this.configuration.equals(that.configuration))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy