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