View Javadoc

1   /**
2    * Autogenerated by Thrift Compiler (0.8.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 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   * Used to perform Put operations for a single row.
32   * 
33   * Add column values to this object and they'll be added.
34   * You can provide a default timestamp if the column values
35   * don't have one. If you don't provide a default timestamp
36   * the current time is inserted.
37   * 
38   * You can also specify if this Put should be written
39   * to the write-ahead Log (WAL) or not. It defaults to true.
40   */
41  public class TPut implements org.apache.thrift.TBase<TPut, TPut._Fields>, java.io.Serializable, Cloneable {
42    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPut");
43  
44    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);
45    private static final org.apache.thrift.protocol.TField COLUMN_VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("columnValues", org.apache.thrift.protocol.TType.LIST, (short)2);
46    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);
47    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)4);
48  
49    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
50    static {
51      schemes.put(StandardScheme.class, new TPutStandardSchemeFactory());
52      schemes.put(TupleScheme.class, new TPutTupleSchemeFactory());
53    }
54  
55    public ByteBuffer row; // required
56    public List<TColumnValue> columnValues; // required
57    public long timestamp; // optional
58    public boolean writeToWal; // optional
59  
60    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
61    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
62      ROW((short)1, "row"),
63      COLUMN_VALUES((short)2, "columnValues"),
64      TIMESTAMP((short)3, "timestamp"),
65      WRITE_TO_WAL((short)4, "writeToWal");
66  
67      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
68  
69      static {
70        for (_Fields field : EnumSet.allOf(_Fields.class)) {
71          byName.put(field.getFieldName(), field);
72        }
73      }
74  
75      /**
76       * Find the _Fields constant that matches fieldId, or null if its not found.
77       */
78      public static _Fields findByThriftId(int fieldId) {
79        switch(fieldId) {
80          case 1: // ROW
81            return ROW;
82          case 2: // COLUMN_VALUES
83            return COLUMN_VALUES;
84          case 3: // TIMESTAMP
85            return TIMESTAMP;
86          case 4: // WRITE_TO_WAL
87            return WRITE_TO_WAL;
88          default:
89            return null;
90        }
91      }
92  
93      /**
94       * Find the _Fields constant that matches fieldId, throwing an exception
95       * if it is not found.
96       */
97      public static _Fields findByThriftIdOrThrow(int fieldId) {
98        _Fields fields = findByThriftId(fieldId);
99        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
100       return fields;
101     }
102 
103     /**
104      * Find the _Fields constant that matches name, or null if its not found.
105      */
106     public static _Fields findByName(String name) {
107       return byName.get(name);
108     }
109 
110     private final short _thriftId;
111     private final String _fieldName;
112 
113     _Fields(short thriftId, String fieldName) {
114       _thriftId = thriftId;
115       _fieldName = fieldName;
116     }
117 
118     public short getThriftFieldId() {
119       return _thriftId;
120     }
121 
122     public String getFieldName() {
123       return _fieldName;
124     }
125   }
126 
127   // isset id assignments
128   private static final int __TIMESTAMP_ISSET_ID = 0;
129   private static final int __WRITETOWAL_ISSET_ID = 1;
130   private BitSet __isset_bit_vector = new BitSet(2);
131   private _Fields optionals[] = {_Fields.TIMESTAMP,_Fields.WRITE_TO_WAL};
132   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
133   static {
134     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
135     tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.REQUIRED, 
136         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
137     tmpMap.put(_Fields.COLUMN_VALUES, new org.apache.thrift.meta_data.FieldMetaData("columnValues", org.apache.thrift.TFieldRequirementType.REQUIRED, 
138         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
139             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class))));
140     tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
141         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
142     tmpMap.put(_Fields.WRITE_TO_WAL, new org.apache.thrift.meta_data.FieldMetaData("writeToWal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
143         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
144     metaDataMap = Collections.unmodifiableMap(tmpMap);
145     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPut.class, metaDataMap);
146   }
147 
148   public TPut() {
149     this.writeToWal = true;
150 
151   }
152 
153   public TPut(
154     ByteBuffer row,
155     List<TColumnValue> columnValues)
156   {
157     this();
158     this.row = row;
159     this.columnValues = columnValues;
160   }
161 
162   /**
163    * Performs a deep copy on <i>other</i>.
164    */
165   public TPut(TPut other) {
166     __isset_bit_vector.clear();
167     __isset_bit_vector.or(other.__isset_bit_vector);
168     if (other.isSetRow()) {
169       this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
170 ;
171     }
172     if (other.isSetColumnValues()) {
173       List<TColumnValue> __this__columnValues = new ArrayList<TColumnValue>();
174       for (TColumnValue other_element : other.columnValues) {
175         __this__columnValues.add(new TColumnValue(other_element));
176       }
177       this.columnValues = __this__columnValues;
178     }
179     this.timestamp = other.timestamp;
180     this.writeToWal = other.writeToWal;
181   }
182 
183   public TPut deepCopy() {
184     return new TPut(this);
185   }
186 
187   @Override
188   public void clear() {
189     this.row = null;
190     this.columnValues = null;
191     setTimestampIsSet(false);
192     this.timestamp = 0;
193     this.writeToWal = true;
194 
195   }
196 
197   public byte[] getRow() {
198     setRow(org.apache.thrift.TBaseHelper.rightSize(row));
199     return row == null ? null : row.array();
200   }
201 
202   public ByteBuffer bufferForRow() {
203     return row;
204   }
205 
206   public TPut setRow(byte[] row) {
207     setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
208     return this;
209   }
210 
211   public TPut setRow(ByteBuffer row) {
212     this.row = row;
213     return this;
214   }
215 
216   public void unsetRow() {
217     this.row = null;
218   }
219 
220   /** Returns true if field row is set (has been assigned a value) and false otherwise */
221   public boolean isSetRow() {
222     return this.row != null;
223   }
224 
225   public void setRowIsSet(boolean value) {
226     if (!value) {
227       this.row = null;
228     }
229   }
230 
231   public int getColumnValuesSize() {
232     return (this.columnValues == null) ? 0 : this.columnValues.size();
233   }
234 
235   public java.util.Iterator<TColumnValue> getColumnValuesIterator() {
236     return (this.columnValues == null) ? null : this.columnValues.iterator();
237   }
238 
239   public void addToColumnValues(TColumnValue elem) {
240     if (this.columnValues == null) {
241       this.columnValues = new ArrayList<TColumnValue>();
242     }
243     this.columnValues.add(elem);
244   }
245 
246   public List<TColumnValue> getColumnValues() {
247     return this.columnValues;
248   }
249 
250   public TPut setColumnValues(List<TColumnValue> columnValues) {
251     this.columnValues = columnValues;
252     return this;
253   }
254 
255   public void unsetColumnValues() {
256     this.columnValues = null;
257   }
258 
259   /** Returns true if field columnValues is set (has been assigned a value) and false otherwise */
260   public boolean isSetColumnValues() {
261     return this.columnValues != null;
262   }
263 
264   public void setColumnValuesIsSet(boolean value) {
265     if (!value) {
266       this.columnValues = null;
267     }
268   }
269 
270   public long getTimestamp() {
271     return this.timestamp;
272   }
273 
274   public TPut setTimestamp(long timestamp) {
275     this.timestamp = timestamp;
276     setTimestampIsSet(true);
277     return this;
278   }
279 
280   public void unsetTimestamp() {
281     __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
282   }
283 
284   /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
285   public boolean isSetTimestamp() {
286     return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
287   }
288 
289   public void setTimestampIsSet(boolean value) {
290     __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
291   }
292 
293   public boolean isWriteToWal() {
294     return this.writeToWal;
295   }
296 
297   public TPut setWriteToWal(boolean writeToWal) {
298     this.writeToWal = writeToWal;
299     setWriteToWalIsSet(true);
300     return this;
301   }
302 
303   public void unsetWriteToWal() {
304     __isset_bit_vector.clear(__WRITETOWAL_ISSET_ID);
305   }
306 
307   /** Returns true if field writeToWal is set (has been assigned a value) and false otherwise */
308   public boolean isSetWriteToWal() {
309     return __isset_bit_vector.get(__WRITETOWAL_ISSET_ID);
310   }
311 
312   public void setWriteToWalIsSet(boolean value) {
313     __isset_bit_vector.set(__WRITETOWAL_ISSET_ID, value);
314   }
315 
316   public void setFieldValue(_Fields field, Object value) {
317     switch (field) {
318     case ROW:
319       if (value == null) {
320         unsetRow();
321       } else {
322         setRow((ByteBuffer)value);
323       }
324       break;
325 
326     case COLUMN_VALUES:
327       if (value == null) {
328         unsetColumnValues();
329       } else {
330         setColumnValues((List<TColumnValue>)value);
331       }
332       break;
333 
334     case TIMESTAMP:
335       if (value == null) {
336         unsetTimestamp();
337       } else {
338         setTimestamp((Long)value);
339       }
340       break;
341 
342     case WRITE_TO_WAL:
343       if (value == null) {
344         unsetWriteToWal();
345       } else {
346         setWriteToWal((Boolean)value);
347       }
348       break;
349 
350     }
351   }
352 
353   public Object getFieldValue(_Fields field) {
354     switch (field) {
355     case ROW:
356       return getRow();
357 
358     case COLUMN_VALUES:
359       return getColumnValues();
360 
361     case TIMESTAMP:
362       return Long.valueOf(getTimestamp());
363 
364     case WRITE_TO_WAL:
365       return Boolean.valueOf(isWriteToWal());
366 
367     }
368     throw new IllegalStateException();
369   }
370 
371   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
372   public boolean isSet(_Fields field) {
373     if (field == null) {
374       throw new IllegalArgumentException();
375     }
376 
377     switch (field) {
378     case ROW:
379       return isSetRow();
380     case COLUMN_VALUES:
381       return isSetColumnValues();
382     case TIMESTAMP:
383       return isSetTimestamp();
384     case WRITE_TO_WAL:
385       return isSetWriteToWal();
386     }
387     throw new IllegalStateException();
388   }
389 
390   @Override
391   public boolean equals(Object that) {
392     if (that == null)
393       return false;
394     if (that instanceof TPut)
395       return this.equals((TPut)that);
396     return false;
397   }
398 
399   public boolean equals(TPut that) {
400     if (that == null)
401       return false;
402 
403     boolean this_present_row = true && this.isSetRow();
404     boolean that_present_row = true && that.isSetRow();
405     if (this_present_row || that_present_row) {
406       if (!(this_present_row && that_present_row))
407         return false;
408       if (!this.row.equals(that.row))
409         return false;
410     }
411 
412     boolean this_present_columnValues = true && this.isSetColumnValues();
413     boolean that_present_columnValues = true && that.isSetColumnValues();
414     if (this_present_columnValues || that_present_columnValues) {
415       if (!(this_present_columnValues && that_present_columnValues))
416         return false;
417       if (!this.columnValues.equals(that.columnValues))
418         return false;
419     }
420 
421     boolean this_present_timestamp = true && this.isSetTimestamp();
422     boolean that_present_timestamp = true && that.isSetTimestamp();
423     if (this_present_timestamp || that_present_timestamp) {
424       if (!(this_present_timestamp && that_present_timestamp))
425         return false;
426       if (this.timestamp != that.timestamp)
427         return false;
428     }
429 
430     boolean this_present_writeToWal = true && this.isSetWriteToWal();
431     boolean that_present_writeToWal = true && that.isSetWriteToWal();
432     if (this_present_writeToWal || that_present_writeToWal) {
433       if (!(this_present_writeToWal && that_present_writeToWal))
434         return false;
435       if (this.writeToWal != that.writeToWal)
436         return false;
437     }
438 
439     return true;
440   }
441 
442   @Override
443   public int hashCode() {
444     return 0;
445   }
446 
447   public int compareTo(TPut other) {
448     if (!getClass().equals(other.getClass())) {
449       return getClass().getName().compareTo(other.getClass().getName());
450     }
451 
452     int lastComparison = 0;
453     TPut typedOther = (TPut)other;
454 
455     lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
456     if (lastComparison != 0) {
457       return lastComparison;
458     }
459     if (isSetRow()) {
460       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
461       if (lastComparison != 0) {
462         return lastComparison;
463       }
464     }
465     lastComparison = Boolean.valueOf(isSetColumnValues()).compareTo(typedOther.isSetColumnValues());
466     if (lastComparison != 0) {
467       return lastComparison;
468     }
469     if (isSetColumnValues()) {
470       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnValues, typedOther.columnValues);
471       if (lastComparison != 0) {
472         return lastComparison;
473       }
474     }
475     lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
476     if (lastComparison != 0) {
477       return lastComparison;
478     }
479     if (isSetTimestamp()) {
480       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
481       if (lastComparison != 0) {
482         return lastComparison;
483       }
484     }
485     lastComparison = Boolean.valueOf(isSetWriteToWal()).compareTo(typedOther.isSetWriteToWal());
486     if (lastComparison != 0) {
487       return lastComparison;
488     }
489     if (isSetWriteToWal()) {
490       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeToWal, typedOther.writeToWal);
491       if (lastComparison != 0) {
492         return lastComparison;
493       }
494     }
495     return 0;
496   }
497 
498   public _Fields fieldForId(int fieldId) {
499     return _Fields.findByThriftId(fieldId);
500   }
501 
502   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
503     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
504   }
505 
506   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
507     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
508   }
509 
510   @Override
511   public String toString() {
512     StringBuilder sb = new StringBuilder("TPut(");
513     boolean first = true;
514 
515     sb.append("row:");
516     if (this.row == null) {
517       sb.append("null");
518     } else {
519       org.apache.thrift.TBaseHelper.toString(this.row, sb);
520     }
521     first = false;
522     if (!first) sb.append(", ");
523     sb.append("columnValues:");
524     if (this.columnValues == null) {
525       sb.append("null");
526     } else {
527       sb.append(this.columnValues);
528     }
529     first = false;
530     if (isSetTimestamp()) {
531       if (!first) sb.append(", ");
532       sb.append("timestamp:");
533       sb.append(this.timestamp);
534       first = false;
535     }
536     if (isSetWriteToWal()) {
537       if (!first) sb.append(", ");
538       sb.append("writeToWal:");
539       sb.append(this.writeToWal);
540       first = false;
541     }
542     sb.append(")");
543     return sb.toString();
544   }
545 
546   public void validate() throws org.apache.thrift.TException {
547     // check for required fields
548     if (row == null) {
549       throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString());
550     }
551     if (columnValues == null) {
552       throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnValues' was not present! Struct: " + toString());
553     }
554   }
555 
556   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
557     try {
558       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
559     } catch (org.apache.thrift.TException te) {
560       throw new java.io.IOException(te);
561     }
562   }
563 
564   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
565     try {
566       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
567       __isset_bit_vector = new BitSet(1);
568       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
569     } catch (org.apache.thrift.TException te) {
570       throw new java.io.IOException(te);
571     }
572   }
573 
574   private static class TPutStandardSchemeFactory implements SchemeFactory {
575     public TPutStandardScheme getScheme() {
576       return new TPutStandardScheme();
577     }
578   }
579 
580   private static class TPutStandardScheme extends StandardScheme<TPut> {
581 
582     public void read(org.apache.thrift.protocol.TProtocol iprot, TPut struct) throws org.apache.thrift.TException {
583       org.apache.thrift.protocol.TField schemeField;
584       iprot.readStructBegin();
585       while (true)
586       {
587         schemeField = iprot.readFieldBegin();
588         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
589           break;
590         }
591         switch (schemeField.id) {
592           case 1: // ROW
593             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
594               struct.row = iprot.readBinary();
595               struct.setRowIsSet(true);
596             } else { 
597               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
598             }
599             break;
600           case 2: // COLUMN_VALUES
601             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
602               {
603                 org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
604                 struct.columnValues = new ArrayList<TColumnValue>(_list16.size);
605                 for (int _i17 = 0; _i17 < _list16.size; ++_i17)
606                 {
607                   TColumnValue _elem18; // optional
608                   _elem18 = new TColumnValue();
609                   _elem18.read(iprot);
610                   struct.columnValues.add(_elem18);
611                 }
612                 iprot.readListEnd();
613               }
614               struct.setColumnValuesIsSet(true);
615             } else { 
616               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
617             }
618             break;
619           case 3: // TIMESTAMP
620             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
621               struct.timestamp = iprot.readI64();
622               struct.setTimestampIsSet(true);
623             } else { 
624               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
625             }
626             break;
627           case 4: // WRITE_TO_WAL
628             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
629               struct.writeToWal = iprot.readBool();
630               struct.setWriteToWalIsSet(true);
631             } else { 
632               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
633             }
634             break;
635           default:
636             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
637         }
638         iprot.readFieldEnd();
639       }
640       iprot.readStructEnd();
641 
642       // check for required fields of primitive type, which can't be checked in the validate method
643       struct.validate();
644     }
645 
646     public void write(org.apache.thrift.protocol.TProtocol oprot, TPut struct) throws org.apache.thrift.TException {
647       struct.validate();
648 
649       oprot.writeStructBegin(STRUCT_DESC);
650       if (struct.row != null) {
651         oprot.writeFieldBegin(ROW_FIELD_DESC);
652         oprot.writeBinary(struct.row);
653         oprot.writeFieldEnd();
654       }
655       if (struct.columnValues != null) {
656         oprot.writeFieldBegin(COLUMN_VALUES_FIELD_DESC);
657         {
658           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columnValues.size()));
659           for (TColumnValue _iter19 : struct.columnValues)
660           {
661             _iter19.write(oprot);
662           }
663           oprot.writeListEnd();
664         }
665         oprot.writeFieldEnd();
666       }
667       if (struct.isSetTimestamp()) {
668         oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
669         oprot.writeI64(struct.timestamp);
670         oprot.writeFieldEnd();
671       }
672       if (struct.isSetWriteToWal()) {
673         oprot.writeFieldBegin(WRITE_TO_WAL_FIELD_DESC);
674         oprot.writeBool(struct.writeToWal);
675         oprot.writeFieldEnd();
676       }
677       oprot.writeFieldStop();
678       oprot.writeStructEnd();
679     }
680 
681   }
682 
683   private static class TPutTupleSchemeFactory implements SchemeFactory {
684     public TPutTupleScheme getScheme() {
685       return new TPutTupleScheme();
686     }
687   }
688 
689   private static class TPutTupleScheme extends TupleScheme<TPut> {
690 
691     @Override
692     public void write(org.apache.thrift.protocol.TProtocol prot, TPut struct) throws org.apache.thrift.TException {
693       TTupleProtocol oprot = (TTupleProtocol) prot;
694       oprot.writeBinary(struct.row);
695       {
696         oprot.writeI32(struct.columnValues.size());
697         for (TColumnValue _iter20 : struct.columnValues)
698         {
699           _iter20.write(oprot);
700         }
701       }
702       BitSet optionals = new BitSet();
703       if (struct.isSetTimestamp()) {
704         optionals.set(0);
705       }
706       if (struct.isSetWriteToWal()) {
707         optionals.set(1);
708       }
709       oprot.writeBitSet(optionals, 2);
710       if (struct.isSetTimestamp()) {
711         oprot.writeI64(struct.timestamp);
712       }
713       if (struct.isSetWriteToWal()) {
714         oprot.writeBool(struct.writeToWal);
715       }
716     }
717 
718     @Override
719     public void read(org.apache.thrift.protocol.TProtocol prot, TPut struct) throws org.apache.thrift.TException {
720       TTupleProtocol iprot = (TTupleProtocol) prot;
721       struct.row = iprot.readBinary();
722       struct.setRowIsSet(true);
723       {
724         org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
725         struct.columnValues = new ArrayList<TColumnValue>(_list21.size);
726         for (int _i22 = 0; _i22 < _list21.size; ++_i22)
727         {
728           TColumnValue _elem23; // optional
729           _elem23 = new TColumnValue();
730           _elem23.read(iprot);
731           struct.columnValues.add(_elem23);
732         }
733       }
734       struct.setColumnValuesIsSet(true);
735       BitSet incoming = iprot.readBitSet(2);
736       if (incoming.get(0)) {
737         struct.timestamp = iprot.readI64();
738         struct.setTimestampIsSet(true);
739       }
740       if (incoming.get(1)) {
741         struct.writeToWal = iprot.readBool();
742         struct.setWriteToWalIsSet(true);
743       }
744     }
745   }
746 
747 }
748