View Javadoc

1   /**
2    * Autogenerated by Thrift Compiler (0.9.0)
3    *
4    * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5    *  @generated
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 org.apache.thrift.protocol.TProtocolException;
16  import org.apache.thrift.EncodingUtils;
17  import org.apache.thrift.TException;
18  import java.util.List;
19  import java.util.ArrayList;
20  import java.util.Map;
21  import java.util.HashMap;
22  import java.util.EnumMap;
23  import java.util.Set;
24  import java.util.HashSet;
25  import java.util.EnumSet;
26  import java.util.Collections;
27  import java.util.BitSet;
28  import java.nio.ByteBuffer;
29  import java.util.Arrays;
30  import org.slf4j.Logger;
31  import org.slf4j.LoggerFactory;
32  
33  /**
34   * Used to perform Delete operations on a single row.
35   * 
36   * The scope can be further narrowed down by specifying a list of
37   * columns or column families as TColumns.
38   * 
39   * Specifying only a family in a TColumn will delete the whole family.
40   * If a timestamp is specified all versions with a timestamp less than
41   * or equal to this will be deleted. If no timestamp is specified the
42   * current time will be used.
43   * 
44   * Specifying a family and a column qualifier in a TColumn will delete only
45   * this qualifier. If a timestamp is specified only versions equal
46   * to this timestamp will be deleted. If no timestamp is specified the
47   * most recent version will be deleted.  To delete all previous versions,
48   * specify the DELETE_COLUMNS TDeleteType.
49   * 
50   * The top level timestamp is only used if a complete row should be deleted
51   * (i.e. no columns are passed) and if it is specified it works the same way
52   * as if you had added a TColumn for every column family and this timestamp
53   * (i.e. all versions older than or equal in all column families will be deleted)
54   * 
55   */
56  public class TDelete implements org.apache.thrift.TBase<TDelete, TDelete._Fields>, java.io.Serializable, Cloneable {
57    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDelete");
58  
59    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);
60    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);
61    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);
62    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);
63    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);
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; // required
72    public List<TColumn> columns; // optional
73    public long timestamp; // optional
74    /**
75     * 
76     * @see TDeleteType
77     */
78    public TDeleteType deleteType; // optional
79    public boolean writeToWal; // optional
80  
81    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
82    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
83      ROW((short)1, "row"),
84      COLUMNS((short)2, "columns"),
85      TIMESTAMP((short)3, "timestamp"),
86      /**
87       * 
88       * @see TDeleteType
89       */
90      DELETE_TYPE((short)4, "deleteType"),
91      WRITE_TO_WAL((short)5, "writeToWal");
92  
93      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
94  
95      static {
96        for (_Fields field : EnumSet.allOf(_Fields.class)) {
97          byName.put(field.getFieldName(), field);
98        }
99      }
100 
101     /**
102      * Find the _Fields constant that matches fieldId, or null if its not found.
103      */
104     public static _Fields findByThriftId(int fieldId) {
105       switch(fieldId) {
106         case 1: // ROW
107           return ROW;
108         case 2: // COLUMNS
109           return COLUMNS;
110         case 3: // TIMESTAMP
111           return TIMESTAMP;
112         case 4: // DELETE_TYPE
113           return DELETE_TYPE;
114         case 5: // WRITE_TO_WAL
115           return WRITE_TO_WAL;
116         default:
117           return null;
118       }
119     }
120 
121     /**
122      * Find the _Fields constant that matches fieldId, throwing an exception
123      * if it is not found.
124      */
125     public static _Fields findByThriftIdOrThrow(int fieldId) {
126       _Fields fields = findByThriftId(fieldId);
127       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
128       return fields;
129     }
130 
131     /**
132      * Find the _Fields constant that matches name, or null if its not found.
133      */
134     public static _Fields findByName(String name) {
135       return byName.get(name);
136     }
137 
138     private final short _thriftId;
139     private final String _fieldName;
140 
141     _Fields(short thriftId, String fieldName) {
142       _thriftId = thriftId;
143       _fieldName = fieldName;
144     }
145 
146     public short getThriftFieldId() {
147       return _thriftId;
148     }
149 
150     public String getFieldName() {
151       return _fieldName;
152     }
153   }
154 
155   // isset id assignments
156   private static final int __TIMESTAMP_ISSET_ID = 0;
157   private static final int __WRITETOWAL_ISSET_ID = 1;
158   private byte __isset_bitfield = 0;
159   private _Fields optionals[] = {_Fields.COLUMNS,_Fields.TIMESTAMP,_Fields.DELETE_TYPE,_Fields.WRITE_TO_WAL};
160   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
161   static {
162     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
163     tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, 
164         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
165     tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
166         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
167             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class))));
168     tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
169         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
170     tmpMap.put(_Fields.DELETE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("deleteType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
171         new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDeleteType.class)));
172     tmpMap.put(_Fields.WRITE_TO_WAL, new org.apache.thrift.meta_data.FieldMetaData("writeToWal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
173         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
174     metaDataMap = Collections.unmodifiableMap(tmpMap);
175     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDelete.class, metaDataMap);
176   }
177 
178   public TDelete() {
179     this.deleteType = org.apache.hadoop.hbase.thrift2.generated.TDeleteType.DELETE_COLUMNS;
180 
181     this.writeToWal = true;
182 
183   }
184 
185   public TDelete(
186     ByteBuffer row)
187   {
188     this();
189     this.row = row;
190   }
191 
192   /**
193    * Performs a deep copy on <i>other</i>.
194    */
195   public TDelete(TDelete other) {
196     __isset_bitfield = other.__isset_bitfield;
197     if (other.isSetRow()) {
198       this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
199 ;
200     }
201     if (other.isSetColumns()) {
202       List<TColumn> __this__columns = new ArrayList<TColumn>();
203       for (TColumn other_element : other.columns) {
204         __this__columns.add(new TColumn(other_element));
205       }
206       this.columns = __this__columns;
207     }
208     this.timestamp = other.timestamp;
209     if (other.isSetDeleteType()) {
210       this.deleteType = other.deleteType;
211     }
212     this.writeToWal = other.writeToWal;
213   }
214 
215   public TDelete deepCopy() {
216     return new TDelete(this);
217   }
218 
219   @Override
220   public void clear() {
221     this.row = null;
222     this.columns = null;
223     setTimestampIsSet(false);
224     this.timestamp = 0;
225     this.deleteType = org.apache.hadoop.hbase.thrift2.generated.TDeleteType.DELETE_COLUMNS;
226 
227     this.writeToWal = true;
228 
229   }
230 
231   public byte[] getRow() {
232     setRow(org.apache.thrift.TBaseHelper.rightSize(row));
233     return row == null ? null : row.array();
234   }
235 
236   public ByteBuffer bufferForRow() {
237     return row;
238   }
239 
240   public TDelete setRow(byte[] row) {
241     setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
242     return this;
243   }
244 
245   public TDelete setRow(ByteBuffer row) {
246     this.row = row;
247     return this;
248   }
249 
250   public void unsetRow() {
251     this.row = null;
252   }
253 
254   /** Returns true if field row is set (has been assigned a value) and false otherwise */
255   public boolean isSetRow() {
256     return this.row != null;
257   }
258 
259   public void setRowIsSet(boolean value) {
260     if (!value) {
261       this.row = null;
262     }
263   }
264 
265   public int getColumnsSize() {
266     return (this.columns == null) ? 0 : this.columns.size();
267   }
268 
269   public java.util.Iterator<TColumn> getColumnsIterator() {
270     return (this.columns == null) ? null : this.columns.iterator();
271   }
272 
273   public void addToColumns(TColumn elem) {
274     if (this.columns == null) {
275       this.columns = new ArrayList<TColumn>();
276     }
277     this.columns.add(elem);
278   }
279 
280   public List<TColumn> getColumns() {
281     return this.columns;
282   }
283 
284   public TDelete setColumns(List<TColumn> columns) {
285     this.columns = columns;
286     return this;
287   }
288 
289   public void unsetColumns() {
290     this.columns = null;
291   }
292 
293   /** Returns true if field columns is set (has been assigned a value) and false otherwise */
294   public boolean isSetColumns() {
295     return this.columns != null;
296   }
297 
298   public void setColumnsIsSet(boolean value) {
299     if (!value) {
300       this.columns = null;
301     }
302   }
303 
304   public long getTimestamp() {
305     return this.timestamp;
306   }
307 
308   public TDelete setTimestamp(long timestamp) {
309     this.timestamp = timestamp;
310     setTimestampIsSet(true);
311     return this;
312   }
313 
314   public void unsetTimestamp() {
315     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
316   }
317 
318   /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
319   public boolean isSetTimestamp() {
320     return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
321   }
322 
323   public void setTimestampIsSet(boolean value) {
324     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value);
325   }
326 
327   /**
328    * 
329    * @see TDeleteType
330    */
331   public TDeleteType getDeleteType() {
332     return this.deleteType;
333   }
334 
335   /**
336    * 
337    * @see TDeleteType
338    */
339   public TDelete setDeleteType(TDeleteType deleteType) {
340     this.deleteType = deleteType;
341     return this;
342   }
343 
344   public void unsetDeleteType() {
345     this.deleteType = null;
346   }
347 
348   /** Returns true if field deleteType is set (has been assigned a value) and false otherwise */
349   public boolean isSetDeleteType() {
350     return this.deleteType != null;
351   }
352 
353   public void setDeleteTypeIsSet(boolean value) {
354     if (!value) {
355       this.deleteType = null;
356     }
357   }
358 
359   public boolean isWriteToWal() {
360     return this.writeToWal;
361   }
362 
363   public TDelete setWriteToWal(boolean writeToWal) {
364     this.writeToWal = writeToWal;
365     setWriteToWalIsSet(true);
366     return this;
367   }
368 
369   public void unsetWriteToWal() {
370     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITETOWAL_ISSET_ID);
371   }
372 
373   /** Returns true if field writeToWal is set (has been assigned a value) and false otherwise */
374   public boolean isSetWriteToWal() {
375     return EncodingUtils.testBit(__isset_bitfield, __WRITETOWAL_ISSET_ID);
376   }
377 
378   public void setWriteToWalIsSet(boolean value) {
379     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITETOWAL_ISSET_ID, value);
380   }
381 
382   public void setFieldValue(_Fields field, Object value) {
383     switch (field) {
384     case ROW:
385       if (value == null) {
386         unsetRow();
387       } else {
388         setRow((ByteBuffer)value);
389       }
390       break;
391 
392     case COLUMNS:
393       if (value == null) {
394         unsetColumns();
395       } else {
396         setColumns((List<TColumn>)value);
397       }
398       break;
399 
400     case TIMESTAMP:
401       if (value == null) {
402         unsetTimestamp();
403       } else {
404         setTimestamp((Long)value);
405       }
406       break;
407 
408     case DELETE_TYPE:
409       if (value == null) {
410         unsetDeleteType();
411       } else {
412         setDeleteType((TDeleteType)value);
413       }
414       break;
415 
416     case WRITE_TO_WAL:
417       if (value == null) {
418         unsetWriteToWal();
419       } else {
420         setWriteToWal((Boolean)value);
421       }
422       break;
423 
424     }
425   }
426 
427   public Object getFieldValue(_Fields field) {
428     switch (field) {
429     case ROW:
430       return getRow();
431 
432     case COLUMNS:
433       return getColumns();
434 
435     case TIMESTAMP:
436       return Long.valueOf(getTimestamp());
437 
438     case DELETE_TYPE:
439       return getDeleteType();
440 
441     case WRITE_TO_WAL:
442       return Boolean.valueOf(isWriteToWal());
443 
444     }
445     throw new IllegalStateException();
446   }
447 
448   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
449   public boolean isSet(_Fields field) {
450     if (field == null) {
451       throw new IllegalArgumentException();
452     }
453 
454     switch (field) {
455     case ROW:
456       return isSetRow();
457     case COLUMNS:
458       return isSetColumns();
459     case TIMESTAMP:
460       return isSetTimestamp();
461     case DELETE_TYPE:
462       return isSetDeleteType();
463     case WRITE_TO_WAL:
464       return isSetWriteToWal();
465     }
466     throw new IllegalStateException();
467   }
468 
469   @Override
470   public boolean equals(Object that) {
471     if (that == null)
472       return false;
473     if (that instanceof TDelete)
474       return this.equals((TDelete)that);
475     return false;
476   }
477 
478   public boolean equals(TDelete that) {
479     if (that == null)
480       return false;
481 
482     boolean this_present_row = true && this.isSetRow();
483     boolean that_present_row = true && that.isSetRow();
484     if (this_present_row || that_present_row) {
485       if (!(this_present_row && that_present_row))
486         return false;
487       if (!this.row.equals(that.row))
488         return false;
489     }
490 
491     boolean this_present_columns = true && this.isSetColumns();
492     boolean that_present_columns = true && that.isSetColumns();
493     if (this_present_columns || that_present_columns) {
494       if (!(this_present_columns && that_present_columns))
495         return false;
496       if (!this.columns.equals(that.columns))
497         return false;
498     }
499 
500     boolean this_present_timestamp = true && this.isSetTimestamp();
501     boolean that_present_timestamp = true && that.isSetTimestamp();
502     if (this_present_timestamp || that_present_timestamp) {
503       if (!(this_present_timestamp && that_present_timestamp))
504         return false;
505       if (this.timestamp != that.timestamp)
506         return false;
507     }
508 
509     boolean this_present_deleteType = true && this.isSetDeleteType();
510     boolean that_present_deleteType = true && that.isSetDeleteType();
511     if (this_present_deleteType || that_present_deleteType) {
512       if (!(this_present_deleteType && that_present_deleteType))
513         return false;
514       if (!this.deleteType.equals(that.deleteType))
515         return false;
516     }
517 
518     boolean this_present_writeToWal = true && this.isSetWriteToWal();
519     boolean that_present_writeToWal = true && that.isSetWriteToWal();
520     if (this_present_writeToWal || that_present_writeToWal) {
521       if (!(this_present_writeToWal && that_present_writeToWal))
522         return false;
523       if (this.writeToWal != that.writeToWal)
524         return false;
525     }
526 
527     return true;
528   }
529 
530   @Override
531   public int hashCode() {
532     return 0;
533   }
534 
535   public int compareTo(TDelete other) {
536     if (!getClass().equals(other.getClass())) {
537       return getClass().getName().compareTo(other.getClass().getName());
538     }
539 
540     int lastComparison = 0;
541     TDelete typedOther = (TDelete)other;
542 
543     lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
544     if (lastComparison != 0) {
545       return lastComparison;
546     }
547     if (isSetRow()) {
548       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
549       if (lastComparison != 0) {
550         return lastComparison;
551       }
552     }
553     lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
554     if (lastComparison != 0) {
555       return lastComparison;
556     }
557     if (isSetColumns()) {
558       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
559       if (lastComparison != 0) {
560         return lastComparison;
561       }
562     }
563     lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
564     if (lastComparison != 0) {
565       return lastComparison;
566     }
567     if (isSetTimestamp()) {
568       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
569       if (lastComparison != 0) {
570         return lastComparison;
571       }
572     }
573     lastComparison = Boolean.valueOf(isSetDeleteType()).compareTo(typedOther.isSetDeleteType());
574     if (lastComparison != 0) {
575       return lastComparison;
576     }
577     if (isSetDeleteType()) {
578       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deleteType, typedOther.deleteType);
579       if (lastComparison != 0) {
580         return lastComparison;
581       }
582     }
583     lastComparison = Boolean.valueOf(isSetWriteToWal()).compareTo(typedOther.isSetWriteToWal());
584     if (lastComparison != 0) {
585       return lastComparison;
586     }
587     if (isSetWriteToWal()) {
588       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeToWal, typedOther.writeToWal);
589       if (lastComparison != 0) {
590         return lastComparison;
591       }
592     }
593     return 0;
594   }
595 
596   public _Fields fieldForId(int fieldId) {
597     return _Fields.findByThriftId(fieldId);
598   }
599 
600   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
601     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
602   }
603 
604   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
605     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
606   }
607 
608   @Override
609   public String toString() {
610     StringBuilder sb = new StringBuilder("TDelete(");
611     boolean first = true;
612 
613     sb.append("row:");
614     if (this.row == null) {
615       sb.append("null");
616     } else {
617       org.apache.thrift.TBaseHelper.toString(this.row, sb);
618     }
619     first = false;
620     if (isSetColumns()) {
621       if (!first) sb.append(", ");
622       sb.append("columns:");
623       if (this.columns == null) {
624         sb.append("null");
625       } else {
626         sb.append(this.columns);
627       }
628       first = false;
629     }
630     if (isSetTimestamp()) {
631       if (!first) sb.append(", ");
632       sb.append("timestamp:");
633       sb.append(this.timestamp);
634       first = false;
635     }
636     if (isSetDeleteType()) {
637       if (!first) sb.append(", ");
638       sb.append("deleteType:");
639       if (this.deleteType == null) {
640         sb.append("null");
641       } else {
642         sb.append(this.deleteType);
643       }
644       first = false;
645     }
646     if (isSetWriteToWal()) {
647       if (!first) sb.append(", ");
648       sb.append("writeToWal:");
649       sb.append(this.writeToWal);
650       first = false;
651     }
652     sb.append(")");
653     return sb.toString();
654   }
655 
656   public void validate() throws org.apache.thrift.TException {
657     // check for required fields
658     if (row == null) {
659       throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString());
660     }
661     // check for sub-struct validity
662   }
663 
664   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
665     try {
666       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
667     } catch (org.apache.thrift.TException te) {
668       throw new java.io.IOException(te);
669     }
670   }
671 
672   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
673     try {
674       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
675       __isset_bitfield = 0;
676       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
677     } catch (org.apache.thrift.TException te) {
678       throw new java.io.IOException(te);
679     }
680   }
681 
682   private static class TDeleteStandardSchemeFactory implements SchemeFactory {
683     public TDeleteStandardScheme getScheme() {
684       return new TDeleteStandardScheme();
685     }
686   }
687 
688   private static class TDeleteStandardScheme extends StandardScheme<TDelete> {
689 
690     public void read(org.apache.thrift.protocol.TProtocol iprot, TDelete struct) throws org.apache.thrift.TException {
691       org.apache.thrift.protocol.TField schemeField;
692       iprot.readStructBegin();
693       while (true)
694       {
695         schemeField = iprot.readFieldBegin();
696         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
697           break;
698         }
699         switch (schemeField.id) {
700           case 1: // ROW
701             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
702               struct.row = iprot.readBinary();
703               struct.setRowIsSet(true);
704             } else { 
705               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
706             }
707             break;
708           case 2: // COLUMNS
709             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
710               {
711                 org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
712                 struct.columns = new ArrayList<TColumn>(_list24.size);
713                 for (int _i25 = 0; _i25 < _list24.size; ++_i25)
714                 {
715                   TColumn _elem26; // required
716                   _elem26 = new TColumn();
717                   _elem26.read(iprot);
718                   struct.columns.add(_elem26);
719                 }
720                 iprot.readListEnd();
721               }
722               struct.setColumnsIsSet(true);
723             } else { 
724               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
725             }
726             break;
727           case 3: // TIMESTAMP
728             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
729               struct.timestamp = iprot.readI64();
730               struct.setTimestampIsSet(true);
731             } else { 
732               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
733             }
734             break;
735           case 4: // DELETE_TYPE
736             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
737               struct.deleteType = TDeleteType.findByValue(iprot.readI32());
738               struct.setDeleteTypeIsSet(true);
739             } else { 
740               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
741             }
742             break;
743           case 5: // WRITE_TO_WAL
744             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
745               struct.writeToWal = iprot.readBool();
746               struct.setWriteToWalIsSet(true);
747             } else { 
748               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
749             }
750             break;
751           default:
752             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
753         }
754         iprot.readFieldEnd();
755       }
756       iprot.readStructEnd();
757 
758       // check for required fields of primitive type, which can't be checked in the validate method
759       struct.validate();
760     }
761 
762     public void write(org.apache.thrift.protocol.TProtocol oprot, TDelete struct) throws org.apache.thrift.TException {
763       struct.validate();
764 
765       oprot.writeStructBegin(STRUCT_DESC);
766       if (struct.row != null) {
767         oprot.writeFieldBegin(ROW_FIELD_DESC);
768         oprot.writeBinary(struct.row);
769         oprot.writeFieldEnd();
770       }
771       if (struct.columns != null) {
772         if (struct.isSetColumns()) {
773           oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
774           {
775             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
776             for (TColumn _iter27 : struct.columns)
777             {
778               _iter27.write(oprot);
779             }
780             oprot.writeListEnd();
781           }
782           oprot.writeFieldEnd();
783         }
784       }
785       if (struct.isSetTimestamp()) {
786         oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
787         oprot.writeI64(struct.timestamp);
788         oprot.writeFieldEnd();
789       }
790       if (struct.deleteType != null) {
791         if (struct.isSetDeleteType()) {
792           oprot.writeFieldBegin(DELETE_TYPE_FIELD_DESC);
793           oprot.writeI32(struct.deleteType.getValue());
794           oprot.writeFieldEnd();
795         }
796       }
797       if (struct.isSetWriteToWal()) {
798         oprot.writeFieldBegin(WRITE_TO_WAL_FIELD_DESC);
799         oprot.writeBool(struct.writeToWal);
800         oprot.writeFieldEnd();
801       }
802       oprot.writeFieldStop();
803       oprot.writeStructEnd();
804     }
805 
806   }
807 
808   private static class TDeleteTupleSchemeFactory implements SchemeFactory {
809     public TDeleteTupleScheme getScheme() {
810       return new TDeleteTupleScheme();
811     }
812   }
813 
814   private static class TDeleteTupleScheme extends TupleScheme<TDelete> {
815 
816     @Override
817     public void write(org.apache.thrift.protocol.TProtocol prot, TDelete struct) throws org.apache.thrift.TException {
818       TTupleProtocol oprot = (TTupleProtocol) prot;
819       oprot.writeBinary(struct.row);
820       BitSet optionals = new BitSet();
821       if (struct.isSetColumns()) {
822         optionals.set(0);
823       }
824       if (struct.isSetTimestamp()) {
825         optionals.set(1);
826       }
827       if (struct.isSetDeleteType()) {
828         optionals.set(2);
829       }
830       if (struct.isSetWriteToWal()) {
831         optionals.set(3);
832       }
833       oprot.writeBitSet(optionals, 4);
834       if (struct.isSetColumns()) {
835         {
836           oprot.writeI32(struct.columns.size());
837           for (TColumn _iter28 : struct.columns)
838           {
839             _iter28.write(oprot);
840           }
841         }
842       }
843       if (struct.isSetTimestamp()) {
844         oprot.writeI64(struct.timestamp);
845       }
846       if (struct.isSetDeleteType()) {
847         oprot.writeI32(struct.deleteType.getValue());
848       }
849       if (struct.isSetWriteToWal()) {
850         oprot.writeBool(struct.writeToWal);
851       }
852     }
853 
854     @Override
855     public void read(org.apache.thrift.protocol.TProtocol prot, TDelete struct) throws org.apache.thrift.TException {
856       TTupleProtocol iprot = (TTupleProtocol) prot;
857       struct.row = iprot.readBinary();
858       struct.setRowIsSet(true);
859       BitSet incoming = iprot.readBitSet(4);
860       if (incoming.get(0)) {
861         {
862           org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
863           struct.columns = new ArrayList<TColumn>(_list29.size);
864           for (int _i30 = 0; _i30 < _list29.size; ++_i30)
865           {
866             TColumn _elem31; // required
867             _elem31 = new TColumn();
868             _elem31.read(iprot);
869             struct.columns.add(_elem31);
870           }
871         }
872         struct.setColumnsIsSet(true);
873       }
874       if (incoming.get(1)) {
875         struct.timestamp = iprot.readI64();
876         struct.setTimestampIsSet(true);
877       }
878       if (incoming.get(2)) {
879         struct.deleteType = TDeleteType.findByValue(iprot.readI32());
880         struct.setDeleteTypeIsSet(true);
881       }
882       if (incoming.get(3)) {
883         struct.writeToWal = iprot.readBool();
884         struct.setWriteToWalIsSet(true);
885       }
886     }
887   }
888 
889 }
890