You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2013/03/12 18:45:12 UTC
svn commit: r1455646 [17/25] - in /hive/trunk/service/src/gen/thrift:
gen-cpp/ gen-javabean/org/apache/hive/ gen-javabean/org/apache/hive/service/
gen-javabean/org/apache/hive/service/cli/
gen-javabean/org/apache/hive/service/cli/thrift/ gen-php/ gen-p...
Added: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java?rev=1455646&view=auto
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java (added)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java Tue Mar 12 17:45:10 2013
@@ -0,0 +1,785 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.cli.thrift;
+
+import org.apache.commons.lang.builder.HashCodeBuilder;
+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 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TOpenSessionReq implements org.apache.thrift.TBase<TOpenSessionReq, TOpenSessionReq._Fields>, java.io.Serializable, Cloneable {
+ 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> 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<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ 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 _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.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1;
+
+ }
+
+ public TOpenSessionReq(
+ TProtocolVersion client_protocol)
+ {
+ this();
+ this.client_protocol = client_protocol;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ 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<String,String> __this__configuration = new HashMap<String,String>();
+ for (Map.Entry<String, String> other_element : other.configuration.entrySet()) {
+
+ String other_element_key = other_element.getKey();
+ String other_element_value = other_element.getValue();
+
+ String __this__configuration_copy_key = other_element_key;
+
+ String __this__configuration_copy_value = other_element_value;
+
+ __this__configuration.put(__this__configuration_copy_key, __this__configuration_copy_value);
+ }
+ this.configuration = __this__configuration;
+ }
+ }
+
+ public TOpenSessionReq deepCopy() {
+ return new TOpenSessionReq(this);
+ }
+
+ @Override
+ public void clear() {
+ this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1;
+
+ 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<String,String>();
+ }
+ this.configuration.put(key, val);
+ }
+
+ public Map<String,String> getConfiguration() {
+ return this.configuration;
+ }
+
+ public void setConfiguration(Map<String,String> 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<String,String>)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() {
+ HashCodeBuilder builder = new HashCodeBuilder();
+
+ boolean present_client_protocol = true && (isSetClient_protocol());
+ builder.append(present_client_protocol);
+ if (present_client_protocol)
+ builder.append(client_protocol.getValue());
+
+ boolean present_username = true && (isSetUsername());
+ builder.append(present_username);
+ if (present_username)
+ builder.append(username);
+
+ boolean present_password = true && (isSetPassword());
+ builder.append(present_password);
+ if (present_password)
+ builder.append(password);
+
+ boolean present_configuration = true && (isSetConfiguration());
+ builder.append(present_configuration);
+ if (present_configuration)
+ builder.append(configuration);
+
+ return builder.toHashCode();
+ }
+
+ public int compareTo(TOpenSessionReq other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TOpenSessionReq typedOther = (TOpenSessionReq)other;
+
+ lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(typedOther.isSetClient_protocol());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetClient_protocol()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, typedOther.client_protocol);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUsername()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetPassword()).compareTo(typedOther.isSetPassword());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetPassword()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(typedOther.isSetConfiguration());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetConfiguration()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, typedOther.configuration);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TOpenSessionReq(");
+ boolean first = true;
+
+ sb.append("client_protocol:");
+ if (this.client_protocol == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.client_protocol);
+ }
+ first = false;
+ if (isSetUsername()) {
+ if (!first) sb.append(", ");
+ sb.append("username:");
+ if (this.username == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.username);
+ }
+ first = false;
+ }
+ if (isSetPassword()) {
+ if (!first) sb.append(", ");
+ sb.append("password:");
+ if (this.password == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.password);
+ }
+ first = false;
+ }
+ if (isSetConfiguration()) {
+ if (!first) sb.append(", ");
+ sb.append("configuration:");
+ if (this.configuration == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.configuration);
+ }
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetClient_protocol()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ 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, ClassNotFoundException {
+ try {
+ 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 TOpenSessionReqStandardSchemeFactory implements SchemeFactory {
+ public TOpenSessionReqStandardScheme getScheme() {
+ return new TOpenSessionReqStandardScheme();
+ }
+ }
+
+ private static class TOpenSessionReqStandardScheme extends StandardScheme<TOpenSessionReq> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq 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: // CLIENT_PROTOCOL
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32());
+ struct.setClient_protocolIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // USERNAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // PASSWORD
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.password = iprot.readString();
+ struct.setPasswordIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // CONFIGURATION
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map124 = iprot.readMapBegin();
+ struct.configuration = new HashMap<String,String>(2*_map124.size);
+ for (int _i125 = 0; _i125 < _map124.size; ++_i125)
+ {
+ String _key126; // required
+ String _val127; // required
+ _key126 = iprot.readString();
+ _val127 = iprot.readString();
+ struct.configuration.put(_key126, _val127);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setConfigurationIsSet(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, TOpenSessionReq struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.client_protocol != null) {
+ oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC);
+ oprot.writeI32(struct.client_protocol.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.username != null) {
+ if (struct.isSetUsername()) {
+ oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+ oprot.writeString(struct.username);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.password != null) {
+ if (struct.isSetPassword()) {
+ oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
+ oprot.writeString(struct.password);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.configuration != null) {
+ if (struct.isSetConfiguration()) {
+ oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size()));
+ for (Map.Entry<String, String> _iter128 : struct.configuration.entrySet())
+ {
+ oprot.writeString(_iter128.getKey());
+ oprot.writeString(_iter128.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TOpenSessionReqTupleSchemeFactory implements SchemeFactory {
+ public TOpenSessionReqTupleScheme getScheme() {
+ return new TOpenSessionReqTupleScheme();
+ }
+ }
+
+ private static class TOpenSessionReqTupleScheme extends TupleScheme<TOpenSessionReq> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeI32(struct.client_protocol.getValue());
+ BitSet optionals = new BitSet();
+ if (struct.isSetUsername()) {
+ optionals.set(0);
+ }
+ if (struct.isSetPassword()) {
+ optionals.set(1);
+ }
+ if (struct.isSetConfiguration()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetUsername()) {
+ oprot.writeString(struct.username);
+ }
+ if (struct.isSetPassword()) {
+ oprot.writeString(struct.password);
+ }
+ if (struct.isSetConfiguration()) {
+ {
+ oprot.writeI32(struct.configuration.size());
+ for (Map.Entry<String, String> _iter129 : struct.configuration.entrySet())
+ {
+ oprot.writeString(_iter129.getKey());
+ oprot.writeString(_iter129.getValue());
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32());
+ struct.setClient_protocolIsSet(true);
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.password = iprot.readString();
+ struct.setPasswordIsSet(true);
+ }
+ if (incoming.get(2)) {
+ {
+ org.apache.thrift.protocol.TMap _map130 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.configuration = new HashMap<String,String>(2*_map130.size);
+ for (int _i131 = 0; _i131 < _map130.size; ++_i131)
+ {
+ String _key132; // required
+ String _val133; // required
+ _key132 = iprot.readString();
+ _val133 = iprot.readString();
+ struct.configuration.put(_key132, _val133);
+ }
+ }
+ struct.setConfigurationIsSet(true);
+ }
+ }
+ }
+
+}
+
Added: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java?rev=1455646&view=auto
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java (added)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java Tue Mar 12 17:45:10 2013
@@ -0,0 +1,790 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.cli.thrift;
+
+import org.apache.commons.lang.builder.HashCodeBuilder;
+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 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TOpenSessionResp implements org.apache.thrift.TBase<TOpenSessionResp, TOpenSessionResp._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp");
+
+ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2);
+ private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TOpenSessionRespStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TOpenSessionRespTupleSchemeFactory());
+ }
+
+ private TStatus status; // required
+ private TProtocolVersion serverProtocolVersion; // required
+ private TSessionHandle sessionHandle; // optional
+ private Map<String,String> 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 {
+ STATUS((short)1, "status"),
+ /**
+ *
+ * @see TProtocolVersion
+ */
+ SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"),
+ SESSION_HANDLE((short)3, "sessionHandle"),
+ CONFIGURATION((short)4, "configuration");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ 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
+ return STATUS;
+ case 2: // SERVER_PROTOCOL_VERSION
+ return SERVER_PROTOCOL_VERSION;
+ case 3: // SESSION_HANDLE
+ return SESSION_HANDLE;
+ 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 _Fields optionals[] = {_Fields.SESSION_HANDLE,_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.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class)));
+ tmpMap.put(_Fields.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class)));
+ tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class)));
+ 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(TOpenSessionResp.class, metaDataMap);
+ }
+
+ public TOpenSessionResp() {
+ this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1;
+
+ }
+
+ public TOpenSessionResp(
+ TStatus status,
+ TProtocolVersion serverProtocolVersion)
+ {
+ this();
+ this.status = status;
+ this.serverProtocolVersion = serverProtocolVersion;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TOpenSessionResp(TOpenSessionResp other) {
+ if (other.isSetStatus()) {
+ this.status = new TStatus(other.status);
+ }
+ if (other.isSetServerProtocolVersion()) {
+ this.serverProtocolVersion = other.serverProtocolVersion;
+ }
+ if (other.isSetSessionHandle()) {
+ this.sessionHandle = new TSessionHandle(other.sessionHandle);
+ }
+ if (other.isSetConfiguration()) {
+ Map<String,String> __this__configuration = new HashMap<String,String>();
+ for (Map.Entry<String, String> other_element : other.configuration.entrySet()) {
+
+ String other_element_key = other_element.getKey();
+ String other_element_value = other_element.getValue();
+
+ String __this__configuration_copy_key = other_element_key;
+
+ String __this__configuration_copy_value = other_element_value;
+
+ __this__configuration.put(__this__configuration_copy_key, __this__configuration_copy_value);
+ }
+ this.configuration = __this__configuration;
+ }
+ }
+
+ public TOpenSessionResp deepCopy() {
+ return new TOpenSessionResp(this);
+ }
+
+ @Override
+ public void clear() {
+ this.status = null;
+ this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1;
+
+ this.sessionHandle = null;
+ this.configuration = null;
+ }
+
+ public TStatus getStatus() {
+ return this.status;
+ }
+
+ public void setStatus(TStatus status) {
+ this.status = status;
+ }
+
+ public void unsetStatus() {
+ this.status = null;
+ }
+
+ /** Returns true if field status is set (has been assigned a value) and false otherwise */
+ public boolean isSetStatus() {
+ return this.status != null;
+ }
+
+ public void setStatusIsSet(boolean value) {
+ if (!value) {
+ this.status = null;
+ }
+ }
+
+ /**
+ *
+ * @see TProtocolVersion
+ */
+ public TProtocolVersion getServerProtocolVersion() {
+ return this.serverProtocolVersion;
+ }
+
+ /**
+ *
+ * @see TProtocolVersion
+ */
+ public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) {
+ this.serverProtocolVersion = serverProtocolVersion;
+ }
+
+ public void unsetServerProtocolVersion() {
+ this.serverProtocolVersion = null;
+ }
+
+ /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */
+ public boolean isSetServerProtocolVersion() {
+ return this.serverProtocolVersion != null;
+ }
+
+ public void setServerProtocolVersionIsSet(boolean value) {
+ if (!value) {
+ this.serverProtocolVersion = null;
+ }
+ }
+
+ public TSessionHandle getSessionHandle() {
+ return this.sessionHandle;
+ }
+
+ public void setSessionHandle(TSessionHandle sessionHandle) {
+ this.sessionHandle = sessionHandle;
+ }
+
+ public void unsetSessionHandle() {
+ this.sessionHandle = null;
+ }
+
+ /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */
+ public boolean isSetSessionHandle() {
+ return this.sessionHandle != null;
+ }
+
+ public void setSessionHandleIsSet(boolean value) {
+ if (!value) {
+ this.sessionHandle = 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<String,String>();
+ }
+ this.configuration.put(key, val);
+ }
+
+ public Map<String,String> getConfiguration() {
+ return this.configuration;
+ }
+
+ public void setConfiguration(Map<String,String> 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 STATUS:
+ if (value == null) {
+ unsetStatus();
+ } else {
+ setStatus((TStatus)value);
+ }
+ break;
+
+ case SERVER_PROTOCOL_VERSION:
+ if (value == null) {
+ unsetServerProtocolVersion();
+ } else {
+ setServerProtocolVersion((TProtocolVersion)value);
+ }
+ break;
+
+ case SESSION_HANDLE:
+ if (value == null) {
+ unsetSessionHandle();
+ } else {
+ setSessionHandle((TSessionHandle)value);
+ }
+ break;
+
+ case CONFIGURATION:
+ if (value == null) {
+ unsetConfiguration();
+ } else {
+ setConfiguration((Map<String,String>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case STATUS:
+ return getStatus();
+
+ case SERVER_PROTOCOL_VERSION:
+ return getServerProtocolVersion();
+
+ case SESSION_HANDLE:
+ return getSessionHandle();
+
+ 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 STATUS:
+ return isSetStatus();
+ case SERVER_PROTOCOL_VERSION:
+ return isSetServerProtocolVersion();
+ case SESSION_HANDLE:
+ return isSetSessionHandle();
+ case CONFIGURATION:
+ return isSetConfiguration();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TOpenSessionResp)
+ return this.equals((TOpenSessionResp)that);
+ return false;
+ }
+
+ public boolean equals(TOpenSessionResp that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_status = true && this.isSetStatus();
+ boolean that_present_status = true && that.isSetStatus();
+ if (this_present_status || that_present_status) {
+ if (!(this_present_status && that_present_status))
+ return false;
+ if (!this.status.equals(that.status))
+ return false;
+ }
+
+ boolean this_present_serverProtocolVersion = true && this.isSetServerProtocolVersion();
+ boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion();
+ if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) {
+ if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion))
+ return false;
+ if (!this.serverProtocolVersion.equals(that.serverProtocolVersion))
+ return false;
+ }
+
+ boolean this_present_sessionHandle = true && this.isSetSessionHandle();
+ boolean that_present_sessionHandle = true && that.isSetSessionHandle();
+ if (this_present_sessionHandle || that_present_sessionHandle) {
+ if (!(this_present_sessionHandle && that_present_sessionHandle))
+ return false;
+ if (!this.sessionHandle.equals(that.sessionHandle))
+ 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() {
+ HashCodeBuilder builder = new HashCodeBuilder();
+
+ boolean present_status = true && (isSetStatus());
+ builder.append(present_status);
+ if (present_status)
+ builder.append(status);
+
+ boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion());
+ builder.append(present_serverProtocolVersion);
+ if (present_serverProtocolVersion)
+ builder.append(serverProtocolVersion.getValue());
+
+ boolean present_sessionHandle = true && (isSetSessionHandle());
+ builder.append(present_sessionHandle);
+ if (present_sessionHandle)
+ builder.append(sessionHandle);
+
+ boolean present_configuration = true && (isSetConfiguration());
+ builder.append(present_configuration);
+ if (present_configuration)
+ builder.append(configuration);
+
+ return builder.toHashCode();
+ }
+
+ public int compareTo(TOpenSessionResp other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TOpenSessionResp typedOther = (TOpenSessionResp)other;
+
+ lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStatus()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(typedOther.isSetServerProtocolVersion());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetServerProtocolVersion()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, typedOther.serverProtocolVersion);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSessionHandle()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(typedOther.isSetConfiguration());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetConfiguration()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, typedOther.configuration);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TOpenSessionResp(");
+ boolean first = true;
+
+ sb.append("status:");
+ if (this.status == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.status);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("serverProtocolVersion:");
+ if (this.serverProtocolVersion == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.serverProtocolVersion);
+ }
+ first = false;
+ if (isSetSessionHandle()) {
+ if (!first) sb.append(", ");
+ sb.append("sessionHandle:");
+ if (this.sessionHandle == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.sessionHandle);
+ }
+ first = false;
+ }
+ if (isSetConfiguration()) {
+ if (!first) sb.append(", ");
+ sb.append("configuration:");
+ if (this.configuration == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.configuration);
+ }
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetStatus()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
+ }
+
+ if (!isSetServerProtocolVersion()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ if (status != null) {
+ status.validate();
+ }
+ if (sessionHandle != null) {
+ sessionHandle.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, ClassNotFoundException {
+ try {
+ 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 TOpenSessionRespStandardSchemeFactory implements SchemeFactory {
+ public TOpenSessionRespStandardScheme getScheme() {
+ return new TOpenSessionRespStandardScheme();
+ }
+ }
+
+ private static class TOpenSessionRespStandardScheme extends StandardScheme<TOpenSessionResp> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp 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: // STATUS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.status = new TStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // SERVER_PROTOCOL_VERSION
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32());
+ struct.setServerProtocolVersionIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // SESSION_HANDLE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.sessionHandle = new TSessionHandle();
+ struct.sessionHandle.read(iprot);
+ struct.setSessionHandleIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // CONFIGURATION
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map134 = iprot.readMapBegin();
+ struct.configuration = new HashMap<String,String>(2*_map134.size);
+ for (int _i135 = 0; _i135 < _map134.size; ++_i135)
+ {
+ String _key136; // required
+ String _val137; // required
+ _key136 = iprot.readString();
+ _val137 = iprot.readString();
+ struct.configuration.put(_key136, _val137);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setConfigurationIsSet(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, TOpenSessionResp struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.status != null) {
+ oprot.writeFieldBegin(STATUS_FIELD_DESC);
+ struct.status.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.serverProtocolVersion != null) {
+ oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC);
+ oprot.writeI32(struct.serverProtocolVersion.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.sessionHandle != null) {
+ if (struct.isSetSessionHandle()) {
+ oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC);
+ struct.sessionHandle.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.configuration != null) {
+ if (struct.isSetConfiguration()) {
+ oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size()));
+ for (Map.Entry<String, String> _iter138 : struct.configuration.entrySet())
+ {
+ oprot.writeString(_iter138.getKey());
+ oprot.writeString(_iter138.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TOpenSessionRespTupleSchemeFactory implements SchemeFactory {
+ public TOpenSessionRespTupleScheme getScheme() {
+ return new TOpenSessionRespTupleScheme();
+ }
+ }
+
+ private static class TOpenSessionRespTupleScheme extends TupleScheme<TOpenSessionResp> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ struct.status.write(oprot);
+ oprot.writeI32(struct.serverProtocolVersion.getValue());
+ BitSet optionals = new BitSet();
+ if (struct.isSetSessionHandle()) {
+ optionals.set(0);
+ }
+ if (struct.isSetConfiguration()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetSessionHandle()) {
+ struct.sessionHandle.write(oprot);
+ }
+ if (struct.isSetConfiguration()) {
+ {
+ oprot.writeI32(struct.configuration.size());
+ for (Map.Entry<String, String> _iter139 : struct.configuration.entrySet())
+ {
+ oprot.writeString(_iter139.getKey());
+ oprot.writeString(_iter139.getValue());
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.status = new TStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
+ struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32());
+ struct.setServerProtocolVersionIsSet(true);
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.sessionHandle = new TSessionHandle();
+ struct.sessionHandle.read(iprot);
+ struct.setSessionHandleIsSet(true);
+ }
+ if (incoming.get(1)) {
+ {
+ org.apache.thrift.protocol.TMap _map140 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.configuration = new HashMap<String,String>(2*_map140.size);
+ for (int _i141 = 0; _i141 < _map140.size; ++_i141)
+ {
+ String _key142; // required
+ String _val143; // required
+ _key142 = iprot.readString();
+ _val143 = iprot.readString();
+ struct.configuration.put(_key142, _val143);
+ }
+ }
+ struct.setConfigurationIsSet(true);
+ }
+ }
+ }
+
+}
+
Added: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationHandle.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationHandle.java?rev=1455646&view=auto
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationHandle.java (added)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationHandle.java Tue Mar 12 17:45:10 2013
@@ -0,0 +1,705 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.cli.thrift;
+
+import org.apache.commons.lang.builder.HashCodeBuilder;
+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 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TOperationHandle implements org.apache.thrift.TBase<TOperationHandle, TOperationHandle._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle");
+
+ private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.I32, (short)2);
+ private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3);
+ private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TOperationHandleStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TOperationHandleTupleSchemeFactory());
+ }
+
+ private THandleIdentifier operationId; // required
+ private TOperationType operationType; // required
+ private boolean hasResultSet; // required
+ private double modifiedRowCount; // 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 {
+ OPERATION_ID((short)1, "operationId"),
+ /**
+ *
+ * @see TOperationType
+ */
+ OPERATION_TYPE((short)2, "operationType"),
+ HAS_RESULT_SET((short)3, "hasResultSet"),
+ MODIFIED_ROW_COUNT((short)4, "modifiedRowCount");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ 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: // OPERATION_ID
+ return OPERATION_ID;
+ case 2: // OPERATION_TYPE
+ return OPERATION_TYPE;
+ case 3: // HAS_RESULT_SET
+ return HAS_RESULT_SET;
+ case 4: // MODIFIED_ROW_COUNT
+ return MODIFIED_ROW_COUNT;
+ 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 __HASRESULTSET_ISSET_ID = 0;
+ private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1;
+ private byte __isset_bitfield = 0;
+ private _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT};
+ 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.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class)));
+ tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationType.class)));
+ tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap);
+ }
+
+ public TOperationHandle() {
+ }
+
+ public TOperationHandle(
+ THandleIdentifier operationId,
+ TOperationType operationType,
+ boolean hasResultSet)
+ {
+ this();
+ this.operationId = operationId;
+ this.operationType = operationType;
+ this.hasResultSet = hasResultSet;
+ setHasResultSetIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TOperationHandle(TOperationHandle other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetOperationId()) {
+ this.operationId = new THandleIdentifier(other.operationId);
+ }
+ if (other.isSetOperationType()) {
+ this.operationType = other.operationType;
+ }
+ this.hasResultSet = other.hasResultSet;
+ this.modifiedRowCount = other.modifiedRowCount;
+ }
+
+ public TOperationHandle deepCopy() {
+ return new TOperationHandle(this);
+ }
+
+ @Override
+ public void clear() {
+ this.operationId = null;
+ this.operationType = null;
+ setHasResultSetIsSet(false);
+ this.hasResultSet = false;
+ setModifiedRowCountIsSet(false);
+ this.modifiedRowCount = 0.0;
+ }
+
+ public THandleIdentifier getOperationId() {
+ return this.operationId;
+ }
+
+ public void setOperationId(THandleIdentifier operationId) {
+ this.operationId = operationId;
+ }
+
+ public void unsetOperationId() {
+ this.operationId = null;
+ }
+
+ /** Returns true if field operationId is set (has been assigned a value) and false otherwise */
+ public boolean isSetOperationId() {
+ return this.operationId != null;
+ }
+
+ public void setOperationIdIsSet(boolean value) {
+ if (!value) {
+ this.operationId = null;
+ }
+ }
+
+ /**
+ *
+ * @see TOperationType
+ */
+ public TOperationType getOperationType() {
+ return this.operationType;
+ }
+
+ /**
+ *
+ * @see TOperationType
+ */
+ public void setOperationType(TOperationType operationType) {
+ this.operationType = operationType;
+ }
+
+ public void unsetOperationType() {
+ this.operationType = null;
+ }
+
+ /** Returns true if field operationType is set (has been assigned a value) and false otherwise */
+ public boolean isSetOperationType() {
+ return this.operationType != null;
+ }
+
+ public void setOperationTypeIsSet(boolean value) {
+ if (!value) {
+ this.operationType = null;
+ }
+ }
+
+ public boolean isHasResultSet() {
+ return this.hasResultSet;
+ }
+
+ public void setHasResultSet(boolean hasResultSet) {
+ this.hasResultSet = hasResultSet;
+ setHasResultSetIsSet(true);
+ }
+
+ public void unsetHasResultSet() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID);
+ }
+
+ /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */
+ public boolean isSetHasResultSet() {
+ return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID);
+ }
+
+ public void setHasResultSetIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value);
+ }
+
+ public double getModifiedRowCount() {
+ return this.modifiedRowCount;
+ }
+
+ public void setModifiedRowCount(double modifiedRowCount) {
+ this.modifiedRowCount = modifiedRowCount;
+ setModifiedRowCountIsSet(true);
+ }
+
+ public void unsetModifiedRowCount() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID);
+ }
+
+ /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */
+ public boolean isSetModifiedRowCount() {
+ return EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID);
+ }
+
+ public void setModifiedRowCountIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case OPERATION_ID:
+ if (value == null) {
+ unsetOperationId();
+ } else {
+ setOperationId((THandleIdentifier)value);
+ }
+ break;
+
+ case OPERATION_TYPE:
+ if (value == null) {
+ unsetOperationType();
+ } else {
+ setOperationType((TOperationType)value);
+ }
+ break;
+
+ case HAS_RESULT_SET:
+ if (value == null) {
+ unsetHasResultSet();
+ } else {
+ setHasResultSet((Boolean)value);
+ }
+ break;
+
+ case MODIFIED_ROW_COUNT:
+ if (value == null) {
+ unsetModifiedRowCount();
+ } else {
+ setModifiedRowCount((Double)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case OPERATION_ID:
+ return getOperationId();
+
+ case OPERATION_TYPE:
+ return getOperationType();
+
+ case HAS_RESULT_SET:
+ return Boolean.valueOf(isHasResultSet());
+
+ case MODIFIED_ROW_COUNT:
+ return Double.valueOf(getModifiedRowCount());
+
+ }
+ 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 OPERATION_ID:
+ return isSetOperationId();
+ case OPERATION_TYPE:
+ return isSetOperationType();
+ case HAS_RESULT_SET:
+ return isSetHasResultSet();
+ case MODIFIED_ROW_COUNT:
+ return isSetModifiedRowCount();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TOperationHandle)
+ return this.equals((TOperationHandle)that);
+ return false;
+ }
+
+ public boolean equals(TOperationHandle that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_operationId = true && this.isSetOperationId();
+ boolean that_present_operationId = true && that.isSetOperationId();
+ if (this_present_operationId || that_present_operationId) {
+ if (!(this_present_operationId && that_present_operationId))
+ return false;
+ if (!this.operationId.equals(that.operationId))
+ return false;
+ }
+
+ boolean this_present_operationType = true && this.isSetOperationType();
+ boolean that_present_operationType = true && that.isSetOperationType();
+ if (this_present_operationType || that_present_operationType) {
+ if (!(this_present_operationType && that_present_operationType))
+ return false;
+ if (!this.operationType.equals(that.operationType))
+ return false;
+ }
+
+ boolean this_present_hasResultSet = true;
+ boolean that_present_hasResultSet = true;
+ if (this_present_hasResultSet || that_present_hasResultSet) {
+ if (!(this_present_hasResultSet && that_present_hasResultSet))
+ return false;
+ if (this.hasResultSet != that.hasResultSet)
+ return false;
+ }
+
+ boolean this_present_modifiedRowCount = true && this.isSetModifiedRowCount();
+ boolean that_present_modifiedRowCount = true && that.isSetModifiedRowCount();
+ if (this_present_modifiedRowCount || that_present_modifiedRowCount) {
+ if (!(this_present_modifiedRowCount && that_present_modifiedRowCount))
+ return false;
+ if (this.modifiedRowCount != that.modifiedRowCount)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ HashCodeBuilder builder = new HashCodeBuilder();
+
+ boolean present_operationId = true && (isSetOperationId());
+ builder.append(present_operationId);
+ if (present_operationId)
+ builder.append(operationId);
+
+ boolean present_operationType = true && (isSetOperationType());
+ builder.append(present_operationType);
+ if (present_operationType)
+ builder.append(operationType.getValue());
+
+ boolean present_hasResultSet = true;
+ builder.append(present_hasResultSet);
+ if (present_hasResultSet)
+ builder.append(hasResultSet);
+
+ boolean present_modifiedRowCount = true && (isSetModifiedRowCount());
+ builder.append(present_modifiedRowCount);
+ if (present_modifiedRowCount)
+ builder.append(modifiedRowCount);
+
+ return builder.toHashCode();
+ }
+
+ public int compareTo(TOperationHandle other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TOperationHandle typedOther = (TOperationHandle)other;
+
+ lastComparison = Boolean.valueOf(isSetOperationId()).compareTo(typedOther.isSetOperationId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOperationId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationId, typedOther.operationId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetOperationType()).compareTo(typedOther.isSetOperationType());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOperationType()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationType, typedOther.operationType);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(typedOther.isSetHasResultSet());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetHasResultSet()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, typedOther.hasResultSet);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetModifiedRowCount()).compareTo(typedOther.isSetModifiedRowCount());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetModifiedRowCount()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modifiedRowCount, typedOther.modifiedRowCount);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TOperationHandle(");
+ boolean first = true;
+
+ sb.append("operationId:");
+ if (this.operationId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.operationId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("operationType:");
+ if (this.operationType == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.operationType);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("hasResultSet:");
+ sb.append(this.hasResultSet);
+ first = false;
+ if (isSetModifiedRowCount()) {
+ if (!first) sb.append(", ");
+ sb.append("modifiedRowCount:");
+ sb.append(this.modifiedRowCount);
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetOperationId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetOperationType()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationType' is unset! Struct:" + toString());
+ }
+
+ if (!isSetHasResultSet()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ if (operationId != null) {
+ operationId.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, 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 TOperationHandleStandardSchemeFactory implements SchemeFactory {
+ public TOperationHandleStandardScheme getScheme() {
+ return new TOperationHandleStandardScheme();
+ }
+ }
+
+ private static class TOperationHandleStandardScheme extends StandardScheme<TOperationHandle> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle 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: // OPERATION_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.operationId = new THandleIdentifier();
+ struct.operationId.read(iprot);
+ struct.setOperationIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // OPERATION_TYPE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.operationType = TOperationType.findByValue(iprot.readI32());
+ struct.setOperationTypeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // HAS_RESULT_SET
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.hasResultSet = iprot.readBool();
+ struct.setHasResultSetIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // MODIFIED_ROW_COUNT
+ if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
+ struct.modifiedRowCount = iprot.readDouble();
+ struct.setModifiedRowCountIsSet(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, TOperationHandle struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.operationId != null) {
+ oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC);
+ struct.operationId.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.operationType != null) {
+ oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC);
+ oprot.writeI32(struct.operationType.getValue());
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC);
+ oprot.writeBool(struct.hasResultSet);
+ oprot.writeFieldEnd();
+ if (struct.isSetModifiedRowCount()) {
+ oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC);
+ oprot.writeDouble(struct.modifiedRowCount);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TOperationHandleTupleSchemeFactory implements SchemeFactory {
+ public TOperationHandleTupleScheme getScheme() {
+ return new TOperationHandleTupleScheme();
+ }
+ }
+
+ private static class TOperationHandleTupleScheme extends TupleScheme<TOperationHandle> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ struct.operationId.write(oprot);
+ oprot.writeI32(struct.operationType.getValue());
+ oprot.writeBool(struct.hasResultSet);
+ BitSet optionals = new BitSet();
+ if (struct.isSetModifiedRowCount()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetModifiedRowCount()) {
+ oprot.writeDouble(struct.modifiedRowCount);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.operationId = new THandleIdentifier();
+ struct.operationId.read(iprot);
+ struct.setOperationIdIsSet(true);
+ struct.operationType = TOperationType.findByValue(iprot.readI32());
+ struct.setOperationTypeIsSet(true);
+ struct.hasResultSet = iprot.readBool();
+ struct.setHasResultSetIsSet(true);
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.modifiedRowCount = iprot.readDouble();
+ struct.setModifiedRowCountIsSet(true);
+ }
+ }
+ }
+
+}
+
Added: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationState.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationState.java?rev=1455646&view=auto
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationState.java (added)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationState.java Tue Mar 12 17:45:10 2013
@@ -0,0 +1,60 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.cli.thrift;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum TOperationState implements org.apache.thrift.TEnum {
+ INITIALIZED_STATE(0),
+ RUNNING_STATE(1),
+ FINISHED_STATE(2),
+ CANCELED_STATE(3),
+ CLOSED_STATE(4),
+ ERROR_STATE(5),
+ UKNOWN_STATE(6);
+
+ private final int value;
+
+ private TOperationState(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static TOperationState findByValue(int value) {
+ switch (value) {
+ case 0:
+ return INITIALIZED_STATE;
+ case 1:
+ return RUNNING_STATE;
+ case 2:
+ return FINISHED_STATE;
+ case 3:
+ return CANCELED_STATE;
+ case 4:
+ return CLOSED_STATE;
+ case 5:
+ return ERROR_STATE;
+ case 6:
+ return UKNOWN_STATE;
+ default:
+ return null;
+ }
+ }
+}
Added: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationType.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationType.java?rev=1455646&view=auto
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationType.java (added)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOperationType.java Tue Mar 12 17:45:10 2013
@@ -0,0 +1,66 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.cli.thrift;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum TOperationType implements org.apache.thrift.TEnum {
+ EXECUTE_STATEMENT(0),
+ GET_TYPE_INFO(1),
+ GET_CATALOGS(2),
+ GET_SCHEMAS(3),
+ GET_TABLES(4),
+ GET_TABLE_TYPES(5),
+ GET_COLUMNS(6),
+ GET_FUNCTIONS(7),
+ UNKNOWN(8);
+
+ private final int value;
+
+ private TOperationType(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static TOperationType findByValue(int value) {
+ switch (value) {
+ case 0:
+ return EXECUTE_STATEMENT;
+ case 1:
+ return GET_TYPE_INFO;
+ case 2:
+ return GET_CATALOGS;
+ case 3:
+ return GET_SCHEMAS;
+ case 4:
+ return GET_TABLES;
+ case 5:
+ return GET_TABLE_TYPES;
+ case 6:
+ return GET_COLUMNS;
+ case 7:
+ return GET_FUNCTIONS;
+ case 8:
+ return UNKNOWN;
+ default:
+ return null;
+ }
+ }
+}