All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.parquet.format.ColumnChunk Maven / Gradle / Ivy

Go to download

Parquet is a columnar storage format that supports nested data. This provides all generated metadata code.

There is a newer version: 2.10.0
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.parquet.format;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-10-17")
public class ColumnChunk implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new ColumnChunkStandardSchemeFactory());
    schemes.put(TupleScheme.class, 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 String file_path; // optional
  /**
   * Byte offset in file_path to the ColumnMetaData *
   */
  public long file_offset; // required
  /**
   * Column metadata for this chunk. This is the same content as what is at
   * file_path/file_offset.  Having it here has it replicated in the file
   * metadata.
   * 
   */
  public 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

  /** 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"),
    /**
     * Byte offset in file_path to the ColumnMetaData *
     */
    FILE_OFFSET((short)2, "file_offset"),
    /**
     * Column metadata for this chunk. This is the same content as what is at
     * file_path/file_offset.  Having it here has it replicated in the file
     * metadata.
     * 
     */
    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");

    private static final Map byName = new HashMap();

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    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;
        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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public 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};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnChunk.class, metaDataMap);
  }

  public ColumnChunk() {
  }

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

  /**
   * Performs a deep copy on other.
   */
  public ColumnChunk(ColumnChunk other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetFile_path()) {
      this.file_path = other.file_path;
    }
    this.file_offset = other.file_offset;
    if (other.isSetMeta_data()) {
      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;
  }

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

  @Override
  public void clear() {
    this.file_path = null;
    setFile_offsetIsSet(false);
    this.file_offset = 0;
    this.meta_data = null;
    setOffset_index_offsetIsSet(false);
    this.offset_index_offset = 0;
    setOffset_index_lengthIsSet(false);
    this.offset_index_length = 0;
    setColumn_index_offsetIsSet(false);
    this.column_index_offset = 0;
    setColumn_index_lengthIsSet(false);
    this.column_index_length = 0;
  }

  /**
   * 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 String getFile_path() {
    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 setFile_path(String file_path) {
    this.file_path = file_path;
    return this;
  }

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

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

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

  /**
   * Byte offset in file_path to the ColumnMetaData *
   */
  public long getFile_offset() {
    return this.file_offset;
  }

  /**
   * Byte offset in file_path to the ColumnMetaData *
   */
  public ColumnChunk setFile_offset(long file_offset) {
    this.file_offset = file_offset;
    setFile_offsetIsSet(true);
    return this;
  }

  public void unsetFile_offset() {
    __isset_bitfield = 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 isSetFile_offset() {
    return EncodingUtils.testBit(__isset_bitfield, __FILE_OFFSET_ISSET_ID);
  }

  public void setFile_offsetIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILE_OFFSET_ISSET_ID, value);
  }

  /**
   * Column metadata for this chunk. This is the same content as what is at
   * file_path/file_offset.  Having it here has it replicated in the file
   * metadata.
   * 
   */
  public ColumnMetaData getMeta_data() {
    return this.meta_data;
  }

  /**
   * Column metadata for this chunk. This is the same content as what is at
   * file_path/file_offset.  Having it here has it replicated in the file
   * metadata.
   * 
   */
  public ColumnChunk setMeta_data(ColumnMetaData meta_data) {
    this.meta_data = meta_data;
    return this;
  }

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

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

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

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

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

  public void unsetOffset_index_offset() {
    __isset_bitfield = 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 isSetOffset_index_offset() {
    return EncodingUtils.testBit(__isset_bitfield, __OFFSET_INDEX_OFFSET_ISSET_ID);
  }

  public void setOffset_index_offsetIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_INDEX_OFFSET_ISSET_ID, value);
  }

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

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

  public void unsetOffset_index_length() {
    __isset_bitfield = 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 isSetOffset_index_length() {
    return EncodingUtils.testBit(__isset_bitfield, __OFFSET_INDEX_LENGTH_ISSET_ID);
  }

  public void setOffset_index_lengthIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_INDEX_LENGTH_ISSET_ID, value);
  }

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

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

  public void unsetColumn_index_offset() {
    __isset_bitfield = 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 isSetColumn_index_offset() {
    return EncodingUtils.testBit(__isset_bitfield, __COLUMN_INDEX_OFFSET_ISSET_ID);
  }

  public void setColumn_index_offsetIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMN_INDEX_OFFSET_ISSET_ID, value);
  }

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

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

  public void unsetColumn_index_length() {
    __isset_bitfield = 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 isSetColumn_index_length() {
    return EncodingUtils.testBit(__isset_bitfield, __COLUMN_INDEX_LENGTH_ISSET_ID);
  }

  public void setColumn_index_lengthIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMN_INDEX_LENGTH_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case FILE_PATH:
      if (value == null) {
        unsetFile_path();
      } else {
        setFile_path((String)value);
      }
      break;

    case FILE_OFFSET:
      if (value == null) {
        unsetFile_offset();
      } else {
        setFile_offset((Long)value);
      }
      break;

    case META_DATA:
      if (value == null) {
        unsetMeta_data();
      } else {
        setMeta_data((ColumnMetaData)value);
      }
      break;

    case OFFSET_INDEX_OFFSET:
      if (value == null) {
        unsetOffset_index_offset();
      } else {
        setOffset_index_offset((Long)value);
      }
      break;

    case OFFSET_INDEX_LENGTH:
      if (value == null) {
        unsetOffset_index_length();
      } else {
        setOffset_index_length((Integer)value);
      }
      break;

    case COLUMN_INDEX_OFFSET:
      if (value == null) {
        unsetColumn_index_offset();
      } else {
        setColumn_index_offset((Long)value);
      }
      break;

    case COLUMN_INDEX_LENGTH:
      if (value == null) {
        unsetColumn_index_length();
      } else {
        setColumn_index_length((Integer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case FILE_PATH:
      return getFile_path();

    case FILE_OFFSET:
      return getFile_offset();

    case META_DATA:
      return getMeta_data();

    case OFFSET_INDEX_OFFSET:
      return getOffset_index_offset();

    case OFFSET_INDEX_LENGTH:
      return getOffset_index_length();

    case COLUMN_INDEX_OFFSET:
      return getColumn_index_offset();

    case COLUMN_INDEX_LENGTH:
      return getColumn_index_length();

    }
    throw new 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 IllegalArgumentException();
    }

    switch (field) {
    case FILE_PATH:
      return isSetFile_path();
    case FILE_OFFSET:
      return isSetFile_offset();
    case META_DATA:
      return isSetMeta_data();
    case OFFSET_INDEX_OFFSET:
      return isSetOffset_index_offset();
    case OFFSET_INDEX_LENGTH:
      return isSetOffset_index_length();
    case COLUMN_INDEX_OFFSET:
      return isSetColumn_index_offset();
    case COLUMN_INDEX_LENGTH:
      return isSetColumn_index_length();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_file_path = true && this.isSetFile_path();
    boolean that_present_file_path = true && that.isSetFile_path();
    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.isSetMeta_data();
    boolean that_present_meta_data = true && that.isSetMeta_data();
    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.isSetOffset_index_offset();
    boolean that_present_offset_index_offset = true && that.isSetOffset_index_offset();
    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.isSetOffset_index_length();
    boolean that_present_offset_index_length = true && that.isSetOffset_index_length();
    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.isSetColumn_index_offset();
    boolean that_present_column_index_offset = true && that.isSetColumn_index_offset();
    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.isSetColumn_index_length();
    boolean that_present_column_index_length = true && that.isSetColumn_index_length();
    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;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_file_path = true && (isSetFile_path());
    list.add(present_file_path);
    if (present_file_path)
      list.add(file_path);

    boolean present_file_offset = true;
    list.add(present_file_offset);
    if (present_file_offset)
      list.add(file_offset);

    boolean present_meta_data = true && (isSetMeta_data());
    list.add(present_meta_data);
    if (present_meta_data)
      list.add(meta_data);

    boolean present_offset_index_offset = true && (isSetOffset_index_offset());
    list.add(present_offset_index_offset);
    if (present_offset_index_offset)
      list.add(offset_index_offset);

    boolean present_offset_index_length = true && (isSetOffset_index_length());
    list.add(present_offset_index_length);
    if (present_offset_index_length)
      list.add(offset_index_length);

    boolean present_column_index_offset = true && (isSetColumn_index_offset());
    list.add(present_column_index_offset);
    if (present_column_index_offset)
      list.add(column_index_offset);

    boolean present_column_index_length = true && (isSetColumn_index_length());
    list.add(present_column_index_length);
    if (present_column_index_length)
      list.add(column_index_length);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetFile_path()).compareTo(other.isSetFile_path());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFile_path()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file_path, other.file_path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFile_offset()).compareTo(other.isSetFile_offset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFile_offset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file_offset, other.file_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMeta_data()).compareTo(other.isSetMeta_data());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMeta_data()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.meta_data, other.meta_data);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOffset_index_offset()).compareTo(other.isSetOffset_index_offset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOffset_index_offset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset_index_offset, other.offset_index_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOffset_index_length()).compareTo(other.isSetOffset_index_length());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOffset_index_length()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset_index_length, other.offset_index_length);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColumn_index_offset()).compareTo(other.isSetColumn_index_offset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumn_index_offset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_index_offset, other.column_index_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColumn_index_length()).compareTo(other.isSetColumn_index_length());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumn_index_length()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_index_length, other.column_index_length);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

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

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

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

    if (isSetFile_path()) {
      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 (isSetMeta_data()) {
      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 (isSetOffset_index_offset()) {
      if (!first) sb.append(", ");
      sb.append("offset_index_offset:");
      sb.append(this.offset_index_offset);
      first = false;
    }
    if (isSetOffset_index_length()) {
      if (!first) sb.append(", ");
      sb.append("offset_index_length:");
      sb.append(this.offset_index_length);
      first = false;
    }
    if (isSetColumn_index_offset()) {
      if (!first) sb.append(", ");
      sb.append("column_index_offset:");
      sb.append(this.column_index_offset);
      first = false;
    }
    if (isSetColumn_index_length()) {
      if (!first) sb.append(", ");
      sb.append("column_index_length:");
      sb.append(this.column_index_length);
      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, 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 SchemeFactory {
    public ColumnChunkStandardScheme getScheme() {
      return new ColumnChunkStandardScheme();
    }
  }

  private static class ColumnChunkStandardScheme extends StandardScheme {

    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.setFile_pathIsSet(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.setFile_offsetIsSet(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.setMeta_dataIsSet(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.setOffset_index_offsetIsSet(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.setOffset_index_lengthIsSet(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.setColumn_index_offsetIsSet(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.setColumn_index_lengthIsSet(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.isSetFile_offset()) {
        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.isSetFile_path()) {
          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.isSetMeta_data()) {
          oprot.writeFieldBegin(META_DATA_FIELD_DESC);
          struct.meta_data.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetOffset_index_offset()) {
        oprot.writeFieldBegin(OFFSET_INDEX_OFFSET_FIELD_DESC);
        oprot.writeI64(struct.offset_index_offset);
        oprot.writeFieldEnd();
      }
      if (struct.isSetOffset_index_length()) {
        oprot.writeFieldBegin(OFFSET_INDEX_LENGTH_FIELD_DESC);
        oprot.writeI32(struct.offset_index_length);
        oprot.writeFieldEnd();
      }
      if (struct.isSetColumn_index_offset()) {
        oprot.writeFieldBegin(COLUMN_INDEX_OFFSET_FIELD_DESC);
        oprot.writeI64(struct.column_index_offset);
        oprot.writeFieldEnd();
      }
      if (struct.isSetColumn_index_length()) {
        oprot.writeFieldBegin(COLUMN_INDEX_LENGTH_FIELD_DESC);
        oprot.writeI32(struct.column_index_length);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ColumnChunkTupleSchemeFactory implements SchemeFactory {
    public ColumnChunkTupleScheme getScheme() {
      return new ColumnChunkTupleScheme();
    }
  }

  private static class ColumnChunkTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ColumnChunk struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeI64(struct.file_offset);
      BitSet optionals = new BitSet();
      if (struct.isSetFile_path()) {
        optionals.set(0);
      }
      if (struct.isSetMeta_data()) {
        optionals.set(1);
      }
      if (struct.isSetOffset_index_offset()) {
        optionals.set(2);
      }
      if (struct.isSetOffset_index_length()) {
        optionals.set(3);
      }
      if (struct.isSetColumn_index_offset()) {
        optionals.set(4);
      }
      if (struct.isSetColumn_index_length()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetFile_path()) {
        oprot.writeString(struct.file_path);
      }
      if (struct.isSetMeta_data()) {
        struct.meta_data.write(oprot);
      }
      if (struct.isSetOffset_index_offset()) {
        oprot.writeI64(struct.offset_index_offset);
      }
      if (struct.isSetOffset_index_length()) {
        oprot.writeI32(struct.offset_index_length);
      }
      if (struct.isSetColumn_index_offset()) {
        oprot.writeI64(struct.column_index_offset);
      }
      if (struct.isSetColumn_index_length()) {
        oprot.writeI32(struct.column_index_length);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ColumnChunk struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.file_offset = iprot.readI64();
      struct.setFile_offsetIsSet(true);
      BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.file_path = iprot.readString();
        struct.setFile_pathIsSet(true);
      }
      if (incoming.get(1)) {
        struct.meta_data = new ColumnMetaData();
        struct.meta_data.read(iprot);
        struct.setMeta_dataIsSet(true);
      }
      if (incoming.get(2)) {
        struct.offset_index_offset = iprot.readI64();
        struct.setOffset_index_offsetIsSet(true);
      }
      if (incoming.get(3)) {
        struct.offset_index_length = iprot.readI32();
        struct.setOffset_index_lengthIsSet(true);
      }
      if (incoming.get(4)) {
        struct.column_index_offset = iprot.readI64();
        struct.setColumn_index_offsetIsSet(true);
      }
      if (incoming.get(5)) {
        struct.column_index_length = iprot.readI32();
        struct.setColumn_index_lengthIsSet(true);
      }
    }
  }

}