org.apache.parquet.format.ColumnChunk Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parquet-format Show documentation
Show all versions of parquet-format Show documentation
Parquet is a columnar storage format that supports nested data. This provides all generated metadata code.
/**
* 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