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   * Any timestamps in the columns are ignored, use timeRange to select by timestamp.
32   * Max versions defaults to 1.
33   */
34  public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable, Cloneable {
35    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");
36  
37    private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)1);
38    private static final org.apache.thrift.protocol.TField STOP_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("stopRow", org.apache.thrift.protocol.TType.STRING, (short)2);
39    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)3);
40    private static final org.apache.thrift.protocol.TField CACHING_FIELD_DESC = new org.apache.thrift.protocol.TField("caching", org.apache.thrift.protocol.TType.I32, (short)4);
41    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);
42    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)6);
43  
44    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
45    static {
46      schemes.put(StandardScheme.class, new TScanStandardSchemeFactory());
47      schemes.put(TupleScheme.class, new TScanTupleSchemeFactory());
48    }
49  
50    public ByteBuffer startRow; // optional
51    public ByteBuffer stopRow; // optional
52    public List<TColumn> columns; // optional
53    public int caching; // optional
54    public int maxVersions; // optional
55    public TTimeRange timeRange; // optional
56  
57    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
59      START_ROW((short)1, "startRow"),
60      STOP_ROW((short)2, "stopRow"),
61      COLUMNS((short)3, "columns"),
62      CACHING((short)4, "caching"),
63      MAX_VERSIONS((short)5, "maxVersions"),
64      TIME_RANGE((short)6, "timeRange");
65  
66      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
67  
68      static {
69        for (_Fields field : EnumSet.allOf(_Fields.class)) {
70          byName.put(field.getFieldName(), field);
71        }
72      }
73  
74      /**
75       * Find the _Fields constant that matches fieldId, or null if its not found.
76       */
77      public static _Fields findByThriftId(int fieldId) {
78        switch(fieldId) {
79          case 1: // START_ROW
80            return START_ROW;
81          case 2: // STOP_ROW
82            return STOP_ROW;
83          case 3: // COLUMNS
84            return COLUMNS;
85          case 4: // CACHING
86            return CACHING;
87          case 5: // MAX_VERSIONS
88            return MAX_VERSIONS;
89          case 6: // TIME_RANGE
90            return TIME_RANGE;
91          default:
92            return null;
93        }
94      }
95  
96      /**
97       * Find the _Fields constant that matches fieldId, throwing an exception
98       * if it is not found.
99       */
100     public static _Fields findByThriftIdOrThrow(int fieldId) {
101       _Fields fields = findByThriftId(fieldId);
102       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
103       return fields;
104     }
105 
106     /**
107      * Find the _Fields constant that matches name, or null if its not found.
108      */
109     public static _Fields findByName(String name) {
110       return byName.get(name);
111     }
112 
113     private final short _thriftId;
114     private final String _fieldName;
115 
116     _Fields(short thriftId, String fieldName) {
117       _thriftId = thriftId;
118       _fieldName = fieldName;
119     }
120 
121     public short getThriftFieldId() {
122       return _thriftId;
123     }
124 
125     public String getFieldName() {
126       return _fieldName;
127     }
128   }
129 
130   // isset id assignments
131   private static final int __CACHING_ISSET_ID = 0;
132   private static final int __MAXVERSIONS_ISSET_ID = 1;
133   private BitSet __isset_bit_vector = new BitSet(2);
134   private _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.COLUMNS,_Fields.CACHING,_Fields.MAX_VERSIONS,_Fields.TIME_RANGE};
135   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
136   static {
137     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
138     tmpMap.put(_Fields.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
139         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
140     tmpMap.put(_Fields.STOP_ROW, new org.apache.thrift.meta_data.FieldMetaData("stopRow", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
141         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
142     tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
143         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
144             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class))));
145     tmpMap.put(_Fields.CACHING, new org.apache.thrift.meta_data.FieldMetaData("caching", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
146         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
147     tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
148         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
149     tmpMap.put(_Fields.TIME_RANGE, new org.apache.thrift.meta_data.FieldMetaData("timeRange", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
150         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTimeRange.class)));
151     metaDataMap = Collections.unmodifiableMap(tmpMap);
152     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TScan.class, metaDataMap);
153   }
154 
155   public TScan() {
156     this.maxVersions = 1;
157 
158   }
159 
160   /**
161    * Performs a deep copy on <i>other</i>.
162    */
163   public TScan(TScan other) {
164     __isset_bit_vector.clear();
165     __isset_bit_vector.or(other.__isset_bit_vector);
166     if (other.isSetStartRow()) {
167       this.startRow = org.apache.thrift.TBaseHelper.copyBinary(other.startRow);
168 ;
169     }
170     if (other.isSetStopRow()) {
171       this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(other.stopRow);
172 ;
173     }
174     if (other.isSetColumns()) {
175       List<TColumn> __this__columns = new ArrayList<TColumn>();
176       for (TColumn other_element : other.columns) {
177         __this__columns.add(new TColumn(other_element));
178       }
179       this.columns = __this__columns;
180     }
181     this.caching = other.caching;
182     this.maxVersions = other.maxVersions;
183     if (other.isSetTimeRange()) {
184       this.timeRange = new TTimeRange(other.timeRange);
185     }
186   }
187 
188   public TScan deepCopy() {
189     return new TScan(this);
190   }
191 
192   @Override
193   public void clear() {
194     this.startRow = null;
195     this.stopRow = null;
196     this.columns = null;
197     setCachingIsSet(false);
198     this.caching = 0;
199     this.maxVersions = 1;
200 
201     this.timeRange = null;
202   }
203 
204   public byte[] getStartRow() {
205     setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow));
206     return startRow == null ? null : startRow.array();
207   }
208 
209   public ByteBuffer bufferForStartRow() {
210     return startRow;
211   }
212 
213   public TScan setStartRow(byte[] startRow) {
214     setStartRow(startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(startRow));
215     return this;
216   }
217 
218   public TScan setStartRow(ByteBuffer startRow) {
219     this.startRow = startRow;
220     return this;
221   }
222 
223   public void unsetStartRow() {
224     this.startRow = null;
225   }
226 
227   /** Returns true if field startRow is set (has been assigned a value) and false otherwise */
228   public boolean isSetStartRow() {
229     return this.startRow != null;
230   }
231 
232   public void setStartRowIsSet(boolean value) {
233     if (!value) {
234       this.startRow = null;
235     }
236   }
237 
238   public byte[] getStopRow() {
239     setStopRow(org.apache.thrift.TBaseHelper.rightSize(stopRow));
240     return stopRow == null ? null : stopRow.array();
241   }
242 
243   public ByteBuffer bufferForStopRow() {
244     return stopRow;
245   }
246 
247   public TScan setStopRow(byte[] stopRow) {
248     setStopRow(stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(stopRow));
249     return this;
250   }
251 
252   public TScan setStopRow(ByteBuffer stopRow) {
253     this.stopRow = stopRow;
254     return this;
255   }
256 
257   public void unsetStopRow() {
258     this.stopRow = null;
259   }
260 
261   /** Returns true if field stopRow is set (has been assigned a value) and false otherwise */
262   public boolean isSetStopRow() {
263     return this.stopRow != null;
264   }
265 
266   public void setStopRowIsSet(boolean value) {
267     if (!value) {
268       this.stopRow = null;
269     }
270   }
271 
272   public int getColumnsSize() {
273     return (this.columns == null) ? 0 : this.columns.size();
274   }
275 
276   public java.util.Iterator<TColumn> getColumnsIterator() {
277     return (this.columns == null) ? null : this.columns.iterator();
278   }
279 
280   public void addToColumns(TColumn elem) {
281     if (this.columns == null) {
282       this.columns = new ArrayList<TColumn>();
283     }
284     this.columns.add(elem);
285   }
286 
287   public List<TColumn> getColumns() {
288     return this.columns;
289   }
290 
291   public TScan setColumns(List<TColumn> columns) {
292     this.columns = columns;
293     return this;
294   }
295 
296   public void unsetColumns() {
297     this.columns = null;
298   }
299 
300   /** Returns true if field columns is set (has been assigned a value) and false otherwise */
301   public boolean isSetColumns() {
302     return this.columns != null;
303   }
304 
305   public void setColumnsIsSet(boolean value) {
306     if (!value) {
307       this.columns = null;
308     }
309   }
310 
311   public int getCaching() {
312     return this.caching;
313   }
314 
315   public TScan setCaching(int caching) {
316     this.caching = caching;
317     setCachingIsSet(true);
318     return this;
319   }
320 
321   public void unsetCaching() {
322     __isset_bit_vector.clear(__CACHING_ISSET_ID);
323   }
324 
325   /** Returns true if field caching is set (has been assigned a value) and false otherwise */
326   public boolean isSetCaching() {
327     return __isset_bit_vector.get(__CACHING_ISSET_ID);
328   }
329 
330   public void setCachingIsSet(boolean value) {
331     __isset_bit_vector.set(__CACHING_ISSET_ID, value);
332   }
333 
334   public int getMaxVersions() {
335     return this.maxVersions;
336   }
337 
338   public TScan setMaxVersions(int maxVersions) {
339     this.maxVersions = maxVersions;
340     setMaxVersionsIsSet(true);
341     return this;
342   }
343 
344   public void unsetMaxVersions() {
345     __isset_bit_vector.clear(__MAXVERSIONS_ISSET_ID);
346   }
347 
348   /** Returns true if field maxVersions is set (has been assigned a value) and false otherwise */
349   public boolean isSetMaxVersions() {
350     return __isset_bit_vector.get(__MAXVERSIONS_ISSET_ID);
351   }
352 
353   public void setMaxVersionsIsSet(boolean value) {
354     __isset_bit_vector.set(__MAXVERSIONS_ISSET_ID, value);
355   }
356 
357   public TTimeRange getTimeRange() {
358     return this.timeRange;
359   }
360 
361   public TScan setTimeRange(TTimeRange timeRange) {
362     this.timeRange = timeRange;
363     return this;
364   }
365 
366   public void unsetTimeRange() {
367     this.timeRange = null;
368   }
369 
370   /** Returns true if field timeRange is set (has been assigned a value) and false otherwise */
371   public boolean isSetTimeRange() {
372     return this.timeRange != null;
373   }
374 
375   public void setTimeRangeIsSet(boolean value) {
376     if (!value) {
377       this.timeRange = null;
378     }
379   }
380 
381   public void setFieldValue(_Fields field, Object value) {
382     switch (field) {
383     case START_ROW:
384       if (value == null) {
385         unsetStartRow();
386       } else {
387         setStartRow((ByteBuffer)value);
388       }
389       break;
390 
391     case STOP_ROW:
392       if (value == null) {
393         unsetStopRow();
394       } else {
395         setStopRow((ByteBuffer)value);
396       }
397       break;
398 
399     case COLUMNS:
400       if (value == null) {
401         unsetColumns();
402       } else {
403         setColumns((List<TColumn>)value);
404       }
405       break;
406 
407     case CACHING:
408       if (value == null) {
409         unsetCaching();
410       } else {
411         setCaching((Integer)value);
412       }
413       break;
414 
415     case MAX_VERSIONS:
416       if (value == null) {
417         unsetMaxVersions();
418       } else {
419         setMaxVersions((Integer)value);
420       }
421       break;
422 
423     case TIME_RANGE:
424       if (value == null) {
425         unsetTimeRange();
426       } else {
427         setTimeRange((TTimeRange)value);
428       }
429       break;
430 
431     }
432   }
433 
434   public Object getFieldValue(_Fields field) {
435     switch (field) {
436     case START_ROW:
437       return getStartRow();
438 
439     case STOP_ROW:
440       return getStopRow();
441 
442     case COLUMNS:
443       return getColumns();
444 
445     case CACHING:
446       return Integer.valueOf(getCaching());
447 
448     case MAX_VERSIONS:
449       return Integer.valueOf(getMaxVersions());
450 
451     case TIME_RANGE:
452       return getTimeRange();
453 
454     }
455     throw new IllegalStateException();
456   }
457 
458   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
459   public boolean isSet(_Fields field) {
460     if (field == null) {
461       throw new IllegalArgumentException();
462     }
463 
464     switch (field) {
465     case START_ROW:
466       return isSetStartRow();
467     case STOP_ROW:
468       return isSetStopRow();
469     case COLUMNS:
470       return isSetColumns();
471     case CACHING:
472       return isSetCaching();
473     case MAX_VERSIONS:
474       return isSetMaxVersions();
475     case TIME_RANGE:
476       return isSetTimeRange();
477     }
478     throw new IllegalStateException();
479   }
480 
481   @Override
482   public boolean equals(Object that) {
483     if (that == null)
484       return false;
485     if (that instanceof TScan)
486       return this.equals((TScan)that);
487     return false;
488   }
489 
490   public boolean equals(TScan that) {
491     if (that == null)
492       return false;
493 
494     boolean this_present_startRow = true && this.isSetStartRow();
495     boolean that_present_startRow = true && that.isSetStartRow();
496     if (this_present_startRow || that_present_startRow) {
497       if (!(this_present_startRow && that_present_startRow))
498         return false;
499       if (!this.startRow.equals(that.startRow))
500         return false;
501     }
502 
503     boolean this_present_stopRow = true && this.isSetStopRow();
504     boolean that_present_stopRow = true && that.isSetStopRow();
505     if (this_present_stopRow || that_present_stopRow) {
506       if (!(this_present_stopRow && that_present_stopRow))
507         return false;
508       if (!this.stopRow.equals(that.stopRow))
509         return false;
510     }
511 
512     boolean this_present_columns = true && this.isSetColumns();
513     boolean that_present_columns = true && that.isSetColumns();
514     if (this_present_columns || that_present_columns) {
515       if (!(this_present_columns && that_present_columns))
516         return false;
517       if (!this.columns.equals(that.columns))
518         return false;
519     }
520 
521     boolean this_present_caching = true && this.isSetCaching();
522     boolean that_present_caching = true && that.isSetCaching();
523     if (this_present_caching || that_present_caching) {
524       if (!(this_present_caching && that_present_caching))
525         return false;
526       if (this.caching != that.caching)
527         return false;
528     }
529 
530     boolean this_present_maxVersions = true && this.isSetMaxVersions();
531     boolean that_present_maxVersions = true && that.isSetMaxVersions();
532     if (this_present_maxVersions || that_present_maxVersions) {
533       if (!(this_present_maxVersions && that_present_maxVersions))
534         return false;
535       if (this.maxVersions != that.maxVersions)
536         return false;
537     }
538 
539     boolean this_present_timeRange = true && this.isSetTimeRange();
540     boolean that_present_timeRange = true && that.isSetTimeRange();
541     if (this_present_timeRange || that_present_timeRange) {
542       if (!(this_present_timeRange && that_present_timeRange))
543         return false;
544       if (!this.timeRange.equals(that.timeRange))
545         return false;
546     }
547 
548     return true;
549   }
550 
551   @Override
552   public int hashCode() {
553     return 0;
554   }
555 
556   public int compareTo(TScan other) {
557     if (!getClass().equals(other.getClass())) {
558       return getClass().getName().compareTo(other.getClass().getName());
559     }
560 
561     int lastComparison = 0;
562     TScan typedOther = (TScan)other;
563 
564     lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow());
565     if (lastComparison != 0) {
566       return lastComparison;
567     }
568     if (isSetStartRow()) {
569       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, typedOther.startRow);
570       if (lastComparison != 0) {
571         return lastComparison;
572       }
573     }
574     lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(typedOther.isSetStopRow());
575     if (lastComparison != 0) {
576       return lastComparison;
577     }
578     if (isSetStopRow()) {
579       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, typedOther.stopRow);
580       if (lastComparison != 0) {
581         return lastComparison;
582       }
583     }
584     lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
585     if (lastComparison != 0) {
586       return lastComparison;
587     }
588     if (isSetColumns()) {
589       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
590       if (lastComparison != 0) {
591         return lastComparison;
592       }
593     }
594     lastComparison = Boolean.valueOf(isSetCaching()).compareTo(typedOther.isSetCaching());
595     if (lastComparison != 0) {
596       return lastComparison;
597     }
598     if (isSetCaching()) {
599       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, typedOther.caching);
600       if (lastComparison != 0) {
601         return lastComparison;
602       }
603     }
604     lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
605     if (lastComparison != 0) {
606       return lastComparison;
607     }
608     if (isSetMaxVersions()) {
609       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
610       if (lastComparison != 0) {
611         return lastComparison;
612       }
613     }
614     lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(typedOther.isSetTimeRange());
615     if (lastComparison != 0) {
616       return lastComparison;
617     }
618     if (isSetTimeRange()) {
619       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, typedOther.timeRange);
620       if (lastComparison != 0) {
621         return lastComparison;
622       }
623     }
624     return 0;
625   }
626 
627   public _Fields fieldForId(int fieldId) {
628     return _Fields.findByThriftId(fieldId);
629   }
630 
631   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
632     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
633   }
634 
635   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
636     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
637   }
638 
639   @Override
640   public String toString() {
641     StringBuilder sb = new StringBuilder("TScan(");
642     boolean first = true;
643 
644     if (isSetStartRow()) {
645       sb.append("startRow:");
646       if (this.startRow == null) {
647         sb.append("null");
648       } else {
649         org.apache.thrift.TBaseHelper.toString(this.startRow, sb);
650       }
651       first = false;
652     }
653     if (isSetStopRow()) {
654       if (!first) sb.append(", ");
655       sb.append("stopRow:");
656       if (this.stopRow == null) {
657         sb.append("null");
658       } else {
659         org.apache.thrift.TBaseHelper.toString(this.stopRow, sb);
660       }
661       first = false;
662     }
663     if (isSetColumns()) {
664       if (!first) sb.append(", ");
665       sb.append("columns:");
666       if (this.columns == null) {
667         sb.append("null");
668       } else {
669         sb.append(this.columns);
670       }
671       first = false;
672     }
673     if (isSetCaching()) {
674       if (!first) sb.append(", ");
675       sb.append("caching:");
676       sb.append(this.caching);
677       first = false;
678     }
679     if (isSetMaxVersions()) {
680       if (!first) sb.append(", ");
681       sb.append("maxVersions:");
682       sb.append(this.maxVersions);
683       first = false;
684     }
685     if (isSetTimeRange()) {
686       if (!first) sb.append(", ");
687       sb.append("timeRange:");
688       if (this.timeRange == null) {
689         sb.append("null");
690       } else {
691         sb.append(this.timeRange);
692       }
693       first = false;
694     }
695     sb.append(")");
696     return sb.toString();
697   }
698 
699   public void validate() throws org.apache.thrift.TException {
700     // check for required fields
701   }
702 
703   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
704     try {
705       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
706     } catch (org.apache.thrift.TException te) {
707       throw new java.io.IOException(te);
708     }
709   }
710 
711   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
712     try {
713       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
714       __isset_bit_vector = new BitSet(1);
715       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
716     } catch (org.apache.thrift.TException te) {
717       throw new java.io.IOException(te);
718     }
719   }
720 
721   private static class TScanStandardSchemeFactory implements SchemeFactory {
722     public TScanStandardScheme getScheme() {
723       return new TScanStandardScheme();
724     }
725   }
726 
727   private static class TScanStandardScheme extends StandardScheme<TScan> {
728 
729     public void read(org.apache.thrift.protocol.TProtocol iprot, TScan struct) throws org.apache.thrift.TException {
730       org.apache.thrift.protocol.TField schemeField;
731       iprot.readStructBegin();
732       while (true)
733       {
734         schemeField = iprot.readFieldBegin();
735         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
736           break;
737         }
738         switch (schemeField.id) {
739           case 1: // START_ROW
740             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
741               struct.startRow = iprot.readBinary();
742               struct.setStartRowIsSet(true);
743             } else { 
744               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
745             }
746             break;
747           case 2: // STOP_ROW
748             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
749               struct.stopRow = iprot.readBinary();
750               struct.setStopRowIsSet(true);
751             } else { 
752               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
753             }
754             break;
755           case 3: // COLUMNS
756             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
757               {
758                 org.apache.thrift.protocol.TList _list40 = iprot.readListBegin();
759                 struct.columns = new ArrayList<TColumn>(_list40.size);
760                 for (int _i41 = 0; _i41 < _list40.size; ++_i41)
761                 {
762                   TColumn _elem42; // optional
763                   _elem42 = new TColumn();
764                   _elem42.read(iprot);
765                   struct.columns.add(_elem42);
766                 }
767                 iprot.readListEnd();
768               }
769               struct.setColumnsIsSet(true);
770             } else { 
771               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
772             }
773             break;
774           case 4: // CACHING
775             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
776               struct.caching = iprot.readI32();
777               struct.setCachingIsSet(true);
778             } else { 
779               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
780             }
781             break;
782           case 5: // MAX_VERSIONS
783             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
784               struct.maxVersions = iprot.readI32();
785               struct.setMaxVersionsIsSet(true);
786             } else { 
787               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
788             }
789             break;
790           case 6: // TIME_RANGE
791             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
792               struct.timeRange = new TTimeRange();
793               struct.timeRange.read(iprot);
794               struct.setTimeRangeIsSet(true);
795             } else { 
796               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
797             }
798             break;
799           default:
800             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
801         }
802         iprot.readFieldEnd();
803       }
804       iprot.readStructEnd();
805 
806       // check for required fields of primitive type, which can't be checked in the validate method
807       struct.validate();
808     }
809 
810     public void write(org.apache.thrift.protocol.TProtocol oprot, TScan struct) throws org.apache.thrift.TException {
811       struct.validate();
812 
813       oprot.writeStructBegin(STRUCT_DESC);
814       if (struct.startRow != null) {
815         if (struct.isSetStartRow()) {
816           oprot.writeFieldBegin(START_ROW_FIELD_DESC);
817           oprot.writeBinary(struct.startRow);
818           oprot.writeFieldEnd();
819         }
820       }
821       if (struct.stopRow != null) {
822         if (struct.isSetStopRow()) {
823           oprot.writeFieldBegin(STOP_ROW_FIELD_DESC);
824           oprot.writeBinary(struct.stopRow);
825           oprot.writeFieldEnd();
826         }
827       }
828       if (struct.columns != null) {
829         if (struct.isSetColumns()) {
830           oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
831           {
832             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
833             for (TColumn _iter43 : struct.columns)
834             {
835               _iter43.write(oprot);
836             }
837             oprot.writeListEnd();
838           }
839           oprot.writeFieldEnd();
840         }
841       }
842       if (struct.isSetCaching()) {
843         oprot.writeFieldBegin(CACHING_FIELD_DESC);
844         oprot.writeI32(struct.caching);
845         oprot.writeFieldEnd();
846       }
847       if (struct.isSetMaxVersions()) {
848         oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
849         oprot.writeI32(struct.maxVersions);
850         oprot.writeFieldEnd();
851       }
852       if (struct.timeRange != null) {
853         if (struct.isSetTimeRange()) {
854           oprot.writeFieldBegin(TIME_RANGE_FIELD_DESC);
855           struct.timeRange.write(oprot);
856           oprot.writeFieldEnd();
857         }
858       }
859       oprot.writeFieldStop();
860       oprot.writeStructEnd();
861     }
862 
863   }
864 
865   private static class TScanTupleSchemeFactory implements SchemeFactory {
866     public TScanTupleScheme getScheme() {
867       return new TScanTupleScheme();
868     }
869   }
870 
871   private static class TScanTupleScheme extends TupleScheme<TScan> {
872 
873     @Override
874     public void write(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
875       TTupleProtocol oprot = (TTupleProtocol) prot;
876       BitSet optionals = new BitSet();
877       if (struct.isSetStartRow()) {
878         optionals.set(0);
879       }
880       if (struct.isSetStopRow()) {
881         optionals.set(1);
882       }
883       if (struct.isSetColumns()) {
884         optionals.set(2);
885       }
886       if (struct.isSetCaching()) {
887         optionals.set(3);
888       }
889       if (struct.isSetMaxVersions()) {
890         optionals.set(4);
891       }
892       if (struct.isSetTimeRange()) {
893         optionals.set(5);
894       }
895       oprot.writeBitSet(optionals, 6);
896       if (struct.isSetStartRow()) {
897         oprot.writeBinary(struct.startRow);
898       }
899       if (struct.isSetStopRow()) {
900         oprot.writeBinary(struct.stopRow);
901       }
902       if (struct.isSetColumns()) {
903         {
904           oprot.writeI32(struct.columns.size());
905           for (TColumn _iter44 : struct.columns)
906           {
907             _iter44.write(oprot);
908           }
909         }
910       }
911       if (struct.isSetCaching()) {
912         oprot.writeI32(struct.caching);
913       }
914       if (struct.isSetMaxVersions()) {
915         oprot.writeI32(struct.maxVersions);
916       }
917       if (struct.isSetTimeRange()) {
918         struct.timeRange.write(oprot);
919       }
920     }
921 
922     @Override
923     public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
924       TTupleProtocol iprot = (TTupleProtocol) prot;
925       BitSet incoming = iprot.readBitSet(6);
926       if (incoming.get(0)) {
927         struct.startRow = iprot.readBinary();
928         struct.setStartRowIsSet(true);
929       }
930       if (incoming.get(1)) {
931         struct.stopRow = iprot.readBinary();
932         struct.setStopRowIsSet(true);
933       }
934       if (incoming.get(2)) {
935         {
936           org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
937           struct.columns = new ArrayList<TColumn>(_list45.size);
938           for (int _i46 = 0; _i46 < _list45.size; ++_i46)
939           {
940             TColumn _elem47; // optional
941             _elem47 = new TColumn();
942             _elem47.read(iprot);
943             struct.columns.add(_elem47);
944           }
945         }
946         struct.setColumnsIsSet(true);
947       }
948       if (incoming.get(3)) {
949         struct.caching = iprot.readI32();
950         struct.setCachingIsSet(true);
951       }
952       if (incoming.get(4)) {
953         struct.maxVersions = iprot.readI32();
954         struct.setMaxVersionsIsSet(true);
955       }
956       if (incoming.get(5)) {
957         struct.timeRange = new TTimeRange();
958         struct.timeRange.read(iprot);
959         struct.setTimeRangeIsSet(true);
960       }
961     }
962   }
963 
964 }
965