com.databricks.jdbc.model.client.thrift.generated.TSparkArrowResultLink Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.19.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package com.databricks.jdbc.model.client.thrift.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(
value = "Autogenerated by Thrift Compiler (0.19.0)",
date = "2024-10-09")
public class TSparkArrowResultLink
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("TSparkArrowResultLink");
private static final org.apache.thrift.protocol.TField FILE_LINK_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"fileLink", org.apache.thrift.protocol.TType.STRING, (short) 1);
private static final org.apache.thrift.protocol.TField EXPIRY_TIME_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"expiryTime", org.apache.thrift.protocol.TType.I64, (short) 2);
private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"startRowOffset", org.apache.thrift.protocol.TType.I64, (short) 3);
private static final org.apache.thrift.protocol.TField ROW_COUNT_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"rowCount", org.apache.thrift.protocol.TType.I64, (short) 4);
private static final org.apache.thrift.protocol.TField BYTES_NUM_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"bytesNum", org.apache.thrift.protocol.TType.I64, (short) 5);
private static final org.apache.thrift.protocol.TField HTTP_HEADERS_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"httpHeaders", org.apache.thrift.protocol.TType.MAP, (short) 6);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
new TSparkArrowResultLinkStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
new TSparkArrowResultLinkTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String fileLink; // required
public long expiryTime; // required
public long startRowOffset; // required
public long rowCount; // required
public long bytesNum; // required
public @org.apache.thrift.annotation.Nullable java.util.Map
httpHeaders; // 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_LINK((short) 1, "fileLink"),
EXPIRY_TIME((short) 2, "expiryTime"),
START_ROW_OFFSET((short) 3, "startRowOffset"),
ROW_COUNT((short) 4, "rowCount"),
BYTES_NUM((short) 5, "bytesNum"),
HTTP_HEADERS((short) 6, "httpHeaders");
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_LINK
return FILE_LINK;
case 2: // EXPIRY_TIME
return EXPIRY_TIME;
case 3: // START_ROW_OFFSET
return START_ROW_OFFSET;
case 4: // ROW_COUNT
return ROW_COUNT;
case 5: // BYTES_NUM
return BYTES_NUM;
case 6: // HTTP_HEADERS
return HTTP_HEADERS;
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;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __EXPIRYTIME_ISSET_ID = 0;
private static final int __STARTROWOFFSET_ISSET_ID = 1;
private static final int __ROWCOUNT_ISSET_ID = 2;
private static final int __BYTESNUM_ISSET_ID = 3;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.HTTP_HEADERS};
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_LINK,
new org.apache.thrift.meta_data.FieldMetaData(
"fileLink",
org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(
_Fields.EXPIRY_TIME,
new org.apache.thrift.meta_data.FieldMetaData(
"expiryTime",
org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.I64)));
tmpMap.put(
_Fields.START_ROW_OFFSET,
new org.apache.thrift.meta_data.FieldMetaData(
"startRowOffset",
org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.I64)));
tmpMap.put(
_Fields.ROW_COUNT,
new org.apache.thrift.meta_data.FieldMetaData(
"rowCount",
org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.I64)));
tmpMap.put(
_Fields.BYTES_NUM,
new org.apache.thrift.meta_data.FieldMetaData(
"bytesNum",
org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.I64)));
tmpMap.put(
_Fields.HTTP_HEADERS,
new org.apache.thrift.meta_data.FieldMetaData(
"httpHeaders",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(
org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(
TSparkArrowResultLink.class, metaDataMap);
}
public TSparkArrowResultLink() {}
public TSparkArrowResultLink(
java.lang.String fileLink,
long expiryTime,
long startRowOffset,
long rowCount,
long bytesNum) {
this();
this.fileLink = fileLink;
this.expiryTime = expiryTime;
setExpiryTimeIsSet(true);
this.startRowOffset = startRowOffset;
setStartRowOffsetIsSet(true);
this.rowCount = rowCount;
setRowCountIsSet(true);
this.bytesNum = bytesNum;
setBytesNumIsSet(true);
}
/** Performs a deep copy on other. */
public TSparkArrowResultLink(TSparkArrowResultLink other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetFileLink()) {
this.fileLink = other.fileLink;
}
this.expiryTime = other.expiryTime;
this.startRowOffset = other.startRowOffset;
this.rowCount = other.rowCount;
this.bytesNum = other.bytesNum;
if (other.isSetHttpHeaders()) {
java.util.Map __this__httpHeaders =
new java.util.HashMap(other.httpHeaders);
this.httpHeaders = __this__httpHeaders;
}
}
@Override
public TSparkArrowResultLink deepCopy() {
return new TSparkArrowResultLink(this);
}
@Override
public void clear() {
this.fileLink = null;
setExpiryTimeIsSet(false);
this.expiryTime = 0;
setStartRowOffsetIsSet(false);
this.startRowOffset = 0;
setRowCountIsSet(false);
this.rowCount = 0;
setBytesNumIsSet(false);
this.bytesNum = 0;
this.httpHeaders = null;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getFileLink() {
return this.fileLink;
}
public TSparkArrowResultLink setFileLink(
@org.apache.thrift.annotation.Nullable java.lang.String fileLink) {
this.fileLink = fileLink;
return this;
}
public void unsetFileLink() {
this.fileLink = null;
}
/** Returns true if field fileLink is set (has been assigned a value) and false otherwise */
public boolean isSetFileLink() {
return this.fileLink != null;
}
public void setFileLinkIsSet(boolean value) {
if (!value) {
this.fileLink = null;
}
}
public long getExpiryTime() {
return this.expiryTime;
}
public TSparkArrowResultLink setExpiryTime(long expiryTime) {
this.expiryTime = expiryTime;
setExpiryTimeIsSet(true);
return this;
}
public void unsetExpiryTime() {
__isset_bitfield =
org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXPIRYTIME_ISSET_ID);
}
/** Returns true if field expiryTime is set (has been assigned a value) and false otherwise */
public boolean isSetExpiryTime() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXPIRYTIME_ISSET_ID);
}
public void setExpiryTimeIsSet(boolean value) {
__isset_bitfield =
org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXPIRYTIME_ISSET_ID, value);
}
public long getStartRowOffset() {
return this.startRowOffset;
}
public TSparkArrowResultLink setStartRowOffset(long startRowOffset) {
this.startRowOffset = startRowOffset;
setStartRowOffsetIsSet(true);
return this;
}
public void unsetStartRowOffset() {
__isset_bitfield =
org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID);
}
/** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */
public boolean isSetStartRowOffset() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID);
}
public void setStartRowOffsetIsSet(boolean value) {
__isset_bitfield =
org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value);
}
public long getRowCount() {
return this.rowCount;
}
public TSparkArrowResultLink setRowCount(long rowCount) {
this.rowCount = rowCount;
setRowCountIsSet(true);
return this;
}
public void unsetRowCount() {
__isset_bitfield =
org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ROWCOUNT_ISSET_ID);
}
/** Returns true if field rowCount is set (has been assigned a value) and false otherwise */
public boolean isSetRowCount() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ROWCOUNT_ISSET_ID);
}
public void setRowCountIsSet(boolean value) {
__isset_bitfield =
org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ROWCOUNT_ISSET_ID, value);
}
public long getBytesNum() {
return this.bytesNum;
}
public TSparkArrowResultLink setBytesNum(long bytesNum) {
this.bytesNum = bytesNum;
setBytesNumIsSet(true);
return this;
}
public void unsetBytesNum() {
__isset_bitfield =
org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BYTESNUM_ISSET_ID);
}
/** Returns true if field bytesNum is set (has been assigned a value) and false otherwise */
public boolean isSetBytesNum() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BYTESNUM_ISSET_ID);
}
public void setBytesNumIsSet(boolean value) {
__isset_bitfield =
org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BYTESNUM_ISSET_ID, value);
}
public int getHttpHeadersSize() {
return (this.httpHeaders == null) ? 0 : this.httpHeaders.size();
}
public void putToHttpHeaders(java.lang.String key, java.lang.String val) {
if (this.httpHeaders == null) {
this.httpHeaders = new java.util.HashMap();
}
this.httpHeaders.put(key, val);
}
@org.apache.thrift.annotation.Nullable
public java.util.Map getHttpHeaders() {
return this.httpHeaders;
}
public TSparkArrowResultLink setHttpHeaders(
@org.apache.thrift.annotation.Nullable
java.util.Map httpHeaders) {
this.httpHeaders = httpHeaders;
return this;
}
public void unsetHttpHeaders() {
this.httpHeaders = null;
}
/** Returns true if field httpHeaders is set (has been assigned a value) and false otherwise */
public boolean isSetHttpHeaders() {
return this.httpHeaders != null;
}
public void setHttpHeadersIsSet(boolean value) {
if (!value) {
this.httpHeaders = null;
}
}
@Override
public void setFieldValue(
_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case FILE_LINK:
if (value == null) {
unsetFileLink();
} else {
setFileLink((java.lang.String) value);
}
break;
case EXPIRY_TIME:
if (value == null) {
unsetExpiryTime();
} else {
setExpiryTime((java.lang.Long) value);
}
break;
case START_ROW_OFFSET:
if (value == null) {
unsetStartRowOffset();
} else {
setStartRowOffset((java.lang.Long) value);
}
break;
case ROW_COUNT:
if (value == null) {
unsetRowCount();
} else {
setRowCount((java.lang.Long) value);
}
break;
case BYTES_NUM:
if (value == null) {
unsetBytesNum();
} else {
setBytesNum((java.lang.Long) value);
}
break;
case HTTP_HEADERS:
if (value == null) {
unsetHttpHeaders();
} else {
setHttpHeaders((java.util.Map) value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case FILE_LINK:
return getFileLink();
case EXPIRY_TIME:
return getExpiryTime();
case START_ROW_OFFSET:
return getStartRowOffset();
case ROW_COUNT:
return getRowCount();
case BYTES_NUM:
return getBytesNum();
case HTTP_HEADERS:
return getHttpHeaders();
}
throw new java.lang.IllegalStateException();
}
/**
* Returns true if field corresponding to fieldID is set (has been assigned a value) and false
* otherwise
*/
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case FILE_LINK:
return isSetFileLink();
case EXPIRY_TIME:
return isSetExpiryTime();
case START_ROW_OFFSET:
return isSetStartRowOffset();
case ROW_COUNT:
return isSetRowCount();
case BYTES_NUM:
return isSetBytesNum();
case HTTP_HEADERS:
return isSetHttpHeaders();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TSparkArrowResultLink) return this.equals((TSparkArrowResultLink) that);
return false;
}
public boolean equals(TSparkArrowResultLink that) {
if (that == null) return false;
if (this == that) return true;
boolean this_present_fileLink = true && this.isSetFileLink();
boolean that_present_fileLink = true && that.isSetFileLink();
if (this_present_fileLink || that_present_fileLink) {
if (!(this_present_fileLink && that_present_fileLink)) return false;
if (!this.fileLink.equals(that.fileLink)) return false;
}
boolean this_present_expiryTime = true;
boolean that_present_expiryTime = true;
if (this_present_expiryTime || that_present_expiryTime) {
if (!(this_present_expiryTime && that_present_expiryTime)) return false;
if (this.expiryTime != that.expiryTime) return false;
}
boolean this_present_startRowOffset = true;
boolean that_present_startRowOffset = true;
if (this_present_startRowOffset || that_present_startRowOffset) {
if (!(this_present_startRowOffset && that_present_startRowOffset)) return false;
if (this.startRowOffset != that.startRowOffset) return false;
}
boolean this_present_rowCount = true;
boolean that_present_rowCount = true;
if (this_present_rowCount || that_present_rowCount) {
if (!(this_present_rowCount && that_present_rowCount)) return false;
if (this.rowCount != that.rowCount) return false;
}
boolean this_present_bytesNum = true;
boolean that_present_bytesNum = true;
if (this_present_bytesNum || that_present_bytesNum) {
if (!(this_present_bytesNum && that_present_bytesNum)) return false;
if (this.bytesNum != that.bytesNum) return false;
}
boolean this_present_httpHeaders = true && this.isSetHttpHeaders();
boolean that_present_httpHeaders = true && that.isSetHttpHeaders();
if (this_present_httpHeaders || that_present_httpHeaders) {
if (!(this_present_httpHeaders && that_present_httpHeaders)) return false;
if (!this.httpHeaders.equals(that.httpHeaders)) return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetFileLink()) ? 131071 : 524287);
if (isSetFileLink()) hashCode = hashCode * 8191 + fileLink.hashCode();
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(expiryTime);
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startRowOffset);
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(rowCount);
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(bytesNum);
hashCode = hashCode * 8191 + ((isSetHttpHeaders()) ? 131071 : 524287);
if (isSetHttpHeaders()) hashCode = hashCode * 8191 + httpHeaders.hashCode();
return hashCode;
}
@Override
public int compareTo(TSparkArrowResultLink other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetFileLink(), other.isSetFileLink());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFileLink()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileLink, other.fileLink);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetExpiryTime(), other.isSetExpiryTime());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetExpiryTime()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.expiryTime, other.expiryTime);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetStartRowOffset(), other.isSetStartRowOffset());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStartRowOffset()) {
lastComparison =
org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, other.startRowOffset);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetRowCount(), other.isSetRowCount());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRowCount()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rowCount, other.rowCount);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetBytesNum(), other.isSetBytesNum());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBytesNum()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bytesNum, other.bytesNum);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetHttpHeaders(), other.isSetHttpHeaders());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetHttpHeaders()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.httpHeaders, other.httpHeaders);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
@Override
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("TSparkArrowResultLink(");
boolean first = true;
sb.append("fileLink:");
if (this.fileLink == null) {
sb.append("null");
} else {
sb.append(this.fileLink);
}
first = false;
if (!first) sb.append(", ");
sb.append("expiryTime:");
sb.append(this.expiryTime);
first = false;
if (!first) sb.append(", ");
sb.append("startRowOffset:");
sb.append(this.startRowOffset);
first = false;
if (!first) sb.append(", ");
sb.append("rowCount:");
sb.append(this.rowCount);
first = false;
if (!first) sb.append(", ");
sb.append("bytesNum:");
sb.append(this.bytesNum);
first = false;
if (isSetHttpHeaders()) {
if (!first) sb.append(", ");
sb.append("httpHeaders:");
if (this.httpHeaders == null) {
sb.append("null");
} else {
sb.append(this.httpHeaders);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (fileLink == null) {
throw new org.apache.thrift.protocol.TProtocolException(
"Required field 'fileLink' was not present! Struct: " + toString());
}
// alas, we cannot check 'expiryTime' because it's a primitive and you chose the non-beans
// generator.
// alas, we cannot check 'startRowOffset' because it's a primitive and you chose the non-beans
// generator.
// alas, we cannot check 'rowCount' because it's a primitive and you chose the non-beans
// generator.
// alas, we cannot check 'bytesNum' because it's a primitive and you chose the non-beans
// generator.
// check for sub-struct validity
}
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 TSparkArrowResultLinkStandardSchemeFactory
implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TSparkArrowResultLinkStandardScheme getScheme() {
return new TSparkArrowResultLinkStandardScheme();
}
}
private static class TSparkArrowResultLinkStandardScheme
extends org.apache.thrift.scheme.StandardScheme {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, TSparkArrowResultLink 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_LINK
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.fileLink = iprot.readString();
struct.setFileLinkIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // EXPIRY_TIME
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.expiryTime = iprot.readI64();
struct.setExpiryTimeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // START_ROW_OFFSET
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.startRowOffset = iprot.readI64();
struct.setStartRowOffsetIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // ROW_COUNT
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.rowCount = iprot.readI64();
struct.setRowCountIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // BYTES_NUM
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.bytesNum = iprot.readI64();
struct.setBytesNumIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // HTTP_HEADERS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map118 = iprot.readMapBegin();
struct.httpHeaders =
new java.util.HashMap(2 * _map118.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key119;
@org.apache.thrift.annotation.Nullable java.lang.String _val120;
for (int _i121 = 0; _i121 < _map118.size; ++_i121) {
_key119 = iprot.readString();
_val120 = iprot.readString();
struct.httpHeaders.put(_key119, _val120);
}
iprot.readMapEnd();
}
struct.setHttpHeadersIsSet(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.isSetExpiryTime()) {
throw new org.apache.thrift.protocol.TProtocolException(
"Required field 'expiryTime' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetStartRowOffset()) {
throw new org.apache.thrift.protocol.TProtocolException(
"Required field 'startRowOffset' was not found in serialized data! Struct: "
+ toString());
}
if (!struct.isSetRowCount()) {
throw new org.apache.thrift.protocol.TProtocolException(
"Required field 'rowCount' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetBytesNum()) {
throw new org.apache.thrift.protocol.TProtocolException(
"Required field 'bytesNum' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, TSparkArrowResultLink struct)
throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.fileLink != null) {
oprot.writeFieldBegin(FILE_LINK_FIELD_DESC);
oprot.writeString(struct.fileLink);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(EXPIRY_TIME_FIELD_DESC);
oprot.writeI64(struct.expiryTime);
oprot.writeFieldEnd();
oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC);
oprot.writeI64(struct.startRowOffset);
oprot.writeFieldEnd();
oprot.writeFieldBegin(ROW_COUNT_FIELD_DESC);
oprot.writeI64(struct.rowCount);
oprot.writeFieldEnd();
oprot.writeFieldBegin(BYTES_NUM_FIELD_DESC);
oprot.writeI64(struct.bytesNum);
oprot.writeFieldEnd();
if (struct.httpHeaders != null) {
if (struct.isSetHttpHeaders()) {
oprot.writeFieldBegin(HTTP_HEADERS_FIELD_DESC);
{
oprot.writeMapBegin(
new org.apache.thrift.protocol.TMap(
org.apache.thrift.protocol.TType.STRING,
org.apache.thrift.protocol.TType.STRING,
struct.httpHeaders.size()));
for (java.util.Map.Entry _iter122 :
struct.httpHeaders.entrySet()) {
oprot.writeString(_iter122.getKey());
oprot.writeString(_iter122.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TSparkArrowResultLinkTupleSchemeFactory
implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TSparkArrowResultLinkTupleScheme getScheme() {
return new TSparkArrowResultLinkTupleScheme();
}
}
private static class TSparkArrowResultLinkTupleScheme
extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TSparkArrowResultLink struct)
throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot =
(org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.fileLink);
oprot.writeI64(struct.expiryTime);
oprot.writeI64(struct.startRowOffset);
oprot.writeI64(struct.rowCount);
oprot.writeI64(struct.bytesNum);
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetHttpHeaders()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetHttpHeaders()) {
{
oprot.writeI32(struct.httpHeaders.size());
for (java.util.Map.Entry _iter123 :
struct.httpHeaders.entrySet()) {
oprot.writeString(_iter123.getKey());
oprot.writeString(_iter123.getValue());
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TSparkArrowResultLink struct)
throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot =
(org.apache.thrift.protocol.TTupleProtocol) prot;
struct.fileLink = iprot.readString();
struct.setFileLinkIsSet(true);
struct.expiryTime = iprot.readI64();
struct.setExpiryTimeIsSet(true);
struct.startRowOffset = iprot.readI64();
struct.setStartRowOffsetIsSet(true);
struct.rowCount = iprot.readI64();
struct.setRowCountIsSet(true);
struct.bytesNum = iprot.readI64();
struct.setBytesNumIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TMap _map124 =
iprot.readMapBegin(
org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING);
struct.httpHeaders =
new java.util.HashMap(2 * _map124.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key125;
@org.apache.thrift.annotation.Nullable java.lang.String _val126;
for (int _i127 = 0; _i127 < _map124.size; ++_i127) {
_key125 = iprot.readString();
_val126 = iprot.readString();
struct.httpHeaders.put(_key125, _val126);
}
}
struct.setHttpHeadersIsSet(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();
}
}