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