ColumnChunk.java

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.parquet.format;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class ColumnChunk implements org.apache.thrift.TBase<ColumnChunk, ColumnChunk._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnChunk> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnChunk");

  private static final org.apache.thrift.protocol.TField FILE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("file_path", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField FILE_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("file_offset", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField META_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("meta_data", org.apache.thrift.protocol.TType.STRUCT, (short)3);
  private static final org.apache.thrift.protocol.TField OFFSET_INDEX_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset_index_offset", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField OFFSET_INDEX_LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("offset_index_length", org.apache.thrift.protocol.TType.I32, (short)5);
  private static final org.apache.thrift.protocol.TField COLUMN_INDEX_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("column_index_offset", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField COLUMN_INDEX_LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("column_index_length", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField CRYPTO_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("crypto_metadata", org.apache.thrift.protocol.TType.STRUCT, (short)8);
  private static final org.apache.thrift.protocol.TField ENCRYPTED_COLUMN_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("encrypted_column_metadata", org.apache.thrift.protocol.TType.STRING, (short)9);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ColumnChunkStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ColumnChunkTupleSchemeFactory();

  /**
   * File where column data is stored.  If not set, assumed to be same file as
   * metadata.  This path is relative to the current file.
   * 
   */
  public @org.apache.thrift.annotation.Nullable java.lang.String file_path; // optional
  /**
   * Deprecated: Byte offset in file_path to the ColumnMetaData
   * 
   * Past use of this field has been inconsistent, with some implementations
   * using it to point to the ColumnMetaData and some using it to point to
   * the first page in the column chunk. In many cases, the ColumnMetaData at this
   * location is wrong. This field is now deprecated and should not be used.
   * Writers should set this field to 0 if no ColumnMetaData has been written outside
   * the footer.
   */
  public long file_offset; // required
  /**
   * Column metadata for this chunk. Some writers may also replicate this at the
   * location pointed to by file_path/file_offset.
   * Note: while marked as optional, this field is in fact required by most major
   * Parquet implementations. As such, writers MUST populate this field.
   * 
   */
  public @org.apache.thrift.annotation.Nullable ColumnMetaData meta_data; // optional
  /**
   * File offset of ColumnChunk's OffsetIndex *
   */
  public long offset_index_offset; // optional
  /**
   * Size of ColumnChunk's OffsetIndex, in bytes *
   */
  public int offset_index_length; // optional
  /**
   * File offset of ColumnChunk's ColumnIndex *
   */
  public long column_index_offset; // optional
  /**
   * Size of ColumnChunk's ColumnIndex, in bytes *
   */
  public int column_index_length; // optional
  /**
   * Crypto metadata of encrypted columns *
   */
  public @org.apache.thrift.annotation.Nullable ColumnCryptoMetaData crypto_metadata; // optional
  /**
   * Encrypted column metadata for this chunk *
   */
  public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer encrypted_column_metadata; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    /**
     * File where column data is stored.  If not set, assumed to be same file as
     * metadata.  This path is relative to the current file.
     * 
     */
    FILE_PATH((short)1, "file_path"),
    /**
     * Deprecated: Byte offset in file_path to the ColumnMetaData
     * 
     * Past use of this field has been inconsistent, with some implementations
     * using it to point to the ColumnMetaData and some using it to point to
     * the first page in the column chunk. In many cases, the ColumnMetaData at this
     * location is wrong. This field is now deprecated and should not be used.
     * Writers should set this field to 0 if no ColumnMetaData has been written outside
     * the footer.
     */
    FILE_OFFSET((short)2, "file_offset"),
    /**
     * Column metadata for this chunk. Some writers may also replicate this at the
     * location pointed to by file_path/file_offset.
     * Note: while marked as optional, this field is in fact required by most major
     * Parquet implementations. As such, writers MUST populate this field.
     * 
     */
    META_DATA((short)3, "meta_data"),
    /**
     * File offset of ColumnChunk's OffsetIndex *
     */
    OFFSET_INDEX_OFFSET((short)4, "offset_index_offset"),
    /**
     * Size of ColumnChunk's OffsetIndex, in bytes *
     */
    OFFSET_INDEX_LENGTH((short)5, "offset_index_length"),
    /**
     * File offset of ColumnChunk's ColumnIndex *
     */
    COLUMN_INDEX_OFFSET((short)6, "column_index_offset"),
    /**
     * Size of ColumnChunk's ColumnIndex, in bytes *
     */
    COLUMN_INDEX_LENGTH((short)7, "column_index_length"),
    /**
     * Crypto metadata of encrypted columns *
     */
    CRYPTO_METADATA((short)8, "crypto_metadata"),
    /**
     * Encrypted column metadata for this chunk *
     */
    ENCRYPTED_COLUMN_METADATA((short)9, "encrypted_column_metadata");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // FILE_PATH
          return FILE_PATH;
        case 2: // FILE_OFFSET
          return FILE_OFFSET;
        case 3: // META_DATA
          return META_DATA;
        case 4: // OFFSET_INDEX_OFFSET
          return OFFSET_INDEX_OFFSET;
        case 5: // OFFSET_INDEX_LENGTH
          return OFFSET_INDEX_LENGTH;
        case 6: // COLUMN_INDEX_OFFSET
          return COLUMN_INDEX_OFFSET;
        case 7: // COLUMN_INDEX_LENGTH
          return COLUMN_INDEX_LENGTH;
        case 8: // CRYPTO_METADATA
          return CRYPTO_METADATA;
        case 9: // ENCRYPTED_COLUMN_METADATA
          return ENCRYPTED_COLUMN_METADATA;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __FILE_OFFSET_ISSET_ID = 0;
  private static final int __OFFSET_INDEX_OFFSET_ISSET_ID = 1;
  private static final int __OFFSET_INDEX_LENGTH_ISSET_ID = 2;
  private static final int __COLUMN_INDEX_OFFSET_ISSET_ID = 3;
  private static final int __COLUMN_INDEX_LENGTH_ISSET_ID = 4;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.FILE_PATH,_Fields.META_DATA,_Fields.OFFSET_INDEX_OFFSET,_Fields.OFFSET_INDEX_LENGTH,_Fields.COLUMN_INDEX_OFFSET,_Fields.COLUMN_INDEX_LENGTH,_Fields.CRYPTO_METADATA,_Fields.ENCRYPTED_COLUMN_METADATA};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.FILE_PATH, new org.apache.thrift.meta_data.FieldMetaData("file_path", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FILE_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("file_offset", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.META_DATA, new org.apache.thrift.meta_data.FieldMetaData("meta_data", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnMetaData.class)));
    tmpMap.put(_Fields.OFFSET_INDEX_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset_index_offset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.OFFSET_INDEX_LENGTH, new org.apache.thrift.meta_data.FieldMetaData("offset_index_length", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.COLUMN_INDEX_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("column_index_offset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.COLUMN_INDEX_LENGTH, new org.apache.thrift.meta_data.FieldMetaData("column_index_length", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.CRYPTO_METADATA, new org.apache.thrift.meta_data.FieldMetaData("crypto_metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnCryptoMetaData.class)));
    tmpMap.put(_Fields.ENCRYPTED_COLUMN_METADATA, new org.apache.thrift.meta_data.FieldMetaData("encrypted_column_metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnChunk.class, metaDataMap);
  }

  public ColumnChunk() {
    this.file_offset = 0L;

  }

  public ColumnChunk(
    long file_offset)
  {
    this();
    this.file_offset = file_offset;
    setFileOffsetIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ColumnChunk(ColumnChunk other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetFilePath()) {
      this.file_path = other.file_path;
    }
    this.file_offset = other.file_offset;
    if (other.isSetMetaData()) {
      this.meta_data = new ColumnMetaData(other.meta_data);
    }
    this.offset_index_offset = other.offset_index_offset;
    this.offset_index_length = other.offset_index_length;
    this.column_index_offset = other.column_index_offset;
    this.column_index_length = other.column_index_length;
    if (other.isSetCryptoMetadata()) {
      this.crypto_metadata = new ColumnCryptoMetaData(other.crypto_metadata);
    }
    if (other.isSetEncryptedColumnMetadata()) {
      this.encrypted_column_metadata = org.apache.thrift.TBaseHelper.copyBinary(other.encrypted_column_metadata);
    }
  }

  public ColumnChunk deepCopy() {
    return new ColumnChunk(this);
  }

  @Override
  public void clear() {
    this.file_path = null;
    this.file_offset = 0L;

    this.meta_data = null;
    setOffsetIndexOffsetIsSet(false);
    this.offset_index_offset = 0;
    setOffsetIndexLengthIsSet(false);
    this.offset_index_length = 0;
    setColumnIndexOffsetIsSet(false);
    this.column_index_offset = 0;
    setColumnIndexLengthIsSet(false);
    this.column_index_length = 0;
    this.crypto_metadata = null;
    this.encrypted_column_metadata = null;
  }

  /**
   * File where column data is stored.  If not set, assumed to be same file as
   * metadata.  This path is relative to the current file.
   * 
   */
  @org.apache.thrift.annotation.Nullable
  public java.lang.String getFilePath() {
    return this.file_path;
  }

  /**
   * File where column data is stored.  If not set, assumed to be same file as
   * metadata.  This path is relative to the current file.
   * 
   */
  public ColumnChunk setFilePath(@org.apache.thrift.annotation.Nullable java.lang.String file_path) {
    this.file_path = file_path;
    return this;
  }

  public void unsetFilePath() {
    this.file_path = null;
  }

  /** Returns true if field file_path is set (has been assigned a value) and false otherwise */
  public boolean isSetFilePath() {
    return this.file_path != null;
  }

  public void setFilePathIsSet(boolean value) {
    if (!value) {
      this.file_path = null;
    }
  }

  /**
   * Deprecated: Byte offset in file_path to the ColumnMetaData
   * 
   * Past use of this field has been inconsistent, with some implementations
   * using it to point to the ColumnMetaData and some using it to point to
   * the first page in the column chunk. In many cases, the ColumnMetaData at this
   * location is wrong. This field is now deprecated and should not be used.
   * Writers should set this field to 0 if no ColumnMetaData has been written outside
   * the footer.
   */
  public long getFileOffset() {
    return this.file_offset;
  }

  /**
   * Deprecated: Byte offset in file_path to the ColumnMetaData
   * 
   * Past use of this field has been inconsistent, with some implementations
   * using it to point to the ColumnMetaData and some using it to point to
   * the first page in the column chunk. In many cases, the ColumnMetaData at this
   * location is wrong. This field is now deprecated and should not be used.
   * Writers should set this field to 0 if no ColumnMetaData has been written outside
   * the footer.
   */
  public ColumnChunk setFileOffset(long file_offset) {
    this.file_offset = file_offset;
    setFileOffsetIsSet(true);
    return this;
  }

  public void unsetFileOffset() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FILE_OFFSET_ISSET_ID);
  }

  /** Returns true if field file_offset is set (has been assigned a value) and false otherwise */
  public boolean isSetFileOffset() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FILE_OFFSET_ISSET_ID);
  }

  public void setFileOffsetIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FILE_OFFSET_ISSET_ID, value);
  }

  /**
   * Column metadata for this chunk. Some writers may also replicate this at the
   * location pointed to by file_path/file_offset.
   * Note: while marked as optional, this field is in fact required by most major
   * Parquet implementations. As such, writers MUST populate this field.
   * 
   */
  @org.apache.thrift.annotation.Nullable
  public ColumnMetaData getMetaData() {
    return this.meta_data;
  }

  /**
   * Column metadata for this chunk. Some writers may also replicate this at the
   * location pointed to by file_path/file_offset.
   * Note: while marked as optional, this field is in fact required by most major
   * Parquet implementations. As such, writers MUST populate this field.
   * 
   */
  public ColumnChunk setMetaData(@org.apache.thrift.annotation.Nullable ColumnMetaData meta_data) {
    this.meta_data = meta_data;
    return this;
  }

  public void unsetMetaData() {
    this.meta_data = null;
  }

  /** Returns true if field meta_data is set (has been assigned a value) and false otherwise */
  public boolean isSetMetaData() {
    return this.meta_data != null;
  }

  public void setMetaDataIsSet(boolean value) {
    if (!value) {
      this.meta_data = null;
    }
  }

  /**
   * File offset of ColumnChunk's OffsetIndex *
   */
  public long getOffsetIndexOffset() {
    return this.offset_index_offset;
  }

  /**
   * File offset of ColumnChunk's OffsetIndex *
   */
  public ColumnChunk setOffsetIndexOffset(long offset_index_offset) {
    this.offset_index_offset = offset_index_offset;
    setOffsetIndexOffsetIsSet(true);
    return this;
  }

  public void unsetOffsetIndexOffset() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OFFSET_INDEX_OFFSET_ISSET_ID);
  }

  /** Returns true if field offset_index_offset is set (has been assigned a value) and false otherwise */
  public boolean isSetOffsetIndexOffset() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OFFSET_INDEX_OFFSET_ISSET_ID);
  }

  public void setOffsetIndexOffsetIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OFFSET_INDEX_OFFSET_ISSET_ID, value);
  }

  /**
   * Size of ColumnChunk's OffsetIndex, in bytes *
   */
  public int getOffsetIndexLength() {
    return this.offset_index_length;
  }

  /**
   * Size of ColumnChunk's OffsetIndex, in bytes *
   */
  public ColumnChunk setOffsetIndexLength(int offset_index_length) {
    this.offset_index_length = offset_index_length;
    setOffsetIndexLengthIsSet(true);
    return this;
  }

  public void unsetOffsetIndexLength() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OFFSET_INDEX_LENGTH_ISSET_ID);
  }

  /** Returns true if field offset_index_length is set (has been assigned a value) and false otherwise */
  public boolean isSetOffsetIndexLength() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OFFSET_INDEX_LENGTH_ISSET_ID);
  }

  public void setOffsetIndexLengthIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OFFSET_INDEX_LENGTH_ISSET_ID, value);
  }

  /**
   * File offset of ColumnChunk's ColumnIndex *
   */
  public long getColumnIndexOffset() {
    return this.column_index_offset;
  }

  /**
   * File offset of ColumnChunk's ColumnIndex *
   */
  public ColumnChunk setColumnIndexOffset(long column_index_offset) {
    this.column_index_offset = column_index_offset;
    setColumnIndexOffsetIsSet(true);
    return this;
  }

  public void unsetColumnIndexOffset() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMN_INDEX_OFFSET_ISSET_ID);
  }

  /** Returns true if field column_index_offset is set (has been assigned a value) and false otherwise */
  public boolean isSetColumnIndexOffset() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMN_INDEX_OFFSET_ISSET_ID);
  }

  public void setColumnIndexOffsetIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMN_INDEX_OFFSET_ISSET_ID, value);
  }

  /**
   * Size of ColumnChunk's ColumnIndex, in bytes *
   */
  public int getColumnIndexLength() {
    return this.column_index_length;
  }

  /**
   * Size of ColumnChunk's ColumnIndex, in bytes *
   */
  public ColumnChunk setColumnIndexLength(int column_index_length) {
    this.column_index_length = column_index_length;
    setColumnIndexLengthIsSet(true);
    return this;
  }

  public void unsetColumnIndexLength() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMN_INDEX_LENGTH_ISSET_ID);
  }

  /** Returns true if field column_index_length is set (has been assigned a value) and false otherwise */
  public boolean isSetColumnIndexLength() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMN_INDEX_LENGTH_ISSET_ID);
  }

  public void setColumnIndexLengthIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMN_INDEX_LENGTH_ISSET_ID, value);
  }

  /**
   * Crypto metadata of encrypted columns *
   */
  @org.apache.thrift.annotation.Nullable
  public ColumnCryptoMetaData getCryptoMetadata() {
    return this.crypto_metadata;
  }

  /**
   * Crypto metadata of encrypted columns *
   */
  public ColumnChunk setCryptoMetadata(@org.apache.thrift.annotation.Nullable ColumnCryptoMetaData crypto_metadata) {
    this.crypto_metadata = crypto_metadata;
    return this;
  }

  public void unsetCryptoMetadata() {
    this.crypto_metadata = null;
  }

  /** Returns true if field crypto_metadata is set (has been assigned a value) and false otherwise */
  public boolean isSetCryptoMetadata() {
    return this.crypto_metadata != null;
  }

  public void setCryptoMetadataIsSet(boolean value) {
    if (!value) {
      this.crypto_metadata = null;
    }
  }

  /**
   * Encrypted column metadata for this chunk *
   */
  public byte[] getEncryptedColumnMetadata() {
    setEncryptedColumnMetadata(org.apache.thrift.TBaseHelper.rightSize(encrypted_column_metadata));
    return encrypted_column_metadata == null ? null : encrypted_column_metadata.array();
  }

  public java.nio.ByteBuffer bufferForEncryptedColumnMetadata() {
    return org.apache.thrift.TBaseHelper.copyBinary(encrypted_column_metadata);
  }

  /**
   * Encrypted column metadata for this chunk *
   */
  public ColumnChunk setEncryptedColumnMetadata(byte[] encrypted_column_metadata) {
    this.encrypted_column_metadata = encrypted_column_metadata == null ? (java.nio.ByteBuffer)null   : java.nio.ByteBuffer.wrap(encrypted_column_metadata.clone());
    return this;
  }

  public ColumnChunk setEncryptedColumnMetadata(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer encrypted_column_metadata) {
    this.encrypted_column_metadata = org.apache.thrift.TBaseHelper.copyBinary(encrypted_column_metadata);
    return this;
  }

  public void unsetEncryptedColumnMetadata() {
    this.encrypted_column_metadata = null;
  }

  /** Returns true if field encrypted_column_metadata is set (has been assigned a value) and false otherwise */
  public boolean isSetEncryptedColumnMetadata() {
    return this.encrypted_column_metadata != null;
  }

  public void setEncryptedColumnMetadataIsSet(boolean value) {
    if (!value) {
      this.encrypted_column_metadata = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case FILE_PATH:
      if (value == null) {
        unsetFilePath();
      } else {
        setFilePath((java.lang.String)value);
      }
      break;

    case FILE_OFFSET:
      if (value == null) {
        unsetFileOffset();
      } else {
        setFileOffset((java.lang.Long)value);
      }
      break;

    case META_DATA:
      if (value == null) {
        unsetMetaData();
      } else {
        setMetaData((ColumnMetaData)value);
      }
      break;

    case OFFSET_INDEX_OFFSET:
      if (value == null) {
        unsetOffsetIndexOffset();
      } else {
        setOffsetIndexOffset((java.lang.Long)value);
      }
      break;

    case OFFSET_INDEX_LENGTH:
      if (value == null) {
        unsetOffsetIndexLength();
      } else {
        setOffsetIndexLength((java.lang.Integer)value);
      }
      break;

    case COLUMN_INDEX_OFFSET:
      if (value == null) {
        unsetColumnIndexOffset();
      } else {
        setColumnIndexOffset((java.lang.Long)value);
      }
      break;

    case COLUMN_INDEX_LENGTH:
      if (value == null) {
        unsetColumnIndexLength();
      } else {
        setColumnIndexLength((java.lang.Integer)value);
      }
      break;

    case CRYPTO_METADATA:
      if (value == null) {
        unsetCryptoMetadata();
      } else {
        setCryptoMetadata((ColumnCryptoMetaData)value);
      }
      break;

    case ENCRYPTED_COLUMN_METADATA:
      if (value == null) {
        unsetEncryptedColumnMetadata();
      } else {
        if (value instanceof byte[]) {
          setEncryptedColumnMetadata((byte[])value);
        } else {
          setEncryptedColumnMetadata((java.nio.ByteBuffer)value);
        }
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case FILE_PATH:
      return getFilePath();

    case FILE_OFFSET:
      return getFileOffset();

    case META_DATA:
      return getMetaData();

    case OFFSET_INDEX_OFFSET:
      return getOffsetIndexOffset();

    case OFFSET_INDEX_LENGTH:
      return getOffsetIndexLength();

    case COLUMN_INDEX_OFFSET:
      return getColumnIndexOffset();

    case COLUMN_INDEX_LENGTH:
      return getColumnIndexLength();

    case CRYPTO_METADATA:
      return getCryptoMetadata();

    case ENCRYPTED_COLUMN_METADATA:
      return getEncryptedColumnMetadata();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case FILE_PATH:
      return isSetFilePath();
    case FILE_OFFSET:
      return isSetFileOffset();
    case META_DATA:
      return isSetMetaData();
    case OFFSET_INDEX_OFFSET:
      return isSetOffsetIndexOffset();
    case OFFSET_INDEX_LENGTH:
      return isSetOffsetIndexLength();
    case COLUMN_INDEX_OFFSET:
      return isSetColumnIndexOffset();
    case COLUMN_INDEX_LENGTH:
      return isSetColumnIndexLength();
    case CRYPTO_METADATA:
      return isSetCryptoMetadata();
    case ENCRYPTED_COLUMN_METADATA:
      return isSetEncryptedColumnMetadata();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof ColumnChunk)
      return this.equals((ColumnChunk)that);
    return false;
  }

  public boolean equals(ColumnChunk that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_file_path = true && this.isSetFilePath();
    boolean that_present_file_path = true && that.isSetFilePath();
    if (this_present_file_path || that_present_file_path) {
      if (!(this_present_file_path && that_present_file_path))
        return false;
      if (!this.file_path.equals(that.file_path))
        return false;
    }

    boolean this_present_file_offset = true;
    boolean that_present_file_offset = true;
    if (this_present_file_offset || that_present_file_offset) {
      if (!(this_present_file_offset && that_present_file_offset))
        return false;
      if (this.file_offset != that.file_offset)
        return false;
    }

    boolean this_present_meta_data = true && this.isSetMetaData();
    boolean that_present_meta_data = true && that.isSetMetaData();
    if (this_present_meta_data || that_present_meta_data) {
      if (!(this_present_meta_data && that_present_meta_data))
        return false;
      if (!this.meta_data.equals(that.meta_data))
        return false;
    }

    boolean this_present_offset_index_offset = true && this.isSetOffsetIndexOffset();
    boolean that_present_offset_index_offset = true && that.isSetOffsetIndexOffset();
    if (this_present_offset_index_offset || that_present_offset_index_offset) {
      if (!(this_present_offset_index_offset && that_present_offset_index_offset))
        return false;
      if (this.offset_index_offset != that.offset_index_offset)
        return false;
    }

    boolean this_present_offset_index_length = true && this.isSetOffsetIndexLength();
    boolean that_present_offset_index_length = true && that.isSetOffsetIndexLength();
    if (this_present_offset_index_length || that_present_offset_index_length) {
      if (!(this_present_offset_index_length && that_present_offset_index_length))
        return false;
      if (this.offset_index_length != that.offset_index_length)
        return false;
    }

    boolean this_present_column_index_offset = true && this.isSetColumnIndexOffset();
    boolean that_present_column_index_offset = true && that.isSetColumnIndexOffset();
    if (this_present_column_index_offset || that_present_column_index_offset) {
      if (!(this_present_column_index_offset && that_present_column_index_offset))
        return false;
      if (this.column_index_offset != that.column_index_offset)
        return false;
    }

    boolean this_present_column_index_length = true && this.isSetColumnIndexLength();
    boolean that_present_column_index_length = true && that.isSetColumnIndexLength();
    if (this_present_column_index_length || that_present_column_index_length) {
      if (!(this_present_column_index_length && that_present_column_index_length))
        return false;
      if (this.column_index_length != that.column_index_length)
        return false;
    }

    boolean this_present_crypto_metadata = true && this.isSetCryptoMetadata();
    boolean that_present_crypto_metadata = true && that.isSetCryptoMetadata();
    if (this_present_crypto_metadata || that_present_crypto_metadata) {
      if (!(this_present_crypto_metadata && that_present_crypto_metadata))
        return false;
      if (!this.crypto_metadata.equals(that.crypto_metadata))
        return false;
    }

    boolean this_present_encrypted_column_metadata = true && this.isSetEncryptedColumnMetadata();
    boolean that_present_encrypted_column_metadata = true && that.isSetEncryptedColumnMetadata();
    if (this_present_encrypted_column_metadata || that_present_encrypted_column_metadata) {
      if (!(this_present_encrypted_column_metadata && that_present_encrypted_column_metadata))
        return false;
      if (!this.encrypted_column_metadata.equals(that.encrypted_column_metadata))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetFilePath()) ? 131071 : 524287);
    if (isSetFilePath())
      hashCode = hashCode * 8191 + file_path.hashCode();

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(file_offset);

    hashCode = hashCode * 8191 + ((isSetMetaData()) ? 131071 : 524287);
    if (isSetMetaData())
      hashCode = hashCode * 8191 + meta_data.hashCode();

    hashCode = hashCode * 8191 + ((isSetOffsetIndexOffset()) ? 131071 : 524287);
    if (isSetOffsetIndexOffset())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(offset_index_offset);

    hashCode = hashCode * 8191 + ((isSetOffsetIndexLength()) ? 131071 : 524287);
    if (isSetOffsetIndexLength())
      hashCode = hashCode * 8191 + offset_index_length;

    hashCode = hashCode * 8191 + ((isSetColumnIndexOffset()) ? 131071 : 524287);
    if (isSetColumnIndexOffset())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(column_index_offset);

    hashCode = hashCode * 8191 + ((isSetColumnIndexLength()) ? 131071 : 524287);
    if (isSetColumnIndexLength())
      hashCode = hashCode * 8191 + column_index_length;

    hashCode = hashCode * 8191 + ((isSetCryptoMetadata()) ? 131071 : 524287);
    if (isSetCryptoMetadata())
      hashCode = hashCode * 8191 + crypto_metadata.hashCode();

    hashCode = hashCode * 8191 + ((isSetEncryptedColumnMetadata()) ? 131071 : 524287);
    if (isSetEncryptedColumnMetadata())
      hashCode = hashCode * 8191 + encrypted_column_metadata.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(ColumnChunk other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetFilePath(), other.isSetFilePath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFilePath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file_path, other.file_path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetFileOffset(), other.isSetFileOffset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFileOffset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file_offset, other.file_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMetaData(), other.isSetMetaData());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetaData()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.meta_data, other.meta_data);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOffsetIndexOffset(), other.isSetOffsetIndexOffset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOffsetIndexOffset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset_index_offset, other.offset_index_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOffsetIndexLength(), other.isSetOffsetIndexLength());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOffsetIndexLength()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset_index_length, other.offset_index_length);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumnIndexOffset(), other.isSetColumnIndexOffset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnIndexOffset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_index_offset, other.column_index_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumnIndexLength(), other.isSetColumnIndexLength());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnIndexLength()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_index_length, other.column_index_length);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCryptoMetadata(), other.isSetCryptoMetadata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCryptoMetadata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.crypto_metadata, other.crypto_metadata);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetEncryptedColumnMetadata(), other.isSetEncryptedColumnMetadata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEncryptedColumnMetadata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encrypted_column_metadata, other.encrypted_column_metadata);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("ColumnChunk(");
    boolean first = true;

    if (isSetFilePath()) {
      sb.append("file_path:");
      if (this.file_path == null) {
        sb.append("null");
      } else {
        sb.append(this.file_path);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("file_offset:");
    sb.append(this.file_offset);
    first = false;
    if (isSetMetaData()) {
      if (!first) sb.append(", ");
      sb.append("meta_data:");
      if (this.meta_data == null) {
        sb.append("null");
      } else {
        sb.append(this.meta_data);
      }
      first = false;
    }
    if (isSetOffsetIndexOffset()) {
      if (!first) sb.append(", ");
      sb.append("offset_index_offset:");
      sb.append(this.offset_index_offset);
      first = false;
    }
    if (isSetOffsetIndexLength()) {
      if (!first) sb.append(", ");
      sb.append("offset_index_length:");
      sb.append(this.offset_index_length);
      first = false;
    }
    if (isSetColumnIndexOffset()) {
      if (!first) sb.append(", ");
      sb.append("column_index_offset:");
      sb.append(this.column_index_offset);
      first = false;
    }
    if (isSetColumnIndexLength()) {
      if (!first) sb.append(", ");
      sb.append("column_index_length:");
      sb.append(this.column_index_length);
      first = false;
    }
    if (isSetCryptoMetadata()) {
      if (!first) sb.append(", ");
      sb.append("crypto_metadata:");
      if (this.crypto_metadata == null) {
        sb.append("null");
      } else {
        sb.append(this.crypto_metadata);
      }
      first = false;
    }
    if (isSetEncryptedColumnMetadata()) {
      if (!first) sb.append(", ");
      sb.append("encrypted_column_metadata:");
      if (this.encrypted_column_metadata == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.encrypted_column_metadata, sb);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'file_offset' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
    if (meta_data != null) {
      meta_data.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class ColumnChunkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ColumnChunkStandardScheme getScheme() {
      return new ColumnChunkStandardScheme();
    }
  }

  private static class ColumnChunkStandardScheme extends org.apache.thrift.scheme.StandardScheme<ColumnChunk> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnChunk struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // FILE_PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.file_path = iprot.readString();
              struct.setFilePathIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FILE_OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.file_offset = iprot.readI64();
              struct.setFileOffsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // META_DATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.meta_data = new ColumnMetaData();
              struct.meta_data.read(iprot);
              struct.setMetaDataIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // OFFSET_INDEX_OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.offset_index_offset = iprot.readI64();
              struct.setOffsetIndexOffsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // OFFSET_INDEX_LENGTH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.offset_index_length = iprot.readI32();
              struct.setOffsetIndexLengthIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // COLUMN_INDEX_OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.column_index_offset = iprot.readI64();
              struct.setColumnIndexOffsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // COLUMN_INDEX_LENGTH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.column_index_length = iprot.readI32();
              struct.setColumnIndexLengthIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // CRYPTO_METADATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.crypto_metadata = new ColumnCryptoMetaData();
              struct.crypto_metadata.read(iprot);
              struct.setCryptoMetadataIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // ENCRYPTED_COLUMN_METADATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.encrypted_column_metadata = iprot.readBinary();
              struct.setEncryptedColumnMetadataIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetFileOffset()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'file_offset' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnChunk struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.file_path != null) {
        if (struct.isSetFilePath()) {
          oprot.writeFieldBegin(FILE_PATH_FIELD_DESC);
          oprot.writeString(struct.file_path);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldBegin(FILE_OFFSET_FIELD_DESC);
      oprot.writeI64(struct.file_offset);
      oprot.writeFieldEnd();
      if (struct.meta_data != null) {
        if (struct.isSetMetaData()) {
          oprot.writeFieldBegin(META_DATA_FIELD_DESC);
          struct.meta_data.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetOffsetIndexOffset()) {
        oprot.writeFieldBegin(OFFSET_INDEX_OFFSET_FIELD_DESC);
        oprot.writeI64(struct.offset_index_offset);
        oprot.writeFieldEnd();
      }
      if (struct.isSetOffsetIndexLength()) {
        oprot.writeFieldBegin(OFFSET_INDEX_LENGTH_FIELD_DESC);
        oprot.writeI32(struct.offset_index_length);
        oprot.writeFieldEnd();
      }
      if (struct.isSetColumnIndexOffset()) {
        oprot.writeFieldBegin(COLUMN_INDEX_OFFSET_FIELD_DESC);
        oprot.writeI64(struct.column_index_offset);
        oprot.writeFieldEnd();
      }
      if (struct.isSetColumnIndexLength()) {
        oprot.writeFieldBegin(COLUMN_INDEX_LENGTH_FIELD_DESC);
        oprot.writeI32(struct.column_index_length);
        oprot.writeFieldEnd();
      }
      if (struct.crypto_metadata != null) {
        if (struct.isSetCryptoMetadata()) {
          oprot.writeFieldBegin(CRYPTO_METADATA_FIELD_DESC);
          struct.crypto_metadata.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.encrypted_column_metadata != null) {
        if (struct.isSetEncryptedColumnMetadata()) {
          oprot.writeFieldBegin(ENCRYPTED_COLUMN_METADATA_FIELD_DESC);
          oprot.writeBinary(struct.encrypted_column_metadata);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ColumnChunkTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ColumnChunkTupleScheme getScheme() {
      return new ColumnChunkTupleScheme();
    }
  }

  private static class ColumnChunkTupleScheme extends org.apache.thrift.scheme.TupleScheme<ColumnChunk> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ColumnChunk struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.file_offset);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetFilePath()) {
        optionals.set(0);
      }
      if (struct.isSetMetaData()) {
        optionals.set(1);
      }
      if (struct.isSetOffsetIndexOffset()) {
        optionals.set(2);
      }
      if (struct.isSetOffsetIndexLength()) {
        optionals.set(3);
      }
      if (struct.isSetColumnIndexOffset()) {
        optionals.set(4);
      }
      if (struct.isSetColumnIndexLength()) {
        optionals.set(5);
      }
      if (struct.isSetCryptoMetadata()) {
        optionals.set(6);
      }
      if (struct.isSetEncryptedColumnMetadata()) {
        optionals.set(7);
      }
      oprot.writeBitSet(optionals, 8);
      if (struct.isSetFilePath()) {
        oprot.writeString(struct.file_path);
      }
      if (struct.isSetMetaData()) {
        struct.meta_data.write(oprot);
      }
      if (struct.isSetOffsetIndexOffset()) {
        oprot.writeI64(struct.offset_index_offset);
      }
      if (struct.isSetOffsetIndexLength()) {
        oprot.writeI32(struct.offset_index_length);
      }
      if (struct.isSetColumnIndexOffset()) {
        oprot.writeI64(struct.column_index_offset);
      }
      if (struct.isSetColumnIndexLength()) {
        oprot.writeI32(struct.column_index_length);
      }
      if (struct.isSetCryptoMetadata()) {
        struct.crypto_metadata.write(oprot);
      }
      if (struct.isSetEncryptedColumnMetadata()) {
        oprot.writeBinary(struct.encrypted_column_metadata);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ColumnChunk struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.file_offset = iprot.readI64();
      struct.setFileOffsetIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(8);
      if (incoming.get(0)) {
        struct.file_path = iprot.readString();
        struct.setFilePathIsSet(true);
      }
      if (incoming.get(1)) {
        struct.meta_data = new ColumnMetaData();
        struct.meta_data.read(iprot);
        struct.setMetaDataIsSet(true);
      }
      if (incoming.get(2)) {
        struct.offset_index_offset = iprot.readI64();
        struct.setOffsetIndexOffsetIsSet(true);
      }
      if (incoming.get(3)) {
        struct.offset_index_length = iprot.readI32();
        struct.setOffsetIndexLengthIsSet(true);
      }
      if (incoming.get(4)) {
        struct.column_index_offset = iprot.readI64();
        struct.setColumnIndexOffsetIsSet(true);
      }
      if (incoming.get(5)) {
        struct.column_index_length = iprot.readI32();
        struct.setColumnIndexLengthIsSet(true);
      }
      if (incoming.get(6)) {
        struct.crypto_metadata = new ColumnCryptoMetaData();
        struct.crypto_metadata.read(iprot);
        struct.setCryptoMetadataIsSet(true);
      }
      if (incoming.get(7)) {
        struct.encrypted_column_metadata = iprot.readBinary();
        struct.setEncryptedColumnMetadataIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}