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 TGetTablesReq implements org.apache.thrift.TBase<TGetTablesReq, TGetTablesReq._Fields>, java.io.Serializable, Cloneable {
0035 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq");
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 TABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("tableTypes", org.apache.thrift.protocol.TType.LIST, (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 TGetTablesReqStandardSchemeFactory());
0046 schemes.put(TupleScheme.class, new TGetTablesReqTupleSchemeFactory());
0047 }
0048
0049 private TSessionHandle sessionHandle;
0050 private String catalogName;
0051 private String schemaName;
0052 private String tableName;
0053 private List<String> tableTypes;
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 TABLE_TYPES((short)5, "tableTypes");
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 TABLE_TYPES;
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.TABLE_TYPES};
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 , "TPatternOrIdentifier")));
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.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL,
0139 new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
0140 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
0141 metaDataMap = Collections.unmodifiableMap(tmpMap);
0142 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap);
0143 }
0144
0145 public TGetTablesReq() {
0146 }
0147
0148 public TGetTablesReq(
0149 TSessionHandle sessionHandle)
0150 {
0151 this();
0152 this.sessionHandle = sessionHandle;
0153 }
0154
0155
0156
0157
0158 public TGetTablesReq(TGetTablesReq other) {
0159 if (other.isSetSessionHandle()) {
0160 this.sessionHandle = new TSessionHandle(other.sessionHandle);
0161 }
0162 if (other.isSetCatalogName()) {
0163 this.catalogName = other.catalogName;
0164 }
0165 if (other.isSetSchemaName()) {
0166 this.schemaName = other.schemaName;
0167 }
0168 if (other.isSetTableName()) {
0169 this.tableName = other.tableName;
0170 }
0171 if (other.isSetTableTypes()) {
0172 List<String> __this__tableTypes = new ArrayList<String>();
0173 for (String other_element : other.tableTypes) {
0174 __this__tableTypes.add(other_element);
0175 }
0176 this.tableTypes = __this__tableTypes;
0177 }
0178 }
0179
0180 public TGetTablesReq deepCopy() {
0181 return new TGetTablesReq(this);
0182 }
0183
0184 @Override
0185 public void clear() {
0186 this.sessionHandle = null;
0187 this.catalogName = null;
0188 this.schemaName = null;
0189 this.tableName = null;
0190 this.tableTypes = null;
0191 }
0192
0193 public TSessionHandle getSessionHandle() {
0194 return this.sessionHandle;
0195 }
0196
0197 public void setSessionHandle(TSessionHandle sessionHandle) {
0198 this.sessionHandle = sessionHandle;
0199 }
0200
0201 public void unsetSessionHandle() {
0202 this.sessionHandle = null;
0203 }
0204
0205
0206 public boolean isSetSessionHandle() {
0207 return this.sessionHandle != null;
0208 }
0209
0210 public void setSessionHandleIsSet(boolean value) {
0211 if (!value) {
0212 this.sessionHandle = null;
0213 }
0214 }
0215
0216 public String getCatalogName() {
0217 return this.catalogName;
0218 }
0219
0220 public void setCatalogName(String catalogName) {
0221 this.catalogName = catalogName;
0222 }
0223
0224 public void unsetCatalogName() {
0225 this.catalogName = null;
0226 }
0227
0228
0229 public boolean isSetCatalogName() {
0230 return this.catalogName != null;
0231 }
0232
0233 public void setCatalogNameIsSet(boolean value) {
0234 if (!value) {
0235 this.catalogName = null;
0236 }
0237 }
0238
0239 public String getSchemaName() {
0240 return this.schemaName;
0241 }
0242
0243 public void setSchemaName(String schemaName) {
0244 this.schemaName = schemaName;
0245 }
0246
0247 public void unsetSchemaName() {
0248 this.schemaName = null;
0249 }
0250
0251
0252 public boolean isSetSchemaName() {
0253 return this.schemaName != null;
0254 }
0255
0256 public void setSchemaNameIsSet(boolean value) {
0257 if (!value) {
0258 this.schemaName = null;
0259 }
0260 }
0261
0262 public String getTableName() {
0263 return this.tableName;
0264 }
0265
0266 public void setTableName(String tableName) {
0267 this.tableName = tableName;
0268 }
0269
0270 public void unsetTableName() {
0271 this.tableName = null;
0272 }
0273
0274
0275 public boolean isSetTableName() {
0276 return this.tableName != null;
0277 }
0278
0279 public void setTableNameIsSet(boolean value) {
0280 if (!value) {
0281 this.tableName = null;
0282 }
0283 }
0284
0285 public int getTableTypesSize() {
0286 return (this.tableTypes == null) ? 0 : this.tableTypes.size();
0287 }
0288
0289 public java.util.Iterator<String> getTableTypesIterator() {
0290 return (this.tableTypes == null) ? null : this.tableTypes.iterator();
0291 }
0292
0293 public void addToTableTypes(String elem) {
0294 if (this.tableTypes == null) {
0295 this.tableTypes = new ArrayList<String>();
0296 }
0297 this.tableTypes.add(elem);
0298 }
0299
0300 public List<String> getTableTypes() {
0301 return this.tableTypes;
0302 }
0303
0304 public void setTableTypes(List<String> tableTypes) {
0305 this.tableTypes = tableTypes;
0306 }
0307
0308 public void unsetTableTypes() {
0309 this.tableTypes = null;
0310 }
0311
0312
0313 public boolean isSetTableTypes() {
0314 return this.tableTypes != null;
0315 }
0316
0317 public void setTableTypesIsSet(boolean value) {
0318 if (!value) {
0319 this.tableTypes = null;
0320 }
0321 }
0322
0323 public void setFieldValue(_Fields field, Object value) {
0324 switch (field) {
0325 case SESSION_HANDLE:
0326 if (value == null) {
0327 unsetSessionHandle();
0328 } else {
0329 setSessionHandle((TSessionHandle)value);
0330 }
0331 break;
0332
0333 case CATALOG_NAME:
0334 if (value == null) {
0335 unsetCatalogName();
0336 } else {
0337 setCatalogName((String)value);
0338 }
0339 break;
0340
0341 case SCHEMA_NAME:
0342 if (value == null) {
0343 unsetSchemaName();
0344 } else {
0345 setSchemaName((String)value);
0346 }
0347 break;
0348
0349 case TABLE_NAME:
0350 if (value == null) {
0351 unsetTableName();
0352 } else {
0353 setTableName((String)value);
0354 }
0355 break;
0356
0357 case TABLE_TYPES:
0358 if (value == null) {
0359 unsetTableTypes();
0360 } else {
0361 setTableTypes((List<String>)value);
0362 }
0363 break;
0364
0365 }
0366 }
0367
0368 public Object getFieldValue(_Fields field) {
0369 switch (field) {
0370 case SESSION_HANDLE:
0371 return getSessionHandle();
0372
0373 case CATALOG_NAME:
0374 return getCatalogName();
0375
0376 case SCHEMA_NAME:
0377 return getSchemaName();
0378
0379 case TABLE_NAME:
0380 return getTableName();
0381
0382 case TABLE_TYPES:
0383 return getTableTypes();
0384
0385 }
0386 throw new IllegalStateException();
0387 }
0388
0389
0390 public boolean isSet(_Fields field) {
0391 if (field == null) {
0392 throw new IllegalArgumentException();
0393 }
0394
0395 switch (field) {
0396 case SESSION_HANDLE:
0397 return isSetSessionHandle();
0398 case CATALOG_NAME:
0399 return isSetCatalogName();
0400 case SCHEMA_NAME:
0401 return isSetSchemaName();
0402 case TABLE_NAME:
0403 return isSetTableName();
0404 case TABLE_TYPES:
0405 return isSetTableTypes();
0406 }
0407 throw new IllegalStateException();
0408 }
0409
0410 @Override
0411 public boolean equals(Object that) {
0412 if (that == null)
0413 return false;
0414 if (that instanceof TGetTablesReq)
0415 return this.equals((TGetTablesReq)that);
0416 return false;
0417 }
0418
0419 public boolean equals(TGetTablesReq that) {
0420 if (that == null)
0421 return false;
0422
0423 boolean this_present_sessionHandle = true && this.isSetSessionHandle();
0424 boolean that_present_sessionHandle = true && that.isSetSessionHandle();
0425 if (this_present_sessionHandle || that_present_sessionHandle) {
0426 if (!(this_present_sessionHandle && that_present_sessionHandle))
0427 return false;
0428 if (!this.sessionHandle.equals(that.sessionHandle))
0429 return false;
0430 }
0431
0432 boolean this_present_catalogName = true && this.isSetCatalogName();
0433 boolean that_present_catalogName = true && that.isSetCatalogName();
0434 if (this_present_catalogName || that_present_catalogName) {
0435 if (!(this_present_catalogName && that_present_catalogName))
0436 return false;
0437 if (!this.catalogName.equals(that.catalogName))
0438 return false;
0439 }
0440
0441 boolean this_present_schemaName = true && this.isSetSchemaName();
0442 boolean that_present_schemaName = true && that.isSetSchemaName();
0443 if (this_present_schemaName || that_present_schemaName) {
0444 if (!(this_present_schemaName && that_present_schemaName))
0445 return false;
0446 if (!this.schemaName.equals(that.schemaName))
0447 return false;
0448 }
0449
0450 boolean this_present_tableName = true && this.isSetTableName();
0451 boolean that_present_tableName = true && that.isSetTableName();
0452 if (this_present_tableName || that_present_tableName) {
0453 if (!(this_present_tableName && that_present_tableName))
0454 return false;
0455 if (!this.tableName.equals(that.tableName))
0456 return false;
0457 }
0458
0459 boolean this_present_tableTypes = true && this.isSetTableTypes();
0460 boolean that_present_tableTypes = true && that.isSetTableTypes();
0461 if (this_present_tableTypes || that_present_tableTypes) {
0462 if (!(this_present_tableTypes && that_present_tableTypes))
0463 return false;
0464 if (!this.tableTypes.equals(that.tableTypes))
0465 return false;
0466 }
0467
0468 return true;
0469 }
0470
0471 @Override
0472 public int hashCode() {
0473 HashCodeBuilder builder = new HashCodeBuilder();
0474
0475 boolean present_sessionHandle = true && (isSetSessionHandle());
0476 builder.append(present_sessionHandle);
0477 if (present_sessionHandle)
0478 builder.append(sessionHandle);
0479
0480 boolean present_catalogName = true && (isSetCatalogName());
0481 builder.append(present_catalogName);
0482 if (present_catalogName)
0483 builder.append(catalogName);
0484
0485 boolean present_schemaName = true && (isSetSchemaName());
0486 builder.append(present_schemaName);
0487 if (present_schemaName)
0488 builder.append(schemaName);
0489
0490 boolean present_tableName = true && (isSetTableName());
0491 builder.append(present_tableName);
0492 if (present_tableName)
0493 builder.append(tableName);
0494
0495 boolean present_tableTypes = true && (isSetTableTypes());
0496 builder.append(present_tableTypes);
0497 if (present_tableTypes)
0498 builder.append(tableTypes);
0499
0500 return builder.toHashCode();
0501 }
0502
0503 public int compareTo(TGetTablesReq other) {
0504 if (!getClass().equals(other.getClass())) {
0505 return getClass().getName().compareTo(other.getClass().getName());
0506 }
0507
0508 int lastComparison = 0;
0509 TGetTablesReq typedOther = (TGetTablesReq)other;
0510
0511 lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle());
0512 if (lastComparison != 0) {
0513 return lastComparison;
0514 }
0515 if (isSetSessionHandle()) {
0516 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle);
0517 if (lastComparison != 0) {
0518 return lastComparison;
0519 }
0520 }
0521 lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(typedOther.isSetCatalogName());
0522 if (lastComparison != 0) {
0523 return lastComparison;
0524 }
0525 if (isSetCatalogName()) {
0526 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, typedOther.catalogName);
0527 if (lastComparison != 0) {
0528 return lastComparison;
0529 }
0530 }
0531 lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(typedOther.isSetSchemaName());
0532 if (lastComparison != 0) {
0533 return lastComparison;
0534 }
0535 if (isSetSchemaName()) {
0536 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, typedOther.schemaName);
0537 if (lastComparison != 0) {
0538 return lastComparison;
0539 }
0540 }
0541 lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName());
0542 if (lastComparison != 0) {
0543 return lastComparison;
0544 }
0545 if (isSetTableName()) {
0546 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, typedOther.tableName);
0547 if (lastComparison != 0) {
0548 return lastComparison;
0549 }
0550 }
0551 lastComparison = Boolean.valueOf(isSetTableTypes()).compareTo(typedOther.isSetTableTypes());
0552 if (lastComparison != 0) {
0553 return lastComparison;
0554 }
0555 if (isSetTableTypes()) {
0556 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableTypes, typedOther.tableTypes);
0557 if (lastComparison != 0) {
0558 return lastComparison;
0559 }
0560 }
0561 return 0;
0562 }
0563
0564 public _Fields fieldForId(int fieldId) {
0565 return _Fields.findByThriftId(fieldId);
0566 }
0567
0568 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0569 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0570 }
0571
0572 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0573 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0574 }
0575
0576 @Override
0577 public String toString() {
0578 StringBuilder sb = new StringBuilder("TGetTablesReq(");
0579 boolean first = true;
0580
0581 sb.append("sessionHandle:");
0582 if (this.sessionHandle == null) {
0583 sb.append("null");
0584 } else {
0585 sb.append(this.sessionHandle);
0586 }
0587 first = false;
0588 if (isSetCatalogName()) {
0589 if (!first) sb.append(", ");
0590 sb.append("catalogName:");
0591 if (this.catalogName == null) {
0592 sb.append("null");
0593 } else {
0594 sb.append(this.catalogName);
0595 }
0596 first = false;
0597 }
0598 if (isSetSchemaName()) {
0599 if (!first) sb.append(", ");
0600 sb.append("schemaName:");
0601 if (this.schemaName == null) {
0602 sb.append("null");
0603 } else {
0604 sb.append(this.schemaName);
0605 }
0606 first = false;
0607 }
0608 if (isSetTableName()) {
0609 if (!first) sb.append(", ");
0610 sb.append("tableName:");
0611 if (this.tableName == null) {
0612 sb.append("null");
0613 } else {
0614 sb.append(this.tableName);
0615 }
0616 first = false;
0617 }
0618 if (isSetTableTypes()) {
0619 if (!first) sb.append(", ");
0620 sb.append("tableTypes:");
0621 if (this.tableTypes == null) {
0622 sb.append("null");
0623 } else {
0624 sb.append(this.tableTypes);
0625 }
0626 first = false;
0627 }
0628 sb.append(")");
0629 return sb.toString();
0630 }
0631
0632 public void validate() throws org.apache.thrift.TException {
0633
0634 if (!isSetSessionHandle()) {
0635 throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString());
0636 }
0637
0638
0639 if (sessionHandle != null) {
0640 sessionHandle.validate();
0641 }
0642 }
0643
0644 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0645 try {
0646 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0647 } catch (org.apache.thrift.TException te) {
0648 throw new java.io.IOException(te);
0649 }
0650 }
0651
0652 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0653 try {
0654 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0655 } catch (org.apache.thrift.TException te) {
0656 throw new java.io.IOException(te);
0657 }
0658 }
0659
0660 private static class TGetTablesReqStandardSchemeFactory implements SchemeFactory {
0661 public TGetTablesReqStandardScheme getScheme() {
0662 return new TGetTablesReqStandardScheme();
0663 }
0664 }
0665
0666 private static class TGetTablesReqStandardScheme extends StandardScheme<TGetTablesReq> {
0667
0668 public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struct) throws org.apache.thrift.TException {
0669 org.apache.thrift.protocol.TField schemeField;
0670 iprot.readStructBegin();
0671 while (true)
0672 {
0673 schemeField = iprot.readFieldBegin();
0674 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
0675 break;
0676 }
0677 switch (schemeField.id) {
0678 case 1:
0679 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0680 struct.sessionHandle = new TSessionHandle();
0681 struct.sessionHandle.read(iprot);
0682 struct.setSessionHandleIsSet(true);
0683 } else {
0684 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0685 }
0686 break;
0687 case 2:
0688 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0689 struct.catalogName = iprot.readString();
0690 struct.setCatalogNameIsSet(true);
0691 } else {
0692 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0693 }
0694 break;
0695 case 3:
0696 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0697 struct.schemaName = iprot.readString();
0698 struct.setSchemaNameIsSet(true);
0699 } else {
0700 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0701 }
0702 break;
0703 case 4:
0704 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0705 struct.tableName = iprot.readString();
0706 struct.setTableNameIsSet(true);
0707 } else {
0708 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0709 }
0710 break;
0711 case 5:
0712 if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
0713 {
0714 org.apache.thrift.protocol.TList _list172 = iprot.readListBegin();
0715 struct.tableTypes = new ArrayList<String>(_list172.size);
0716 for (int _i173 = 0; _i173 < _list172.size; ++_i173)
0717 {
0718 String _elem174;
0719 _elem174 = iprot.readString();
0720 struct.tableTypes.add(_elem174);
0721 }
0722 iprot.readListEnd();
0723 }
0724 struct.setTableTypesIsSet(true);
0725 } else {
0726 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0727 }
0728 break;
0729 default:
0730 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0731 }
0732 iprot.readFieldEnd();
0733 }
0734 iprot.readStructEnd();
0735 struct.validate();
0736 }
0737
0738 public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq struct) throws org.apache.thrift.TException {
0739 struct.validate();
0740
0741 oprot.writeStructBegin(STRUCT_DESC);
0742 if (struct.sessionHandle != null) {
0743 oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC);
0744 struct.sessionHandle.write(oprot);
0745 oprot.writeFieldEnd();
0746 }
0747 if (struct.catalogName != null) {
0748 if (struct.isSetCatalogName()) {
0749 oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC);
0750 oprot.writeString(struct.catalogName);
0751 oprot.writeFieldEnd();
0752 }
0753 }
0754 if (struct.schemaName != null) {
0755 if (struct.isSetSchemaName()) {
0756 oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC);
0757 oprot.writeString(struct.schemaName);
0758 oprot.writeFieldEnd();
0759 }
0760 }
0761 if (struct.tableName != null) {
0762 if (struct.isSetTableName()) {
0763 oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
0764 oprot.writeString(struct.tableName);
0765 oprot.writeFieldEnd();
0766 }
0767 }
0768 if (struct.tableTypes != null) {
0769 if (struct.isSetTableTypes()) {
0770 oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC);
0771 {
0772 oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size()));
0773 for (String _iter175 : struct.tableTypes)
0774 {
0775 oprot.writeString(_iter175);
0776 }
0777 oprot.writeListEnd();
0778 }
0779 oprot.writeFieldEnd();
0780 }
0781 }
0782 oprot.writeFieldStop();
0783 oprot.writeStructEnd();
0784 }
0785
0786 }
0787
0788 private static class TGetTablesReqTupleSchemeFactory implements SchemeFactory {
0789 public TGetTablesReqTupleScheme getScheme() {
0790 return new TGetTablesReqTupleScheme();
0791 }
0792 }
0793
0794 private static class TGetTablesReqTupleScheme extends TupleScheme<TGetTablesReq> {
0795
0796 @Override
0797 public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException {
0798 TTupleProtocol oprot = (TTupleProtocol) prot;
0799 struct.sessionHandle.write(oprot);
0800 BitSet optionals = new BitSet();
0801 if (struct.isSetCatalogName()) {
0802 optionals.set(0);
0803 }
0804 if (struct.isSetSchemaName()) {
0805 optionals.set(1);
0806 }
0807 if (struct.isSetTableName()) {
0808 optionals.set(2);
0809 }
0810 if (struct.isSetTableTypes()) {
0811 optionals.set(3);
0812 }
0813 oprot.writeBitSet(optionals, 4);
0814 if (struct.isSetCatalogName()) {
0815 oprot.writeString(struct.catalogName);
0816 }
0817 if (struct.isSetSchemaName()) {
0818 oprot.writeString(struct.schemaName);
0819 }
0820 if (struct.isSetTableName()) {
0821 oprot.writeString(struct.tableName);
0822 }
0823 if (struct.isSetTableTypes()) {
0824 {
0825 oprot.writeI32(struct.tableTypes.size());
0826 for (String _iter176 : struct.tableTypes)
0827 {
0828 oprot.writeString(_iter176);
0829 }
0830 }
0831 }
0832 }
0833
0834 @Override
0835 public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException {
0836 TTupleProtocol iprot = (TTupleProtocol) prot;
0837 struct.sessionHandle = new TSessionHandle();
0838 struct.sessionHandle.read(iprot);
0839 struct.setSessionHandleIsSet(true);
0840 BitSet incoming = iprot.readBitSet(4);
0841 if (incoming.get(0)) {
0842 struct.catalogName = iprot.readString();
0843 struct.setCatalogNameIsSet(true);
0844 }
0845 if (incoming.get(1)) {
0846 struct.schemaName = iprot.readString();
0847 struct.setSchemaNameIsSet(true);
0848 }
0849 if (incoming.get(2)) {
0850 struct.tableName = iprot.readString();
0851 struct.setTableNameIsSet(true);
0852 }
0853 if (incoming.get(3)) {
0854 {
0855 org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
0856 struct.tableTypes = new ArrayList<String>(_list177.size);
0857 for (int _i178 = 0; _i178 < _list177.size; ++_i178)
0858 {
0859 String _elem179;
0860 _elem179 = iprot.readString();
0861 struct.tableTypes.add(_elem179);
0862 }
0863 }
0864 struct.setTableTypesIsSet(true);
0865 }
0866 }
0867 }
0868
0869 }
0870