org.apache.iotdb.service.rpc.thrift.TSAppendSchemaTemplateReq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timechodb-thrift Show documentation
Show all versions of timechodb-thrift Show documentation
RPC (Thrift) framework for client and server.
The newest version!
/**
* Autogenerated by Thrift Compiler (0.14.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.iotdb.service.rpc.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2023-04-20")
public class TSAppendSchemaTemplateReq 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("TSAppendSchemaTemplateReq");
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField IS_ALIGNED_FIELD_DESC = new org.apache.thrift.protocol.TField("isAligned", org.apache.thrift.protocol.TType.BOOL, (short)3);
private static final org.apache.thrift.protocol.TField MEASUREMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("measurements", org.apache.thrift.protocol.TType.LIST, (short)4);
private static final org.apache.thrift.protocol.TField DATA_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("dataTypes", org.apache.thrift.protocol.TType.LIST, (short)5);
private static final org.apache.thrift.protocol.TField ENCODINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("encodings", org.apache.thrift.protocol.TType.LIST, (short)6);
private static final org.apache.thrift.protocol.TField COMPRESSORS_FIELD_DESC = new org.apache.thrift.protocol.TField("compressors", org.apache.thrift.protocol.TType.LIST, (short)7);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSAppendSchemaTemplateReqStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSAppendSchemaTemplateReqTupleSchemeFactory();
public long sessionId; // required
public @org.apache.thrift.annotation.Nullable java.lang.String name; // required
public boolean isAligned; // required
public @org.apache.thrift.annotation.Nullable java.util.List measurements; // required
public @org.apache.thrift.annotation.Nullable java.util.List dataTypes; // required
public @org.apache.thrift.annotation.Nullable java.util.List encodings; // required
public @org.apache.thrift.annotation.Nullable java.util.List compressors; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SESSION_ID((short)1, "sessionId"),
NAME((short)2, "name"),
IS_ALIGNED((short)3, "isAligned"),
MEASUREMENTS((short)4, "measurements"),
DATA_TYPES((short)5, "dataTypes"),
ENCODINGS((short)6, "encodings"),
COMPRESSORS((short)7, "compressors");
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: // SESSION_ID
return SESSION_ID;
case 2: // NAME
return NAME;
case 3: // IS_ALIGNED
return IS_ALIGNED;
case 4: // MEASUREMENTS
return MEASUREMENTS;
case 5: // DATA_TYPES
return DATA_TYPES;
case 6: // ENCODINGS
return ENCODINGS;
case 7: // COMPRESSORS
return COMPRESSORS;
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 __SESSIONID_ISSET_ID = 0;
private static final int __ISALIGNED_ISSET_ID = 1;
private byte __isset_bitfield = 0;
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.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IS_ALIGNED, new org.apache.thrift.meta_data.FieldMetaData("isAligned", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.MEASUREMENTS, new org.apache.thrift.meta_data.FieldMetaData("measurements", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.DATA_TYPES, new org.apache.thrift.meta_data.FieldMetaData("dataTypes", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
tmpMap.put(_Fields.ENCODINGS, new org.apache.thrift.meta_data.FieldMetaData("encodings", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
tmpMap.put(_Fields.COMPRESSORS, new org.apache.thrift.meta_data.FieldMetaData("compressors", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSAppendSchemaTemplateReq.class, metaDataMap);
}
public TSAppendSchemaTemplateReq() {
}
public TSAppendSchemaTemplateReq(
long sessionId,
java.lang.String name,
boolean isAligned,
java.util.List measurements,
java.util.List dataTypes,
java.util.List encodings,
java.util.List compressors)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.name = name;
this.isAligned = isAligned;
setIsAlignedIsSet(true);
this.measurements = measurements;
this.dataTypes = dataTypes;
this.encodings = encodings;
this.compressors = compressors;
}
/**
* Performs a deep copy on other.
*/
public TSAppendSchemaTemplateReq(TSAppendSchemaTemplateReq other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
if (other.isSetName()) {
this.name = other.name;
}
this.isAligned = other.isAligned;
if (other.isSetMeasurements()) {
java.util.List __this__measurements = new java.util.ArrayList(other.measurements);
this.measurements = __this__measurements;
}
if (other.isSetDataTypes()) {
java.util.List __this__dataTypes = new java.util.ArrayList(other.dataTypes);
this.dataTypes = __this__dataTypes;
}
if (other.isSetEncodings()) {
java.util.List __this__encodings = new java.util.ArrayList(other.encodings);
this.encodings = __this__encodings;
}
if (other.isSetCompressors()) {
java.util.List __this__compressors = new java.util.ArrayList(other.compressors);
this.compressors = __this__compressors;
}
}
public TSAppendSchemaTemplateReq deepCopy() {
return new TSAppendSchemaTemplateReq(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
this.name = null;
setIsAlignedIsSet(false);
this.isAligned = false;
this.measurements = null;
this.dataTypes = null;
this.encodings = null;
this.compressors = null;
}
public long getSessionId() {
return this.sessionId;
}
public TSAppendSchemaTemplateReq setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getName() {
return this.name;
}
public TSAppendSchemaTemplateReq setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public boolean isIsAligned() {
return this.isAligned;
}
public TSAppendSchemaTemplateReq setIsAligned(boolean isAligned) {
this.isAligned = isAligned;
setIsAlignedIsSet(true);
return this;
}
public void unsetIsAligned() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ISALIGNED_ISSET_ID);
}
/** Returns true if field isAligned is set (has been assigned a value) and false otherwise */
public boolean isSetIsAligned() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ISALIGNED_ISSET_ID);
}
public void setIsAlignedIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ISALIGNED_ISSET_ID, value);
}
public int getMeasurementsSize() {
return (this.measurements == null) ? 0 : this.measurements.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator getMeasurementsIterator() {
return (this.measurements == null) ? null : this.measurements.iterator();
}
public void addToMeasurements(java.lang.String elem) {
if (this.measurements == null) {
this.measurements = new java.util.ArrayList();
}
this.measurements.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List getMeasurements() {
return this.measurements;
}
public TSAppendSchemaTemplateReq setMeasurements(@org.apache.thrift.annotation.Nullable java.util.List measurements) {
this.measurements = measurements;
return this;
}
public void unsetMeasurements() {
this.measurements = null;
}
/** Returns true if field measurements is set (has been assigned a value) and false otherwise */
public boolean isSetMeasurements() {
return this.measurements != null;
}
public void setMeasurementsIsSet(boolean value) {
if (!value) {
this.measurements = null;
}
}
public int getDataTypesSize() {
return (this.dataTypes == null) ? 0 : this.dataTypes.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator getDataTypesIterator() {
return (this.dataTypes == null) ? null : this.dataTypes.iterator();
}
public void addToDataTypes(int elem) {
if (this.dataTypes == null) {
this.dataTypes = new java.util.ArrayList();
}
this.dataTypes.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List getDataTypes() {
return this.dataTypes;
}
public TSAppendSchemaTemplateReq setDataTypes(@org.apache.thrift.annotation.Nullable java.util.List dataTypes) {
this.dataTypes = dataTypes;
return this;
}
public void unsetDataTypes() {
this.dataTypes = null;
}
/** Returns true if field dataTypes is set (has been assigned a value) and false otherwise */
public boolean isSetDataTypes() {
return this.dataTypes != null;
}
public void setDataTypesIsSet(boolean value) {
if (!value) {
this.dataTypes = null;
}
}
public int getEncodingsSize() {
return (this.encodings == null) ? 0 : this.encodings.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator getEncodingsIterator() {
return (this.encodings == null) ? null : this.encodings.iterator();
}
public void addToEncodings(int elem) {
if (this.encodings == null) {
this.encodings = new java.util.ArrayList();
}
this.encodings.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List getEncodings() {
return this.encodings;
}
public TSAppendSchemaTemplateReq setEncodings(@org.apache.thrift.annotation.Nullable java.util.List encodings) {
this.encodings = encodings;
return this;
}
public void unsetEncodings() {
this.encodings = null;
}
/** Returns true if field encodings is set (has been assigned a value) and false otherwise */
public boolean isSetEncodings() {
return this.encodings != null;
}
public void setEncodingsIsSet(boolean value) {
if (!value) {
this.encodings = null;
}
}
public int getCompressorsSize() {
return (this.compressors == null) ? 0 : this.compressors.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator getCompressorsIterator() {
return (this.compressors == null) ? null : this.compressors.iterator();
}
public void addToCompressors(int elem) {
if (this.compressors == null) {
this.compressors = new java.util.ArrayList();
}
this.compressors.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List getCompressors() {
return this.compressors;
}
public TSAppendSchemaTemplateReq setCompressors(@org.apache.thrift.annotation.Nullable java.util.List compressors) {
this.compressors = compressors;
return this;
}
public void unsetCompressors() {
this.compressors = null;
}
/** Returns true if field compressors is set (has been assigned a value) and false otherwise */
public boolean isSetCompressors() {
return this.compressors != null;
}
public void setCompressorsIsSet(boolean value) {
if (!value) {
this.compressors = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((java.lang.Long)value);
}
break;
case NAME:
if (value == null) {
unsetName();
} else {
setName((java.lang.String)value);
}
break;
case IS_ALIGNED:
if (value == null) {
unsetIsAligned();
} else {
setIsAligned((java.lang.Boolean)value);
}
break;
case MEASUREMENTS:
if (value == null) {
unsetMeasurements();
} else {
setMeasurements((java.util.List)value);
}
break;
case DATA_TYPES:
if (value == null) {
unsetDataTypes();
} else {
setDataTypes((java.util.List)value);
}
break;
case ENCODINGS:
if (value == null) {
unsetEncodings();
} else {
setEncodings((java.util.List)value);
}
break;
case COMPRESSORS:
if (value == null) {
unsetCompressors();
} else {
setCompressors((java.util.List)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case NAME:
return getName();
case IS_ALIGNED:
return isIsAligned();
case MEASUREMENTS:
return getMeasurements();
case DATA_TYPES:
return getDataTypes();
case ENCODINGS:
return getEncodings();
case COMPRESSORS:
return getCompressors();
}
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 SESSION_ID:
return isSetSessionId();
case NAME:
return isSetName();
case IS_ALIGNED:
return isSetIsAligned();
case MEASUREMENTS:
return isSetMeasurements();
case DATA_TYPES:
return isSetDataTypes();
case ENCODINGS:
return isSetEncodings();
case COMPRESSORS:
return isSetCompressors();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TSAppendSchemaTemplateReq)
return this.equals((TSAppendSchemaTemplateReq)that);
return false;
}
public boolean equals(TSAppendSchemaTemplateReq that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_isAligned = true;
boolean that_present_isAligned = true;
if (this_present_isAligned || that_present_isAligned) {
if (!(this_present_isAligned && that_present_isAligned))
return false;
if (this.isAligned != that.isAligned)
return false;
}
boolean this_present_measurements = true && this.isSetMeasurements();
boolean that_present_measurements = true && that.isSetMeasurements();
if (this_present_measurements || that_present_measurements) {
if (!(this_present_measurements && that_present_measurements))
return false;
if (!this.measurements.equals(that.measurements))
return false;
}
boolean this_present_dataTypes = true && this.isSetDataTypes();
boolean that_present_dataTypes = true && that.isSetDataTypes();
if (this_present_dataTypes || that_present_dataTypes) {
if (!(this_present_dataTypes && that_present_dataTypes))
return false;
if (!this.dataTypes.equals(that.dataTypes))
return false;
}
boolean this_present_encodings = true && this.isSetEncodings();
boolean that_present_encodings = true && that.isSetEncodings();
if (this_present_encodings || that_present_encodings) {
if (!(this_present_encodings && that_present_encodings))
return false;
if (!this.encodings.equals(that.encodings))
return false;
}
boolean this_present_compressors = true && this.isSetCompressors();
boolean that_present_compressors = true && that.isSetCompressors();
if (this_present_compressors || that_present_compressors) {
if (!(this_present_compressors && that_present_compressors))
return false;
if (!this.compressors.equals(that.compressors))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sessionId);
hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
if (isSetName())
hashCode = hashCode * 8191 + name.hashCode();
hashCode = hashCode * 8191 + ((isAligned) ? 131071 : 524287);
hashCode = hashCode * 8191 + ((isSetMeasurements()) ? 131071 : 524287);
if (isSetMeasurements())
hashCode = hashCode * 8191 + measurements.hashCode();
hashCode = hashCode * 8191 + ((isSetDataTypes()) ? 131071 : 524287);
if (isSetDataTypes())
hashCode = hashCode * 8191 + dataTypes.hashCode();
hashCode = hashCode * 8191 + ((isSetEncodings()) ? 131071 : 524287);
if (isSetEncodings())
hashCode = hashCode * 8191 + encodings.hashCode();
hashCode = hashCode * 8191 + ((isSetCompressors()) ? 131071 : 524287);
if (isSetCompressors())
hashCode = hashCode * 8191 + compressors.hashCode();
return hashCode;
}
@Override
public int compareTo(TSAppendSchemaTemplateReq other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetSessionId(), other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetIsAligned(), other.isSetIsAligned());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetIsAligned()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isAligned, other.isAligned);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetMeasurements(), other.isSetMeasurements());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMeasurements()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.measurements, other.measurements);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetDataTypes(), other.isSetDataTypes());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDataTypes()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataTypes, other.dataTypes);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetEncodings(), other.isSetEncodings());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEncodings()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encodings, other.encodings);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetCompressors(), other.isSetCompressors());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCompressors()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compressors, other.compressors);
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("TSAppendSchemaTemplateReq(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("name:");
if (this.name == null) {
sb.append("null");
} else {
sb.append(this.name);
}
first = false;
if (!first) sb.append(", ");
sb.append("isAligned:");
sb.append(this.isAligned);
first = false;
if (!first) sb.append(", ");
sb.append("measurements:");
if (this.measurements == null) {
sb.append("null");
} else {
sb.append(this.measurements);
}
first = false;
if (!first) sb.append(", ");
sb.append("dataTypes:");
if (this.dataTypes == null) {
sb.append("null");
} else {
sb.append(this.dataTypes);
}
first = false;
if (!first) sb.append(", ");
sb.append("encodings:");
if (this.encodings == null) {
sb.append("null");
} else {
sb.append(this.encodings);
}
first = false;
if (!first) sb.append(", ");
sb.append("compressors:");
if (this.compressors == null) {
sb.append("null");
} else {
sb.append(this.compressors);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'sessionId' because it's a primitive and you chose the non-beans generator.
if (name == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
}
// alas, we cannot check 'isAligned' because it's a primitive and you chose the non-beans generator.
if (measurements == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'measurements' was not present! Struct: " + toString());
}
if (dataTypes == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataTypes' was not present! Struct: " + toString());
}
if (encodings == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'encodings' was not present! Struct: " + toString());
}
if (compressors == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'compressors' was not present! Struct: " + toString());
}
// 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 TSAppendSchemaTemplateReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TSAppendSchemaTemplateReqStandardScheme getScheme() {
return new TSAppendSchemaTemplateReqStandardScheme();
}
}
private static class TSAppendSchemaTemplateReqStandardScheme extends org.apache.thrift.scheme.StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, TSAppendSchemaTemplateReq 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: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // IS_ALIGNED
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.isAligned = iprot.readBool();
struct.setIsAlignedIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // MEASUREMENTS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list638 = iprot.readListBegin();
struct.measurements = new java.util.ArrayList(_list638.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem639;
for (int _i640 = 0; _i640 < _list638.size; ++_i640)
{
_elem639 = iprot.readString();
struct.measurements.add(_elem639);
}
iprot.readListEnd();
}
struct.setMeasurementsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // DATA_TYPES
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list641 = iprot.readListBegin();
struct.dataTypes = new java.util.ArrayList(_list641.size);
int _elem642;
for (int _i643 = 0; _i643 < _list641.size; ++_i643)
{
_elem642 = iprot.readI32();
struct.dataTypes.add(_elem642);
}
iprot.readListEnd();
}
struct.setDataTypesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // ENCODINGS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list644 = iprot.readListBegin();
struct.encodings = new java.util.ArrayList(_list644.size);
int _elem645;
for (int _i646 = 0; _i646 < _list644.size; ++_i646)
{
_elem645 = iprot.readI32();
struct.encodings.add(_elem645);
}
iprot.readListEnd();
}
struct.setEncodingsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // COMPRESSORS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list647 = iprot.readListBegin();
struct.compressors = new java.util.ArrayList(_list647.size);
int _elem648;
for (int _i649 = 0; _i649 < _list647.size; ++_i649)
{
_elem648 = iprot.readI32();
struct.compressors.add(_elem648);
}
iprot.readListEnd();
}
struct.setCompressorsIsSet(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.isSetSessionId()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionId' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetIsAligned()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'isAligned' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TSAppendSchemaTemplateReq struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
if (struct.name != null) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(struct.name);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(IS_ALIGNED_FIELD_DESC);
oprot.writeBool(struct.isAligned);
oprot.writeFieldEnd();
if (struct.measurements != null) {
oprot.writeFieldBegin(MEASUREMENTS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.measurements.size()));
for (java.lang.String _iter650 : struct.measurements)
{
oprot.writeString(_iter650);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.dataTypes != null) {
oprot.writeFieldBegin(DATA_TYPES_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.dataTypes.size()));
for (int _iter651 : struct.dataTypes)
{
oprot.writeI32(_iter651);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.encodings != null) {
oprot.writeFieldBegin(ENCODINGS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.encodings.size()));
for (int _iter652 : struct.encodings)
{
oprot.writeI32(_iter652);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.compressors != null) {
oprot.writeFieldBegin(COMPRESSORS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.compressors.size()));
for (int _iter653 : struct.compressors)
{
oprot.writeI32(_iter653);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TSAppendSchemaTemplateReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TSAppendSchemaTemplateReqTupleScheme getScheme() {
return new TSAppendSchemaTemplateReqTupleScheme();
}
}
private static class TSAppendSchemaTemplateReqTupleScheme extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TSAppendSchemaTemplateReq struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI64(struct.sessionId);
oprot.writeString(struct.name);
oprot.writeBool(struct.isAligned);
{
oprot.writeI32(struct.measurements.size());
for (java.lang.String _iter654 : struct.measurements)
{
oprot.writeString(_iter654);
}
}
{
oprot.writeI32(struct.dataTypes.size());
for (int _iter655 : struct.dataTypes)
{
oprot.writeI32(_iter655);
}
}
{
oprot.writeI32(struct.encodings.size());
for (int _iter656 : struct.encodings)
{
oprot.writeI32(_iter656);
}
}
{
oprot.writeI32(struct.compressors.size());
for (int _iter657 : struct.compressors)
{
oprot.writeI32(_iter657);
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TSAppendSchemaTemplateReq struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
struct.name = iprot.readString();
struct.setNameIsSet(true);
struct.isAligned = iprot.readBool();
struct.setIsAlignedIsSet(true);
{
org.apache.thrift.protocol.TList _list658 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
struct.measurements = new java.util.ArrayList(_list658.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem659;
for (int _i660 = 0; _i660 < _list658.size; ++_i660)
{
_elem659 = iprot.readString();
struct.measurements.add(_elem659);
}
}
struct.setMeasurementsIsSet(true);
{
org.apache.thrift.protocol.TList _list661 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
struct.dataTypes = new java.util.ArrayList(_list661.size);
int _elem662;
for (int _i663 = 0; _i663 < _list661.size; ++_i663)
{
_elem662 = iprot.readI32();
struct.dataTypes.add(_elem662);
}
}
struct.setDataTypesIsSet(true);
{
org.apache.thrift.protocol.TList _list664 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
struct.encodings = new java.util.ArrayList(_list664.size);
int _elem665;
for (int _i666 = 0; _i666 < _list664.size; ++_i666)
{
_elem665 = iprot.readI32();
struct.encodings.add(_elem665);
}
}
struct.setEncodingsIsSet(true);
{
org.apache.thrift.protocol.TList _list667 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
struct.compressors = new java.util.ArrayList(_list667.size);
int _elem668;
for (int _i669 = 0; _i669 < _list667.size; ++_i669)
{
_elem668 = iprot.readI32();
struct.compressors.add(_elem668);
}
}
struct.setCompressorsIsSet(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();
}
}