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.thrift.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   * An HColumnDescriptor contains information about a column family
32   * such as the number of versions, compression settings, etc. It is
33   * used as input when creating a table or adding a column.
34   */
35  public class ColumnDescriptor implements org.apache.thrift.TBase<ColumnDescriptor, ColumnDescriptor._Fields>, java.io.Serializable, Cloneable {
36    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDescriptor");
37  
38    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
39    private static final org.apache.thrift.protocol.TField MAX_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxVersions", org.apache.thrift.protocol.TType.I32, (short)2);
40    private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.STRING, (short)3);
41    private static final org.apache.thrift.protocol.TField IN_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("inMemory", org.apache.thrift.protocol.TType.BOOL, (short)4);
42    private static final org.apache.thrift.protocol.TField BLOOM_FILTER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterType", org.apache.thrift.protocol.TType.STRING, (short)5);
43    private static final org.apache.thrift.protocol.TField BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterVectorSize", org.apache.thrift.protocol.TType.I32, (short)6);
44    private static final org.apache.thrift.protocol.TField BLOOM_FILTER_NB_HASHES_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterNbHashes", org.apache.thrift.protocol.TType.I32, (short)7);
45    private static final org.apache.thrift.protocol.TField BLOCK_CACHE_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("blockCacheEnabled", org.apache.thrift.protocol.TType.BOOL, (short)8);
46    private static final org.apache.thrift.protocol.TField TIME_TO_LIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeToLive", org.apache.thrift.protocol.TType.I32, (short)9);
47  
48    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
49    static {
50      schemes.put(StandardScheme.class, new ColumnDescriptorStandardSchemeFactory());
51      schemes.put(TupleScheme.class, new ColumnDescriptorTupleSchemeFactory());
52    }
53  
54    public ByteBuffer name; // required
55    public int maxVersions; // required
56    public String compression; // required
57    public boolean inMemory; // required
58    public String bloomFilterType; // required
59    public int bloomFilterVectorSize; // required
60    public int bloomFilterNbHashes; // required
61    public boolean blockCacheEnabled; // required
62    public int timeToLive; // required
63  
64    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
65    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
66      NAME((short)1, "name"),
67      MAX_VERSIONS((short)2, "maxVersions"),
68      COMPRESSION((short)3, "compression"),
69      IN_MEMORY((short)4, "inMemory"),
70      BLOOM_FILTER_TYPE((short)5, "bloomFilterType"),
71      BLOOM_FILTER_VECTOR_SIZE((short)6, "bloomFilterVectorSize"),
72      BLOOM_FILTER_NB_HASHES((short)7, "bloomFilterNbHashes"),
73      BLOCK_CACHE_ENABLED((short)8, "blockCacheEnabled"),
74      TIME_TO_LIVE((short)9, "timeToLive");
75  
76      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
77  
78      static {
79        for (_Fields field : EnumSet.allOf(_Fields.class)) {
80          byName.put(field.getFieldName(), field);
81        }
82      }
83  
84      /**
85       * Find the _Fields constant that matches fieldId, or null if its not found.
86       */
87      public static _Fields findByThriftId(int fieldId) {
88        switch(fieldId) {
89          case 1: // NAME
90            return NAME;
91          case 2: // MAX_VERSIONS
92            return MAX_VERSIONS;
93          case 3: // COMPRESSION
94            return COMPRESSION;
95          case 4: // IN_MEMORY
96            return IN_MEMORY;
97          case 5: // BLOOM_FILTER_TYPE
98            return BLOOM_FILTER_TYPE;
99          case 6: // BLOOM_FILTER_VECTOR_SIZE
100           return BLOOM_FILTER_VECTOR_SIZE;
101         case 7: // BLOOM_FILTER_NB_HASHES
102           return BLOOM_FILTER_NB_HASHES;
103         case 8: // BLOCK_CACHE_ENABLED
104           return BLOCK_CACHE_ENABLED;
105         case 9: // TIME_TO_LIVE
106           return TIME_TO_LIVE;
107         default:
108           return null;
109       }
110     }
111 
112     /**
113      * Find the _Fields constant that matches fieldId, throwing an exception
114      * if it is not found.
115      */
116     public static _Fields findByThriftIdOrThrow(int fieldId) {
117       _Fields fields = findByThriftId(fieldId);
118       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
119       return fields;
120     }
121 
122     /**
123      * Find the _Fields constant that matches name, or null if its not found.
124      */
125     public static _Fields findByName(String name) {
126       return byName.get(name);
127     }
128 
129     private final short _thriftId;
130     private final String _fieldName;
131 
132     _Fields(short thriftId, String fieldName) {
133       _thriftId = thriftId;
134       _fieldName = fieldName;
135     }
136 
137     public short getThriftFieldId() {
138       return _thriftId;
139     }
140 
141     public String getFieldName() {
142       return _fieldName;
143     }
144   }
145 
146   // isset id assignments
147   private static final int __MAXVERSIONS_ISSET_ID = 0;
148   private static final int __INMEMORY_ISSET_ID = 1;
149   private static final int __BLOOMFILTERVECTORSIZE_ISSET_ID = 2;
150   private static final int __BLOOMFILTERNBHASHES_ISSET_ID = 3;
151   private static final int __BLOCKCACHEENABLED_ISSET_ID = 4;
152   private static final int __TIMETOLIVE_ISSET_ID = 5;
153   private BitSet __isset_bit_vector = new BitSet(6);
154   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
155   static {
156     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
157     tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "Text")));
159     tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
161     tmpMap.put(_Fields.COMPRESSION, new org.apache.thrift.meta_data.FieldMetaData("compression", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
163     tmpMap.put(_Fields.IN_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("inMemory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
164         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
165     tmpMap.put(_Fields.BLOOM_FILTER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
166         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
167     tmpMap.put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterVectorSize", org.apache.thrift.TFieldRequirementType.DEFAULT, 
168         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
169     tmpMap.put(_Fields.BLOOM_FILTER_NB_HASHES, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterNbHashes", org.apache.thrift.TFieldRequirementType.DEFAULT, 
170         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
171     tmpMap.put(_Fields.BLOCK_CACHE_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("blockCacheEnabled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
172         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
173     tmpMap.put(_Fields.TIME_TO_LIVE, new org.apache.thrift.meta_data.FieldMetaData("timeToLive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
174         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
175     metaDataMap = Collections.unmodifiableMap(tmpMap);
176     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDescriptor.class, metaDataMap);
177   }
178 
179   public ColumnDescriptor() {
180     this.maxVersions = 3;
181 
182     this.compression = "NONE";
183 
184     this.inMemory = false;
185 
186     this.bloomFilterType = "NONE";
187 
188     this.bloomFilterVectorSize = 0;
189 
190     this.bloomFilterNbHashes = 0;
191 
192     this.blockCacheEnabled = false;
193 
194     this.timeToLive = -1;
195 
196   }
197 
198   public ColumnDescriptor(
199     ByteBuffer name,
200     int maxVersions,
201     String compression,
202     boolean inMemory,
203     String bloomFilterType,
204     int bloomFilterVectorSize,
205     int bloomFilterNbHashes,
206     boolean blockCacheEnabled,
207     int timeToLive)
208   {
209     this();
210     this.name = name;
211     this.maxVersions = maxVersions;
212     setMaxVersionsIsSet(true);
213     this.compression = compression;
214     this.inMemory = inMemory;
215     setInMemoryIsSet(true);
216     this.bloomFilterType = bloomFilterType;
217     this.bloomFilterVectorSize = bloomFilterVectorSize;
218     setBloomFilterVectorSizeIsSet(true);
219     this.bloomFilterNbHashes = bloomFilterNbHashes;
220     setBloomFilterNbHashesIsSet(true);
221     this.blockCacheEnabled = blockCacheEnabled;
222     setBlockCacheEnabledIsSet(true);
223     this.timeToLive = timeToLive;
224     setTimeToLiveIsSet(true);
225   }
226 
227   /**
228    * Performs a deep copy on <i>other</i>.
229    */
230   public ColumnDescriptor(ColumnDescriptor other) {
231     __isset_bit_vector.clear();
232     __isset_bit_vector.or(other.__isset_bit_vector);
233     if (other.isSetName()) {
234       this.name = other.name;
235     }
236     this.maxVersions = other.maxVersions;
237     if (other.isSetCompression()) {
238       this.compression = other.compression;
239     }
240     this.inMemory = other.inMemory;
241     if (other.isSetBloomFilterType()) {
242       this.bloomFilterType = other.bloomFilterType;
243     }
244     this.bloomFilterVectorSize = other.bloomFilterVectorSize;
245     this.bloomFilterNbHashes = other.bloomFilterNbHashes;
246     this.blockCacheEnabled = other.blockCacheEnabled;
247     this.timeToLive = other.timeToLive;
248   }
249 
250   public ColumnDescriptor deepCopy() {
251     return new ColumnDescriptor(this);
252   }
253 
254   @Override
255   public void clear() {
256     this.name = null;
257     this.maxVersions = 3;
258 
259     this.compression = "NONE";
260 
261     this.inMemory = false;
262 
263     this.bloomFilterType = "NONE";
264 
265     this.bloomFilterVectorSize = 0;
266 
267     this.bloomFilterNbHashes = 0;
268 
269     this.blockCacheEnabled = false;
270 
271     this.timeToLive = -1;
272 
273   }
274 
275   public byte[] getName() {
276     setName(org.apache.thrift.TBaseHelper.rightSize(name));
277     return name == null ? null : name.array();
278   }
279 
280   public ByteBuffer bufferForName() {
281     return name;
282   }
283 
284   public ColumnDescriptor setName(byte[] name) {
285     setName(name == null ? (ByteBuffer)null : ByteBuffer.wrap(name));
286     return this;
287   }
288 
289   public ColumnDescriptor setName(ByteBuffer name) {
290     this.name = name;
291     return this;
292   }
293 
294   public void unsetName() {
295     this.name = null;
296   }
297 
298   /** Returns true if field name is set (has been assigned a value) and false otherwise */
299   public boolean isSetName() {
300     return this.name != null;
301   }
302 
303   public void setNameIsSet(boolean value) {
304     if (!value) {
305       this.name = null;
306     }
307   }
308 
309   public int getMaxVersions() {
310     return this.maxVersions;
311   }
312 
313   public ColumnDescriptor setMaxVersions(int maxVersions) {
314     this.maxVersions = maxVersions;
315     setMaxVersionsIsSet(true);
316     return this;
317   }
318 
319   public void unsetMaxVersions() {
320     __isset_bit_vector.clear(__MAXVERSIONS_ISSET_ID);
321   }
322 
323   /** Returns true if field maxVersions is set (has been assigned a value) and false otherwise */
324   public boolean isSetMaxVersions() {
325     return __isset_bit_vector.get(__MAXVERSIONS_ISSET_ID);
326   }
327 
328   public void setMaxVersionsIsSet(boolean value) {
329     __isset_bit_vector.set(__MAXVERSIONS_ISSET_ID, value);
330   }
331 
332   public String getCompression() {
333     return this.compression;
334   }
335 
336   public ColumnDescriptor setCompression(String compression) {
337     this.compression = compression;
338     return this;
339   }
340 
341   public void unsetCompression() {
342     this.compression = null;
343   }
344 
345   /** Returns true if field compression is set (has been assigned a value) and false otherwise */
346   public boolean isSetCompression() {
347     return this.compression != null;
348   }
349 
350   public void setCompressionIsSet(boolean value) {
351     if (!value) {
352       this.compression = null;
353     }
354   }
355 
356   public boolean isInMemory() {
357     return this.inMemory;
358   }
359 
360   public ColumnDescriptor setInMemory(boolean inMemory) {
361     this.inMemory = inMemory;
362     setInMemoryIsSet(true);
363     return this;
364   }
365 
366   public void unsetInMemory() {
367     __isset_bit_vector.clear(__INMEMORY_ISSET_ID);
368   }
369 
370   /** Returns true if field inMemory is set (has been assigned a value) and false otherwise */
371   public boolean isSetInMemory() {
372     return __isset_bit_vector.get(__INMEMORY_ISSET_ID);
373   }
374 
375   public void setInMemoryIsSet(boolean value) {
376     __isset_bit_vector.set(__INMEMORY_ISSET_ID, value);
377   }
378 
379   public String getBloomFilterType() {
380     return this.bloomFilterType;
381   }
382 
383   public ColumnDescriptor setBloomFilterType(String bloomFilterType) {
384     this.bloomFilterType = bloomFilterType;
385     return this;
386   }
387 
388   public void unsetBloomFilterType() {
389     this.bloomFilterType = null;
390   }
391 
392   /** Returns true if field bloomFilterType is set (has been assigned a value) and false otherwise */
393   public boolean isSetBloomFilterType() {
394     return this.bloomFilterType != null;
395   }
396 
397   public void setBloomFilterTypeIsSet(boolean value) {
398     if (!value) {
399       this.bloomFilterType = null;
400     }
401   }
402 
403   public int getBloomFilterVectorSize() {
404     return this.bloomFilterVectorSize;
405   }
406 
407   public ColumnDescriptor setBloomFilterVectorSize(int bloomFilterVectorSize) {
408     this.bloomFilterVectorSize = bloomFilterVectorSize;
409     setBloomFilterVectorSizeIsSet(true);
410     return this;
411   }
412 
413   public void unsetBloomFilterVectorSize() {
414     __isset_bit_vector.clear(__BLOOMFILTERVECTORSIZE_ISSET_ID);
415   }
416 
417   /** Returns true if field bloomFilterVectorSize is set (has been assigned a value) and false otherwise */
418   public boolean isSetBloomFilterVectorSize() {
419     return __isset_bit_vector.get(__BLOOMFILTERVECTORSIZE_ISSET_ID);
420   }
421 
422   public void setBloomFilterVectorSizeIsSet(boolean value) {
423     __isset_bit_vector.set(__BLOOMFILTERVECTORSIZE_ISSET_ID, value);
424   }
425 
426   public int getBloomFilterNbHashes() {
427     return this.bloomFilterNbHashes;
428   }
429 
430   public ColumnDescriptor setBloomFilterNbHashes(int bloomFilterNbHashes) {
431     this.bloomFilterNbHashes = bloomFilterNbHashes;
432     setBloomFilterNbHashesIsSet(true);
433     return this;
434   }
435 
436   public void unsetBloomFilterNbHashes() {
437     __isset_bit_vector.clear(__BLOOMFILTERNBHASHES_ISSET_ID);
438   }
439 
440   /** Returns true if field bloomFilterNbHashes is set (has been assigned a value) and false otherwise */
441   public boolean isSetBloomFilterNbHashes() {
442     return __isset_bit_vector.get(__BLOOMFILTERNBHASHES_ISSET_ID);
443   }
444 
445   public void setBloomFilterNbHashesIsSet(boolean value) {
446     __isset_bit_vector.set(__BLOOMFILTERNBHASHES_ISSET_ID, value);
447   }
448 
449   public boolean isBlockCacheEnabled() {
450     return this.blockCacheEnabled;
451   }
452 
453   public ColumnDescriptor setBlockCacheEnabled(boolean blockCacheEnabled) {
454     this.blockCacheEnabled = blockCacheEnabled;
455     setBlockCacheEnabledIsSet(true);
456     return this;
457   }
458 
459   public void unsetBlockCacheEnabled() {
460     __isset_bit_vector.clear(__BLOCKCACHEENABLED_ISSET_ID);
461   }
462 
463   /** Returns true if field blockCacheEnabled is set (has been assigned a value) and false otherwise */
464   public boolean isSetBlockCacheEnabled() {
465     return __isset_bit_vector.get(__BLOCKCACHEENABLED_ISSET_ID);
466   }
467 
468   public void setBlockCacheEnabledIsSet(boolean value) {
469     __isset_bit_vector.set(__BLOCKCACHEENABLED_ISSET_ID, value);
470   }
471 
472   public int getTimeToLive() {
473     return this.timeToLive;
474   }
475 
476   public ColumnDescriptor setTimeToLive(int timeToLive) {
477     this.timeToLive = timeToLive;
478     setTimeToLiveIsSet(true);
479     return this;
480   }
481 
482   public void unsetTimeToLive() {
483     __isset_bit_vector.clear(__TIMETOLIVE_ISSET_ID);
484   }
485 
486   /** Returns true if field timeToLive is set (has been assigned a value) and false otherwise */
487   public boolean isSetTimeToLive() {
488     return __isset_bit_vector.get(__TIMETOLIVE_ISSET_ID);
489   }
490 
491   public void setTimeToLiveIsSet(boolean value) {
492     __isset_bit_vector.set(__TIMETOLIVE_ISSET_ID, value);
493   }
494 
495   public void setFieldValue(_Fields field, Object value) {
496     switch (field) {
497     case NAME:
498       if (value == null) {
499         unsetName();
500       } else {
501         setName((ByteBuffer)value);
502       }
503       break;
504 
505     case MAX_VERSIONS:
506       if (value == null) {
507         unsetMaxVersions();
508       } else {
509         setMaxVersions((Integer)value);
510       }
511       break;
512 
513     case COMPRESSION:
514       if (value == null) {
515         unsetCompression();
516       } else {
517         setCompression((String)value);
518       }
519       break;
520 
521     case IN_MEMORY:
522       if (value == null) {
523         unsetInMemory();
524       } else {
525         setInMemory((Boolean)value);
526       }
527       break;
528 
529     case BLOOM_FILTER_TYPE:
530       if (value == null) {
531         unsetBloomFilterType();
532       } else {
533         setBloomFilterType((String)value);
534       }
535       break;
536 
537     case BLOOM_FILTER_VECTOR_SIZE:
538       if (value == null) {
539         unsetBloomFilterVectorSize();
540       } else {
541         setBloomFilterVectorSize((Integer)value);
542       }
543       break;
544 
545     case BLOOM_FILTER_NB_HASHES:
546       if (value == null) {
547         unsetBloomFilterNbHashes();
548       } else {
549         setBloomFilterNbHashes((Integer)value);
550       }
551       break;
552 
553     case BLOCK_CACHE_ENABLED:
554       if (value == null) {
555         unsetBlockCacheEnabled();
556       } else {
557         setBlockCacheEnabled((Boolean)value);
558       }
559       break;
560 
561     case TIME_TO_LIVE:
562       if (value == null) {
563         unsetTimeToLive();
564       } else {
565         setTimeToLive((Integer)value);
566       }
567       break;
568 
569     }
570   }
571 
572   public Object getFieldValue(_Fields field) {
573     switch (field) {
574     case NAME:
575       return getName();
576 
577     case MAX_VERSIONS:
578       return Integer.valueOf(getMaxVersions());
579 
580     case COMPRESSION:
581       return getCompression();
582 
583     case IN_MEMORY:
584       return Boolean.valueOf(isInMemory());
585 
586     case BLOOM_FILTER_TYPE:
587       return getBloomFilterType();
588 
589     case BLOOM_FILTER_VECTOR_SIZE:
590       return Integer.valueOf(getBloomFilterVectorSize());
591 
592     case BLOOM_FILTER_NB_HASHES:
593       return Integer.valueOf(getBloomFilterNbHashes());
594 
595     case BLOCK_CACHE_ENABLED:
596       return Boolean.valueOf(isBlockCacheEnabled());
597 
598     case TIME_TO_LIVE:
599       return Integer.valueOf(getTimeToLive());
600 
601     }
602     throw new IllegalStateException();
603   }
604 
605   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
606   public boolean isSet(_Fields field) {
607     if (field == null) {
608       throw new IllegalArgumentException();
609     }
610 
611     switch (field) {
612     case NAME:
613       return isSetName();
614     case MAX_VERSIONS:
615       return isSetMaxVersions();
616     case COMPRESSION:
617       return isSetCompression();
618     case IN_MEMORY:
619       return isSetInMemory();
620     case BLOOM_FILTER_TYPE:
621       return isSetBloomFilterType();
622     case BLOOM_FILTER_VECTOR_SIZE:
623       return isSetBloomFilterVectorSize();
624     case BLOOM_FILTER_NB_HASHES:
625       return isSetBloomFilterNbHashes();
626     case BLOCK_CACHE_ENABLED:
627       return isSetBlockCacheEnabled();
628     case TIME_TO_LIVE:
629       return isSetTimeToLive();
630     }
631     throw new IllegalStateException();
632   }
633 
634   @Override
635   public boolean equals(Object that) {
636     if (that == null)
637       return false;
638     if (that instanceof ColumnDescriptor)
639       return this.equals((ColumnDescriptor)that);
640     return false;
641   }
642 
643   public boolean equals(ColumnDescriptor that) {
644     if (that == null)
645       return false;
646 
647     boolean this_present_name = true && this.isSetName();
648     boolean that_present_name = true && that.isSetName();
649     if (this_present_name || that_present_name) {
650       if (!(this_present_name && that_present_name))
651         return false;
652       if (!this.name.equals(that.name))
653         return false;
654     }
655 
656     boolean this_present_maxVersions = true;
657     boolean that_present_maxVersions = true;
658     if (this_present_maxVersions || that_present_maxVersions) {
659       if (!(this_present_maxVersions && that_present_maxVersions))
660         return false;
661       if (this.maxVersions != that.maxVersions)
662         return false;
663     }
664 
665     boolean this_present_compression = true && this.isSetCompression();
666     boolean that_present_compression = true && that.isSetCompression();
667     if (this_present_compression || that_present_compression) {
668       if (!(this_present_compression && that_present_compression))
669         return false;
670       if (!this.compression.equals(that.compression))
671         return false;
672     }
673 
674     boolean this_present_inMemory = true;
675     boolean that_present_inMemory = true;
676     if (this_present_inMemory || that_present_inMemory) {
677       if (!(this_present_inMemory && that_present_inMemory))
678         return false;
679       if (this.inMemory != that.inMemory)
680         return false;
681     }
682 
683     boolean this_present_bloomFilterType = true && this.isSetBloomFilterType();
684     boolean that_present_bloomFilterType = true && that.isSetBloomFilterType();
685     if (this_present_bloomFilterType || that_present_bloomFilterType) {
686       if (!(this_present_bloomFilterType && that_present_bloomFilterType))
687         return false;
688       if (!this.bloomFilterType.equals(that.bloomFilterType))
689         return false;
690     }
691 
692     boolean this_present_bloomFilterVectorSize = true;
693     boolean that_present_bloomFilterVectorSize = true;
694     if (this_present_bloomFilterVectorSize || that_present_bloomFilterVectorSize) {
695       if (!(this_present_bloomFilterVectorSize && that_present_bloomFilterVectorSize))
696         return false;
697       if (this.bloomFilterVectorSize != that.bloomFilterVectorSize)
698         return false;
699     }
700 
701     boolean this_present_bloomFilterNbHashes = true;
702     boolean that_present_bloomFilterNbHashes = true;
703     if (this_present_bloomFilterNbHashes || that_present_bloomFilterNbHashes) {
704       if (!(this_present_bloomFilterNbHashes && that_present_bloomFilterNbHashes))
705         return false;
706       if (this.bloomFilterNbHashes != that.bloomFilterNbHashes)
707         return false;
708     }
709 
710     boolean this_present_blockCacheEnabled = true;
711     boolean that_present_blockCacheEnabled = true;
712     if (this_present_blockCacheEnabled || that_present_blockCacheEnabled) {
713       if (!(this_present_blockCacheEnabled && that_present_blockCacheEnabled))
714         return false;
715       if (this.blockCacheEnabled != that.blockCacheEnabled)
716         return false;
717     }
718 
719     boolean this_present_timeToLive = true;
720     boolean that_present_timeToLive = true;
721     if (this_present_timeToLive || that_present_timeToLive) {
722       if (!(this_present_timeToLive && that_present_timeToLive))
723         return false;
724       if (this.timeToLive != that.timeToLive)
725         return false;
726     }
727 
728     return true;
729   }
730 
731   @Override
732   public int hashCode() {
733     return 0;
734   }
735 
736   public int compareTo(ColumnDescriptor other) {
737     if (!getClass().equals(other.getClass())) {
738       return getClass().getName().compareTo(other.getClass().getName());
739     }
740 
741     int lastComparison = 0;
742     ColumnDescriptor typedOther = (ColumnDescriptor)other;
743 
744     lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
745     if (lastComparison != 0) {
746       return lastComparison;
747     }
748     if (isSetName()) {
749       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
750       if (lastComparison != 0) {
751         return lastComparison;
752       }
753     }
754     lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
755     if (lastComparison != 0) {
756       return lastComparison;
757     }
758     if (isSetMaxVersions()) {
759       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
760       if (lastComparison != 0) {
761         return lastComparison;
762       }
763     }
764     lastComparison = Boolean.valueOf(isSetCompression()).compareTo(typedOther.isSetCompression());
765     if (lastComparison != 0) {
766       return lastComparison;
767     }
768     if (isSetCompression()) {
769       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compression, typedOther.compression);
770       if (lastComparison != 0) {
771         return lastComparison;
772       }
773     }
774     lastComparison = Boolean.valueOf(isSetInMemory()).compareTo(typedOther.isSetInMemory());
775     if (lastComparison != 0) {
776       return lastComparison;
777     }
778     if (isSetInMemory()) {
779       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inMemory, typedOther.inMemory);
780       if (lastComparison != 0) {
781         return lastComparison;
782       }
783     }
784     lastComparison = Boolean.valueOf(isSetBloomFilterType()).compareTo(typedOther.isSetBloomFilterType());
785     if (lastComparison != 0) {
786       return lastComparison;
787     }
788     if (isSetBloomFilterType()) {
789       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterType, typedOther.bloomFilterType);
790       if (lastComparison != 0) {
791         return lastComparison;
792       }
793     }
794     lastComparison = Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(typedOther.isSetBloomFilterVectorSize());
795     if (lastComparison != 0) {
796       return lastComparison;
797     }
798     if (isSetBloomFilterVectorSize()) {
799       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterVectorSize, typedOther.bloomFilterVectorSize);
800       if (lastComparison != 0) {
801         return lastComparison;
802       }
803     }
804     lastComparison = Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(typedOther.isSetBloomFilterNbHashes());
805     if (lastComparison != 0) {
806       return lastComparison;
807     }
808     if (isSetBloomFilterNbHashes()) {
809       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterNbHashes, typedOther.bloomFilterNbHashes);
810       if (lastComparison != 0) {
811         return lastComparison;
812       }
813     }
814     lastComparison = Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(typedOther.isSetBlockCacheEnabled());
815     if (lastComparison != 0) {
816       return lastComparison;
817     }
818     if (isSetBlockCacheEnabled()) {
819       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockCacheEnabled, typedOther.blockCacheEnabled);
820       if (lastComparison != 0) {
821         return lastComparison;
822       }
823     }
824     lastComparison = Boolean.valueOf(isSetTimeToLive()).compareTo(typedOther.isSetTimeToLive());
825     if (lastComparison != 0) {
826       return lastComparison;
827     }
828     if (isSetTimeToLive()) {
829       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeToLive, typedOther.timeToLive);
830       if (lastComparison != 0) {
831         return lastComparison;
832       }
833     }
834     return 0;
835   }
836 
837   public _Fields fieldForId(int fieldId) {
838     return _Fields.findByThriftId(fieldId);
839   }
840 
841   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
842     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
843   }
844 
845   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
846     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
847   }
848 
849   @Override
850   public String toString() {
851     StringBuilder sb = new StringBuilder("ColumnDescriptor(");
852     boolean first = true;
853 
854     sb.append("name:");
855     if (this.name == null) {
856       sb.append("null");
857     } else {
858       sb.append(this.name);
859     }
860     first = false;
861     if (!first) sb.append(", ");
862     sb.append("maxVersions:");
863     sb.append(this.maxVersions);
864     first = false;
865     if (!first) sb.append(", ");
866     sb.append("compression:");
867     if (this.compression == null) {
868       sb.append("null");
869     } else {
870       sb.append(this.compression);
871     }
872     first = false;
873     if (!first) sb.append(", ");
874     sb.append("inMemory:");
875     sb.append(this.inMemory);
876     first = false;
877     if (!first) sb.append(", ");
878     sb.append("bloomFilterType:");
879     if (this.bloomFilterType == null) {
880       sb.append("null");
881     } else {
882       sb.append(this.bloomFilterType);
883     }
884     first = false;
885     if (!first) sb.append(", ");
886     sb.append("bloomFilterVectorSize:");
887     sb.append(this.bloomFilterVectorSize);
888     first = false;
889     if (!first) sb.append(", ");
890     sb.append("bloomFilterNbHashes:");
891     sb.append(this.bloomFilterNbHashes);
892     first = false;
893     if (!first) sb.append(", ");
894     sb.append("blockCacheEnabled:");
895     sb.append(this.blockCacheEnabled);
896     first = false;
897     if (!first) sb.append(", ");
898     sb.append("timeToLive:");
899     sb.append(this.timeToLive);
900     first = false;
901     sb.append(")");
902     return sb.toString();
903   }
904 
905   public void validate() throws org.apache.thrift.TException {
906     // check for required fields
907   }
908 
909   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
910     try {
911       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
912     } catch (org.apache.thrift.TException te) {
913       throw new java.io.IOException(te);
914     }
915   }
916 
917   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
918     try {
919       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
920       __isset_bit_vector = new BitSet(1);
921       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
922     } catch (org.apache.thrift.TException te) {
923       throw new java.io.IOException(te);
924     }
925   }
926 
927   private static class ColumnDescriptorStandardSchemeFactory implements SchemeFactory {
928     public ColumnDescriptorStandardScheme getScheme() {
929       return new ColumnDescriptorStandardScheme();
930     }
931   }
932 
933   private static class ColumnDescriptorStandardScheme extends StandardScheme<ColumnDescriptor> {
934 
935     public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnDescriptor struct) throws org.apache.thrift.TException {
936       org.apache.thrift.protocol.TField schemeField;
937       iprot.readStructBegin();
938       while (true)
939       {
940         schemeField = iprot.readFieldBegin();
941         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
942           break;
943         }
944         switch (schemeField.id) {
945           case 1: // NAME
946             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
947               struct.name = iprot.readBinary();
948               struct.setNameIsSet(true);
949             } else { 
950               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
951             }
952             break;
953           case 2: // MAX_VERSIONS
954             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
955               struct.maxVersions = iprot.readI32();
956               struct.setMaxVersionsIsSet(true);
957             } else { 
958               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
959             }
960             break;
961           case 3: // COMPRESSION
962             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
963               struct.compression = iprot.readString();
964               struct.setCompressionIsSet(true);
965             } else { 
966               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
967             }
968             break;
969           case 4: // IN_MEMORY
970             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
971               struct.inMemory = iprot.readBool();
972               struct.setInMemoryIsSet(true);
973             } else { 
974               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
975             }
976             break;
977           case 5: // BLOOM_FILTER_TYPE
978             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
979               struct.bloomFilterType = iprot.readString();
980               struct.setBloomFilterTypeIsSet(true);
981             } else { 
982               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
983             }
984             break;
985           case 6: // BLOOM_FILTER_VECTOR_SIZE
986             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
987               struct.bloomFilterVectorSize = iprot.readI32();
988               struct.setBloomFilterVectorSizeIsSet(true);
989             } else { 
990               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
991             }
992             break;
993           case 7: // BLOOM_FILTER_NB_HASHES
994             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
995               struct.bloomFilterNbHashes = iprot.readI32();
996               struct.setBloomFilterNbHashesIsSet(true);
997             } else { 
998               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
999             }
1000             break;
1001           case 8: // BLOCK_CACHE_ENABLED
1002             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
1003               struct.blockCacheEnabled = iprot.readBool();
1004               struct.setBlockCacheEnabledIsSet(true);
1005             } else { 
1006               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1007             }
1008             break;
1009           case 9: // TIME_TO_LIVE
1010             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1011               struct.timeToLive = iprot.readI32();
1012               struct.setTimeToLiveIsSet(true);
1013             } else { 
1014               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1015             }
1016             break;
1017           default:
1018             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1019         }
1020         iprot.readFieldEnd();
1021       }
1022       iprot.readStructEnd();
1023 
1024       // check for required fields of primitive type, which can't be checked in the validate method
1025       struct.validate();
1026     }
1027 
1028     public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnDescriptor struct) throws org.apache.thrift.TException {
1029       struct.validate();
1030 
1031       oprot.writeStructBegin(STRUCT_DESC);
1032       if (struct.name != null) {
1033         oprot.writeFieldBegin(NAME_FIELD_DESC);
1034         oprot.writeBinary(struct.name);
1035         oprot.writeFieldEnd();
1036       }
1037       oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
1038       oprot.writeI32(struct.maxVersions);
1039       oprot.writeFieldEnd();
1040       if (struct.compression != null) {
1041         oprot.writeFieldBegin(COMPRESSION_FIELD_DESC);
1042         oprot.writeString(struct.compression);
1043         oprot.writeFieldEnd();
1044       }
1045       oprot.writeFieldBegin(IN_MEMORY_FIELD_DESC);
1046       oprot.writeBool(struct.inMemory);
1047       oprot.writeFieldEnd();
1048       if (struct.bloomFilterType != null) {
1049         oprot.writeFieldBegin(BLOOM_FILTER_TYPE_FIELD_DESC);
1050         oprot.writeString(struct.bloomFilterType);
1051         oprot.writeFieldEnd();
1052       }
1053       oprot.writeFieldBegin(BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC);
1054       oprot.writeI32(struct.bloomFilterVectorSize);
1055       oprot.writeFieldEnd();
1056       oprot.writeFieldBegin(BLOOM_FILTER_NB_HASHES_FIELD_DESC);
1057       oprot.writeI32(struct.bloomFilterNbHashes);
1058       oprot.writeFieldEnd();
1059       oprot.writeFieldBegin(BLOCK_CACHE_ENABLED_FIELD_DESC);
1060       oprot.writeBool(struct.blockCacheEnabled);
1061       oprot.writeFieldEnd();
1062       oprot.writeFieldBegin(TIME_TO_LIVE_FIELD_DESC);
1063       oprot.writeI32(struct.timeToLive);
1064       oprot.writeFieldEnd();
1065       oprot.writeFieldStop();
1066       oprot.writeStructEnd();
1067     }
1068 
1069   }
1070 
1071   private static class ColumnDescriptorTupleSchemeFactory implements SchemeFactory {
1072     public ColumnDescriptorTupleScheme getScheme() {
1073       return new ColumnDescriptorTupleScheme();
1074     }
1075   }
1076 
1077   private static class ColumnDescriptorTupleScheme extends TupleScheme<ColumnDescriptor> {
1078 
1079     @Override
1080     public void write(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException {
1081       TTupleProtocol oprot = (TTupleProtocol) prot;
1082       BitSet optionals = new BitSet();
1083       if (struct.isSetName()) {
1084         optionals.set(0);
1085       }
1086       if (struct.isSetMaxVersions()) {
1087         optionals.set(1);
1088       }
1089       if (struct.isSetCompression()) {
1090         optionals.set(2);
1091       }
1092       if (struct.isSetInMemory()) {
1093         optionals.set(3);
1094       }
1095       if (struct.isSetBloomFilterType()) {
1096         optionals.set(4);
1097       }
1098       if (struct.isSetBloomFilterVectorSize()) {
1099         optionals.set(5);
1100       }
1101       if (struct.isSetBloomFilterNbHashes()) {
1102         optionals.set(6);
1103       }
1104       if (struct.isSetBlockCacheEnabled()) {
1105         optionals.set(7);
1106       }
1107       if (struct.isSetTimeToLive()) {
1108         optionals.set(8);
1109       }
1110       oprot.writeBitSet(optionals, 9);
1111       if (struct.isSetName()) {
1112         oprot.writeBinary(struct.name);
1113       }
1114       if (struct.isSetMaxVersions()) {
1115         oprot.writeI32(struct.maxVersions);
1116       }
1117       if (struct.isSetCompression()) {
1118         oprot.writeString(struct.compression);
1119       }
1120       if (struct.isSetInMemory()) {
1121         oprot.writeBool(struct.inMemory);
1122       }
1123       if (struct.isSetBloomFilterType()) {
1124         oprot.writeString(struct.bloomFilterType);
1125       }
1126       if (struct.isSetBloomFilterVectorSize()) {
1127         oprot.writeI32(struct.bloomFilterVectorSize);
1128       }
1129       if (struct.isSetBloomFilterNbHashes()) {
1130         oprot.writeI32(struct.bloomFilterNbHashes);
1131       }
1132       if (struct.isSetBlockCacheEnabled()) {
1133         oprot.writeBool(struct.blockCacheEnabled);
1134       }
1135       if (struct.isSetTimeToLive()) {
1136         oprot.writeI32(struct.timeToLive);
1137       }
1138     }
1139 
1140     @Override
1141     public void read(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException {
1142       TTupleProtocol iprot = (TTupleProtocol) prot;
1143       BitSet incoming = iprot.readBitSet(9);
1144       if (incoming.get(0)) {
1145         struct.name = iprot.readBinary();
1146         struct.setNameIsSet(true);
1147       }
1148       if (incoming.get(1)) {
1149         struct.maxVersions = iprot.readI32();
1150         struct.setMaxVersionsIsSet(true);
1151       }
1152       if (incoming.get(2)) {
1153         struct.compression = iprot.readString();
1154         struct.setCompressionIsSet(true);
1155       }
1156       if (incoming.get(3)) {
1157         struct.inMemory = iprot.readBool();
1158         struct.setInMemoryIsSet(true);
1159       }
1160       if (incoming.get(4)) {
1161         struct.bloomFilterType = iprot.readString();
1162         struct.setBloomFilterTypeIsSet(true);
1163       }
1164       if (incoming.get(5)) {
1165         struct.bloomFilterVectorSize = iprot.readI32();
1166         struct.setBloomFilterVectorSizeIsSet(true);
1167       }
1168       if (incoming.get(6)) {
1169         struct.bloomFilterNbHashes = iprot.readI32();
1170         struct.setBloomFilterNbHashesIsSet(true);
1171       }
1172       if (incoming.get(7)) {
1173         struct.blockCacheEnabled = iprot.readBool();
1174         struct.setBlockCacheEnabledIsSet(true);
1175       }
1176       if (incoming.get(8)) {
1177         struct.timeToLive = iprot.readI32();
1178         struct.setTimeToLiveIsSet(true);
1179       }
1180     }
1181   }
1182 
1183 }
1184