View Javadoc

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