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