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