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