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