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