View Javadoc

1   /**
2    * Autogenerated by Thrift Compiler (0.8.0)
3    *
4    * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5    *  @generated
6    */
7   package org.apache.hadoop.hbase.thrift2.generated;
8   
9   import org.apache.thrift.scheme.IScheme;
10  import org.apache.thrift.scheme.SchemeFactory;
11  import org.apache.thrift.scheme.StandardScheme;
12  
13  import org.apache.thrift.scheme.TupleScheme;
14  import org.apache.thrift.protocol.TTupleProtocol;
15  import java.util.List;
16  import java.util.ArrayList;
17  import java.util.Map;
18  import java.util.HashMap;
19  import java.util.EnumMap;
20  import java.util.Set;
21  import java.util.HashSet;
22  import java.util.EnumSet;
23  import java.util.Collections;
24  import java.util.BitSet;
25  import java.nio.ByteBuffer;
26  import java.util.Arrays;
27  import org.slf4j.Logger;
28  import org.slf4j.LoggerFactory;
29  
30  /**
31   * Used to perform Get operations on a single row.
32   * 
33   * The scope can be further narrowed down by specifying a list of
34   * columns or column families.
35   * 
36   * To get everything for a row, instantiate a Get object with just the row to get.
37   * To further define the scope of what to get you can add a timestamp or time range
38   * with an optional maximum number of versions to return.
39   * 
40   * If you specify a time range and a timestamp the range is ignored.
41   * Timestamps on TColumns are ignored.
42   * 
43   * TODO: Filter, Locks
44   */
45  public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.io.Serializable, Cloneable {
46    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGet");
47  
48    private static final org.apache.thrift.protocol.TField ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("row", org.apache.thrift.protocol.TType.STRING, (short)1);
49    private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)2);
50    private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3);
51    private static final org.apache.thrift.protocol.TField TIME_RANGE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeRange", org.apache.thrift.protocol.TType.STRUCT, (short)4);
52    private static final org.apache.thrift.protocol.TField MAX_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxVersions", org.apache.thrift.protocol.TType.I32, (short)5);
53  
54    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
55    static {
56      schemes.put(StandardScheme.class, new TGetStandardSchemeFactory());
57      schemes.put(TupleScheme.class, new TGetTupleSchemeFactory());
58    }
59  
60    public ByteBuffer row; // required
61    public List<TColumn> columns; // optional
62    public long timestamp; // optional
63    public TTimeRange timeRange; // optional
64    public int maxVersions; // optional
65  
66    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
67    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
68      ROW((short)1, "row"),
69      COLUMNS((short)2, "columns"),
70      TIMESTAMP((short)3, "timestamp"),
71      TIME_RANGE((short)4, "timeRange"),
72      MAX_VERSIONS((short)5, "maxVersions");
73  
74      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
75  
76      static {
77        for (_Fields field : EnumSet.allOf(_Fields.class)) {
78          byName.put(field.getFieldName(), field);
79        }
80      }
81  
82      /**
83       * Find the _Fields constant that matches fieldId, or null if its not found.
84       */
85      public static _Fields findByThriftId(int fieldId) {
86        switch(fieldId) {
87          case 1: // ROW
88            return ROW;
89          case 2: // COLUMNS
90            return COLUMNS;
91          case 3: // TIMESTAMP
92            return TIMESTAMP;
93          case 4: // TIME_RANGE
94            return TIME_RANGE;
95          case 5: // MAX_VERSIONS
96            return MAX_VERSIONS;
97          default:
98            return null;
99        }
100     }
101 
102     /**
103      * Find the _Fields constant that matches fieldId, throwing an exception
104      * if it is not found.
105      */
106     public static _Fields findByThriftIdOrThrow(int fieldId) {
107       _Fields fields = findByThriftId(fieldId);
108       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
109       return fields;
110     }
111 
112     /**
113      * Find the _Fields constant that matches name, or null if its not found.
114      */
115     public static _Fields findByName(String name) {
116       return byName.get(name);
117     }
118 
119     private final short _thriftId;
120     private final String _fieldName;
121 
122     _Fields(short thriftId, String fieldName) {
123       _thriftId = thriftId;
124       _fieldName = fieldName;
125     }
126 
127     public short getThriftFieldId() {
128       return _thriftId;
129     }
130 
131     public String getFieldName() {
132       return _fieldName;
133     }
134   }
135 
136   // isset id assignments
137   private static final int __TIMESTAMP_ISSET_ID = 0;
138   private static final int __MAXVERSIONS_ISSET_ID = 1;
139   private BitSet __isset_bit_vector = new BitSet(2);
140   private _Fields optionals[] = {_Fields.COLUMNS,_Fields.TIMESTAMP,_Fields.TIME_RANGE,_Fields.MAX_VERSIONS};
141   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
142   static {
143     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
144     tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, 
145         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
146     tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
147         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
148             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class))));
149     tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
150         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151     tmpMap.put(_Fields.TIME_RANGE, new org.apache.thrift.meta_data.FieldMetaData("timeRange", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
152         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTimeRange.class)));
153     tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
154         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
155     metaDataMap = Collections.unmodifiableMap(tmpMap);
156     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGet.class, metaDataMap);
157   }
158 
159   public TGet() {
160   }
161 
162   public TGet(
163     ByteBuffer row)
164   {
165     this();
166     this.row = row;
167   }
168 
169   /**
170    * Performs a deep copy on <i>other</i>.
171    */
172   public TGet(TGet other) {
173     __isset_bit_vector.clear();
174     __isset_bit_vector.or(other.__isset_bit_vector);
175     if (other.isSetRow()) {
176       this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
177 ;
178     }
179     if (other.isSetColumns()) {
180       List<TColumn> __this__columns = new ArrayList<TColumn>();
181       for (TColumn other_element : other.columns) {
182         __this__columns.add(new TColumn(other_element));
183       }
184       this.columns = __this__columns;
185     }
186     this.timestamp = other.timestamp;
187     if (other.isSetTimeRange()) {
188       this.timeRange = new TTimeRange(other.timeRange);
189     }
190     this.maxVersions = other.maxVersions;
191   }
192 
193   public TGet deepCopy() {
194     return new TGet(this);
195   }
196 
197   @Override
198   public void clear() {
199     this.row = null;
200     this.columns = null;
201     setTimestampIsSet(false);
202     this.timestamp = 0;
203     this.timeRange = null;
204     setMaxVersionsIsSet(false);
205     this.maxVersions = 0;
206   }
207 
208   public byte[] getRow() {
209     setRow(org.apache.thrift.TBaseHelper.rightSize(row));
210     return row == null ? null : row.array();
211   }
212 
213   public ByteBuffer bufferForRow() {
214     return row;
215   }
216 
217   public TGet setRow(byte[] row) {
218     setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
219     return this;
220   }
221 
222   public TGet setRow(ByteBuffer row) {
223     this.row = row;
224     return this;
225   }
226 
227   public void unsetRow() {
228     this.row = null;
229   }
230 
231   /** Returns true if field row is set (has been assigned a value) and false otherwise */
232   public boolean isSetRow() {
233     return this.row != null;
234   }
235 
236   public void setRowIsSet(boolean value) {
237     if (!value) {
238       this.row = null;
239     }
240   }
241 
242   public int getColumnsSize() {
243     return (this.columns == null) ? 0 : this.columns.size();
244   }
245 
246   public java.util.Iterator<TColumn> getColumnsIterator() {
247     return (this.columns == null) ? null : this.columns.iterator();
248   }
249 
250   public void addToColumns(TColumn elem) {
251     if (this.columns == null) {
252       this.columns = new ArrayList<TColumn>();
253     }
254     this.columns.add(elem);
255   }
256 
257   public List<TColumn> getColumns() {
258     return this.columns;
259   }
260 
261   public TGet setColumns(List<TColumn> columns) {
262     this.columns = columns;
263     return this;
264   }
265 
266   public void unsetColumns() {
267     this.columns = null;
268   }
269 
270   /** Returns true if field columns is set (has been assigned a value) and false otherwise */
271   public boolean isSetColumns() {
272     return this.columns != null;
273   }
274 
275   public void setColumnsIsSet(boolean value) {
276     if (!value) {
277       this.columns = null;
278     }
279   }
280 
281   public long getTimestamp() {
282     return this.timestamp;
283   }
284 
285   public TGet setTimestamp(long timestamp) {
286     this.timestamp = timestamp;
287     setTimestampIsSet(true);
288     return this;
289   }
290 
291   public void unsetTimestamp() {
292     __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
293   }
294 
295   /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
296   public boolean isSetTimestamp() {
297     return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
298   }
299 
300   public void setTimestampIsSet(boolean value) {
301     __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
302   }
303 
304   public TTimeRange getTimeRange() {
305     return this.timeRange;
306   }
307 
308   public TGet setTimeRange(TTimeRange timeRange) {
309     this.timeRange = timeRange;
310     return this;
311   }
312 
313   public void unsetTimeRange() {
314     this.timeRange = null;
315   }
316 
317   /** Returns true if field timeRange is set (has been assigned a value) and false otherwise */
318   public boolean isSetTimeRange() {
319     return this.timeRange != null;
320   }
321 
322   public void setTimeRangeIsSet(boolean value) {
323     if (!value) {
324       this.timeRange = null;
325     }
326   }
327 
328   public int getMaxVersions() {
329     return this.maxVersions;
330   }
331 
332   public TGet setMaxVersions(int maxVersions) {
333     this.maxVersions = maxVersions;
334     setMaxVersionsIsSet(true);
335     return this;
336   }
337 
338   public void unsetMaxVersions() {
339     __isset_bit_vector.clear(__MAXVERSIONS_ISSET_ID);
340   }
341 
342   /** Returns true if field maxVersions is set (has been assigned a value) and false otherwise */
343   public boolean isSetMaxVersions() {
344     return __isset_bit_vector.get(__MAXVERSIONS_ISSET_ID);
345   }
346 
347   public void setMaxVersionsIsSet(boolean value) {
348     __isset_bit_vector.set(__MAXVERSIONS_ISSET_ID, value);
349   }
350 
351   public void setFieldValue(_Fields field, Object value) {
352     switch (field) {
353     case ROW:
354       if (value == null) {
355         unsetRow();
356       } else {
357         setRow((ByteBuffer)value);
358       }
359       break;
360 
361     case COLUMNS:
362       if (value == null) {
363         unsetColumns();
364       } else {
365         setColumns((List<TColumn>)value);
366       }
367       break;
368 
369     case TIMESTAMP:
370       if (value == null) {
371         unsetTimestamp();
372       } else {
373         setTimestamp((Long)value);
374       }
375       break;
376 
377     case TIME_RANGE:
378       if (value == null) {
379         unsetTimeRange();
380       } else {
381         setTimeRange((TTimeRange)value);
382       }
383       break;
384 
385     case MAX_VERSIONS:
386       if (value == null) {
387         unsetMaxVersions();
388       } else {
389         setMaxVersions((Integer)value);
390       }
391       break;
392 
393     }
394   }
395 
396   public Object getFieldValue(_Fields field) {
397     switch (field) {
398     case ROW:
399       return getRow();
400 
401     case COLUMNS:
402       return getColumns();
403 
404     case TIMESTAMP:
405       return Long.valueOf(getTimestamp());
406 
407     case TIME_RANGE:
408       return getTimeRange();
409 
410     case MAX_VERSIONS:
411       return Integer.valueOf(getMaxVersions());
412 
413     }
414     throw new IllegalStateException();
415   }
416 
417   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
418   public boolean isSet(_Fields field) {
419     if (field == null) {
420       throw new IllegalArgumentException();
421     }
422 
423     switch (field) {
424     case ROW:
425       return isSetRow();
426     case COLUMNS:
427       return isSetColumns();
428     case TIMESTAMP:
429       return isSetTimestamp();
430     case TIME_RANGE:
431       return isSetTimeRange();
432     case MAX_VERSIONS:
433       return isSetMaxVersions();
434     }
435     throw new IllegalStateException();
436   }
437 
438   @Override
439   public boolean equals(Object that) {
440     if (that == null)
441       return false;
442     if (that instanceof TGet)
443       return this.equals((TGet)that);
444     return false;
445   }
446 
447   public boolean equals(TGet that) {
448     if (that == null)
449       return false;
450 
451     boolean this_present_row = true && this.isSetRow();
452     boolean that_present_row = true && that.isSetRow();
453     if (this_present_row || that_present_row) {
454       if (!(this_present_row && that_present_row))
455         return false;
456       if (!this.row.equals(that.row))
457         return false;
458     }
459 
460     boolean this_present_columns = true && this.isSetColumns();
461     boolean that_present_columns = true && that.isSetColumns();
462     if (this_present_columns || that_present_columns) {
463       if (!(this_present_columns && that_present_columns))
464         return false;
465       if (!this.columns.equals(that.columns))
466         return false;
467     }
468 
469     boolean this_present_timestamp = true && this.isSetTimestamp();
470     boolean that_present_timestamp = true && that.isSetTimestamp();
471     if (this_present_timestamp || that_present_timestamp) {
472       if (!(this_present_timestamp && that_present_timestamp))
473         return false;
474       if (this.timestamp != that.timestamp)
475         return false;
476     }
477 
478     boolean this_present_timeRange = true && this.isSetTimeRange();
479     boolean that_present_timeRange = true && that.isSetTimeRange();
480     if (this_present_timeRange || that_present_timeRange) {
481       if (!(this_present_timeRange && that_present_timeRange))
482         return false;
483       if (!this.timeRange.equals(that.timeRange))
484         return false;
485     }
486 
487     boolean this_present_maxVersions = true && this.isSetMaxVersions();
488     boolean that_present_maxVersions = true && that.isSetMaxVersions();
489     if (this_present_maxVersions || that_present_maxVersions) {
490       if (!(this_present_maxVersions && that_present_maxVersions))
491         return false;
492       if (this.maxVersions != that.maxVersions)
493         return false;
494     }
495 
496     return true;
497   }
498 
499   @Override
500   public int hashCode() {
501     return 0;
502   }
503 
504   public int compareTo(TGet other) {
505     if (!getClass().equals(other.getClass())) {
506       return getClass().getName().compareTo(other.getClass().getName());
507     }
508 
509     int lastComparison = 0;
510     TGet typedOther = (TGet)other;
511 
512     lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
513     if (lastComparison != 0) {
514       return lastComparison;
515     }
516     if (isSetRow()) {
517       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
518       if (lastComparison != 0) {
519         return lastComparison;
520       }
521     }
522     lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
523     if (lastComparison != 0) {
524       return lastComparison;
525     }
526     if (isSetColumns()) {
527       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
528       if (lastComparison != 0) {
529         return lastComparison;
530       }
531     }
532     lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
533     if (lastComparison != 0) {
534       return lastComparison;
535     }
536     if (isSetTimestamp()) {
537       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
538       if (lastComparison != 0) {
539         return lastComparison;
540       }
541     }
542     lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(typedOther.isSetTimeRange());
543     if (lastComparison != 0) {
544       return lastComparison;
545     }
546     if (isSetTimeRange()) {
547       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, typedOther.timeRange);
548       if (lastComparison != 0) {
549         return lastComparison;
550       }
551     }
552     lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
553     if (lastComparison != 0) {
554       return lastComparison;
555     }
556     if (isSetMaxVersions()) {
557       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
558       if (lastComparison != 0) {
559         return lastComparison;
560       }
561     }
562     return 0;
563   }
564 
565   public _Fields fieldForId(int fieldId) {
566     return _Fields.findByThriftId(fieldId);
567   }
568 
569   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
570     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
571   }
572 
573   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
574     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
575   }
576 
577   @Override
578   public String toString() {
579     StringBuilder sb = new StringBuilder("TGet(");
580     boolean first = true;
581 
582     sb.append("row:");
583     if (this.row == null) {
584       sb.append("null");
585     } else {
586       org.apache.thrift.TBaseHelper.toString(this.row, sb);
587     }
588     first = false;
589     if (isSetColumns()) {
590       if (!first) sb.append(", ");
591       sb.append("columns:");
592       if (this.columns == null) {
593         sb.append("null");
594       } else {
595         sb.append(this.columns);
596       }
597       first = false;
598     }
599     if (isSetTimestamp()) {
600       if (!first) sb.append(", ");
601       sb.append("timestamp:");
602       sb.append(this.timestamp);
603       first = false;
604     }
605     if (isSetTimeRange()) {
606       if (!first) sb.append(", ");
607       sb.append("timeRange:");
608       if (this.timeRange == null) {
609         sb.append("null");
610       } else {
611         sb.append(this.timeRange);
612       }
613       first = false;
614     }
615     if (isSetMaxVersions()) {
616       if (!first) sb.append(", ");
617       sb.append("maxVersions:");
618       sb.append(this.maxVersions);
619       first = false;
620     }
621     sb.append(")");
622     return sb.toString();
623   }
624 
625   public void validate() throws org.apache.thrift.TException {
626     // check for required fields
627     if (row == null) {
628       throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString());
629     }
630   }
631 
632   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
633     try {
634       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
635     } catch (org.apache.thrift.TException te) {
636       throw new java.io.IOException(te);
637     }
638   }
639 
640   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
641     try {
642       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
643       __isset_bit_vector = new BitSet(1);
644       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
645     } catch (org.apache.thrift.TException te) {
646       throw new java.io.IOException(te);
647     }
648   }
649 
650   private static class TGetStandardSchemeFactory implements SchemeFactory {
651     public TGetStandardScheme getScheme() {
652       return new TGetStandardScheme();
653     }
654   }
655 
656   private static class TGetStandardScheme extends StandardScheme<TGet> {
657 
658     public void read(org.apache.thrift.protocol.TProtocol iprot, TGet struct) throws org.apache.thrift.TException {
659       org.apache.thrift.protocol.TField schemeField;
660       iprot.readStructBegin();
661       while (true)
662       {
663         schemeField = iprot.readFieldBegin();
664         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
665           break;
666         }
667         switch (schemeField.id) {
668           case 1: // ROW
669             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
670               struct.row = iprot.readBinary();
671               struct.setRowIsSet(true);
672             } else { 
673               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
674             }
675             break;
676           case 2: // COLUMNS
677             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
678               {
679                 org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
680                 struct.columns = new ArrayList<TColumn>(_list8.size);
681                 for (int _i9 = 0; _i9 < _list8.size; ++_i9)
682                 {
683                   TColumn _elem10; // optional
684                   _elem10 = new TColumn();
685                   _elem10.read(iprot);
686                   struct.columns.add(_elem10);
687                 }
688                 iprot.readListEnd();
689               }
690               struct.setColumnsIsSet(true);
691             } else { 
692               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
693             }
694             break;
695           case 3: // TIMESTAMP
696             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
697               struct.timestamp = iprot.readI64();
698               struct.setTimestampIsSet(true);
699             } else { 
700               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
701             }
702             break;
703           case 4: // TIME_RANGE
704             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
705               struct.timeRange = new TTimeRange();
706               struct.timeRange.read(iprot);
707               struct.setTimeRangeIsSet(true);
708             } else { 
709               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
710             }
711             break;
712           case 5: // MAX_VERSIONS
713             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
714               struct.maxVersions = iprot.readI32();
715               struct.setMaxVersionsIsSet(true);
716             } else { 
717               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
718             }
719             break;
720           default:
721             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
722         }
723         iprot.readFieldEnd();
724       }
725       iprot.readStructEnd();
726 
727       // check for required fields of primitive type, which can't be checked in the validate method
728       struct.validate();
729     }
730 
731     public void write(org.apache.thrift.protocol.TProtocol oprot, TGet struct) throws org.apache.thrift.TException {
732       struct.validate();
733 
734       oprot.writeStructBegin(STRUCT_DESC);
735       if (struct.row != null) {
736         oprot.writeFieldBegin(ROW_FIELD_DESC);
737         oprot.writeBinary(struct.row);
738         oprot.writeFieldEnd();
739       }
740       if (struct.columns != null) {
741         if (struct.isSetColumns()) {
742           oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
743           {
744             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
745             for (TColumn _iter11 : struct.columns)
746             {
747               _iter11.write(oprot);
748             }
749             oprot.writeListEnd();
750           }
751           oprot.writeFieldEnd();
752         }
753       }
754       if (struct.isSetTimestamp()) {
755         oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
756         oprot.writeI64(struct.timestamp);
757         oprot.writeFieldEnd();
758       }
759       if (struct.timeRange != null) {
760         if (struct.isSetTimeRange()) {
761           oprot.writeFieldBegin(TIME_RANGE_FIELD_DESC);
762           struct.timeRange.write(oprot);
763           oprot.writeFieldEnd();
764         }
765       }
766       if (struct.isSetMaxVersions()) {
767         oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
768         oprot.writeI32(struct.maxVersions);
769         oprot.writeFieldEnd();
770       }
771       oprot.writeFieldStop();
772       oprot.writeStructEnd();
773     }
774 
775   }
776 
777   private static class TGetTupleSchemeFactory implements SchemeFactory {
778     public TGetTupleScheme getScheme() {
779       return new TGetTupleScheme();
780     }
781   }
782 
783   private static class TGetTupleScheme extends TupleScheme<TGet> {
784 
785     @Override
786     public void write(org.apache.thrift.protocol.TProtocol prot, TGet struct) throws org.apache.thrift.TException {
787       TTupleProtocol oprot = (TTupleProtocol) prot;
788       oprot.writeBinary(struct.row);
789       BitSet optionals = new BitSet();
790       if (struct.isSetColumns()) {
791         optionals.set(0);
792       }
793       if (struct.isSetTimestamp()) {
794         optionals.set(1);
795       }
796       if (struct.isSetTimeRange()) {
797         optionals.set(2);
798       }
799       if (struct.isSetMaxVersions()) {
800         optionals.set(3);
801       }
802       oprot.writeBitSet(optionals, 4);
803       if (struct.isSetColumns()) {
804         {
805           oprot.writeI32(struct.columns.size());
806           for (TColumn _iter12 : struct.columns)
807           {
808             _iter12.write(oprot);
809           }
810         }
811       }
812       if (struct.isSetTimestamp()) {
813         oprot.writeI64(struct.timestamp);
814       }
815       if (struct.isSetTimeRange()) {
816         struct.timeRange.write(oprot);
817       }
818       if (struct.isSetMaxVersions()) {
819         oprot.writeI32(struct.maxVersions);
820       }
821     }
822 
823     @Override
824     public void read(org.apache.thrift.protocol.TProtocol prot, TGet struct) throws org.apache.thrift.TException {
825       TTupleProtocol iprot = (TTupleProtocol) prot;
826       struct.row = iprot.readBinary();
827       struct.setRowIsSet(true);
828       BitSet incoming = iprot.readBitSet(4);
829       if (incoming.get(0)) {
830         {
831           org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
832           struct.columns = new ArrayList<TColumn>(_list13.size);
833           for (int _i14 = 0; _i14 < _list13.size; ++_i14)
834           {
835             TColumn _elem15; // optional
836             _elem15 = new TColumn();
837             _elem15.read(iprot);
838             struct.columns.add(_elem15);
839           }
840         }
841         struct.setColumnsIsSet(true);
842       }
843       if (incoming.get(1)) {
844         struct.timestamp = iprot.readI64();
845         struct.setTimestampIsSet(true);
846       }
847       if (incoming.get(2)) {
848         struct.timeRange = new TTimeRange();
849         struct.timeRange.read(iprot);
850         struct.setTimeRangeIsSet(true);
851       }
852       if (incoming.get(3)) {
853         struct.maxVersions = iprot.readI32();
854         struct.setMaxVersionsIsSet(true);
855       }
856     }
857   }
858 
859 }
860