Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.apache.parquet.format.ColumnChunk Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.12.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.12.0)", date = "2020-07-29")
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 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
/**
* 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 @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"),
/**
* 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"),
/**
* 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 byName = new java.util.HashMap();
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() {
}
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;
if (other.isSetCrypto_metadata()) {
this.crypto_metadata = new ColumnCryptoMetaData(other.crypto_metadata);
}
if (other.isSetEncrypted_column_metadata()) {
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;
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;
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 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(@org.apache.thrift.annotation.Nullable java.lang.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 = 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 isSetFile_offset() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FILE_OFFSET_ISSET_ID);
}
public void setFile_offsetIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.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.
*
*/
@org.apache.thrift.annotation.Nullable
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(@org.apache.thrift.annotation.Nullable 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 = 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 isSetOffset_index_offset() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OFFSET_INDEX_OFFSET_ISSET_ID);
}
public void setOffset_index_offsetIsSet(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 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 = 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 isSetOffset_index_length() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OFFSET_INDEX_LENGTH_ISSET_ID);
}
public void setOffset_index_lengthIsSet(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 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 = 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 isSetColumn_index_offset() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMN_INDEX_OFFSET_ISSET_ID);
}
public void setColumn_index_offsetIsSet(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 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 = 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 isSetColumn_index_length() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMN_INDEX_LENGTH_ISSET_ID);
}
public void setColumn_index_lengthIsSet(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 getCrypto_metadata() {
return this.crypto_metadata;
}
/**
* Crypto metadata of encrypted columns *
*/
public ColumnChunk setCrypto_metadata(@org.apache.thrift.annotation.Nullable ColumnCryptoMetaData crypto_metadata) {
this.crypto_metadata = crypto_metadata;
return this;
}
public void unsetCrypto_metadata() {
this.crypto_metadata = null;
}
/** Returns true if field crypto_metadata is set (has been assigned a value) and false otherwise */
public boolean isSetCrypto_metadata() {
return this.crypto_metadata != null;
}
public void setCrypto_metadataIsSet(boolean value) {
if (!value) {
this.crypto_metadata = null;
}
}
/**
* Encrypted column metadata for this chunk *
*/
public byte[] getEncrypted_column_metadata() {
setEncrypted_column_metadata(org.apache.thrift.TBaseHelper.rightSize(encrypted_column_metadata));
return encrypted_column_metadata == null ? null : encrypted_column_metadata.array();
}
public java.nio.ByteBuffer bufferForEncrypted_column_metadata() {
return org.apache.thrift.TBaseHelper.copyBinary(encrypted_column_metadata);
}
/**
* Encrypted column metadata for this chunk *
*/
public ColumnChunk setEncrypted_column_metadata(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 setEncrypted_column_metadata(@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 unsetEncrypted_column_metadata() {
this.encrypted_column_metadata = null;
}
/** Returns true if field encrypted_column_metadata is set (has been assigned a value) and false otherwise */
public boolean isSetEncrypted_column_metadata() {
return this.encrypted_column_metadata != null;
}
public void setEncrypted_column_metadataIsSet(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) {
unsetFile_path();
} else {
setFile_path((java.lang.String)value);
}
break;
case FILE_OFFSET:
if (value == null) {
unsetFile_offset();
} else {
setFile_offset((java.lang.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((java.lang.Long)value);
}
break;
case OFFSET_INDEX_LENGTH:
if (value == null) {
unsetOffset_index_length();
} else {
setOffset_index_length((java.lang.Integer)value);
}
break;
case COLUMN_INDEX_OFFSET:
if (value == null) {
unsetColumn_index_offset();
} else {
setColumn_index_offset((java.lang.Long)value);
}
break;
case COLUMN_INDEX_LENGTH:
if (value == null) {
unsetColumn_index_length();
} else {
setColumn_index_length((java.lang.Integer)value);
}
break;
case CRYPTO_METADATA:
if (value == null) {
unsetCrypto_metadata();
} else {
setCrypto_metadata((ColumnCryptoMetaData)value);
}
break;
case ENCRYPTED_COLUMN_METADATA:
if (value == null) {
unsetEncrypted_column_metadata();
} else {
if (value instanceof byte[]) {
setEncrypted_column_metadata((byte[])value);
} else {
setEncrypted_column_metadata((java.nio.ByteBuffer)value);
}
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.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();
case CRYPTO_METADATA:
return getCrypto_metadata();
case ENCRYPTED_COLUMN_METADATA:
return getEncrypted_column_metadata();
}
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 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();
case CRYPTO_METADATA:
return isSetCrypto_metadata();
case ENCRYPTED_COLUMN_METADATA:
return isSetEncrypted_column_metadata();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.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;
if (this == that)
return true;
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;
}
boolean this_present_crypto_metadata = true && this.isSetCrypto_metadata();
boolean that_present_crypto_metadata = true && that.isSetCrypto_metadata();
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.isSetEncrypted_column_metadata();
boolean that_present_encrypted_column_metadata = true && that.isSetEncrypted_column_metadata();
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 + ((isSetFile_path()) ? 131071 : 524287);
if (isSetFile_path())
hashCode = hashCode * 8191 + file_path.hashCode();
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(file_offset);
hashCode = hashCode * 8191 + ((isSetMeta_data()) ? 131071 : 524287);
if (isSetMeta_data())
hashCode = hashCode * 8191 + meta_data.hashCode();
hashCode = hashCode * 8191 + ((isSetOffset_index_offset()) ? 131071 : 524287);
if (isSetOffset_index_offset())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(offset_index_offset);
hashCode = hashCode * 8191 + ((isSetOffset_index_length()) ? 131071 : 524287);
if (isSetOffset_index_length())
hashCode = hashCode * 8191 + offset_index_length;
hashCode = hashCode * 8191 + ((isSetColumn_index_offset()) ? 131071 : 524287);
if (isSetColumn_index_offset())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(column_index_offset);
hashCode = hashCode * 8191 + ((isSetColumn_index_length()) ? 131071 : 524287);
if (isSetColumn_index_length())
hashCode = hashCode * 8191 + column_index_length;
hashCode = hashCode * 8191 + ((isSetCrypto_metadata()) ? 131071 : 524287);
if (isSetCrypto_metadata())
hashCode = hashCode * 8191 + crypto_metadata.hashCode();
hashCode = hashCode * 8191 + ((isSetEncrypted_column_metadata()) ? 131071 : 524287);
if (isSetEncrypted_column_metadata())
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.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 = java.lang.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 = java.lang.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 = java.lang.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 = java.lang.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 = java.lang.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 = java.lang.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;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetCrypto_metadata()).compareTo(other.isSetCrypto_metadata());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCrypto_metadata()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.crypto_metadata, other.crypto_metadata);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetEncrypted_column_metadata()).compareTo(other.isSetEncrypted_column_metadata());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEncrypted_column_metadata()) {
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 (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;
}
if (isSetCrypto_metadata()) {
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 (isSetEncrypted_column_metadata()) {
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 {
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;
case 8: // CRYPTO_METADATA
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.crypto_metadata = new ColumnCryptoMetaData();
struct.crypto_metadata.read(iprot);
struct.setCrypto_metadataIsSet(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.setEncrypted_column_metadataIsSet(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();
}
if (struct.crypto_metadata != null) {
if (struct.isSetCrypto_metadata()) {
oprot.writeFieldBegin(CRYPTO_METADATA_FIELD_DESC);
struct.crypto_metadata.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.encrypted_column_metadata != null) {
if (struct.isSetEncrypted_column_metadata()) {
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 {
@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.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);
}
if (struct.isSetCrypto_metadata()) {
optionals.set(6);
}
if (struct.isSetEncrypted_column_metadata()) {
optionals.set(7);
}
oprot.writeBitSet(optionals, 8);
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);
}
if (struct.isSetCrypto_metadata()) {
struct.crypto_metadata.write(oprot);
}
if (struct.isSetEncrypted_column_metadata()) {
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.setFile_offsetIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(8);
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);
}
if (incoming.get(6)) {
struct.crypto_metadata = new ColumnCryptoMetaData();
struct.crypto_metadata.read(iprot);
struct.setCrypto_metadataIsSet(true);
}
if (incoming.get(7)) {
struct.encrypted_column_metadata = iprot.readBinary();
struct.setEncrypted_column_metadataIsSet(true);
}
}
}
private static 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();
}
}