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