1
2
3
4
5
6
7 package org.apache.hadoop.hbase.thrift2.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
35 public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable, Cloneable {
36 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");
37
38 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);
39 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);
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)3);
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)4);
42 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);
43 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);
44 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)7);
45 private static final org.apache.thrift.protocol.TField BATCH_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("batchSize", org.apache.thrift.protocol.TType.I32, (short)8);
46 private static final org.apache.thrift.protocol.TField ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.MAP, (short)9);
47
48 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
49 static {
50 schemes.put(StandardScheme.class, new TScanStandardSchemeFactory());
51 schemes.put(TupleScheme.class, new TScanTupleSchemeFactory());
52 }
53
54 public ByteBuffer startRow;
55 public ByteBuffer stopRow;
56 public List<TColumn> columns;
57 public int caching;
58 public int maxVersions;
59 public TTimeRange timeRange;
60 public ByteBuffer filterString;
61 public int batchSize;
62 public Map<ByteBuffer,ByteBuffer> attributes;
63
64
65 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
66 START_ROW((short)1, "startRow"),
67 STOP_ROW((short)2, "stopRow"),
68 COLUMNS((short)3, "columns"),
69 CACHING((short)4, "caching"),
70 MAX_VERSIONS((short)5, "maxVersions"),
71 TIME_RANGE((short)6, "timeRange"),
72 FILTER_STRING((short)7, "filterString"),
73 BATCH_SIZE((short)8, "batchSize"),
74 ATTRIBUTES((short)9, "attributes");
75
76 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
77
78 static {
79 for (_Fields field : EnumSet.allOf(_Fields.class)) {
80 byName.put(field.getFieldName(), field);
81 }
82 }
83
84
85
86
87 public static _Fields findByThriftId(int fieldId) {
88 switch(fieldId) {
89 case 1:
90 return START_ROW;
91 case 2:
92 return STOP_ROW;
93 case 3:
94 return COLUMNS;
95 case 4:
96 return CACHING;
97 case 5:
98 return MAX_VERSIONS;
99 case 6:
100 return TIME_RANGE;
101 case 7:
102 return FILTER_STRING;
103 case 8:
104 return BATCH_SIZE;
105 case 9:
106 return ATTRIBUTES;
107 default:
108 return null;
109 }
110 }
111
112
113
114
115
116 public static _Fields findByThriftIdOrThrow(int fieldId) {
117 _Fields fields = findByThriftId(fieldId);
118 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
119 return fields;
120 }
121
122
123
124
125 public static _Fields findByName(String name) {
126 return byName.get(name);
127 }
128
129 private final short _thriftId;
130 private final String _fieldName;
131
132 _Fields(short thriftId, String fieldName) {
133 _thriftId = thriftId;
134 _fieldName = fieldName;
135 }
136
137 public short getThriftFieldId() {
138 return _thriftId;
139 }
140
141 public String getFieldName() {
142 return _fieldName;
143 }
144 }
145
146
147 private static final int __CACHING_ISSET_ID = 0;
148 private static final int __MAXVERSIONS_ISSET_ID = 1;
149 private static final int __BATCHSIZE_ISSET_ID = 2;
150 private BitSet __isset_bit_vector = new BitSet(3);
151 private _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.COLUMNS,_Fields.CACHING,_Fields.MAX_VERSIONS,_Fields.TIME_RANGE,_Fields.FILTER_STRING,_Fields.BATCH_SIZE,_Fields.ATTRIBUTES};
152 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
153 static {
154 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
155 tmpMap.put(_Fields.START_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.OPTIONAL,
156 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
157 tmpMap.put(_Fields.STOP_ROW, new org.apache.thrift.meta_data.FieldMetaData("stopRow", org.apache.thrift.TFieldRequirementType.OPTIONAL,
158 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
159 tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL,
160 new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
161 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class))));
162 tmpMap.put(_Fields.CACHING, new org.apache.thrift.meta_data.FieldMetaData("caching", org.apache.thrift.TFieldRequirementType.OPTIONAL,
163 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
164 tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.OPTIONAL,
165 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
166 tmpMap.put(_Fields.TIME_RANGE, new org.apache.thrift.meta_data.FieldMetaData("timeRange", org.apache.thrift.TFieldRequirementType.OPTIONAL,
167 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTimeRange.class)));
168 tmpMap.put(_Fields.FILTER_STRING, new org.apache.thrift.meta_data.FieldMetaData("filterString", org.apache.thrift.TFieldRequirementType.OPTIONAL,
169 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
170 tmpMap.put(_Fields.BATCH_SIZE, new org.apache.thrift.meta_data.FieldMetaData("batchSize", org.apache.thrift.TFieldRequirementType.OPTIONAL,
171 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
172 tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.OPTIONAL,
173 new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
174 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true),
175 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
176 metaDataMap = Collections.unmodifiableMap(tmpMap);
177 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TScan.class, metaDataMap);
178 }
179
180 public TScan() {
181 this.maxVersions = 1;
182
183 }
184
185
186
187
188 public TScan(TScan other) {
189 __isset_bit_vector.clear();
190 __isset_bit_vector.or(other.__isset_bit_vector);
191 if (other.isSetStartRow()) {
192 this.startRow = org.apache.thrift.TBaseHelper.copyBinary(other.startRow);
193 ;
194 }
195 if (other.isSetStopRow()) {
196 this.stopRow = org.apache.thrift.TBaseHelper.copyBinary(other.stopRow);
197 ;
198 }
199 if (other.isSetColumns()) {
200 List<TColumn> __this__columns = new ArrayList<TColumn>();
201 for (TColumn other_element : other.columns) {
202 __this__columns.add(new TColumn(other_element));
203 }
204 this.columns = __this__columns;
205 }
206 this.caching = other.caching;
207 this.maxVersions = other.maxVersions;
208 if (other.isSetTimeRange()) {
209 this.timeRange = new TTimeRange(other.timeRange);
210 }
211 if (other.isSetFilterString()) {
212 this.filterString = org.apache.thrift.TBaseHelper.copyBinary(other.filterString);
213 ;
214 }
215 this.batchSize = other.batchSize;
216 if (other.isSetAttributes()) {
217 Map<ByteBuffer,ByteBuffer> __this__attributes = new HashMap<ByteBuffer,ByteBuffer>();
218 for (Map.Entry<ByteBuffer, ByteBuffer> other_element : other.attributes.entrySet()) {
219
220 ByteBuffer other_element_key = other_element.getKey();
221 ByteBuffer other_element_value = other_element.getValue();
222
223 ByteBuffer __this__attributes_copy_key = org.apache.thrift.TBaseHelper.copyBinary(other_element_key);
224 ;
225
226 ByteBuffer __this__attributes_copy_value = org.apache.thrift.TBaseHelper.copyBinary(other_element_value);
227 ;
228
229 __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value);
230 }
231 this.attributes = __this__attributes;
232 }
233 }
234
235 public TScan deepCopy() {
236 return new TScan(this);
237 }
238
239 @Override
240 public void clear() {
241 this.startRow = null;
242 this.stopRow = null;
243 this.columns = null;
244 setCachingIsSet(false);
245 this.caching = 0;
246 this.maxVersions = 1;
247
248 this.timeRange = null;
249 this.filterString = null;
250 setBatchSizeIsSet(false);
251 this.batchSize = 0;
252 this.attributes = null;
253 }
254
255 public byte[] getStartRow() {
256 setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow));
257 return startRow == null ? null : startRow.array();
258 }
259
260 public ByteBuffer bufferForStartRow() {
261 return startRow;
262 }
263
264 public TScan setStartRow(byte[] startRow) {
265 setStartRow(startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(startRow));
266 return this;
267 }
268
269 public TScan setStartRow(ByteBuffer startRow) {
270 this.startRow = startRow;
271 return this;
272 }
273
274 public void unsetStartRow() {
275 this.startRow = null;
276 }
277
278
279 public boolean isSetStartRow() {
280 return this.startRow != null;
281 }
282
283 public void setStartRowIsSet(boolean value) {
284 if (!value) {
285 this.startRow = null;
286 }
287 }
288
289 public byte[] getStopRow() {
290 setStopRow(org.apache.thrift.TBaseHelper.rightSize(stopRow));
291 return stopRow == null ? null : stopRow.array();
292 }
293
294 public ByteBuffer bufferForStopRow() {
295 return stopRow;
296 }
297
298 public TScan setStopRow(byte[] stopRow) {
299 setStopRow(stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(stopRow));
300 return this;
301 }
302
303 public TScan setStopRow(ByteBuffer stopRow) {
304 this.stopRow = stopRow;
305 return this;
306 }
307
308 public void unsetStopRow() {
309 this.stopRow = null;
310 }
311
312
313 public boolean isSetStopRow() {
314 return this.stopRow != null;
315 }
316
317 public void setStopRowIsSet(boolean value) {
318 if (!value) {
319 this.stopRow = null;
320 }
321 }
322
323 public int getColumnsSize() {
324 return (this.columns == null) ? 0 : this.columns.size();
325 }
326
327 public java.util.Iterator<TColumn> getColumnsIterator() {
328 return (this.columns == null) ? null : this.columns.iterator();
329 }
330
331 public void addToColumns(TColumn elem) {
332 if (this.columns == null) {
333 this.columns = new ArrayList<TColumn>();
334 }
335 this.columns.add(elem);
336 }
337
338 public List<TColumn> getColumns() {
339 return this.columns;
340 }
341
342 public TScan setColumns(List<TColumn> columns) {
343 this.columns = columns;
344 return this;
345 }
346
347 public void unsetColumns() {
348 this.columns = null;
349 }
350
351
352 public boolean isSetColumns() {
353 return this.columns != null;
354 }
355
356 public void setColumnsIsSet(boolean value) {
357 if (!value) {
358 this.columns = null;
359 }
360 }
361
362 public int getCaching() {
363 return this.caching;
364 }
365
366 public TScan setCaching(int caching) {
367 this.caching = caching;
368 setCachingIsSet(true);
369 return this;
370 }
371
372 public void unsetCaching() {
373 __isset_bit_vector.clear(__CACHING_ISSET_ID);
374 }
375
376
377 public boolean isSetCaching() {
378 return __isset_bit_vector.get(__CACHING_ISSET_ID);
379 }
380
381 public void setCachingIsSet(boolean value) {
382 __isset_bit_vector.set(__CACHING_ISSET_ID, value);
383 }
384
385 public int getMaxVersions() {
386 return this.maxVersions;
387 }
388
389 public TScan setMaxVersions(int maxVersions) {
390 this.maxVersions = maxVersions;
391 setMaxVersionsIsSet(true);
392 return this;
393 }
394
395 public void unsetMaxVersions() {
396 __isset_bit_vector.clear(__MAXVERSIONS_ISSET_ID);
397 }
398
399
400 public boolean isSetMaxVersions() {
401 return __isset_bit_vector.get(__MAXVERSIONS_ISSET_ID);
402 }
403
404 public void setMaxVersionsIsSet(boolean value) {
405 __isset_bit_vector.set(__MAXVERSIONS_ISSET_ID, value);
406 }
407
408 public TTimeRange getTimeRange() {
409 return this.timeRange;
410 }
411
412 public TScan setTimeRange(TTimeRange timeRange) {
413 this.timeRange = timeRange;
414 return this;
415 }
416
417 public void unsetTimeRange() {
418 this.timeRange = null;
419 }
420
421
422 public boolean isSetTimeRange() {
423 return this.timeRange != null;
424 }
425
426 public void setTimeRangeIsSet(boolean value) {
427 if (!value) {
428 this.timeRange = null;
429 }
430 }
431
432 public byte[] getFilterString() {
433 setFilterString(org.apache.thrift.TBaseHelper.rightSize(filterString));
434 return filterString == null ? null : filterString.array();
435 }
436
437 public ByteBuffer bufferForFilterString() {
438 return filterString;
439 }
440
441 public TScan setFilterString(byte[] filterString) {
442 setFilterString(filterString == null ? (ByteBuffer)null : ByteBuffer.wrap(filterString));
443 return this;
444 }
445
446 public TScan setFilterString(ByteBuffer filterString) {
447 this.filterString = filterString;
448 return this;
449 }
450
451 public void unsetFilterString() {
452 this.filterString = null;
453 }
454
455
456 public boolean isSetFilterString() {
457 return this.filterString != null;
458 }
459
460 public void setFilterStringIsSet(boolean value) {
461 if (!value) {
462 this.filterString = null;
463 }
464 }
465
466 public int getBatchSize() {
467 return this.batchSize;
468 }
469
470 public TScan setBatchSize(int batchSize) {
471 this.batchSize = batchSize;
472 setBatchSizeIsSet(true);
473 return this;
474 }
475
476 public void unsetBatchSize() {
477 __isset_bit_vector.clear(__BATCHSIZE_ISSET_ID);
478 }
479
480
481 public boolean isSetBatchSize() {
482 return __isset_bit_vector.get(__BATCHSIZE_ISSET_ID);
483 }
484
485 public void setBatchSizeIsSet(boolean value) {
486 __isset_bit_vector.set(__BATCHSIZE_ISSET_ID, value);
487 }
488
489 public int getAttributesSize() {
490 return (this.attributes == null) ? 0 : this.attributes.size();
491 }
492
493 public void putToAttributes(ByteBuffer key, ByteBuffer val) {
494 if (this.attributes == null) {
495 this.attributes = new HashMap<ByteBuffer,ByteBuffer>();
496 }
497 this.attributes.put(key, val);
498 }
499
500 public Map<ByteBuffer,ByteBuffer> getAttributes() {
501 return this.attributes;
502 }
503
504 public TScan setAttributes(Map<ByteBuffer,ByteBuffer> attributes) {
505 this.attributes = attributes;
506 return this;
507 }
508
509 public void unsetAttributes() {
510 this.attributes = null;
511 }
512
513
514 public boolean isSetAttributes() {
515 return this.attributes != null;
516 }
517
518 public void setAttributesIsSet(boolean value) {
519 if (!value) {
520 this.attributes = null;
521 }
522 }
523
524 public void setFieldValue(_Fields field, Object value) {
525 switch (field) {
526 case START_ROW:
527 if (value == null) {
528 unsetStartRow();
529 } else {
530 setStartRow((ByteBuffer)value);
531 }
532 break;
533
534 case STOP_ROW:
535 if (value == null) {
536 unsetStopRow();
537 } else {
538 setStopRow((ByteBuffer)value);
539 }
540 break;
541
542 case COLUMNS:
543 if (value == null) {
544 unsetColumns();
545 } else {
546 setColumns((List<TColumn>)value);
547 }
548 break;
549
550 case CACHING:
551 if (value == null) {
552 unsetCaching();
553 } else {
554 setCaching((Integer)value);
555 }
556 break;
557
558 case MAX_VERSIONS:
559 if (value == null) {
560 unsetMaxVersions();
561 } else {
562 setMaxVersions((Integer)value);
563 }
564 break;
565
566 case TIME_RANGE:
567 if (value == null) {
568 unsetTimeRange();
569 } else {
570 setTimeRange((TTimeRange)value);
571 }
572 break;
573
574 case FILTER_STRING:
575 if (value == null) {
576 unsetFilterString();
577 } else {
578 setFilterString((ByteBuffer)value);
579 }
580 break;
581
582 case BATCH_SIZE:
583 if (value == null) {
584 unsetBatchSize();
585 } else {
586 setBatchSize((Integer)value);
587 }
588 break;
589
590 case ATTRIBUTES:
591 if (value == null) {
592 unsetAttributes();
593 } else {
594 setAttributes((Map<ByteBuffer,ByteBuffer>)value);
595 }
596 break;
597
598 }
599 }
600
601 public Object getFieldValue(_Fields field) {
602 switch (field) {
603 case START_ROW:
604 return getStartRow();
605
606 case STOP_ROW:
607 return getStopRow();
608
609 case COLUMNS:
610 return getColumns();
611
612 case CACHING:
613 return Integer.valueOf(getCaching());
614
615 case MAX_VERSIONS:
616 return Integer.valueOf(getMaxVersions());
617
618 case TIME_RANGE:
619 return getTimeRange();
620
621 case FILTER_STRING:
622 return getFilterString();
623
624 case BATCH_SIZE:
625 return Integer.valueOf(getBatchSize());
626
627 case ATTRIBUTES:
628 return getAttributes();
629
630 }
631 throw new IllegalStateException();
632 }
633
634
635 public boolean isSet(_Fields field) {
636 if (field == null) {
637 throw new IllegalArgumentException();
638 }
639
640 switch (field) {
641 case START_ROW:
642 return isSetStartRow();
643 case STOP_ROW:
644 return isSetStopRow();
645 case COLUMNS:
646 return isSetColumns();
647 case CACHING:
648 return isSetCaching();
649 case MAX_VERSIONS:
650 return isSetMaxVersions();
651 case TIME_RANGE:
652 return isSetTimeRange();
653 case FILTER_STRING:
654 return isSetFilterString();
655 case BATCH_SIZE:
656 return isSetBatchSize();
657 case ATTRIBUTES:
658 return isSetAttributes();
659 }
660 throw new IllegalStateException();
661 }
662
663 @Override
664 public boolean equals(Object that) {
665 if (that == null)
666 return false;
667 if (that instanceof TScan)
668 return this.equals((TScan)that);
669 return false;
670 }
671
672 public boolean equals(TScan that) {
673 if (that == null)
674 return false;
675
676 boolean this_present_startRow = true && this.isSetStartRow();
677 boolean that_present_startRow = true && that.isSetStartRow();
678 if (this_present_startRow || that_present_startRow) {
679 if (!(this_present_startRow && that_present_startRow))
680 return false;
681 if (!this.startRow.equals(that.startRow))
682 return false;
683 }
684
685 boolean this_present_stopRow = true && this.isSetStopRow();
686 boolean that_present_stopRow = true && that.isSetStopRow();
687 if (this_present_stopRow || that_present_stopRow) {
688 if (!(this_present_stopRow && that_present_stopRow))
689 return false;
690 if (!this.stopRow.equals(that.stopRow))
691 return false;
692 }
693
694 boolean this_present_columns = true && this.isSetColumns();
695 boolean that_present_columns = true && that.isSetColumns();
696 if (this_present_columns || that_present_columns) {
697 if (!(this_present_columns && that_present_columns))
698 return false;
699 if (!this.columns.equals(that.columns))
700 return false;
701 }
702
703 boolean this_present_caching = true && this.isSetCaching();
704 boolean that_present_caching = true && that.isSetCaching();
705 if (this_present_caching || that_present_caching) {
706 if (!(this_present_caching && that_present_caching))
707 return false;
708 if (this.caching != that.caching)
709 return false;
710 }
711
712 boolean this_present_maxVersions = true && this.isSetMaxVersions();
713 boolean that_present_maxVersions = true && that.isSetMaxVersions();
714 if (this_present_maxVersions || that_present_maxVersions) {
715 if (!(this_present_maxVersions && that_present_maxVersions))
716 return false;
717 if (this.maxVersions != that.maxVersions)
718 return false;
719 }
720
721 boolean this_present_timeRange = true && this.isSetTimeRange();
722 boolean that_present_timeRange = true && that.isSetTimeRange();
723 if (this_present_timeRange || that_present_timeRange) {
724 if (!(this_present_timeRange && that_present_timeRange))
725 return false;
726 if (!this.timeRange.equals(that.timeRange))
727 return false;
728 }
729
730 boolean this_present_filterString = true && this.isSetFilterString();
731 boolean that_present_filterString = true && that.isSetFilterString();
732 if (this_present_filterString || that_present_filterString) {
733 if (!(this_present_filterString && that_present_filterString))
734 return false;
735 if (!this.filterString.equals(that.filterString))
736 return false;
737 }
738
739 boolean this_present_batchSize = true && this.isSetBatchSize();
740 boolean that_present_batchSize = true && that.isSetBatchSize();
741 if (this_present_batchSize || that_present_batchSize) {
742 if (!(this_present_batchSize && that_present_batchSize))
743 return false;
744 if (this.batchSize != that.batchSize)
745 return false;
746 }
747
748 boolean this_present_attributes = true && this.isSetAttributes();
749 boolean that_present_attributes = true && that.isSetAttributes();
750 if (this_present_attributes || that_present_attributes) {
751 if (!(this_present_attributes && that_present_attributes))
752 return false;
753 if (!this.attributes.equals(that.attributes))
754 return false;
755 }
756
757 return true;
758 }
759
760 @Override
761 public int hashCode() {
762 HashCodeBuilder builder = new HashCodeBuilder();
763
764 boolean present_startRow = true && (isSetStartRow());
765 builder.append(present_startRow);
766 if (present_startRow)
767 builder.append(startRow);
768
769 boolean present_stopRow = true && (isSetStopRow());
770 builder.append(present_stopRow);
771 if (present_stopRow)
772 builder.append(stopRow);
773
774 boolean present_columns = true && (isSetColumns());
775 builder.append(present_columns);
776 if (present_columns)
777 builder.append(columns);
778
779 boolean present_caching = true && (isSetCaching());
780 builder.append(present_caching);
781 if (present_caching)
782 builder.append(caching);
783
784 boolean present_maxVersions = true && (isSetMaxVersions());
785 builder.append(present_maxVersions);
786 if (present_maxVersions)
787 builder.append(maxVersions);
788
789 boolean present_timeRange = true && (isSetTimeRange());
790 builder.append(present_timeRange);
791 if (present_timeRange)
792 builder.append(timeRange);
793
794 boolean present_filterString = true && (isSetFilterString());
795 builder.append(present_filterString);
796 if (present_filterString)
797 builder.append(filterString);
798
799 boolean present_batchSize = true && (isSetBatchSize());
800 builder.append(present_batchSize);
801 if (present_batchSize)
802 builder.append(batchSize);
803
804 boolean present_attributes = true && (isSetAttributes());
805 builder.append(present_attributes);
806 if (present_attributes)
807 builder.append(attributes);
808
809 return builder.toHashCode();
810 }
811
812 public int compareTo(TScan other) {
813 if (!getClass().equals(other.getClass())) {
814 return getClass().getName().compareTo(other.getClass().getName());
815 }
816
817 int lastComparison = 0;
818 TScan typedOther = (TScan)other;
819
820 lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow());
821 if (lastComparison != 0) {
822 return lastComparison;
823 }
824 if (isSetStartRow()) {
825 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, typedOther.startRow);
826 if (lastComparison != 0) {
827 return lastComparison;
828 }
829 }
830 lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(typedOther.isSetStopRow());
831 if (lastComparison != 0) {
832 return lastComparison;
833 }
834 if (isSetStopRow()) {
835 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, typedOther.stopRow);
836 if (lastComparison != 0) {
837 return lastComparison;
838 }
839 }
840 lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
841 if (lastComparison != 0) {
842 return lastComparison;
843 }
844 if (isSetColumns()) {
845 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
846 if (lastComparison != 0) {
847 return lastComparison;
848 }
849 }
850 lastComparison = Boolean.valueOf(isSetCaching()).compareTo(typedOther.isSetCaching());
851 if (lastComparison != 0) {
852 return lastComparison;
853 }
854 if (isSetCaching()) {
855 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, typedOther.caching);
856 if (lastComparison != 0) {
857 return lastComparison;
858 }
859 }
860 lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
861 if (lastComparison != 0) {
862 return lastComparison;
863 }
864 if (isSetMaxVersions()) {
865 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
866 if (lastComparison != 0) {
867 return lastComparison;
868 }
869 }
870 lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(typedOther.isSetTimeRange());
871 if (lastComparison != 0) {
872 return lastComparison;
873 }
874 if (isSetTimeRange()) {
875 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, typedOther.timeRange);
876 if (lastComparison != 0) {
877 return lastComparison;
878 }
879 }
880 lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(typedOther.isSetFilterString());
881 if (lastComparison != 0) {
882 return lastComparison;
883 }
884 if (isSetFilterString()) {
885 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterString, typedOther.filterString);
886 if (lastComparison != 0) {
887 return lastComparison;
888 }
889 }
890 lastComparison = Boolean.valueOf(isSetBatchSize()).compareTo(typedOther.isSetBatchSize());
891 if (lastComparison != 0) {
892 return lastComparison;
893 }
894 if (isSetBatchSize()) {
895 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batchSize, typedOther.batchSize);
896 if (lastComparison != 0) {
897 return lastComparison;
898 }
899 }
900 lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(typedOther.isSetAttributes());
901 if (lastComparison != 0) {
902 return lastComparison;
903 }
904 if (isSetAttributes()) {
905 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attributes, typedOther.attributes);
906 if (lastComparison != 0) {
907 return lastComparison;
908 }
909 }
910 return 0;
911 }
912
913 public _Fields fieldForId(int fieldId) {
914 return _Fields.findByThriftId(fieldId);
915 }
916
917 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
918 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
919 }
920
921 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
922 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
923 }
924
925 @Override
926 public String toString() {
927 StringBuilder sb = new StringBuilder("TScan(");
928 boolean first = true;
929
930 if (isSetStartRow()) {
931 sb.append("startRow:");
932 if (this.startRow == null) {
933 sb.append("null");
934 } else {
935 org.apache.thrift.TBaseHelper.toString(this.startRow, sb);
936 }
937 first = false;
938 }
939 if (isSetStopRow()) {
940 if (!first) sb.append(", ");
941 sb.append("stopRow:");
942 if (this.stopRow == null) {
943 sb.append("null");
944 } else {
945 org.apache.thrift.TBaseHelper.toString(this.stopRow, sb);
946 }
947 first = false;
948 }
949 if (isSetColumns()) {
950 if (!first) sb.append(", ");
951 sb.append("columns:");
952 if (this.columns == null) {
953 sb.append("null");
954 } else {
955 sb.append(this.columns);
956 }
957 first = false;
958 }
959 if (isSetCaching()) {
960 if (!first) sb.append(", ");
961 sb.append("caching:");
962 sb.append(this.caching);
963 first = false;
964 }
965 if (isSetMaxVersions()) {
966 if (!first) sb.append(", ");
967 sb.append("maxVersions:");
968 sb.append(this.maxVersions);
969 first = false;
970 }
971 if (isSetTimeRange()) {
972 if (!first) sb.append(", ");
973 sb.append("timeRange:");
974 if (this.timeRange == null) {
975 sb.append("null");
976 } else {
977 sb.append(this.timeRange);
978 }
979 first = false;
980 }
981 if (isSetFilterString()) {
982 if (!first) sb.append(", ");
983 sb.append("filterString:");
984 if (this.filterString == null) {
985 sb.append("null");
986 } else {
987 org.apache.thrift.TBaseHelper.toString(this.filterString, sb);
988 }
989 first = false;
990 }
991 if (isSetBatchSize()) {
992 if (!first) sb.append(", ");
993 sb.append("batchSize:");
994 sb.append(this.batchSize);
995 first = false;
996 }
997 if (isSetAttributes()) {
998 if (!first) sb.append(", ");
999 sb.append("attributes:");
1000 if (this.attributes == null) {
1001 sb.append("null");
1002 } else {
1003 sb.append(this.attributes);
1004 }
1005 first = false;
1006 }
1007 sb.append(")");
1008 return sb.toString();
1009 }
1010
1011 public void validate() throws org.apache.thrift.TException {
1012
1013 }
1014
1015 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1016 try {
1017 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1018 } catch (org.apache.thrift.TException te) {
1019 throw new java.io.IOException(te);
1020 }
1021 }
1022
1023 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1024 try {
1025
1026 __isset_bit_vector = new BitSet(1);
1027 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1028 } catch (org.apache.thrift.TException te) {
1029 throw new java.io.IOException(te);
1030 }
1031 }
1032
1033 private static class TScanStandardSchemeFactory implements SchemeFactory {
1034 public TScanStandardScheme getScheme() {
1035 return new TScanStandardScheme();
1036 }
1037 }
1038
1039 private static class TScanStandardScheme extends StandardScheme<TScan> {
1040
1041 public void read(org.apache.thrift.protocol.TProtocol iprot, TScan struct) throws org.apache.thrift.TException {
1042 org.apache.thrift.protocol.TField schemeField;
1043 iprot.readStructBegin();
1044 while (true)
1045 {
1046 schemeField = iprot.readFieldBegin();
1047 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
1048 break;
1049 }
1050 switch (schemeField.id) {
1051 case 1:
1052 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1053 struct.startRow = iprot.readBinary();
1054 struct.setStartRowIsSet(true);
1055 } else {
1056 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1057 }
1058 break;
1059 case 2:
1060 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1061 struct.stopRow = iprot.readBinary();
1062 struct.setStopRowIsSet(true);
1063 } else {
1064 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1065 }
1066 break;
1067 case 3:
1068 if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
1069 {
1070 org.apache.thrift.protocol.TList _list70 = iprot.readListBegin();
1071 struct.columns = new ArrayList<TColumn>(_list70.size);
1072 for (int _i71 = 0; _i71 < _list70.size; ++_i71)
1073 {
1074 TColumn _elem72;
1075 _elem72 = new TColumn();
1076 _elem72.read(iprot);
1077 struct.columns.add(_elem72);
1078 }
1079 iprot.readListEnd();
1080 }
1081 struct.setColumnsIsSet(true);
1082 } else {
1083 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1084 }
1085 break;
1086 case 4:
1087 if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1088 struct.caching = iprot.readI32();
1089 struct.setCachingIsSet(true);
1090 } else {
1091 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1092 }
1093 break;
1094 case 5:
1095 if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1096 struct.maxVersions = iprot.readI32();
1097 struct.setMaxVersionsIsSet(true);
1098 } else {
1099 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1100 }
1101 break;
1102 case 6:
1103 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
1104 struct.timeRange = new TTimeRange();
1105 struct.timeRange.read(iprot);
1106 struct.setTimeRangeIsSet(true);
1107 } else {
1108 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1109 }
1110 break;
1111 case 7:
1112 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1113 struct.filterString = iprot.readBinary();
1114 struct.setFilterStringIsSet(true);
1115 } else {
1116 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1117 }
1118 break;
1119 case 8:
1120 if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1121 struct.batchSize = iprot.readI32();
1122 struct.setBatchSizeIsSet(true);
1123 } else {
1124 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1125 }
1126 break;
1127 case 9:
1128 if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
1129 {
1130 org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin();
1131 struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map73.size);
1132 for (int _i74 = 0; _i74 < _map73.size; ++_i74)
1133 {
1134 ByteBuffer _key75;
1135 ByteBuffer _val76;
1136 _key75 = iprot.readBinary();
1137 _val76 = iprot.readBinary();
1138 struct.attributes.put(_key75, _val76);
1139 }
1140 iprot.readMapEnd();
1141 }
1142 struct.setAttributesIsSet(true);
1143 } else {
1144 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1145 }
1146 break;
1147 default:
1148 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1149 }
1150 iprot.readFieldEnd();
1151 }
1152 iprot.readStructEnd();
1153
1154
1155 struct.validate();
1156 }
1157
1158 public void write(org.apache.thrift.protocol.TProtocol oprot, TScan struct) throws org.apache.thrift.TException {
1159 struct.validate();
1160
1161 oprot.writeStructBegin(STRUCT_DESC);
1162 if (struct.startRow != null) {
1163 if (struct.isSetStartRow()) {
1164 oprot.writeFieldBegin(START_ROW_FIELD_DESC);
1165 oprot.writeBinary(struct.startRow);
1166 oprot.writeFieldEnd();
1167 }
1168 }
1169 if (struct.stopRow != null) {
1170 if (struct.isSetStopRow()) {
1171 oprot.writeFieldBegin(STOP_ROW_FIELD_DESC);
1172 oprot.writeBinary(struct.stopRow);
1173 oprot.writeFieldEnd();
1174 }
1175 }
1176 if (struct.columns != null) {
1177 if (struct.isSetColumns()) {
1178 oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
1179 {
1180 oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
1181 for (TColumn _iter77 : struct.columns)
1182 {
1183 _iter77.write(oprot);
1184 }
1185 oprot.writeListEnd();
1186 }
1187 oprot.writeFieldEnd();
1188 }
1189 }
1190 if (struct.isSetCaching()) {
1191 oprot.writeFieldBegin(CACHING_FIELD_DESC);
1192 oprot.writeI32(struct.caching);
1193 oprot.writeFieldEnd();
1194 }
1195 if (struct.isSetMaxVersions()) {
1196 oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
1197 oprot.writeI32(struct.maxVersions);
1198 oprot.writeFieldEnd();
1199 }
1200 if (struct.timeRange != null) {
1201 if (struct.isSetTimeRange()) {
1202 oprot.writeFieldBegin(TIME_RANGE_FIELD_DESC);
1203 struct.timeRange.write(oprot);
1204 oprot.writeFieldEnd();
1205 }
1206 }
1207 if (struct.filterString != null) {
1208 if (struct.isSetFilterString()) {
1209 oprot.writeFieldBegin(FILTER_STRING_FIELD_DESC);
1210 oprot.writeBinary(struct.filterString);
1211 oprot.writeFieldEnd();
1212 }
1213 }
1214 if (struct.isSetBatchSize()) {
1215 oprot.writeFieldBegin(BATCH_SIZE_FIELD_DESC);
1216 oprot.writeI32(struct.batchSize);
1217 oprot.writeFieldEnd();
1218 }
1219 if (struct.attributes != null) {
1220 if (struct.isSetAttributes()) {
1221 oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
1222 {
1223 oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.attributes.size()));
1224 for (Map.Entry<ByteBuffer, ByteBuffer> _iter78 : struct.attributes.entrySet())
1225 {
1226 oprot.writeBinary(_iter78.getKey());
1227 oprot.writeBinary(_iter78.getValue());
1228 }
1229 oprot.writeMapEnd();
1230 }
1231 oprot.writeFieldEnd();
1232 }
1233 }
1234 oprot.writeFieldStop();
1235 oprot.writeStructEnd();
1236 }
1237
1238 }
1239
1240 private static class TScanTupleSchemeFactory implements SchemeFactory {
1241 public TScanTupleScheme getScheme() {
1242 return new TScanTupleScheme();
1243 }
1244 }
1245
1246 private static class TScanTupleScheme extends TupleScheme<TScan> {
1247
1248 @Override
1249 public void write(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
1250 TTupleProtocol oprot = (TTupleProtocol) prot;
1251 BitSet optionals = new BitSet();
1252 if (struct.isSetStartRow()) {
1253 optionals.set(0);
1254 }
1255 if (struct.isSetStopRow()) {
1256 optionals.set(1);
1257 }
1258 if (struct.isSetColumns()) {
1259 optionals.set(2);
1260 }
1261 if (struct.isSetCaching()) {
1262 optionals.set(3);
1263 }
1264 if (struct.isSetMaxVersions()) {
1265 optionals.set(4);
1266 }
1267 if (struct.isSetTimeRange()) {
1268 optionals.set(5);
1269 }
1270 if (struct.isSetFilterString()) {
1271 optionals.set(6);
1272 }
1273 if (struct.isSetBatchSize()) {
1274 optionals.set(7);
1275 }
1276 if (struct.isSetAttributes()) {
1277 optionals.set(8);
1278 }
1279 oprot.writeBitSet(optionals, 9);
1280 if (struct.isSetStartRow()) {
1281 oprot.writeBinary(struct.startRow);
1282 }
1283 if (struct.isSetStopRow()) {
1284 oprot.writeBinary(struct.stopRow);
1285 }
1286 if (struct.isSetColumns()) {
1287 {
1288 oprot.writeI32(struct.columns.size());
1289 for (TColumn _iter79 : struct.columns)
1290 {
1291 _iter79.write(oprot);
1292 }
1293 }
1294 }
1295 if (struct.isSetCaching()) {
1296 oprot.writeI32(struct.caching);
1297 }
1298 if (struct.isSetMaxVersions()) {
1299 oprot.writeI32(struct.maxVersions);
1300 }
1301 if (struct.isSetTimeRange()) {
1302 struct.timeRange.write(oprot);
1303 }
1304 if (struct.isSetFilterString()) {
1305 oprot.writeBinary(struct.filterString);
1306 }
1307 if (struct.isSetBatchSize()) {
1308 oprot.writeI32(struct.batchSize);
1309 }
1310 if (struct.isSetAttributes()) {
1311 {
1312 oprot.writeI32(struct.attributes.size());
1313 for (Map.Entry<ByteBuffer, ByteBuffer> _iter80 : struct.attributes.entrySet())
1314 {
1315 oprot.writeBinary(_iter80.getKey());
1316 oprot.writeBinary(_iter80.getValue());
1317 }
1318 }
1319 }
1320 }
1321
1322 @Override
1323 public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
1324 TTupleProtocol iprot = (TTupleProtocol) prot;
1325 BitSet incoming = iprot.readBitSet(9);
1326 if (incoming.get(0)) {
1327 struct.startRow = iprot.readBinary();
1328 struct.setStartRowIsSet(true);
1329 }
1330 if (incoming.get(1)) {
1331 struct.stopRow = iprot.readBinary();
1332 struct.setStopRowIsSet(true);
1333 }
1334 if (incoming.get(2)) {
1335 {
1336 org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
1337 struct.columns = new ArrayList<TColumn>(_list81.size);
1338 for (int _i82 = 0; _i82 < _list81.size; ++_i82)
1339 {
1340 TColumn _elem83;
1341 _elem83 = new TColumn();
1342 _elem83.read(iprot);
1343 struct.columns.add(_elem83);
1344 }
1345 }
1346 struct.setColumnsIsSet(true);
1347 }
1348 if (incoming.get(3)) {
1349 struct.caching = iprot.readI32();
1350 struct.setCachingIsSet(true);
1351 }
1352 if (incoming.get(4)) {
1353 struct.maxVersions = iprot.readI32();
1354 struct.setMaxVersionsIsSet(true);
1355 }
1356 if (incoming.get(5)) {
1357 struct.timeRange = new TTimeRange();
1358 struct.timeRange.read(iprot);
1359 struct.setTimeRangeIsSet(true);
1360 }
1361 if (incoming.get(6)) {
1362 struct.filterString = iprot.readBinary();
1363 struct.setFilterStringIsSet(true);
1364 }
1365 if (incoming.get(7)) {
1366 struct.batchSize = iprot.readI32();
1367 struct.setBatchSizeIsSet(true);
1368 }
1369 if (incoming.get(8)) {
1370 {
1371 org.apache.thrift.protocol.TMap _map84 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
1372 struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map84.size);
1373 for (int _i85 = 0; _i85 < _map84.size; ++_i85)
1374 {
1375 ByteBuffer _key86;
1376 ByteBuffer _val87;
1377 _key86 = iprot.readBinary();
1378 _val87 = iprot.readBinary();
1379 struct.attributes.put(_key86, _val87);
1380 }
1381 }
1382 struct.setAttributesIsSet(true);
1383 }
1384 }
1385 }
1386
1387 }
1388