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