0001
0002
0003
0004
0005
0006
0007 package org.apache.hive.service.cli.thrift;
0008
0009 import org.apache.commons.lang.builder.HashCodeBuilder;
0010 import org.apache.thrift.scheme.IScheme;
0011 import org.apache.thrift.scheme.SchemeFactory;
0012 import org.apache.thrift.scheme.StandardScheme;
0013
0014 import org.apache.thrift.scheme.TupleScheme;
0015 import org.apache.thrift.protocol.TTupleProtocol;
0016 import org.apache.thrift.protocol.TProtocolException;
0017 import org.apache.thrift.EncodingUtils;
0018 import org.apache.thrift.TException;
0019 import java.util.List;
0020 import java.util.ArrayList;
0021 import java.util.Map;
0022 import java.util.HashMap;
0023 import java.util.EnumMap;
0024 import java.util.Set;
0025 import java.util.HashSet;
0026 import java.util.EnumSet;
0027 import java.util.Collections;
0028 import java.util.BitSet;
0029 import java.nio.ByteBuffer;
0030 import java.util.Arrays;
0031 import org.slf4j.Logger;
0032 import org.slf4j.LoggerFactory;
0033
0034 public class TGetColumnsReq implements org.apache.thrift.TBase<TGetColumnsReq, TGetColumnsReq._Fields>, java.io.Serializable, Cloneable {
0035 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq");
0036
0037 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)1);
0038 private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2);
0039 private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3);
0040 private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4);
0041 private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)5);
0042
0043 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0044 static {
0045 schemes.put(StandardScheme.class, new TGetColumnsReqStandardSchemeFactory());
0046 schemes.put(TupleScheme.class, new TGetColumnsReqTupleSchemeFactory());
0047 }
0048
0049 private TSessionHandle sessionHandle;
0050 private String catalogName;
0051 private String schemaName;
0052 private String tableName;
0053 private String columnName;
0054
0055
0056 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0057 SESSION_HANDLE((short)1, "sessionHandle"),
0058 CATALOG_NAME((short)2, "catalogName"),
0059 SCHEMA_NAME((short)3, "schemaName"),
0060 TABLE_NAME((short)4, "tableName"),
0061 COLUMN_NAME((short)5, "columnName");
0062
0063 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0064
0065 static {
0066 for (_Fields field : EnumSet.allOf(_Fields.class)) {
0067 byName.put(field.getFieldName(), field);
0068 }
0069 }
0070
0071
0072
0073
0074 public static _Fields findByThriftId(int fieldId) {
0075 switch(fieldId) {
0076 case 1:
0077 return SESSION_HANDLE;
0078 case 2:
0079 return CATALOG_NAME;
0080 case 3:
0081 return SCHEMA_NAME;
0082 case 4:
0083 return TABLE_NAME;
0084 case 5:
0085 return COLUMN_NAME;
0086 default:
0087 return null;
0088 }
0089 }
0090
0091
0092
0093
0094
0095 public static _Fields findByThriftIdOrThrow(int fieldId) {
0096 _Fields fields = findByThriftId(fieldId);
0097 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0098 return fields;
0099 }
0100
0101
0102
0103
0104 public static _Fields findByName(String name) {
0105 return byName.get(name);
0106 }
0107
0108 private final short _thriftId;
0109 private final String _fieldName;
0110
0111 _Fields(short thriftId, String fieldName) {
0112 _thriftId = thriftId;
0113 _fieldName = fieldName;
0114 }
0115
0116 public short getThriftFieldId() {
0117 return _thriftId;
0118 }
0119
0120 public String getFieldName() {
0121 return _fieldName;
0122 }
0123 }
0124
0125
0126 private _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME};
0127 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0128 static {
0129 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0130 tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED,
0131 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class)));
0132 tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
0133 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier")));
0134 tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
0135 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier")));
0136 tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
0137 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier")));
0138 tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
0139 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier")));
0140 metaDataMap = Collections.unmodifiableMap(tmpMap);
0141 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap);
0142 }
0143
0144 public TGetColumnsReq() {
0145 }
0146
0147 public TGetColumnsReq(
0148 TSessionHandle sessionHandle)
0149 {
0150 this();
0151 this.sessionHandle = sessionHandle;
0152 }
0153
0154
0155
0156
0157 public TGetColumnsReq(TGetColumnsReq other) {
0158 if (other.isSetSessionHandle()) {
0159 this.sessionHandle = new TSessionHandle(other.sessionHandle);
0160 }
0161 if (other.isSetCatalogName()) {
0162 this.catalogName = other.catalogName;
0163 }
0164 if (other.isSetSchemaName()) {
0165 this.schemaName = other.schemaName;
0166 }
0167 if (other.isSetTableName()) {
0168 this.tableName = other.tableName;
0169 }
0170 if (other.isSetColumnName()) {
0171 this.columnName = other.columnName;
0172 }
0173 }
0174
0175 public TGetColumnsReq deepCopy() {
0176 return new TGetColumnsReq(this);
0177 }
0178
0179 @Override
0180 public void clear() {
0181 this.sessionHandle = null;
0182 this.catalogName = null;
0183 this.schemaName = null;
0184 this.tableName = null;
0185 this.columnName = null;
0186 }
0187
0188 public TSessionHandle getSessionHandle() {
0189 return this.sessionHandle;
0190 }
0191
0192 public void setSessionHandle(TSessionHandle sessionHandle) {
0193 this.sessionHandle = sessionHandle;
0194 }
0195
0196 public void unsetSessionHandle() {
0197 this.sessionHandle = null;
0198 }
0199
0200
0201 public boolean isSetSessionHandle() {
0202 return this.sessionHandle != null;
0203 }
0204
0205 public void setSessionHandleIsSet(boolean value) {
0206 if (!value) {
0207 this.sessionHandle = null;
0208 }
0209 }
0210
0211 public String getCatalogName() {
0212 return this.catalogName;
0213 }
0214
0215 public void setCatalogName(String catalogName) {
0216 this.catalogName = catalogName;
0217 }
0218
0219 public void unsetCatalogName() {
0220 this.catalogName = null;
0221 }
0222
0223
0224 public boolean isSetCatalogName() {
0225 return this.catalogName != null;
0226 }
0227
0228 public void setCatalogNameIsSet(boolean value) {
0229 if (!value) {
0230 this.catalogName = null;
0231 }
0232 }
0233
0234 public String getSchemaName() {
0235 return this.schemaName;
0236 }
0237
0238 public void setSchemaName(String schemaName) {
0239 this.schemaName = schemaName;
0240 }
0241
0242 public void unsetSchemaName() {
0243 this.schemaName = null;
0244 }
0245
0246
0247 public boolean isSetSchemaName() {
0248 return this.schemaName != null;
0249 }
0250
0251 public void setSchemaNameIsSet(boolean value) {
0252 if (!value) {
0253 this.schemaName = null;
0254 }
0255 }
0256
0257 public String getTableName() {
0258 return this.tableName;
0259 }
0260
0261 public void setTableName(String tableName) {
0262 this.tableName = tableName;
0263 }
0264
0265 public void unsetTableName() {
0266 this.tableName = null;
0267 }
0268
0269
0270 public boolean isSetTableName() {
0271 return this.tableName != null;
0272 }
0273
0274 public void setTableNameIsSet(boolean value) {
0275 if (!value) {
0276 this.tableName = null;
0277 }
0278 }
0279
0280 public String getColumnName() {
0281 return this.columnName;
0282 }
0283
0284 public void setColumnName(String columnName) {
0285 this.columnName = columnName;
0286 }
0287
0288 public void unsetColumnName() {
0289 this.columnName = null;
0290 }
0291
0292
0293 public boolean isSetColumnName() {
0294 return this.columnName != null;
0295 }
0296
0297 public void setColumnNameIsSet(boolean value) {
0298 if (!value) {
0299 this.columnName = null;
0300 }
0301 }
0302
0303 public void setFieldValue(_Fields field, Object value) {
0304 switch (field) {
0305 case SESSION_HANDLE:
0306 if (value == null) {
0307 unsetSessionHandle();
0308 } else {
0309 setSessionHandle((TSessionHandle)value);
0310 }
0311 break;
0312
0313 case CATALOG_NAME:
0314 if (value == null) {
0315 unsetCatalogName();
0316 } else {
0317 setCatalogName((String)value);
0318 }
0319 break;
0320
0321 case SCHEMA_NAME:
0322 if (value == null) {
0323 unsetSchemaName();
0324 } else {
0325 setSchemaName((String)value);
0326 }
0327 break;
0328
0329 case TABLE_NAME:
0330 if (value == null) {
0331 unsetTableName();
0332 } else {
0333 setTableName((String)value);
0334 }
0335 break;
0336
0337 case COLUMN_NAME:
0338 if (value == null) {
0339 unsetColumnName();
0340 } else {
0341 setColumnName((String)value);
0342 }
0343 break;
0344
0345 }
0346 }
0347
0348 public Object getFieldValue(_Fields field) {
0349 switch (field) {
0350 case SESSION_HANDLE:
0351 return getSessionHandle();
0352
0353 case CATALOG_NAME:
0354 return getCatalogName();
0355
0356 case SCHEMA_NAME:
0357 return getSchemaName();
0358
0359 case TABLE_NAME:
0360 return getTableName();
0361
0362 case COLUMN_NAME:
0363 return getColumnName();
0364
0365 }
0366 throw new IllegalStateException();
0367 }
0368
0369
0370 public boolean isSet(_Fields field) {
0371 if (field == null) {
0372 throw new IllegalArgumentException();
0373 }
0374
0375 switch (field) {
0376 case SESSION_HANDLE:
0377 return isSetSessionHandle();
0378 case CATALOG_NAME:
0379 return isSetCatalogName();
0380 case SCHEMA_NAME:
0381 return isSetSchemaName();
0382 case TABLE_NAME:
0383 return isSetTableName();
0384 case COLUMN_NAME:
0385 return isSetColumnName();
0386 }
0387 throw new IllegalStateException();
0388 }
0389
0390 @Override
0391 public boolean equals(Object that) {
0392 if (that == null)
0393 return false;
0394 if (that instanceof TGetColumnsReq)
0395 return this.equals((TGetColumnsReq)that);
0396 return false;
0397 }
0398
0399 public boolean equals(TGetColumnsReq that) {
0400 if (that == null)
0401 return false;
0402
0403 boolean this_present_sessionHandle = true && this.isSetSessionHandle();
0404 boolean that_present_sessionHandle = true && that.isSetSessionHandle();
0405 if (this_present_sessionHandle || that_present_sessionHandle) {
0406 if (!(this_present_sessionHandle && that_present_sessionHandle))
0407 return false;
0408 if (!this.sessionHandle.equals(that.sessionHandle))
0409 return false;
0410 }
0411
0412 boolean this_present_catalogName = true && this.isSetCatalogName();
0413 boolean that_present_catalogName = true && that.isSetCatalogName();
0414 if (this_present_catalogName || that_present_catalogName) {
0415 if (!(this_present_catalogName && that_present_catalogName))
0416 return false;
0417 if (!this.catalogName.equals(that.catalogName))
0418 return false;
0419 }
0420
0421 boolean this_present_schemaName = true && this.isSetSchemaName();
0422 boolean that_present_schemaName = true && that.isSetSchemaName();
0423 if (this_present_schemaName || that_present_schemaName) {
0424 if (!(this_present_schemaName && that_present_schemaName))
0425 return false;
0426 if (!this.schemaName.equals(that.schemaName))
0427 return false;
0428 }
0429
0430 boolean this_present_tableName = true && this.isSetTableName();
0431 boolean that_present_tableName = true && that.isSetTableName();
0432 if (this_present_tableName || that_present_tableName) {
0433 if (!(this_present_tableName && that_present_tableName))
0434 return false;
0435 if (!this.tableName.equals(that.tableName))
0436 return false;
0437 }
0438
0439 boolean this_present_columnName = true && this.isSetColumnName();
0440 boolean that_present_columnName = true && that.isSetColumnName();
0441 if (this_present_columnName || that_present_columnName) {
0442 if (!(this_present_columnName && that_present_columnName))
0443 return false;
0444 if (!this.columnName.equals(that.columnName))
0445 return false;
0446 }
0447
0448 return true;
0449 }
0450
0451 @Override
0452 public int hashCode() {
0453 HashCodeBuilder builder = new HashCodeBuilder();
0454
0455 boolean present_sessionHandle = true && (isSetSessionHandle());
0456 builder.append(present_sessionHandle);
0457 if (present_sessionHandle)
0458 builder.append(sessionHandle);
0459
0460 boolean present_catalogName = true && (isSetCatalogName());
0461 builder.append(present_catalogName);
0462 if (present_catalogName)
0463 builder.append(catalogName);
0464
0465 boolean present_schemaName = true && (isSetSchemaName());
0466 builder.append(present_schemaName);
0467 if (present_schemaName)
0468 builder.append(schemaName);
0469
0470 boolean present_tableName = true && (isSetTableName());
0471 builder.append(present_tableName);
0472 if (present_tableName)
0473 builder.append(tableName);
0474
0475 boolean present_columnName = true && (isSetColumnName());
0476 builder.append(present_columnName);
0477 if (present_columnName)
0478 builder.append(columnName);
0479
0480 return builder.toHashCode();
0481 }
0482
0483 public int compareTo(TGetColumnsReq other) {
0484 if (!getClass().equals(other.getClass())) {
0485 return getClass().getName().compareTo(other.getClass().getName());
0486 }
0487
0488 int lastComparison = 0;
0489 TGetColumnsReq typedOther = (TGetColumnsReq)other;
0490
0491 lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle());
0492 if (lastComparison != 0) {
0493 return lastComparison;
0494 }
0495 if (isSetSessionHandle()) {
0496 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle);
0497 if (lastComparison != 0) {
0498 return lastComparison;
0499 }
0500 }
0501 lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(typedOther.isSetCatalogName());
0502 if (lastComparison != 0) {
0503 return lastComparison;
0504 }
0505 if (isSetCatalogName()) {
0506 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, typedOther.catalogName);
0507 if (lastComparison != 0) {
0508 return lastComparison;
0509 }
0510 }
0511 lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(typedOther.isSetSchemaName());
0512 if (lastComparison != 0) {
0513 return lastComparison;
0514 }
0515 if (isSetSchemaName()) {
0516 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, typedOther.schemaName);
0517 if (lastComparison != 0) {
0518 return lastComparison;
0519 }
0520 }
0521 lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName());
0522 if (lastComparison != 0) {
0523 return lastComparison;
0524 }
0525 if (isSetTableName()) {
0526 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, typedOther.tableName);
0527 if (lastComparison != 0) {
0528 return lastComparison;
0529 }
0530 }
0531 lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(typedOther.isSetColumnName());
0532 if (lastComparison != 0) {
0533 return lastComparison;
0534 }
0535 if (isSetColumnName()) {
0536 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, typedOther.columnName);
0537 if (lastComparison != 0) {
0538 return lastComparison;
0539 }
0540 }
0541 return 0;
0542 }
0543
0544 public _Fields fieldForId(int fieldId) {
0545 return _Fields.findByThriftId(fieldId);
0546 }
0547
0548 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0549 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0550 }
0551
0552 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0553 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0554 }
0555
0556 @Override
0557 public String toString() {
0558 StringBuilder sb = new StringBuilder("TGetColumnsReq(");
0559 boolean first = true;
0560
0561 sb.append("sessionHandle:");
0562 if (this.sessionHandle == null) {
0563 sb.append("null");
0564 } else {
0565 sb.append(this.sessionHandle);
0566 }
0567 first = false;
0568 if (isSetCatalogName()) {
0569 if (!first) sb.append(", ");
0570 sb.append("catalogName:");
0571 if (this.catalogName == null) {
0572 sb.append("null");
0573 } else {
0574 sb.append(this.catalogName);
0575 }
0576 first = false;
0577 }
0578 if (isSetSchemaName()) {
0579 if (!first) sb.append(", ");
0580 sb.append("schemaName:");
0581 if (this.schemaName == null) {
0582 sb.append("null");
0583 } else {
0584 sb.append(this.schemaName);
0585 }
0586 first = false;
0587 }
0588 if (isSetTableName()) {
0589 if (!first) sb.append(", ");
0590 sb.append("tableName:");
0591 if (this.tableName == null) {
0592 sb.append("null");
0593 } else {
0594 sb.append(this.tableName);
0595 }
0596 first = false;
0597 }
0598 if (isSetColumnName()) {
0599 if (!first) sb.append(", ");
0600 sb.append("columnName:");
0601 if (this.columnName == null) {
0602 sb.append("null");
0603 } else {
0604 sb.append(this.columnName);
0605 }
0606 first = false;
0607 }
0608 sb.append(")");
0609 return sb.toString();
0610 }
0611
0612 public void validate() throws org.apache.thrift.TException {
0613
0614 if (!isSetSessionHandle()) {
0615 throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString());
0616 }
0617
0618
0619 if (sessionHandle != null) {
0620 sessionHandle.validate();
0621 }
0622 }
0623
0624 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0625 try {
0626 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0627 } catch (org.apache.thrift.TException te) {
0628 throw new java.io.IOException(te);
0629 }
0630 }
0631
0632 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0633 try {
0634 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0635 } catch (org.apache.thrift.TException te) {
0636 throw new java.io.IOException(te);
0637 }
0638 }
0639
0640 private static class TGetColumnsReqStandardSchemeFactory implements SchemeFactory {
0641 public TGetColumnsReqStandardScheme getScheme() {
0642 return new TGetColumnsReqStandardScheme();
0643 }
0644 }
0645
0646 private static class TGetColumnsReqStandardScheme extends StandardScheme<TGetColumnsReq> {
0647
0648 public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq struct) throws org.apache.thrift.TException {
0649 org.apache.thrift.protocol.TField schemeField;
0650 iprot.readStructBegin();
0651 while (true)
0652 {
0653 schemeField = iprot.readFieldBegin();
0654 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
0655 break;
0656 }
0657 switch (schemeField.id) {
0658 case 1:
0659 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0660 struct.sessionHandle = new TSessionHandle();
0661 struct.sessionHandle.read(iprot);
0662 struct.setSessionHandleIsSet(true);
0663 } else {
0664 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0665 }
0666 break;
0667 case 2:
0668 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0669 struct.catalogName = iprot.readString();
0670 struct.setCatalogNameIsSet(true);
0671 } else {
0672 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0673 }
0674 break;
0675 case 3:
0676 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0677 struct.schemaName = iprot.readString();
0678 struct.setSchemaNameIsSet(true);
0679 } else {
0680 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0681 }
0682 break;
0683 case 4:
0684 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0685 struct.tableName = iprot.readString();
0686 struct.setTableNameIsSet(true);
0687 } else {
0688 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0689 }
0690 break;
0691 case 5:
0692 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0693 struct.columnName = iprot.readString();
0694 struct.setColumnNameIsSet(true);
0695 } else {
0696 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0697 }
0698 break;
0699 default:
0700 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0701 }
0702 iprot.readFieldEnd();
0703 }
0704 iprot.readStructEnd();
0705 struct.validate();
0706 }
0707
0708 public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsReq struct) throws org.apache.thrift.TException {
0709 struct.validate();
0710
0711 oprot.writeStructBegin(STRUCT_DESC);
0712 if (struct.sessionHandle != null) {
0713 oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC);
0714 struct.sessionHandle.write(oprot);
0715 oprot.writeFieldEnd();
0716 }
0717 if (struct.catalogName != null) {
0718 if (struct.isSetCatalogName()) {
0719 oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC);
0720 oprot.writeString(struct.catalogName);
0721 oprot.writeFieldEnd();
0722 }
0723 }
0724 if (struct.schemaName != null) {
0725 if (struct.isSetSchemaName()) {
0726 oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC);
0727 oprot.writeString(struct.schemaName);
0728 oprot.writeFieldEnd();
0729 }
0730 }
0731 if (struct.tableName != null) {
0732 if (struct.isSetTableName()) {
0733 oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
0734 oprot.writeString(struct.tableName);
0735 oprot.writeFieldEnd();
0736 }
0737 }
0738 if (struct.columnName != null) {
0739 if (struct.isSetColumnName()) {
0740 oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC);
0741 oprot.writeString(struct.columnName);
0742 oprot.writeFieldEnd();
0743 }
0744 }
0745 oprot.writeFieldStop();
0746 oprot.writeStructEnd();
0747 }
0748
0749 }
0750
0751 private static class TGetColumnsReqTupleSchemeFactory implements SchemeFactory {
0752 public TGetColumnsReqTupleScheme getScheme() {
0753 return new TGetColumnsReqTupleScheme();
0754 }
0755 }
0756
0757 private static class TGetColumnsReqTupleScheme extends TupleScheme<TGetColumnsReq> {
0758
0759 @Override
0760 public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException {
0761 TTupleProtocol oprot = (TTupleProtocol) prot;
0762 struct.sessionHandle.write(oprot);
0763 BitSet optionals = new BitSet();
0764 if (struct.isSetCatalogName()) {
0765 optionals.set(0);
0766 }
0767 if (struct.isSetSchemaName()) {
0768 optionals.set(1);
0769 }
0770 if (struct.isSetTableName()) {
0771 optionals.set(2);
0772 }
0773 if (struct.isSetColumnName()) {
0774 optionals.set(3);
0775 }
0776 oprot.writeBitSet(optionals, 4);
0777 if (struct.isSetCatalogName()) {
0778 oprot.writeString(struct.catalogName);
0779 }
0780 if (struct.isSetSchemaName()) {
0781 oprot.writeString(struct.schemaName);
0782 }
0783 if (struct.isSetTableName()) {
0784 oprot.writeString(struct.tableName);
0785 }
0786 if (struct.isSetColumnName()) {
0787 oprot.writeString(struct.columnName);
0788 }
0789 }
0790
0791 @Override
0792 public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException {
0793 TTupleProtocol iprot = (TTupleProtocol) prot;
0794 struct.sessionHandle = new TSessionHandle();
0795 struct.sessionHandle.read(iprot);
0796 struct.setSessionHandleIsSet(true);
0797 BitSet incoming = iprot.readBitSet(4);
0798 if (incoming.get(0)) {
0799 struct.catalogName = iprot.readString();
0800 struct.setCatalogNameIsSet(true);
0801 }
0802 if (incoming.get(1)) {
0803 struct.schemaName = iprot.readString();
0804 struct.setSchemaNameIsSet(true);
0805 }
0806 if (incoming.get(2)) {
0807 struct.tableName = iprot.readString();
0808 struct.setTableNameIsSet(true);
0809 }
0810 if (incoming.get(3)) {
0811 struct.columnName = iprot.readString();
0812 struct.setColumnNameIsSet(true);
0813 }
0814 }
0815 }
0816
0817 }
0818