1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 /**
18 * Autogenerated by Thrift Compiler (0.9.0)
19 *
20 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
21 * @generated
22 */
23 package org.apache.accumulo.core.data.thrift;
24
25 import org.apache.thrift.scheme.IScheme;
26 import org.apache.thrift.scheme.SchemeFactory;
27 import org.apache.thrift.scheme.StandardScheme;
28
29 import org.apache.thrift.scheme.TupleScheme;
30 import org.apache.thrift.protocol.TTupleProtocol;
31 import org.apache.thrift.protocol.TProtocolException;
32 import org.apache.thrift.EncodingUtils;
33 import org.apache.thrift.TException;
34 import java.util.List;
35 import java.util.ArrayList;
36 import java.util.Map;
37 import java.util.HashMap;
38 import java.util.EnumMap;
39 import java.util.Set;
40 import java.util.HashSet;
41 import java.util.EnumSet;
42 import java.util.Collections;
43 import java.util.BitSet;
44 import java.nio.ByteBuffer;
45 import java.util.Arrays;
46 import org.slf4j.Logger;
47 import org.slf4j.LoggerFactory;
48
49 @SuppressWarnings("all") public class TKey implements org.apache.thrift.TBase<TKey, TKey._Fields>, java.io.Serializable, Cloneable {
50 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TKey");
51
52 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);
53 private static final org.apache.thrift.protocol.TField COL_FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("colFamily", org.apache.thrift.protocol.TType.STRING, (short)2);
54 private static final org.apache.thrift.protocol.TField COL_QUALIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("colQualifier", org.apache.thrift.protocol.TType.STRING, (short)3);
55 private static final org.apache.thrift.protocol.TField COL_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("colVisibility", org.apache.thrift.protocol.TType.STRING, (short)4);
56 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)5);
57
58 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
59 static {
60 schemes.put(StandardScheme.class, new TKeyStandardSchemeFactory());
61 schemes.put(TupleScheme.class, new TKeyTupleSchemeFactory());
62 }
63
64 public ByteBuffer row;
65 public ByteBuffer colFamily;
66 public ByteBuffer colQualifier;
67 public ByteBuffer colVisibility;
68 public long timestamp;
69
70 /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
71 @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
72 ROW((short)1, "row"),
73 COL_FAMILY((short)2, "colFamily"),
74 COL_QUALIFIER((short)3, "colQualifier"),
75 COL_VISIBILITY((short)4, "colVisibility"),
76 TIMESTAMP((short)5, "timestamp");
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 * Find the _Fields constant that matches fieldId, or null if its not found.
88 */
89 public static _Fields findByThriftId(int fieldId) {
90 switch(fieldId) {
91 case 1:
92 return ROW;
93 case 2:
94 return COL_FAMILY;
95 case 3:
96 return COL_QUALIFIER;
97 case 4:
98 return COL_VISIBILITY;
99 case 5:
100 return TIMESTAMP;
101 default:
102 return null;
103 }
104 }
105
106 /**
107 * Find the _Fields constant that matches fieldId, throwing an exception
108 * if it is not found.
109 */
110 public static _Fields findByThriftIdOrThrow(int fieldId) {
111 _Fields fields = findByThriftId(fieldId);
112 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
113 return fields;
114 }
115
116 /**
117 * Find the _Fields constant that matches name, or null if its not found.
118 */
119 public static _Fields findByName(String name) {
120 return byName.get(name);
121 }
122
123 private final short _thriftId;
124 private final String _fieldName;
125
126 _Fields(short thriftId, String fieldName) {
127 _thriftId = thriftId;
128 _fieldName = fieldName;
129 }
130
131 public short getThriftFieldId() {
132 return _thriftId;
133 }
134
135 public String getFieldName() {
136 return _fieldName;
137 }
138 }
139
140
141 private static final int __TIMESTAMP_ISSET_ID = 0;
142 private byte __isset_bitfield = 0;
143 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
144 static {
145 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
146 tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT,
147 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
148 tmpMap.put(_Fields.COL_FAMILY, new org.apache.thrift.meta_data.FieldMetaData("colFamily", org.apache.thrift.TFieldRequirementType.DEFAULT,
149 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
150 tmpMap.put(_Fields.COL_QUALIFIER, new org.apache.thrift.meta_data.FieldMetaData("colQualifier", org.apache.thrift.TFieldRequirementType.DEFAULT,
151 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
152 tmpMap.put(_Fields.COL_VISIBILITY, new org.apache.thrift.meta_data.FieldMetaData("colVisibility", org.apache.thrift.TFieldRequirementType.DEFAULT,
153 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
154 tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT,
155 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
156 metaDataMap = Collections.unmodifiableMap(tmpMap);
157 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TKey.class, metaDataMap);
158 }
159
160 public TKey() {
161 }
162
163 public TKey(
164 ByteBuffer row,
165 ByteBuffer colFamily,
166 ByteBuffer colQualifier,
167 ByteBuffer colVisibility,
168 long timestamp)
169 {
170 this();
171 this.row = row;
172 this.colFamily = colFamily;
173 this.colQualifier = colQualifier;
174 this.colVisibility = colVisibility;
175 this.timestamp = timestamp;
176 setTimestampIsSet(true);
177 }
178
179 /**
180 * Performs a deep copy on <i>other</i>.
181 */
182 public TKey(TKey other) {
183 __isset_bitfield = other.__isset_bitfield;
184 if (other.isSetRow()) {
185 this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
186 ;
187 }
188 if (other.isSetColFamily()) {
189 this.colFamily = org.apache.thrift.TBaseHelper.copyBinary(other.colFamily);
190 ;
191 }
192 if (other.isSetColQualifier()) {
193 this.colQualifier = org.apache.thrift.TBaseHelper.copyBinary(other.colQualifier);
194 ;
195 }
196 if (other.isSetColVisibility()) {
197 this.colVisibility = org.apache.thrift.TBaseHelper.copyBinary(other.colVisibility);
198 ;
199 }
200 this.timestamp = other.timestamp;
201 }
202
203 public TKey deepCopy() {
204 return new TKey(this);
205 }
206
207 @Override
208 public void clear() {
209 this.row = null;
210 this.colFamily = null;
211 this.colQualifier = null;
212 this.colVisibility = null;
213 setTimestampIsSet(false);
214 this.timestamp = 0;
215 }
216
217 public byte[] getRow() {
218 setRow(org.apache.thrift.TBaseHelper.rightSize(row));
219 return row == null ? null : row.array();
220 }
221
222 public ByteBuffer bufferForRow() {
223 return row;
224 }
225
226 public TKey setRow(byte[] row) {
227 setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
228 return this;
229 }
230
231 public TKey setRow(ByteBuffer row) {
232 this.row = row;
233 return this;
234 }
235
236 public void unsetRow() {
237 this.row = null;
238 }
239
240 /** Returns true if field row is set (has been assigned a value) and false otherwise */
241 public boolean isSetRow() {
242 return this.row != null;
243 }
244
245 public void setRowIsSet(boolean value) {
246 if (!value) {
247 this.row = null;
248 }
249 }
250
251 public byte[] getColFamily() {
252 setColFamily(org.apache.thrift.TBaseHelper.rightSize(colFamily));
253 return colFamily == null ? null : colFamily.array();
254 }
255
256 public ByteBuffer bufferForColFamily() {
257 return colFamily;
258 }
259
260 public TKey setColFamily(byte[] colFamily) {
261 setColFamily(colFamily == null ? (ByteBuffer)null : ByteBuffer.wrap(colFamily));
262 return this;
263 }
264
265 public TKey setColFamily(ByteBuffer colFamily) {
266 this.colFamily = colFamily;
267 return this;
268 }
269
270 public void unsetColFamily() {
271 this.colFamily = null;
272 }
273
274 /** Returns true if field colFamily is set (has been assigned a value) and false otherwise */
275 public boolean isSetColFamily() {
276 return this.colFamily != null;
277 }
278
279 public void setColFamilyIsSet(boolean value) {
280 if (!value) {
281 this.colFamily = null;
282 }
283 }
284
285 public byte[] getColQualifier() {
286 setColQualifier(org.apache.thrift.TBaseHelper.rightSize(colQualifier));
287 return colQualifier == null ? null : colQualifier.array();
288 }
289
290 public ByteBuffer bufferForColQualifier() {
291 return colQualifier;
292 }
293
294 public TKey setColQualifier(byte[] colQualifier) {
295 setColQualifier(colQualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(colQualifier));
296 return this;
297 }
298
299 public TKey setColQualifier(ByteBuffer colQualifier) {
300 this.colQualifier = colQualifier;
301 return this;
302 }
303
304 public void unsetColQualifier() {
305 this.colQualifier = null;
306 }
307
308 /** Returns true if field colQualifier is set (has been assigned a value) and false otherwise */
309 public boolean isSetColQualifier() {
310 return this.colQualifier != null;
311 }
312
313 public void setColQualifierIsSet(boolean value) {
314 if (!value) {
315 this.colQualifier = null;
316 }
317 }
318
319 public byte[] getColVisibility() {
320 setColVisibility(org.apache.thrift.TBaseHelper.rightSize(colVisibility));
321 return colVisibility == null ? null : colVisibility.array();
322 }
323
324 public ByteBuffer bufferForColVisibility() {
325 return colVisibility;
326 }
327
328 public TKey setColVisibility(byte[] colVisibility) {
329 setColVisibility(colVisibility == null ? (ByteBuffer)null : ByteBuffer.wrap(colVisibility));
330 return this;
331 }
332
333 public TKey setColVisibility(ByteBuffer colVisibility) {
334 this.colVisibility = colVisibility;
335 return this;
336 }
337
338 public void unsetColVisibility() {
339 this.colVisibility = null;
340 }
341
342 /** Returns true if field colVisibility is set (has been assigned a value) and false otherwise */
343 public boolean isSetColVisibility() {
344 return this.colVisibility != null;
345 }
346
347 public void setColVisibilityIsSet(boolean value) {
348 if (!value) {
349 this.colVisibility = null;
350 }
351 }
352
353 public long getTimestamp() {
354 return this.timestamp;
355 }
356
357 public TKey setTimestamp(long timestamp) {
358 this.timestamp = timestamp;
359 setTimestampIsSet(true);
360 return this;
361 }
362
363 public void unsetTimestamp() {
364 __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
365 }
366
367 /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
368 public boolean isSetTimestamp() {
369 return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
370 }
371
372 public void setTimestampIsSet(boolean value) {
373 __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value);
374 }
375
376 public void setFieldValue(_Fields field, Object value) {
377 switch (field) {
378 case ROW:
379 if (value == null) {
380 unsetRow();
381 } else {
382 setRow((ByteBuffer)value);
383 }
384 break;
385
386 case COL_FAMILY:
387 if (value == null) {
388 unsetColFamily();
389 } else {
390 setColFamily((ByteBuffer)value);
391 }
392 break;
393
394 case COL_QUALIFIER:
395 if (value == null) {
396 unsetColQualifier();
397 } else {
398 setColQualifier((ByteBuffer)value);
399 }
400 break;
401
402 case COL_VISIBILITY:
403 if (value == null) {
404 unsetColVisibility();
405 } else {
406 setColVisibility((ByteBuffer)value);
407 }
408 break;
409
410 case TIMESTAMP:
411 if (value == null) {
412 unsetTimestamp();
413 } else {
414 setTimestamp((Long)value);
415 }
416 break;
417
418 }
419 }
420
421 public Object getFieldValue(_Fields field) {
422 switch (field) {
423 case ROW:
424 return getRow();
425
426 case COL_FAMILY:
427 return getColFamily();
428
429 case COL_QUALIFIER:
430 return getColQualifier();
431
432 case COL_VISIBILITY:
433 return getColVisibility();
434
435 case TIMESTAMP:
436 return Long.valueOf(getTimestamp());
437
438 }
439 throw new IllegalStateException();
440 }
441
442 /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
443 public boolean isSet(_Fields field) {
444 if (field == null) {
445 throw new IllegalArgumentException();
446 }
447
448 switch (field) {
449 case ROW:
450 return isSetRow();
451 case COL_FAMILY:
452 return isSetColFamily();
453 case COL_QUALIFIER:
454 return isSetColQualifier();
455 case COL_VISIBILITY:
456 return isSetColVisibility();
457 case TIMESTAMP:
458 return isSetTimestamp();
459 }
460 throw new IllegalStateException();
461 }
462
463 @Override
464 public boolean equals(Object that) {
465 if (that == null)
466 return false;
467 if (that instanceof TKey)
468 return this.equals((TKey)that);
469 return false;
470 }
471
472 public boolean equals(TKey that) {
473 if (that == null)
474 return false;
475
476 boolean this_present_row = true && this.isSetRow();
477 boolean that_present_row = true && that.isSetRow();
478 if (this_present_row || that_present_row) {
479 if (!(this_present_row && that_present_row))
480 return false;
481 if (!this.row.equals(that.row))
482 return false;
483 }
484
485 boolean this_present_colFamily = true && this.isSetColFamily();
486 boolean that_present_colFamily = true && that.isSetColFamily();
487 if (this_present_colFamily || that_present_colFamily) {
488 if (!(this_present_colFamily && that_present_colFamily))
489 return false;
490 if (!this.colFamily.equals(that.colFamily))
491 return false;
492 }
493
494 boolean this_present_colQualifier = true && this.isSetColQualifier();
495 boolean that_present_colQualifier = true && that.isSetColQualifier();
496 if (this_present_colQualifier || that_present_colQualifier) {
497 if (!(this_present_colQualifier && that_present_colQualifier))
498 return false;
499 if (!this.colQualifier.equals(that.colQualifier))
500 return false;
501 }
502
503 boolean this_present_colVisibility = true && this.isSetColVisibility();
504 boolean that_present_colVisibility = true && that.isSetColVisibility();
505 if (this_present_colVisibility || that_present_colVisibility) {
506 if (!(this_present_colVisibility && that_present_colVisibility))
507 return false;
508 if (!this.colVisibility.equals(that.colVisibility))
509 return false;
510 }
511
512 boolean this_present_timestamp = true;
513 boolean that_present_timestamp = true;
514 if (this_present_timestamp || that_present_timestamp) {
515 if (!(this_present_timestamp && that_present_timestamp))
516 return false;
517 if (this.timestamp != that.timestamp)
518 return false;
519 }
520
521 return true;
522 }
523
524 @Override
525 public int hashCode() {
526 return 0;
527 }
528
529 public int compareTo(TKey other) {
530 if (!getClass().equals(other.getClass())) {
531 return getClass().getName().compareTo(other.getClass().getName());
532 }
533
534 int lastComparison = 0;
535 TKey typedOther = (TKey)other;
536
537 lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
538 if (lastComparison != 0) {
539 return lastComparison;
540 }
541 if (isSetRow()) {
542 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
543 if (lastComparison != 0) {
544 return lastComparison;
545 }
546 }
547 lastComparison = Boolean.valueOf(isSetColFamily()).compareTo(typedOther.isSetColFamily());
548 if (lastComparison != 0) {
549 return lastComparison;
550 }
551 if (isSetColFamily()) {
552 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colFamily, typedOther.colFamily);
553 if (lastComparison != 0) {
554 return lastComparison;
555 }
556 }
557 lastComparison = Boolean.valueOf(isSetColQualifier()).compareTo(typedOther.isSetColQualifier());
558 if (lastComparison != 0) {
559 return lastComparison;
560 }
561 if (isSetColQualifier()) {
562 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colQualifier, typedOther.colQualifier);
563 if (lastComparison != 0) {
564 return lastComparison;
565 }
566 }
567 lastComparison = Boolean.valueOf(isSetColVisibility()).compareTo(typedOther.isSetColVisibility());
568 if (lastComparison != 0) {
569 return lastComparison;
570 }
571 if (isSetColVisibility()) {
572 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVisibility, typedOther.colVisibility);
573 if (lastComparison != 0) {
574 return lastComparison;
575 }
576 }
577 lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
578 if (lastComparison != 0) {
579 return lastComparison;
580 }
581 if (isSetTimestamp()) {
582 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
583 if (lastComparison != 0) {
584 return lastComparison;
585 }
586 }
587 return 0;
588 }
589
590 public _Fields fieldForId(int fieldId) {
591 return _Fields.findByThriftId(fieldId);
592 }
593
594 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
595 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
596 }
597
598 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
599 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
600 }
601
602 @Override
603 public String toString() {
604 StringBuilder sb = new StringBuilder("TKey(");
605 boolean first = true;
606
607 sb.append("row:");
608 if (this.row == null) {
609 sb.append("null");
610 } else {
611 org.apache.thrift.TBaseHelper.toString(this.row, sb);
612 }
613 first = false;
614 if (!first) sb.append(", ");
615 sb.append("colFamily:");
616 if (this.colFamily == null) {
617 sb.append("null");
618 } else {
619 org.apache.thrift.TBaseHelper.toString(this.colFamily, sb);
620 }
621 first = false;
622 if (!first) sb.append(", ");
623 sb.append("colQualifier:");
624 if (this.colQualifier == null) {
625 sb.append("null");
626 } else {
627 org.apache.thrift.TBaseHelper.toString(this.colQualifier, sb);
628 }
629 first = false;
630 if (!first) sb.append(", ");
631 sb.append("colVisibility:");
632 if (this.colVisibility == null) {
633 sb.append("null");
634 } else {
635 org.apache.thrift.TBaseHelper.toString(this.colVisibility, sb);
636 }
637 first = false;
638 if (!first) sb.append(", ");
639 sb.append("timestamp:");
640 sb.append(this.timestamp);
641 first = false;
642 sb.append(")");
643 return sb.toString();
644 }
645
646 public void validate() throws org.apache.thrift.TException {
647
648
649 }
650
651 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
652 try {
653 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
654 } catch (org.apache.thrift.TException te) {
655 throw new java.io.IOException(te);
656 }
657 }
658
659 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
660 try {
661
662 __isset_bitfield = 0;
663 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
664 } catch (org.apache.thrift.TException te) {
665 throw new java.io.IOException(te);
666 }
667 }
668
669 private static class TKeyStandardSchemeFactory implements SchemeFactory {
670 public TKeyStandardScheme getScheme() {
671 return new TKeyStandardScheme();
672 }
673 }
674
675 private static class TKeyStandardScheme extends StandardScheme<TKey> {
676
677 public void read(org.apache.thrift.protocol.TProtocol iprot, TKey struct) throws org.apache.thrift.TException {
678 org.apache.thrift.protocol.TField schemeField;
679 iprot.readStructBegin();
680 while (true)
681 {
682 schemeField = iprot.readFieldBegin();
683 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
684 break;
685 }
686 switch (schemeField.id) {
687 case 1:
688 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
689 struct.row = iprot.readBinary();
690 struct.setRowIsSet(true);
691 } else {
692 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
693 }
694 break;
695 case 2:
696 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
697 struct.colFamily = iprot.readBinary();
698 struct.setColFamilyIsSet(true);
699 } else {
700 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
701 }
702 break;
703 case 3:
704 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
705 struct.colQualifier = iprot.readBinary();
706 struct.setColQualifierIsSet(true);
707 } else {
708 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
709 }
710 break;
711 case 4:
712 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
713 struct.colVisibility = iprot.readBinary();
714 struct.setColVisibilityIsSet(true);
715 } else {
716 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
717 }
718 break;
719 case 5:
720 if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
721 struct.timestamp = iprot.readI64();
722 struct.setTimestampIsSet(true);
723 } else {
724 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
725 }
726 break;
727 default:
728 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
729 }
730 iprot.readFieldEnd();
731 }
732 iprot.readStructEnd();
733
734
735 struct.validate();
736 }
737
738 public void write(org.apache.thrift.protocol.TProtocol oprot, TKey struct) throws org.apache.thrift.TException {
739 struct.validate();
740
741 oprot.writeStructBegin(STRUCT_DESC);
742 if (struct.row != null) {
743 oprot.writeFieldBegin(ROW_FIELD_DESC);
744 oprot.writeBinary(struct.row);
745 oprot.writeFieldEnd();
746 }
747 if (struct.colFamily != null) {
748 oprot.writeFieldBegin(COL_FAMILY_FIELD_DESC);
749 oprot.writeBinary(struct.colFamily);
750 oprot.writeFieldEnd();
751 }
752 if (struct.colQualifier != null) {
753 oprot.writeFieldBegin(COL_QUALIFIER_FIELD_DESC);
754 oprot.writeBinary(struct.colQualifier);
755 oprot.writeFieldEnd();
756 }
757 if (struct.colVisibility != null) {
758 oprot.writeFieldBegin(COL_VISIBILITY_FIELD_DESC);
759 oprot.writeBinary(struct.colVisibility);
760 oprot.writeFieldEnd();
761 }
762 oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
763 oprot.writeI64(struct.timestamp);
764 oprot.writeFieldEnd();
765 oprot.writeFieldStop();
766 oprot.writeStructEnd();
767 }
768
769 }
770
771 private static class TKeyTupleSchemeFactory implements SchemeFactory {
772 public TKeyTupleScheme getScheme() {
773 return new TKeyTupleScheme();
774 }
775 }
776
777 private static class TKeyTupleScheme extends TupleScheme<TKey> {
778
779 @Override
780 public void write(org.apache.thrift.protocol.TProtocol prot, TKey struct) throws org.apache.thrift.TException {
781 TTupleProtocol oprot = (TTupleProtocol) prot;
782 BitSet optionals = new BitSet();
783 if (struct.isSetRow()) {
784 optionals.set(0);
785 }
786 if (struct.isSetColFamily()) {
787 optionals.set(1);
788 }
789 if (struct.isSetColQualifier()) {
790 optionals.set(2);
791 }
792 if (struct.isSetColVisibility()) {
793 optionals.set(3);
794 }
795 if (struct.isSetTimestamp()) {
796 optionals.set(4);
797 }
798 oprot.writeBitSet(optionals, 5);
799 if (struct.isSetRow()) {
800 oprot.writeBinary(struct.row);
801 }
802 if (struct.isSetColFamily()) {
803 oprot.writeBinary(struct.colFamily);
804 }
805 if (struct.isSetColQualifier()) {
806 oprot.writeBinary(struct.colQualifier);
807 }
808 if (struct.isSetColVisibility()) {
809 oprot.writeBinary(struct.colVisibility);
810 }
811 if (struct.isSetTimestamp()) {
812 oprot.writeI64(struct.timestamp);
813 }
814 }
815
816 @Override
817 public void read(org.apache.thrift.protocol.TProtocol prot, TKey struct) throws org.apache.thrift.TException {
818 TTupleProtocol iprot = (TTupleProtocol) prot;
819 BitSet incoming = iprot.readBitSet(5);
820 if (incoming.get(0)) {
821 struct.row = iprot.readBinary();
822 struct.setRowIsSet(true);
823 }
824 if (incoming.get(1)) {
825 struct.colFamily = iprot.readBinary();
826 struct.setColFamilyIsSet(true);
827 }
828 if (incoming.get(2)) {
829 struct.colQualifier = iprot.readBinary();
830 struct.setColQualifierIsSet(true);
831 }
832 if (incoming.get(3)) {
833 struct.colVisibility = iprot.readBinary();
834 struct.setColVisibilityIsSet(true);
835 }
836 if (incoming.get(4)) {
837 struct.timestamp = iprot.readI64();
838 struct.setTimestampIsSet(true);
839 }
840 }
841 }
842
843 }
844