index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDBException.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDBException extends org.apache.thrift.TException implements org.apache.thrift.TBase<TDBException, TDBException._Fields>, java.io.Serializable, Cloneable, Comparable<TDBException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDBException"); private static final org.apache.thrift.protocol.TField ERROR_MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("error_msg", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDBExceptionStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDBExceptionTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String error_msg; // 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 { ERROR_MSG((short)1, "error_msg"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ERROR_MSG return ERROR_MSG; 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 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.ERROR_MSG, new org.apache.thrift.meta_data.FieldMetaData("error_msg", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TDBException.class, metaDataMap); } public TDBException() { } public TDBException( java.lang.String error_msg) { this(); this.error_msg = error_msg; } /** * Performs a deep copy on <i>other</i>. */ public TDBException(TDBException other) { if (other.isSetError_msg()) { this.error_msg = other.error_msg; } } public TDBException deepCopy() { return new TDBException(this); } @Override public void clear() { this.error_msg = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getError_msg() { return this.error_msg; } public TDBException setError_msg(@org.apache.thrift.annotation.Nullable java.lang.String error_msg) { this.error_msg = error_msg; return this; } public void unsetError_msg() { this.error_msg = null; } /** Returns true if field error_msg is set (has been assigned a value) and false otherwise */ public boolean isSetError_msg() { return this.error_msg != null; } public void setError_msgIsSet(boolean value) { if (!value) { this.error_msg = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ERROR_MSG: if (value == null) { unsetError_msg(); } else { setError_msg((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ERROR_MSG: return getError_msg(); } 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 ERROR_MSG: return isSetError_msg(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDBException) return this.equals((TDBException)that); return false; } public boolean equals(TDBException that) { if (that == null) return false; if (this == that) return true; boolean this_present_error_msg = true && this.isSetError_msg(); boolean that_present_error_msg = true && that.isSetError_msg(); if (this_present_error_msg || that_present_error_msg) { if (!(this_present_error_msg && that_present_error_msg)) return false; if (!this.error_msg.equals(that.error_msg)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetError_msg()) ? 131071 : 524287); if (isSetError_msg()) hashCode = hashCode * 8191 + error_msg.hashCode(); return hashCode; } @Override public int compareTo(TDBException other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetError_msg(), other.isSetError_msg()); if (lastComparison != 0) { return lastComparison; } if (isSetError_msg()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error_msg, other.error_msg); 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("TDBException("); boolean first = true; sb.append("error_msg:"); if (this.error_msg == null) { sb.append("null"); } else { sb.append(this.error_msg); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TDBExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDBExceptionStandardScheme getScheme() { return new TDBExceptionStandardScheme(); } } private static class TDBExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDBException> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDBException 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: // ERROR_MSG if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.error_msg = iprot.readString(); struct.setError_msgIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDBException struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.error_msg != null) { oprot.writeFieldBegin(ERROR_MSG_FIELD_DESC); oprot.writeString(struct.error_msg); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDBExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDBExceptionTupleScheme getScheme() { return new TDBExceptionTupleScheme(); } } private static class TDBExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDBException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDBException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetError_msg()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetError_msg()) { oprot.writeString(struct.error_msg); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDBException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.error_msg = iprot.readString(); struct.setError_msgIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDBInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDBInfo implements org.apache.thrift.TBase<TDBInfo, TDBInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TDBInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDBInfo"); private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField DB_OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("db_owner", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDBInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDBInfoTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String db_name; // required public @org.apache.thrift.annotation.Nullable java.lang.String db_owner; // 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 { DB_NAME((short)1, "db_name"), DB_OWNER((short)2, "db_owner"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // DB_NAME return DB_NAME; case 2: // DB_OWNER return DB_OWNER; 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 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.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("db_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DB_OWNER, new org.apache.thrift.meta_data.FieldMetaData("db_owner", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TDBInfo.class, metaDataMap); } public TDBInfo() { } public TDBInfo( java.lang.String db_name, java.lang.String db_owner) { this(); this.db_name = db_name; this.db_owner = db_owner; } /** * Performs a deep copy on <i>other</i>. */ public TDBInfo(TDBInfo other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetDb_owner()) { this.db_owner = other.db_owner; } } public TDBInfo deepCopy() { return new TDBInfo(this); } @Override public void clear() { this.db_name = null; this.db_owner = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getDb_name() { return this.db_name; } public TDBInfo setDb_name(@org.apache.thrift.annotation.Nullable java.lang.String db_name) { this.db_name = db_name; return this; } public void unsetDb_name() { this.db_name = null; } /** Returns true if field db_name is set (has been assigned a value) and false otherwise */ public boolean isSetDb_name() { return this.db_name != null; } public void setDb_nameIsSet(boolean value) { if (!value) { this.db_name = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getDb_owner() { return this.db_owner; } public TDBInfo setDb_owner(@org.apache.thrift.annotation.Nullable java.lang.String db_owner) { this.db_owner = db_owner; return this; } public void unsetDb_owner() { this.db_owner = null; } /** Returns true if field db_owner is set (has been assigned a value) and false otherwise */ public boolean isSetDb_owner() { return this.db_owner != null; } public void setDb_ownerIsSet(boolean value) { if (!value) { this.db_owner = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case DB_NAME: if (value == null) { unsetDb_name(); } else { setDb_name((java.lang.String)value); } break; case DB_OWNER: if (value == null) { unsetDb_owner(); } else { setDb_owner((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case DB_NAME: return getDb_name(); case DB_OWNER: return getDb_owner(); } 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 DB_NAME: return isSetDb_name(); case DB_OWNER: return isSetDb_owner(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDBInfo) return this.equals((TDBInfo)that); return false; } public boolean equals(TDBInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_db_name = true && this.isSetDb_name(); boolean that_present_db_name = true && that.isSetDb_name(); if (this_present_db_name || that_present_db_name) { if (!(this_present_db_name && that_present_db_name)) return false; if (!this.db_name.equals(that.db_name)) return false; } boolean this_present_db_owner = true && this.isSetDb_owner(); boolean that_present_db_owner = true && that.isSetDb_owner(); if (this_present_db_owner || that_present_db_owner) { if (!(this_present_db_owner && that_present_db_owner)) return false; if (!this.db_owner.equals(that.db_owner)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetDb_name()) ? 131071 : 524287); if (isSetDb_name()) hashCode = hashCode * 8191 + db_name.hashCode(); hashCode = hashCode * 8191 + ((isSetDb_owner()) ? 131071 : 524287); if (isSetDb_owner()) hashCode = hashCode * 8191 + db_owner.hashCode(); return hashCode; } @Override public int compareTo(TDBInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetDb_name(), other.isSetDb_name()); if (lastComparison != 0) { return lastComparison; } if (isSetDb_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_name, other.db_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDb_owner(), other.isSetDb_owner()); if (lastComparison != 0) { return lastComparison; } if (isSetDb_owner()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_owner, other.db_owner); 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("TDBInfo("); boolean first = true; sb.append("db_name:"); if (this.db_name == null) { sb.append("null"); } else { sb.append(this.db_name); } first = false; if (!first) sb.append(", "); sb.append("db_owner:"); if (this.db_owner == null) { sb.append("null"); } else { sb.append(this.db_owner); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TDBInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDBInfoStandardScheme getScheme() { return new TDBInfoStandardScheme(); } } private static class TDBInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDBInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDBInfo 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: // DB_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.db_name = iprot.readString(); struct.setDb_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DB_OWNER if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.db_owner = iprot.readString(); struct.setDb_ownerIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDBInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.db_name != null) { oprot.writeFieldBegin(DB_NAME_FIELD_DESC); oprot.writeString(struct.db_name); oprot.writeFieldEnd(); } if (struct.db_owner != null) { oprot.writeFieldBegin(DB_OWNER_FIELD_DESC); oprot.writeString(struct.db_owner); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDBInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDBInfoTupleScheme getScheme() { return new TDBInfoTupleScheme(); } } private static class TDBInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDBInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDBInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetDb_name()) { optionals.set(0); } if (struct.isSetDb_owner()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetDb_name()) { oprot.writeString(struct.db_name); } if (struct.isSetDb_owner()) { oprot.writeString(struct.db_owner); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDBInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.db_name = iprot.readString(); struct.setDb_nameIsSet(true); } if (incoming.get(1)) { struct.db_owner = iprot.readString(); struct.setDb_ownerIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDBObject.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDBObject implements org.apache.thrift.TBase<TDBObject, TDBObject._Fields>, java.io.Serializable, Cloneable, Comparable<TDBObject> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDBObject"); private static final org.apache.thrift.protocol.TField OBJECT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("objectName", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField OBJECT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("objectType", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField PRIVS_FIELD_DESC = new org.apache.thrift.protocol.TField("privs", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField GRANTEE_FIELD_DESC = new org.apache.thrift.protocol.TField("grantee", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField PRIVILEGE_OBJECT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("privilegeObjectType", org.apache.thrift.protocol.TType.I32, (short)5); private static final org.apache.thrift.protocol.TField OBJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("objectId", org.apache.thrift.protocol.TType.I32, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDBObjectStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDBObjectTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String objectName; // required /** * * @see TDBObjectType */ public @org.apache.thrift.annotation.Nullable TDBObjectType objectType; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Boolean> privs; // required public @org.apache.thrift.annotation.Nullable java.lang.String grantee; // required /** * * @see TDBObjectType */ public @org.apache.thrift.annotation.Nullable TDBObjectType privilegeObjectType; // required public int objectId; // 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 { OBJECT_NAME((short)1, "objectName"), /** * * @see TDBObjectType */ OBJECT_TYPE((short)2, "objectType"), PRIVS((short)3, "privs"), GRANTEE((short)4, "grantee"), /** * * @see TDBObjectType */ PRIVILEGE_OBJECT_TYPE((short)5, "privilegeObjectType"), OBJECT_ID((short)6, "objectId"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // OBJECT_NAME return OBJECT_NAME; case 2: // OBJECT_TYPE return OBJECT_TYPE; case 3: // PRIVS return PRIVS; case 4: // GRANTEE return GRANTEE; case 5: // PRIVILEGE_OBJECT_TYPE return PRIVILEGE_OBJECT_TYPE; case 6: // OBJECT_ID return OBJECT_ID; 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 __OBJECTID_ISSET_ID = 0; 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.OBJECT_NAME, new org.apache.thrift.meta_data.FieldMetaData("objectName", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OBJECT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("objectType", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDBObjectType.class))); tmpMap.put(_Fields.PRIVS, new org.apache.thrift.meta_data.FieldMetaData("privs", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.BOOL)))); tmpMap.put(_Fields.GRANTEE, new org.apache.thrift.meta_data.FieldMetaData("grantee", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PRIVILEGE_OBJECT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("privilegeObjectType", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDBObjectType.class))); tmpMap.put(_Fields.OBJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("objectId", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TDBObject.class, metaDataMap); } public TDBObject() { } public TDBObject( java.lang.String objectName, TDBObjectType objectType, java.util.List<java.lang.Boolean> privs, java.lang.String grantee, TDBObjectType privilegeObjectType, int objectId) { this(); this.objectName = objectName; this.objectType = objectType; this.privs = privs; this.grantee = grantee; this.privilegeObjectType = privilegeObjectType; this.objectId = objectId; setObjectIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TDBObject(TDBObject other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetObjectName()) { this.objectName = other.objectName; } if (other.isSetObjectType()) { this.objectType = other.objectType; } if (other.isSetPrivs()) { java.util.List<java.lang.Boolean> __this__privs = new java.util.ArrayList<java.lang.Boolean>(other.privs); this.privs = __this__privs; } if (other.isSetGrantee()) { this.grantee = other.grantee; } if (other.isSetPrivilegeObjectType()) { this.privilegeObjectType = other.privilegeObjectType; } this.objectId = other.objectId; } public TDBObject deepCopy() { return new TDBObject(this); } @Override public void clear() { this.objectName = null; this.objectType = null; this.privs = null; this.grantee = null; this.privilegeObjectType = null; setObjectIdIsSet(false); this.objectId = 0; } @org.apache.thrift.annotation.Nullable public java.lang.String getObjectName() { return this.objectName; } public TDBObject setObjectName(@org.apache.thrift.annotation.Nullable java.lang.String objectName) { this.objectName = objectName; return this; } public void unsetObjectName() { this.objectName = null; } /** Returns true if field objectName is set (has been assigned a value) and false otherwise */ public boolean isSetObjectName() { return this.objectName != null; } public void setObjectNameIsSet(boolean value) { if (!value) { this.objectName = null; } } /** * * @see TDBObjectType */ @org.apache.thrift.annotation.Nullable public TDBObjectType getObjectType() { return this.objectType; } /** * * @see TDBObjectType */ public TDBObject setObjectType(@org.apache.thrift.annotation.Nullable TDBObjectType objectType) { this.objectType = objectType; return this; } public void unsetObjectType() { this.objectType = null; } /** Returns true if field objectType is set (has been assigned a value) and false otherwise */ public boolean isSetObjectType() { return this.objectType != null; } public void setObjectTypeIsSet(boolean value) { if (!value) { this.objectType = null; } } public int getPrivsSize() { return (this.privs == null) ? 0 : this.privs.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Boolean> getPrivsIterator() { return (this.privs == null) ? null : this.privs.iterator(); } public void addToPrivs(boolean elem) { if (this.privs == null) { this.privs = new java.util.ArrayList<java.lang.Boolean>(); } this.privs.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Boolean> getPrivs() { return this.privs; } public TDBObject setPrivs(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Boolean> privs) { this.privs = privs; return this; } public void unsetPrivs() { this.privs = null; } /** Returns true if field privs is set (has been assigned a value) and false otherwise */ public boolean isSetPrivs() { return this.privs != null; } public void setPrivsIsSet(boolean value) { if (!value) { this.privs = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getGrantee() { return this.grantee; } public TDBObject setGrantee(@org.apache.thrift.annotation.Nullable java.lang.String grantee) { this.grantee = grantee; return this; } public void unsetGrantee() { this.grantee = null; } /** Returns true if field grantee is set (has been assigned a value) and false otherwise */ public boolean isSetGrantee() { return this.grantee != null; } public void setGranteeIsSet(boolean value) { if (!value) { this.grantee = null; } } /** * * @see TDBObjectType */ @org.apache.thrift.annotation.Nullable public TDBObjectType getPrivilegeObjectType() { return this.privilegeObjectType; } /** * * @see TDBObjectType */ public TDBObject setPrivilegeObjectType(@org.apache.thrift.annotation.Nullable TDBObjectType privilegeObjectType) { this.privilegeObjectType = privilegeObjectType; return this; } public void unsetPrivilegeObjectType() { this.privilegeObjectType = null; } /** Returns true if field privilegeObjectType is set (has been assigned a value) and false otherwise */ public boolean isSetPrivilegeObjectType() { return this.privilegeObjectType != null; } public void setPrivilegeObjectTypeIsSet(boolean value) { if (!value) { this.privilegeObjectType = null; } } public int getObjectId() { return this.objectId; } public TDBObject setObjectId(int objectId) { this.objectId = objectId; setObjectIdIsSet(true); return this; } public void unsetObjectId() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OBJECTID_ISSET_ID); } /** Returns true if field objectId is set (has been assigned a value) and false otherwise */ public boolean isSetObjectId() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OBJECTID_ISSET_ID); } public void setObjectIdIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OBJECTID_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OBJECT_NAME: if (value == null) { unsetObjectName(); } else { setObjectName((java.lang.String)value); } break; case OBJECT_TYPE: if (value == null) { unsetObjectType(); } else { setObjectType((TDBObjectType)value); } break; case PRIVS: if (value == null) { unsetPrivs(); } else { setPrivs((java.util.List<java.lang.Boolean>)value); } break; case GRANTEE: if (value == null) { unsetGrantee(); } else { setGrantee((java.lang.String)value); } break; case PRIVILEGE_OBJECT_TYPE: if (value == null) { unsetPrivilegeObjectType(); } else { setPrivilegeObjectType((TDBObjectType)value); } break; case OBJECT_ID: if (value == null) { unsetObjectId(); } else { setObjectId((java.lang.Integer)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OBJECT_NAME: return getObjectName(); case OBJECT_TYPE: return getObjectType(); case PRIVS: return getPrivs(); case GRANTEE: return getGrantee(); case PRIVILEGE_OBJECT_TYPE: return getPrivilegeObjectType(); case OBJECT_ID: return getObjectId(); } 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 OBJECT_NAME: return isSetObjectName(); case OBJECT_TYPE: return isSetObjectType(); case PRIVS: return isSetPrivs(); case GRANTEE: return isSetGrantee(); case PRIVILEGE_OBJECT_TYPE: return isSetPrivilegeObjectType(); case OBJECT_ID: return isSetObjectId(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDBObject) return this.equals((TDBObject)that); return false; } public boolean equals(TDBObject that) { if (that == null) return false; if (this == that) return true; boolean this_present_objectName = true && this.isSetObjectName(); boolean that_present_objectName = true && that.isSetObjectName(); if (this_present_objectName || that_present_objectName) { if (!(this_present_objectName && that_present_objectName)) return false; if (!this.objectName.equals(that.objectName)) return false; } boolean this_present_objectType = true && this.isSetObjectType(); boolean that_present_objectType = true && that.isSetObjectType(); if (this_present_objectType || that_present_objectType) { if (!(this_present_objectType && that_present_objectType)) return false; if (!this.objectType.equals(that.objectType)) return false; } boolean this_present_privs = true && this.isSetPrivs(); boolean that_present_privs = true && that.isSetPrivs(); if (this_present_privs || that_present_privs) { if (!(this_present_privs && that_present_privs)) return false; if (!this.privs.equals(that.privs)) return false; } boolean this_present_grantee = true && this.isSetGrantee(); boolean that_present_grantee = true && that.isSetGrantee(); if (this_present_grantee || that_present_grantee) { if (!(this_present_grantee && that_present_grantee)) return false; if (!this.grantee.equals(that.grantee)) return false; } boolean this_present_privilegeObjectType = true && this.isSetPrivilegeObjectType(); boolean that_present_privilegeObjectType = true && that.isSetPrivilegeObjectType(); if (this_present_privilegeObjectType || that_present_privilegeObjectType) { if (!(this_present_privilegeObjectType && that_present_privilegeObjectType)) return false; if (!this.privilegeObjectType.equals(that.privilegeObjectType)) return false; } boolean this_present_objectId = true; boolean that_present_objectId = true; if (this_present_objectId || that_present_objectId) { if (!(this_present_objectId && that_present_objectId)) return false; if (this.objectId != that.objectId) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetObjectName()) ? 131071 : 524287); if (isSetObjectName()) hashCode = hashCode * 8191 + objectName.hashCode(); hashCode = hashCode * 8191 + ((isSetObjectType()) ? 131071 : 524287); if (isSetObjectType()) hashCode = hashCode * 8191 + objectType.getValue(); hashCode = hashCode * 8191 + ((isSetPrivs()) ? 131071 : 524287); if (isSetPrivs()) hashCode = hashCode * 8191 + privs.hashCode(); hashCode = hashCode * 8191 + ((isSetGrantee()) ? 131071 : 524287); if (isSetGrantee()) hashCode = hashCode * 8191 + grantee.hashCode(); hashCode = hashCode * 8191 + ((isSetPrivilegeObjectType()) ? 131071 : 524287); if (isSetPrivilegeObjectType()) hashCode = hashCode * 8191 + privilegeObjectType.getValue(); hashCode = hashCode * 8191 + objectId; return hashCode; } @Override public int compareTo(TDBObject other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetObjectName(), other.isSetObjectName()); if (lastComparison != 0) { return lastComparison; } if (isSetObjectName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectName, other.objectName); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetObjectType(), other.isSetObjectType()); if (lastComparison != 0) { return lastComparison; } if (isSetObjectType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectType, other.objectType); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPrivs(), other.isSetPrivs()); if (lastComparison != 0) { return lastComparison; } if (isSetPrivs()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privs, other.privs); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetGrantee(), other.isSetGrantee()); if (lastComparison != 0) { return lastComparison; } if (isSetGrantee()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grantee, other.grantee); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPrivilegeObjectType(), other.isSetPrivilegeObjectType()); if (lastComparison != 0) { return lastComparison; } if (isSetPrivilegeObjectType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privilegeObjectType, other.privilegeObjectType); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetObjectId(), other.isSetObjectId()); if (lastComparison != 0) { return lastComparison; } if (isSetObjectId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectId, other.objectId); 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("TDBObject("); boolean first = true; sb.append("objectName:"); if (this.objectName == null) { sb.append("null"); } else { sb.append(this.objectName); } first = false; if (!first) sb.append(", "); sb.append("objectType:"); if (this.objectType == null) { sb.append("null"); } else { sb.append(this.objectType); } first = false; if (!first) sb.append(", "); sb.append("privs:"); if (this.privs == null) { sb.append("null"); } else { sb.append(this.privs); } first = false; if (!first) sb.append(", "); sb.append("grantee:"); if (this.grantee == null) { sb.append("null"); } else { sb.append(this.grantee); } first = false; if (!first) sb.append(", "); sb.append("privilegeObjectType:"); if (this.privilegeObjectType == null) { sb.append("null"); } else { sb.append(this.privilegeObjectType); } first = false; if (!first) sb.append(", "); sb.append("objectId:"); sb.append(this.objectId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TDBObjectStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDBObjectStandardScheme getScheme() { return new TDBObjectStandardScheme(); } } private static class TDBObjectStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDBObject> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDBObject 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: // OBJECT_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.objectName = iprot.readString(); struct.setObjectNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // OBJECT_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.objectType = ai.heavy.thrift.server.TDBObjectType.findByValue(iprot.readI32()); struct.setObjectTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PRIVS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list298 = iprot.readListBegin(); struct.privs = new java.util.ArrayList<java.lang.Boolean>(_list298.size); boolean _elem299; for (int _i300 = 0; _i300 < _list298.size; ++_i300) { _elem299 = iprot.readBool(); struct.privs.add(_elem299); } iprot.readListEnd(); } struct.setPrivsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // GRANTEE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.grantee = iprot.readString(); struct.setGranteeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // PRIVILEGE_OBJECT_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.privilegeObjectType = ai.heavy.thrift.server.TDBObjectType.findByValue(iprot.readI32()); struct.setPrivilegeObjectTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // OBJECT_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.objectId = iprot.readI32(); struct.setObjectIdIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDBObject struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.objectName != null) { oprot.writeFieldBegin(OBJECT_NAME_FIELD_DESC); oprot.writeString(struct.objectName); oprot.writeFieldEnd(); } if (struct.objectType != null) { oprot.writeFieldBegin(OBJECT_TYPE_FIELD_DESC); oprot.writeI32(struct.objectType.getValue()); oprot.writeFieldEnd(); } if (struct.privs != null) { oprot.writeFieldBegin(PRIVS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.privs.size())); for (boolean _iter301 : struct.privs) { oprot.writeBool(_iter301); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.grantee != null) { oprot.writeFieldBegin(GRANTEE_FIELD_DESC); oprot.writeString(struct.grantee); oprot.writeFieldEnd(); } if (struct.privilegeObjectType != null) { oprot.writeFieldBegin(PRIVILEGE_OBJECT_TYPE_FIELD_DESC); oprot.writeI32(struct.privilegeObjectType.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(OBJECT_ID_FIELD_DESC); oprot.writeI32(struct.objectId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDBObjectTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDBObjectTupleScheme getScheme() { return new TDBObjectTupleScheme(); } } private static class TDBObjectTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDBObject> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDBObject struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetObjectName()) { optionals.set(0); } if (struct.isSetObjectType()) { optionals.set(1); } if (struct.isSetPrivs()) { optionals.set(2); } if (struct.isSetGrantee()) { optionals.set(3); } if (struct.isSetPrivilegeObjectType()) { optionals.set(4); } if (struct.isSetObjectId()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetObjectName()) { oprot.writeString(struct.objectName); } if (struct.isSetObjectType()) { oprot.writeI32(struct.objectType.getValue()); } if (struct.isSetPrivs()) { { oprot.writeI32(struct.privs.size()); for (boolean _iter302 : struct.privs) { oprot.writeBool(_iter302); } } } if (struct.isSetGrantee()) { oprot.writeString(struct.grantee); } if (struct.isSetPrivilegeObjectType()) { oprot.writeI32(struct.privilegeObjectType.getValue()); } if (struct.isSetObjectId()) { oprot.writeI32(struct.objectId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDBObject struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.objectName = iprot.readString(); struct.setObjectNameIsSet(true); } if (incoming.get(1)) { struct.objectType = ai.heavy.thrift.server.TDBObjectType.findByValue(iprot.readI32()); struct.setObjectTypeIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list303 = iprot.readListBegin(org.apache.thrift.protocol.TType.BOOL); struct.privs = new java.util.ArrayList<java.lang.Boolean>(_list303.size); boolean _elem304; for (int _i305 = 0; _i305 < _list303.size; ++_i305) { _elem304 = iprot.readBool(); struct.privs.add(_elem304); } } struct.setPrivsIsSet(true); } if (incoming.get(3)) { struct.grantee = iprot.readString(); struct.setGranteeIsSet(true); } if (incoming.get(4)) { struct.privilegeObjectType = ai.heavy.thrift.server.TDBObjectType.findByValue(iprot.readI32()); struct.setPrivilegeObjectTypeIsSet(true); } if (incoming.get(5)) { struct.objectId = iprot.readI32(); struct.setObjectIdIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDBObjectPermissions.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDBObjectPermissions extends org.apache.thrift.TUnion<TDBObjectPermissions, TDBObjectPermissions._Fields> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDBObjectPermissions"); private static final org.apache.thrift.protocol.TField DATABASE_PERMISSIONS__FIELD_DESC = new org.apache.thrift.protocol.TField("database_permissions_", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TABLE_PERMISSIONS__FIELD_DESC = new org.apache.thrift.protocol.TField("table_permissions_", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField DASHBOARD_PERMISSIONS__FIELD_DESC = new org.apache.thrift.protocol.TField("dashboard_permissions_", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField VIEW_PERMISSIONS__FIELD_DESC = new org.apache.thrift.protocol.TField("view_permissions_", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField SERVER_PERMISSIONS__FIELD_DESC = new org.apache.thrift.protocol.TField("server_permissions_", org.apache.thrift.protocol.TType.STRUCT, (short)5); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DATABASE_PERMISSIONS_((short)1, "database_permissions_"), TABLE_PERMISSIONS_((short)2, "table_permissions_"), DASHBOARD_PERMISSIONS_((short)3, "dashboard_permissions_"), VIEW_PERMISSIONS_((short)4, "view_permissions_"), SERVER_PERMISSIONS_((short)5, "server_permissions_"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // DATABASE_PERMISSIONS_ return DATABASE_PERMISSIONS_; case 2: // TABLE_PERMISSIONS_ return TABLE_PERMISSIONS_; case 3: // DASHBOARD_PERMISSIONS_ return DASHBOARD_PERMISSIONS_; case 4: // VIEW_PERMISSIONS_ return VIEW_PERMISSIONS_; case 5: // SERVER_PERMISSIONS_ return SERVER_PERMISSIONS_; 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; } } 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.DATABASE_PERMISSIONS_, new org.apache.thrift.meta_data.FieldMetaData("database_permissions_", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatabasePermissions.class))); tmpMap.put(_Fields.TABLE_PERMISSIONS_, new org.apache.thrift.meta_data.FieldMetaData("table_permissions_", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTablePermissions.class))); tmpMap.put(_Fields.DASHBOARD_PERMISSIONS_, new org.apache.thrift.meta_data.FieldMetaData("dashboard_permissions_", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDashboardPermissions.class))); tmpMap.put(_Fields.VIEW_PERMISSIONS_, new org.apache.thrift.meta_data.FieldMetaData("view_permissions_", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TViewPermissions.class))); tmpMap.put(_Fields.SERVER_PERMISSIONS_, new org.apache.thrift.meta_data.FieldMetaData("server_permissions_", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TServerPermissions.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDBObjectPermissions.class, metaDataMap); } public TDBObjectPermissions() { super(); } public TDBObjectPermissions(_Fields setField, java.lang.Object value) { super(setField, value); } public TDBObjectPermissions(TDBObjectPermissions other) { super(other); } public TDBObjectPermissions deepCopy() { return new TDBObjectPermissions(this); } public static TDBObjectPermissions database_permissions_(TDatabasePermissions value) { TDBObjectPermissions x = new TDBObjectPermissions(); x.setDatabase_permissions_(value); return x; } public static TDBObjectPermissions table_permissions_(TTablePermissions value) { TDBObjectPermissions x = new TDBObjectPermissions(); x.setTable_permissions_(value); return x; } public static TDBObjectPermissions dashboard_permissions_(TDashboardPermissions value) { TDBObjectPermissions x = new TDBObjectPermissions(); x.setDashboard_permissions_(value); return x; } public static TDBObjectPermissions view_permissions_(TViewPermissions value) { TDBObjectPermissions x = new TDBObjectPermissions(); x.setView_permissions_(value); return x; } public static TDBObjectPermissions server_permissions_(TServerPermissions value) { TDBObjectPermissions x = new TDBObjectPermissions(); x.setServer_permissions_(value); return x; } @Override protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case DATABASE_PERMISSIONS_: if (value instanceof TDatabasePermissions) { break; } throw new java.lang.ClassCastException("Was expecting value of type TDatabasePermissions for field 'database_permissions_', but got " + value.getClass().getSimpleName()); case TABLE_PERMISSIONS_: if (value instanceof TTablePermissions) { break; } throw new java.lang.ClassCastException("Was expecting value of type TTablePermissions for field 'table_permissions_', but got " + value.getClass().getSimpleName()); case DASHBOARD_PERMISSIONS_: if (value instanceof TDashboardPermissions) { break; } throw new java.lang.ClassCastException("Was expecting value of type TDashboardPermissions for field 'dashboard_permissions_', but got " + value.getClass().getSimpleName()); case VIEW_PERMISSIONS_: if (value instanceof TViewPermissions) { break; } throw new java.lang.ClassCastException("Was expecting value of type TViewPermissions for field 'view_permissions_', but got " + value.getClass().getSimpleName()); case SERVER_PERMISSIONS_: if (value instanceof TServerPermissions) { break; } throw new java.lang.ClassCastException("Was expecting value of type TServerPermissions for field 'server_permissions_', but got " + value.getClass().getSimpleName()); default: throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { case DATABASE_PERMISSIONS_: if (field.type == DATABASE_PERMISSIONS__FIELD_DESC.type) { TDatabasePermissions database_permissions_; database_permissions_ = new TDatabasePermissions(); database_permissions_.read(iprot); return database_permissions_; } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } case TABLE_PERMISSIONS_: if (field.type == TABLE_PERMISSIONS__FIELD_DESC.type) { TTablePermissions table_permissions_; table_permissions_ = new TTablePermissions(); table_permissions_.read(iprot); return table_permissions_; } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } case DASHBOARD_PERMISSIONS_: if (field.type == DASHBOARD_PERMISSIONS__FIELD_DESC.type) { TDashboardPermissions dashboard_permissions_; dashboard_permissions_ = new TDashboardPermissions(); dashboard_permissions_.read(iprot); return dashboard_permissions_; } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } case VIEW_PERMISSIONS_: if (field.type == VIEW_PERMISSIONS__FIELD_DESC.type) { TViewPermissions view_permissions_; view_permissions_ = new TViewPermissions(); view_permissions_.read(iprot); return view_permissions_; } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } case SERVER_PERMISSIONS_: if (field.type == SERVER_PERMISSIONS__FIELD_DESC.type) { TServerPermissions server_permissions_; server_permissions_ = new TServerPermissions(); server_permissions_.read(iprot); return server_permissions_; } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } default: throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } } @Override protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case DATABASE_PERMISSIONS_: TDatabasePermissions database_permissions_ = (TDatabasePermissions)value_; database_permissions_.write(oprot); return; case TABLE_PERMISSIONS_: TTablePermissions table_permissions_ = (TTablePermissions)value_; table_permissions_.write(oprot); return; case DASHBOARD_PERMISSIONS_: TDashboardPermissions dashboard_permissions_ = (TDashboardPermissions)value_; dashboard_permissions_.write(oprot); return; case VIEW_PERMISSIONS_: TViewPermissions view_permissions_ = (TViewPermissions)value_; view_permissions_.write(oprot); return; case SERVER_PERMISSIONS_: TServerPermissions server_permissions_ = (TServerPermissions)value_; server_permissions_.write(oprot); return; default: throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case DATABASE_PERMISSIONS_: TDatabasePermissions database_permissions_; database_permissions_ = new TDatabasePermissions(); database_permissions_.read(iprot); return database_permissions_; case TABLE_PERMISSIONS_: TTablePermissions table_permissions_; table_permissions_ = new TTablePermissions(); table_permissions_.read(iprot); return table_permissions_; case DASHBOARD_PERMISSIONS_: TDashboardPermissions dashboard_permissions_; dashboard_permissions_ = new TDashboardPermissions(); dashboard_permissions_.read(iprot); return dashboard_permissions_; case VIEW_PERMISSIONS_: TViewPermissions view_permissions_; view_permissions_ = new TViewPermissions(); view_permissions_.read(iprot); return view_permissions_; case SERVER_PERMISSIONS_: TServerPermissions server_permissions_; server_permissions_ = new TServerPermissions(); server_permissions_.read(iprot); return server_permissions_; default: throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @Override protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case DATABASE_PERMISSIONS_: TDatabasePermissions database_permissions_ = (TDatabasePermissions)value_; database_permissions_.write(oprot); return; case TABLE_PERMISSIONS_: TTablePermissions table_permissions_ = (TTablePermissions)value_; table_permissions_.write(oprot); return; case DASHBOARD_PERMISSIONS_: TDashboardPermissions dashboard_permissions_ = (TDashboardPermissions)value_; dashboard_permissions_.write(oprot); return; case VIEW_PERMISSIONS_: TViewPermissions view_permissions_ = (TViewPermissions)value_; view_permissions_.write(oprot); return; case SERVER_PERMISSIONS_: TServerPermissions server_permissions_ = (TServerPermissions)value_; server_permissions_.write(oprot); return; default: throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { switch (setField) { case DATABASE_PERMISSIONS_: return DATABASE_PERMISSIONS__FIELD_DESC; case TABLE_PERMISSIONS_: return TABLE_PERMISSIONS__FIELD_DESC; case DASHBOARD_PERMISSIONS_: return DASHBOARD_PERMISSIONS__FIELD_DESC; case VIEW_PERMISSIONS_: return VIEW_PERMISSIONS__FIELD_DESC; case SERVER_PERMISSIONS_: return SERVER_PERMISSIONS__FIELD_DESC; default: throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override protected org.apache.thrift.protocol.TStruct getStructDesc() { return STRUCT_DESC; } @Override protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public TDatabasePermissions getDatabase_permissions_() { if (getSetField() == _Fields.DATABASE_PERMISSIONS_) { return (TDatabasePermissions)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'database_permissions_' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setDatabase_permissions_(TDatabasePermissions value) { setField_ = _Fields.DATABASE_PERMISSIONS_; value_ = java.util.Objects.requireNonNull(value,"_Fields.DATABASE_PERMISSIONS_"); } public TTablePermissions getTable_permissions_() { if (getSetField() == _Fields.TABLE_PERMISSIONS_) { return (TTablePermissions)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'table_permissions_' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setTable_permissions_(TTablePermissions value) { setField_ = _Fields.TABLE_PERMISSIONS_; value_ = java.util.Objects.requireNonNull(value,"_Fields.TABLE_PERMISSIONS_"); } public TDashboardPermissions getDashboard_permissions_() { if (getSetField() == _Fields.DASHBOARD_PERMISSIONS_) { return (TDashboardPermissions)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'dashboard_permissions_' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setDashboard_permissions_(TDashboardPermissions value) { setField_ = _Fields.DASHBOARD_PERMISSIONS_; value_ = java.util.Objects.requireNonNull(value,"_Fields.DASHBOARD_PERMISSIONS_"); } public TViewPermissions getView_permissions_() { if (getSetField() == _Fields.VIEW_PERMISSIONS_) { return (TViewPermissions)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'view_permissions_' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setView_permissions_(TViewPermissions value) { setField_ = _Fields.VIEW_PERMISSIONS_; value_ = java.util.Objects.requireNonNull(value,"_Fields.VIEW_PERMISSIONS_"); } public TServerPermissions getServer_permissions_() { if (getSetField() == _Fields.SERVER_PERMISSIONS_) { return (TServerPermissions)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'server_permissions_' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setServer_permissions_(TServerPermissions value) { setField_ = _Fields.SERVER_PERMISSIONS_; value_ = java.util.Objects.requireNonNull(value,"_Fields.SERVER_PERMISSIONS_"); } public boolean isSetDatabase_permissions_() { return setField_ == _Fields.DATABASE_PERMISSIONS_; } public boolean isSetTable_permissions_() { return setField_ == _Fields.TABLE_PERMISSIONS_; } public boolean isSetDashboard_permissions_() { return setField_ == _Fields.DASHBOARD_PERMISSIONS_; } public boolean isSetView_permissions_() { return setField_ == _Fields.VIEW_PERMISSIONS_; } public boolean isSetServer_permissions_() { return setField_ == _Fields.SERVER_PERMISSIONS_; } public boolean equals(java.lang.Object other) { if (other instanceof TDBObjectPermissions) { return equals((TDBObjectPermissions)other); } else { return false; } } public boolean equals(TDBObjectPermissions other) { return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); } @Override public int compareTo(TDBObjectPermissions other) { int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); if (lastComparison == 0) { return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); } return lastComparison; } @Override public int hashCode() { java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { list.add(value); } } return list.hashCode(); } 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 { 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); } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDBObjectType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TDBObjectType implements org.apache.thrift.TEnum { AbstractDBObjectType(0), DatabaseDBObjectType(1), TableDBObjectType(2), DashboardDBObjectType(3), ViewDBObjectType(4), ServerDBObjectType(5); private final int value; private TDBObjectType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TDBObjectType findByValue(int value) { switch (value) { case 0: return AbstractDBObjectType; case 1: return DatabaseDBObjectType; case 2: return TableDBObjectType; case 3: return DashboardDBObjectType; case 4: return ViewDBObjectType; case 5: return ServerDBObjectType; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDashboard.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDashboard implements org.apache.thrift.TBase<TDashboard, TDashboard._Fields>, java.io.Serializable, Cloneable, Comparable<TDashboard> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDashboard"); private static final org.apache.thrift.protocol.TField DASHBOARD_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("dashboard_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField DASHBOARD_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("dashboard_state", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField IMAGE_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("image_hash", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("update_time", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField DASHBOARD_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("dashboard_metadata", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField DASHBOARD_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dashboard_id", org.apache.thrift.protocol.TType.I32, (short)6); private static final org.apache.thrift.protocol.TField DASHBOARD_OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("dashboard_owner", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField IS_DASH_SHARED_FIELD_DESC = new org.apache.thrift.protocol.TField("is_dash_shared", org.apache.thrift.protocol.TType.BOOL, (short)8); private static final org.apache.thrift.protocol.TField DASHBOARD_PERMISSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("dashboard_permissions", org.apache.thrift.protocol.TType.STRUCT, (short)9); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDashboardStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDashboardTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String dashboard_name; // required public @org.apache.thrift.annotation.Nullable java.lang.String dashboard_state; // required public @org.apache.thrift.annotation.Nullable java.lang.String image_hash; // required public @org.apache.thrift.annotation.Nullable java.lang.String update_time; // required public @org.apache.thrift.annotation.Nullable java.lang.String dashboard_metadata; // required public int dashboard_id; // required public @org.apache.thrift.annotation.Nullable java.lang.String dashboard_owner; // required public boolean is_dash_shared; // required public @org.apache.thrift.annotation.Nullable TDashboardPermissions dashboard_permissions; // 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 { DASHBOARD_NAME((short)1, "dashboard_name"), DASHBOARD_STATE((short)2, "dashboard_state"), IMAGE_HASH((short)3, "image_hash"), UPDATE_TIME((short)4, "update_time"), DASHBOARD_METADATA((short)5, "dashboard_metadata"), DASHBOARD_ID((short)6, "dashboard_id"), DASHBOARD_OWNER((short)7, "dashboard_owner"), IS_DASH_SHARED((short)8, "is_dash_shared"), DASHBOARD_PERMISSIONS((short)9, "dashboard_permissions"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // DASHBOARD_NAME return DASHBOARD_NAME; case 2: // DASHBOARD_STATE return DASHBOARD_STATE; case 3: // IMAGE_HASH return IMAGE_HASH; case 4: // UPDATE_TIME return UPDATE_TIME; case 5: // DASHBOARD_METADATA return DASHBOARD_METADATA; case 6: // DASHBOARD_ID return DASHBOARD_ID; case 7: // DASHBOARD_OWNER return DASHBOARD_OWNER; case 8: // IS_DASH_SHARED return IS_DASH_SHARED; case 9: // DASHBOARD_PERMISSIONS return DASHBOARD_PERMISSIONS; 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 __DASHBOARD_ID_ISSET_ID = 0; private static final int __IS_DASH_SHARED_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.DASHBOARD_NAME, new org.apache.thrift.meta_data.FieldMetaData("dashboard_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DASHBOARD_STATE, new org.apache.thrift.meta_data.FieldMetaData("dashboard_state", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IMAGE_HASH, new org.apache.thrift.meta_data.FieldMetaData("image_hash", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("update_time", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DASHBOARD_METADATA, new org.apache.thrift.meta_data.FieldMetaData("dashboard_metadata", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DASHBOARD_ID, new org.apache.thrift.meta_data.FieldMetaData("dashboard_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DASHBOARD_OWNER, new org.apache.thrift.meta_data.FieldMetaData("dashboard_owner", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_DASH_SHARED, new org.apache.thrift.meta_data.FieldMetaData("is_dash_shared", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DASHBOARD_PERMISSIONS, new org.apache.thrift.meta_data.FieldMetaData("dashboard_permissions", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDashboardPermissions.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDashboard.class, metaDataMap); } public TDashboard() { } public TDashboard( java.lang.String dashboard_name, java.lang.String dashboard_state, java.lang.String image_hash, java.lang.String update_time, java.lang.String dashboard_metadata, int dashboard_id, java.lang.String dashboard_owner, boolean is_dash_shared, TDashboardPermissions dashboard_permissions) { this(); this.dashboard_name = dashboard_name; this.dashboard_state = dashboard_state; this.image_hash = image_hash; this.update_time = update_time; this.dashboard_metadata = dashboard_metadata; this.dashboard_id = dashboard_id; setDashboard_idIsSet(true); this.dashboard_owner = dashboard_owner; this.is_dash_shared = is_dash_shared; setIs_dash_sharedIsSet(true); this.dashboard_permissions = dashboard_permissions; } /** * Performs a deep copy on <i>other</i>. */ public TDashboard(TDashboard other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetDashboard_name()) { this.dashboard_name = other.dashboard_name; } if (other.isSetDashboard_state()) { this.dashboard_state = other.dashboard_state; } if (other.isSetImage_hash()) { this.image_hash = other.image_hash; } if (other.isSetUpdate_time()) { this.update_time = other.update_time; } if (other.isSetDashboard_metadata()) { this.dashboard_metadata = other.dashboard_metadata; } this.dashboard_id = other.dashboard_id; if (other.isSetDashboard_owner()) { this.dashboard_owner = other.dashboard_owner; } this.is_dash_shared = other.is_dash_shared; if (other.isSetDashboard_permissions()) { this.dashboard_permissions = new TDashboardPermissions(other.dashboard_permissions); } } public TDashboard deepCopy() { return new TDashboard(this); } @Override public void clear() { this.dashboard_name = null; this.dashboard_state = null; this.image_hash = null; this.update_time = null; this.dashboard_metadata = null; setDashboard_idIsSet(false); this.dashboard_id = 0; this.dashboard_owner = null; setIs_dash_sharedIsSet(false); this.is_dash_shared = false; this.dashboard_permissions = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getDashboard_name() { return this.dashboard_name; } public TDashboard setDashboard_name(@org.apache.thrift.annotation.Nullable java.lang.String dashboard_name) { this.dashboard_name = dashboard_name; return this; } public void unsetDashboard_name() { this.dashboard_name = null; } /** Returns true if field dashboard_name is set (has been assigned a value) and false otherwise */ public boolean isSetDashboard_name() { return this.dashboard_name != null; } public void setDashboard_nameIsSet(boolean value) { if (!value) { this.dashboard_name = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getDashboard_state() { return this.dashboard_state; } public TDashboard setDashboard_state(@org.apache.thrift.annotation.Nullable java.lang.String dashboard_state) { this.dashboard_state = dashboard_state; return this; } public void unsetDashboard_state() { this.dashboard_state = null; } /** Returns true if field dashboard_state is set (has been assigned a value) and false otherwise */ public boolean isSetDashboard_state() { return this.dashboard_state != null; } public void setDashboard_stateIsSet(boolean value) { if (!value) { this.dashboard_state = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getImage_hash() { return this.image_hash; } public TDashboard setImage_hash(@org.apache.thrift.annotation.Nullable java.lang.String image_hash) { this.image_hash = image_hash; return this; } public void unsetImage_hash() { this.image_hash = null; } /** Returns true if field image_hash is set (has been assigned a value) and false otherwise */ public boolean isSetImage_hash() { return this.image_hash != null; } public void setImage_hashIsSet(boolean value) { if (!value) { this.image_hash = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getUpdate_time() { return this.update_time; } public TDashboard setUpdate_time(@org.apache.thrift.annotation.Nullable java.lang.String update_time) { this.update_time = update_time; return this; } public void unsetUpdate_time() { this.update_time = null; } /** Returns true if field update_time is set (has been assigned a value) and false otherwise */ public boolean isSetUpdate_time() { return this.update_time != null; } public void setUpdate_timeIsSet(boolean value) { if (!value) { this.update_time = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getDashboard_metadata() { return this.dashboard_metadata; } public TDashboard setDashboard_metadata(@org.apache.thrift.annotation.Nullable java.lang.String dashboard_metadata) { this.dashboard_metadata = dashboard_metadata; return this; } public void unsetDashboard_metadata() { this.dashboard_metadata = null; } /** Returns true if field dashboard_metadata is set (has been assigned a value) and false otherwise */ public boolean isSetDashboard_metadata() { return this.dashboard_metadata != null; } public void setDashboard_metadataIsSet(boolean value) { if (!value) { this.dashboard_metadata = null; } } public int getDashboard_id() { return this.dashboard_id; } public TDashboard setDashboard_id(int dashboard_id) { this.dashboard_id = dashboard_id; setDashboard_idIsSet(true); return this; } public void unsetDashboard_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DASHBOARD_ID_ISSET_ID); } /** Returns true if field dashboard_id is set (has been assigned a value) and false otherwise */ public boolean isSetDashboard_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DASHBOARD_ID_ISSET_ID); } public void setDashboard_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DASHBOARD_ID_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getDashboard_owner() { return this.dashboard_owner; } public TDashboard setDashboard_owner(@org.apache.thrift.annotation.Nullable java.lang.String dashboard_owner) { this.dashboard_owner = dashboard_owner; return this; } public void unsetDashboard_owner() { this.dashboard_owner = null; } /** Returns true if field dashboard_owner is set (has been assigned a value) and false otherwise */ public boolean isSetDashboard_owner() { return this.dashboard_owner != null; } public void setDashboard_ownerIsSet(boolean value) { if (!value) { this.dashboard_owner = null; } } public boolean isIs_dash_shared() { return this.is_dash_shared; } public TDashboard setIs_dash_shared(boolean is_dash_shared) { this.is_dash_shared = is_dash_shared; setIs_dash_sharedIsSet(true); return this; } public void unsetIs_dash_shared() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_DASH_SHARED_ISSET_ID); } /** Returns true if field is_dash_shared is set (has been assigned a value) and false otherwise */ public boolean isSetIs_dash_shared() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_DASH_SHARED_ISSET_ID); } public void setIs_dash_sharedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_DASH_SHARED_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public TDashboardPermissions getDashboard_permissions() { return this.dashboard_permissions; } public TDashboard setDashboard_permissions(@org.apache.thrift.annotation.Nullable TDashboardPermissions dashboard_permissions) { this.dashboard_permissions = dashboard_permissions; return this; } public void unsetDashboard_permissions() { this.dashboard_permissions = null; } /** Returns true if field dashboard_permissions is set (has been assigned a value) and false otherwise */ public boolean isSetDashboard_permissions() { return this.dashboard_permissions != null; } public void setDashboard_permissionsIsSet(boolean value) { if (!value) { this.dashboard_permissions = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case DASHBOARD_NAME: if (value == null) { unsetDashboard_name(); } else { setDashboard_name((java.lang.String)value); } break; case DASHBOARD_STATE: if (value == null) { unsetDashboard_state(); } else { setDashboard_state((java.lang.String)value); } break; case IMAGE_HASH: if (value == null) { unsetImage_hash(); } else { setImage_hash((java.lang.String)value); } break; case UPDATE_TIME: if (value == null) { unsetUpdate_time(); } else { setUpdate_time((java.lang.String)value); } break; case DASHBOARD_METADATA: if (value == null) { unsetDashboard_metadata(); } else { setDashboard_metadata((java.lang.String)value); } break; case DASHBOARD_ID: if (value == null) { unsetDashboard_id(); } else { setDashboard_id((java.lang.Integer)value); } break; case DASHBOARD_OWNER: if (value == null) { unsetDashboard_owner(); } else { setDashboard_owner((java.lang.String)value); } break; case IS_DASH_SHARED: if (value == null) { unsetIs_dash_shared(); } else { setIs_dash_shared((java.lang.Boolean)value); } break; case DASHBOARD_PERMISSIONS: if (value == null) { unsetDashboard_permissions(); } else { setDashboard_permissions((TDashboardPermissions)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case DASHBOARD_NAME: return getDashboard_name(); case DASHBOARD_STATE: return getDashboard_state(); case IMAGE_HASH: return getImage_hash(); case UPDATE_TIME: return getUpdate_time(); case DASHBOARD_METADATA: return getDashboard_metadata(); case DASHBOARD_ID: return getDashboard_id(); case DASHBOARD_OWNER: return getDashboard_owner(); case IS_DASH_SHARED: return isIs_dash_shared(); case DASHBOARD_PERMISSIONS: return getDashboard_permissions(); } 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 DASHBOARD_NAME: return isSetDashboard_name(); case DASHBOARD_STATE: return isSetDashboard_state(); case IMAGE_HASH: return isSetImage_hash(); case UPDATE_TIME: return isSetUpdate_time(); case DASHBOARD_METADATA: return isSetDashboard_metadata(); case DASHBOARD_ID: return isSetDashboard_id(); case DASHBOARD_OWNER: return isSetDashboard_owner(); case IS_DASH_SHARED: return isSetIs_dash_shared(); case DASHBOARD_PERMISSIONS: return isSetDashboard_permissions(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDashboard) return this.equals((TDashboard)that); return false; } public boolean equals(TDashboard that) { if (that == null) return false; if (this == that) return true; boolean this_present_dashboard_name = true && this.isSetDashboard_name(); boolean that_present_dashboard_name = true && that.isSetDashboard_name(); if (this_present_dashboard_name || that_present_dashboard_name) { if (!(this_present_dashboard_name && that_present_dashboard_name)) return false; if (!this.dashboard_name.equals(that.dashboard_name)) return false; } boolean this_present_dashboard_state = true && this.isSetDashboard_state(); boolean that_present_dashboard_state = true && that.isSetDashboard_state(); if (this_present_dashboard_state || that_present_dashboard_state) { if (!(this_present_dashboard_state && that_present_dashboard_state)) return false; if (!this.dashboard_state.equals(that.dashboard_state)) return false; } boolean this_present_image_hash = true && this.isSetImage_hash(); boolean that_present_image_hash = true && that.isSetImage_hash(); if (this_present_image_hash || that_present_image_hash) { if (!(this_present_image_hash && that_present_image_hash)) return false; if (!this.image_hash.equals(that.image_hash)) return false; } boolean this_present_update_time = true && this.isSetUpdate_time(); boolean that_present_update_time = true && that.isSetUpdate_time(); if (this_present_update_time || that_present_update_time) { if (!(this_present_update_time && that_present_update_time)) return false; if (!this.update_time.equals(that.update_time)) return false; } boolean this_present_dashboard_metadata = true && this.isSetDashboard_metadata(); boolean that_present_dashboard_metadata = true && that.isSetDashboard_metadata(); if (this_present_dashboard_metadata || that_present_dashboard_metadata) { if (!(this_present_dashboard_metadata && that_present_dashboard_metadata)) return false; if (!this.dashboard_metadata.equals(that.dashboard_metadata)) return false; } boolean this_present_dashboard_id = true; boolean that_present_dashboard_id = true; if (this_present_dashboard_id || that_present_dashboard_id) { if (!(this_present_dashboard_id && that_present_dashboard_id)) return false; if (this.dashboard_id != that.dashboard_id) return false; } boolean this_present_dashboard_owner = true && this.isSetDashboard_owner(); boolean that_present_dashboard_owner = true && that.isSetDashboard_owner(); if (this_present_dashboard_owner || that_present_dashboard_owner) { if (!(this_present_dashboard_owner && that_present_dashboard_owner)) return false; if (!this.dashboard_owner.equals(that.dashboard_owner)) return false; } boolean this_present_is_dash_shared = true; boolean that_present_is_dash_shared = true; if (this_present_is_dash_shared || that_present_is_dash_shared) { if (!(this_present_is_dash_shared && that_present_is_dash_shared)) return false; if (this.is_dash_shared != that.is_dash_shared) return false; } boolean this_present_dashboard_permissions = true && this.isSetDashboard_permissions(); boolean that_present_dashboard_permissions = true && that.isSetDashboard_permissions(); if (this_present_dashboard_permissions || that_present_dashboard_permissions) { if (!(this_present_dashboard_permissions && that_present_dashboard_permissions)) return false; if (!this.dashboard_permissions.equals(that.dashboard_permissions)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetDashboard_name()) ? 131071 : 524287); if (isSetDashboard_name()) hashCode = hashCode * 8191 + dashboard_name.hashCode(); hashCode = hashCode * 8191 + ((isSetDashboard_state()) ? 131071 : 524287); if (isSetDashboard_state()) hashCode = hashCode * 8191 + dashboard_state.hashCode(); hashCode = hashCode * 8191 + ((isSetImage_hash()) ? 131071 : 524287); if (isSetImage_hash()) hashCode = hashCode * 8191 + image_hash.hashCode(); hashCode = hashCode * 8191 + ((isSetUpdate_time()) ? 131071 : 524287); if (isSetUpdate_time()) hashCode = hashCode * 8191 + update_time.hashCode(); hashCode = hashCode * 8191 + ((isSetDashboard_metadata()) ? 131071 : 524287); if (isSetDashboard_metadata()) hashCode = hashCode * 8191 + dashboard_metadata.hashCode(); hashCode = hashCode * 8191 + dashboard_id; hashCode = hashCode * 8191 + ((isSetDashboard_owner()) ? 131071 : 524287); if (isSetDashboard_owner()) hashCode = hashCode * 8191 + dashboard_owner.hashCode(); hashCode = hashCode * 8191 + ((is_dash_shared) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetDashboard_permissions()) ? 131071 : 524287); if (isSetDashboard_permissions()) hashCode = hashCode * 8191 + dashboard_permissions.hashCode(); return hashCode; } @Override public int compareTo(TDashboard other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetDashboard_name(), other.isSetDashboard_name()); if (lastComparison != 0) { return lastComparison; } if (isSetDashboard_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dashboard_name, other.dashboard_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDashboard_state(), other.isSetDashboard_state()); if (lastComparison != 0) { return lastComparison; } if (isSetDashboard_state()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dashboard_state, other.dashboard_state); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetImage_hash(), other.isSetImage_hash()); if (lastComparison != 0) { return lastComparison; } if (isSetImage_hash()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_hash, other.image_hash); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetUpdate_time(), other.isSetUpdate_time()); if (lastComparison != 0) { return lastComparison; } if (isSetUpdate_time()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.update_time, other.update_time); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDashboard_metadata(), other.isSetDashboard_metadata()); if (lastComparison != 0) { return lastComparison; } if (isSetDashboard_metadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dashboard_metadata, other.dashboard_metadata); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDashboard_id(), other.isSetDashboard_id()); if (lastComparison != 0) { return lastComparison; } if (isSetDashboard_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dashboard_id, other.dashboard_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDashboard_owner(), other.isSetDashboard_owner()); if (lastComparison != 0) { return lastComparison; } if (isSetDashboard_owner()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dashboard_owner, other.dashboard_owner); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_dash_shared(), other.isSetIs_dash_shared()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_dash_shared()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_dash_shared, other.is_dash_shared); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDashboard_permissions(), other.isSetDashboard_permissions()); if (lastComparison != 0) { return lastComparison; } if (isSetDashboard_permissions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dashboard_permissions, other.dashboard_permissions); 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("TDashboard("); boolean first = true; sb.append("dashboard_name:"); if (this.dashboard_name == null) { sb.append("null"); } else { sb.append(this.dashboard_name); } first = false; if (!first) sb.append(", "); sb.append("dashboard_state:"); if (this.dashboard_state == null) { sb.append("null"); } else { sb.append(this.dashboard_state); } first = false; if (!first) sb.append(", "); sb.append("image_hash:"); if (this.image_hash == null) { sb.append("null"); } else { sb.append(this.image_hash); } first = false; if (!first) sb.append(", "); sb.append("update_time:"); if (this.update_time == null) { sb.append("null"); } else { sb.append(this.update_time); } first = false; if (!first) sb.append(", "); sb.append("dashboard_metadata:"); if (this.dashboard_metadata == null) { sb.append("null"); } else { sb.append(this.dashboard_metadata); } first = false; if (!first) sb.append(", "); sb.append("dashboard_id:"); sb.append(this.dashboard_id); first = false; if (!first) sb.append(", "); sb.append("dashboard_owner:"); if (this.dashboard_owner == null) { sb.append("null"); } else { sb.append(this.dashboard_owner); } first = false; if (!first) sb.append(", "); sb.append("is_dash_shared:"); sb.append(this.is_dash_shared); first = false; if (!first) sb.append(", "); sb.append("dashboard_permissions:"); if (this.dashboard_permissions == null) { sb.append("null"); } else { sb.append(this.dashboard_permissions); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (dashboard_permissions != null) { dashboard_permissions.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 TDashboardStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDashboardStandardScheme getScheme() { return new TDashboardStandardScheme(); } } private static class TDashboardStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDashboard> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDashboard 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: // DASHBOARD_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dashboard_name = iprot.readString(); struct.setDashboard_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DASHBOARD_STATE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dashboard_state = iprot.readString(); struct.setDashboard_stateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // IMAGE_HASH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.image_hash = iprot.readString(); struct.setImage_hashIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // UPDATE_TIME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.update_time = iprot.readString(); struct.setUpdate_timeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // DASHBOARD_METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dashboard_metadata = iprot.readString(); struct.setDashboard_metadataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // DASHBOARD_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.dashboard_id = iprot.readI32(); struct.setDashboard_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // DASHBOARD_OWNER if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dashboard_owner = iprot.readString(); struct.setDashboard_ownerIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // IS_DASH_SHARED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_dash_shared = iprot.readBool(); struct.setIs_dash_sharedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // DASHBOARD_PERMISSIONS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.dashboard_permissions = new TDashboardPermissions(); struct.dashboard_permissions.read(iprot); struct.setDashboard_permissionsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDashboard struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.dashboard_name != null) { oprot.writeFieldBegin(DASHBOARD_NAME_FIELD_DESC); oprot.writeString(struct.dashboard_name); oprot.writeFieldEnd(); } if (struct.dashboard_state != null) { oprot.writeFieldBegin(DASHBOARD_STATE_FIELD_DESC); oprot.writeString(struct.dashboard_state); oprot.writeFieldEnd(); } if (struct.image_hash != null) { oprot.writeFieldBegin(IMAGE_HASH_FIELD_DESC); oprot.writeString(struct.image_hash); oprot.writeFieldEnd(); } if (struct.update_time != null) { oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC); oprot.writeString(struct.update_time); oprot.writeFieldEnd(); } if (struct.dashboard_metadata != null) { oprot.writeFieldBegin(DASHBOARD_METADATA_FIELD_DESC); oprot.writeString(struct.dashboard_metadata); oprot.writeFieldEnd(); } oprot.writeFieldBegin(DASHBOARD_ID_FIELD_DESC); oprot.writeI32(struct.dashboard_id); oprot.writeFieldEnd(); if (struct.dashboard_owner != null) { oprot.writeFieldBegin(DASHBOARD_OWNER_FIELD_DESC); oprot.writeString(struct.dashboard_owner); oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_DASH_SHARED_FIELD_DESC); oprot.writeBool(struct.is_dash_shared); oprot.writeFieldEnd(); if (struct.dashboard_permissions != null) { oprot.writeFieldBegin(DASHBOARD_PERMISSIONS_FIELD_DESC); struct.dashboard_permissions.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDashboardTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDashboardTupleScheme getScheme() { return new TDashboardTupleScheme(); } } private static class TDashboardTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDashboard> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDashboard struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetDashboard_name()) { optionals.set(0); } if (struct.isSetDashboard_state()) { optionals.set(1); } if (struct.isSetImage_hash()) { optionals.set(2); } if (struct.isSetUpdate_time()) { optionals.set(3); } if (struct.isSetDashboard_metadata()) { optionals.set(4); } if (struct.isSetDashboard_id()) { optionals.set(5); } if (struct.isSetDashboard_owner()) { optionals.set(6); } if (struct.isSetIs_dash_shared()) { optionals.set(7); } if (struct.isSetDashboard_permissions()) { optionals.set(8); } oprot.writeBitSet(optionals, 9); if (struct.isSetDashboard_name()) { oprot.writeString(struct.dashboard_name); } if (struct.isSetDashboard_state()) { oprot.writeString(struct.dashboard_state); } if (struct.isSetImage_hash()) { oprot.writeString(struct.image_hash); } if (struct.isSetUpdate_time()) { oprot.writeString(struct.update_time); } if (struct.isSetDashboard_metadata()) { oprot.writeString(struct.dashboard_metadata); } if (struct.isSetDashboard_id()) { oprot.writeI32(struct.dashboard_id); } if (struct.isSetDashboard_owner()) { oprot.writeString(struct.dashboard_owner); } if (struct.isSetIs_dash_shared()) { oprot.writeBool(struct.is_dash_shared); } if (struct.isSetDashboard_permissions()) { struct.dashboard_permissions.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDashboard struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(9); if (incoming.get(0)) { struct.dashboard_name = iprot.readString(); struct.setDashboard_nameIsSet(true); } if (incoming.get(1)) { struct.dashboard_state = iprot.readString(); struct.setDashboard_stateIsSet(true); } if (incoming.get(2)) { struct.image_hash = iprot.readString(); struct.setImage_hashIsSet(true); } if (incoming.get(3)) { struct.update_time = iprot.readString(); struct.setUpdate_timeIsSet(true); } if (incoming.get(4)) { struct.dashboard_metadata = iprot.readString(); struct.setDashboard_metadataIsSet(true); } if (incoming.get(5)) { struct.dashboard_id = iprot.readI32(); struct.setDashboard_idIsSet(true); } if (incoming.get(6)) { struct.dashboard_owner = iprot.readString(); struct.setDashboard_ownerIsSet(true); } if (incoming.get(7)) { struct.is_dash_shared = iprot.readBool(); struct.setIs_dash_sharedIsSet(true); } if (incoming.get(8)) { struct.dashboard_permissions = new TDashboardPermissions(); struct.dashboard_permissions.read(iprot); struct.setDashboard_permissionsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDashboardGrantees.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDashboardGrantees implements org.apache.thrift.TBase<TDashboardGrantees, TDashboardGrantees._Fields>, java.io.Serializable, Cloneable, Comparable<TDashboardGrantees> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDashboardGrantees"); 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)1); private static final org.apache.thrift.protocol.TField IS_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("is_user", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField PERMISSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("permissions", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDashboardGranteesStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDashboardGranteesTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String name; // required public boolean is_user; // required public @org.apache.thrift.annotation.Nullable TDashboardPermissions permissions; // 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 { NAME((short)1, "name"), IS_USER((short)2, "is_user"), PERMISSIONS((short)3, "permissions"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // NAME return NAME; case 2: // IS_USER return IS_USER; case 3: // PERMISSIONS return PERMISSIONS; 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 __IS_USER_ISSET_ID = 0; 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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_USER, new org.apache.thrift.meta_data.FieldMetaData("is_user", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.PERMISSIONS, new org.apache.thrift.meta_data.FieldMetaData("permissions", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDashboardPermissions.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDashboardGrantees.class, metaDataMap); } public TDashboardGrantees() { } public TDashboardGrantees( java.lang.String name, boolean is_user, TDashboardPermissions permissions) { this(); this.name = name; this.is_user = is_user; setIs_userIsSet(true); this.permissions = permissions; } /** * Performs a deep copy on <i>other</i>. */ public TDashboardGrantees(TDashboardGrantees other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = other.name; } this.is_user = other.is_user; if (other.isSetPermissions()) { this.permissions = new TDashboardPermissions(other.permissions); } } public TDashboardGrantees deepCopy() { return new TDashboardGrantees(this); } @Override public void clear() { this.name = null; setIs_userIsSet(false); this.is_user = false; this.permissions = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getName() { return this.name; } public TDashboardGrantees 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 isIs_user() { return this.is_user; } public TDashboardGrantees setIs_user(boolean is_user) { this.is_user = is_user; setIs_userIsSet(true); return this; } public void unsetIs_user() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_USER_ISSET_ID); } /** Returns true if field is_user is set (has been assigned a value) and false otherwise */ public boolean isSetIs_user() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_USER_ISSET_ID); } public void setIs_userIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_USER_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public TDashboardPermissions getPermissions() { return this.permissions; } public TDashboardGrantees setPermissions(@org.apache.thrift.annotation.Nullable TDashboardPermissions permissions) { this.permissions = permissions; return this; } public void unsetPermissions() { this.permissions = null; } /** Returns true if field permissions is set (has been assigned a value) and false otherwise */ public boolean isSetPermissions() { return this.permissions != null; } public void setPermissionsIsSet(boolean value) { if (!value) { this.permissions = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NAME: if (value == null) { unsetName(); } else { setName((java.lang.String)value); } break; case IS_USER: if (value == null) { unsetIs_user(); } else { setIs_user((java.lang.Boolean)value); } break; case PERMISSIONS: if (value == null) { unsetPermissions(); } else { setPermissions((TDashboardPermissions)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME: return getName(); case IS_USER: return isIs_user(); case PERMISSIONS: return getPermissions(); } 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 NAME: return isSetName(); case IS_USER: return isSetIs_user(); case PERMISSIONS: return isSetPermissions(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDashboardGrantees) return this.equals((TDashboardGrantees)that); return false; } public boolean equals(TDashboardGrantees that) { if (that == null) return false; if (this == that) return true; 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_is_user = true; boolean that_present_is_user = true; if (this_present_is_user || that_present_is_user) { if (!(this_present_is_user && that_present_is_user)) return false; if (this.is_user != that.is_user) return false; } boolean this_present_permissions = true && this.isSetPermissions(); boolean that_present_permissions = true && that.isSetPermissions(); if (this_present_permissions || that_present_permissions) { if (!(this_present_permissions && that_present_permissions)) return false; if (!this.permissions.equals(that.permissions)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); if (isSetName()) hashCode = hashCode * 8191 + name.hashCode(); hashCode = hashCode * 8191 + ((is_user) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetPermissions()) ? 131071 : 524287); if (isSetPermissions()) hashCode = hashCode * 8191 + permissions.hashCode(); return hashCode; } @Override public int compareTo(TDashboardGrantees other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; 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(isSetIs_user(), other.isSetIs_user()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_user()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_user, other.is_user); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPermissions(), other.isSetPermissions()); if (lastComparison != 0) { return lastComparison; } if (isSetPermissions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.permissions, other.permissions); 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("TDashboardGrantees("); boolean first = true; sb.append("name:"); if (this.name == null) { sb.append("null"); } else { sb.append(this.name); } first = false; if (!first) sb.append(", "); sb.append("is_user:"); sb.append(this.is_user); first = false; if (!first) sb.append(", "); sb.append("permissions:"); if (this.permissions == null) { sb.append("null"); } else { sb.append(this.permissions); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (permissions != null) { permissions.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 TDashboardGranteesStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDashboardGranteesStandardScheme getScheme() { return new TDashboardGranteesStandardScheme(); } } private static class TDashboardGranteesStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDashboardGrantees> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDashboardGrantees 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: // 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 2: // IS_USER if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_user = iprot.readBool(); struct.setIs_userIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PERMISSIONS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.permissions = new TDashboardPermissions(); struct.permissions.read(iprot); struct.setPermissionsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDashboardGrantees struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(struct.name); oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_USER_FIELD_DESC); oprot.writeBool(struct.is_user); oprot.writeFieldEnd(); if (struct.permissions != null) { oprot.writeFieldBegin(PERMISSIONS_FIELD_DESC); struct.permissions.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDashboardGranteesTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDashboardGranteesTupleScheme getScheme() { return new TDashboardGranteesTupleScheme(); } } private static class TDashboardGranteesTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDashboardGrantees> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDashboardGrantees struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetName()) { optionals.set(0); } if (struct.isSetIs_user()) { optionals.set(1); } if (struct.isSetPermissions()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetName()) { oprot.writeString(struct.name); } if (struct.isSetIs_user()) { oprot.writeBool(struct.is_user); } if (struct.isSetPermissions()) { struct.permissions.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDashboardGrantees struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); } if (incoming.get(1)) { struct.is_user = iprot.readBool(); struct.setIs_userIsSet(true); } if (incoming.get(2)) { struct.permissions = new TDashboardPermissions(); struct.permissions.read(iprot); struct.setPermissionsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDashboardPermissions.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDashboardPermissions implements org.apache.thrift.TBase<TDashboardPermissions, TDashboardPermissions._Fields>, java.io.Serializable, Cloneable, Comparable<TDashboardPermissions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDashboardPermissions"); private static final org.apache.thrift.protocol.TField CREATE__FIELD_DESC = new org.apache.thrift.protocol.TField("create_", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField DELETE__FIELD_DESC = new org.apache.thrift.protocol.TField("delete_", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField VIEW__FIELD_DESC = new org.apache.thrift.protocol.TField("view_", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField EDIT__FIELD_DESC = new org.apache.thrift.protocol.TField("edit_", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDashboardPermissionsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDashboardPermissionsTupleSchemeFactory(); public boolean create_; // required public boolean delete_; // required public boolean view_; // required public boolean edit_; // 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 { CREATE_((short)1, "create_"), DELETE_((short)2, "delete_"), VIEW_((short)3, "view_"), EDIT_((short)4, "edit_"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // CREATE_ return CREATE_; case 2: // DELETE_ return DELETE_; case 3: // VIEW_ return VIEW_; case 4: // EDIT_ return EDIT_; 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 __CREATE__ISSET_ID = 0; private static final int __DELETE__ISSET_ID = 1; private static final int __VIEW__ISSET_ID = 2; private static final int __EDIT__ISSET_ID = 3; 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.CREATE_, new org.apache.thrift.meta_data.FieldMetaData("create_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DELETE_, new org.apache.thrift.meta_data.FieldMetaData("delete_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.VIEW_, new org.apache.thrift.meta_data.FieldMetaData("view_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.EDIT_, new org.apache.thrift.meta_data.FieldMetaData("edit_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDashboardPermissions.class, metaDataMap); } public TDashboardPermissions() { } public TDashboardPermissions( boolean create_, boolean delete_, boolean view_, boolean edit_) { this(); this.create_ = create_; setCreate_IsSet(true); this.delete_ = delete_; setDelete_IsSet(true); this.view_ = view_; setView_IsSet(true); this.edit_ = edit_; setEdit_IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TDashboardPermissions(TDashboardPermissions other) { __isset_bitfield = other.__isset_bitfield; this.create_ = other.create_; this.delete_ = other.delete_; this.view_ = other.view_; this.edit_ = other.edit_; } public TDashboardPermissions deepCopy() { return new TDashboardPermissions(this); } @Override public void clear() { setCreate_IsSet(false); this.create_ = false; setDelete_IsSet(false); this.delete_ = false; setView_IsSet(false); this.view_ = false; setEdit_IsSet(false); this.edit_ = false; } public boolean isCreate_() { return this.create_; } public TDashboardPermissions setCreate_(boolean create_) { this.create_ = create_; setCreate_IsSet(true); return this; } public void unsetCreate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATE__ISSET_ID); } /** Returns true if field create_ is set (has been assigned a value) and false otherwise */ public boolean isSetCreate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATE__ISSET_ID); } public void setCreate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATE__ISSET_ID, value); } public boolean isDelete_() { return this.delete_; } public TDashboardPermissions setDelete_(boolean delete_) { this.delete_ = delete_; setDelete_IsSet(true); return this; } public void unsetDelete_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DELETE__ISSET_ID); } /** Returns true if field delete_ is set (has been assigned a value) and false otherwise */ public boolean isSetDelete_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DELETE__ISSET_ID); } public void setDelete_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DELETE__ISSET_ID, value); } public boolean isView_() { return this.view_; } public TDashboardPermissions setView_(boolean view_) { this.view_ = view_; setView_IsSet(true); return this; } public void unsetView_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VIEW__ISSET_ID); } /** Returns true if field view_ is set (has been assigned a value) and false otherwise */ public boolean isSetView_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VIEW__ISSET_ID); } public void setView_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VIEW__ISSET_ID, value); } public boolean isEdit_() { return this.edit_; } public TDashboardPermissions setEdit_(boolean edit_) { this.edit_ = edit_; setEdit_IsSet(true); return this; } public void unsetEdit_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EDIT__ISSET_ID); } /** Returns true if field edit_ is set (has been assigned a value) and false otherwise */ public boolean isSetEdit_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EDIT__ISSET_ID); } public void setEdit_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EDIT__ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case CREATE_: if (value == null) { unsetCreate_(); } else { setCreate_((java.lang.Boolean)value); } break; case DELETE_: if (value == null) { unsetDelete_(); } else { setDelete_((java.lang.Boolean)value); } break; case VIEW_: if (value == null) { unsetView_(); } else { setView_((java.lang.Boolean)value); } break; case EDIT_: if (value == null) { unsetEdit_(); } else { setEdit_((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case CREATE_: return isCreate_(); case DELETE_: return isDelete_(); case VIEW_: return isView_(); case EDIT_: return isEdit_(); } 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 CREATE_: return isSetCreate_(); case DELETE_: return isSetDelete_(); case VIEW_: return isSetView_(); case EDIT_: return isSetEdit_(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDashboardPermissions) return this.equals((TDashboardPermissions)that); return false; } public boolean equals(TDashboardPermissions that) { if (that == null) return false; if (this == that) return true; boolean this_present_create_ = true; boolean that_present_create_ = true; if (this_present_create_ || that_present_create_) { if (!(this_present_create_ && that_present_create_)) return false; if (this.create_ != that.create_) return false; } boolean this_present_delete_ = true; boolean that_present_delete_ = true; if (this_present_delete_ || that_present_delete_) { if (!(this_present_delete_ && that_present_delete_)) return false; if (this.delete_ != that.delete_) return false; } boolean this_present_view_ = true; boolean that_present_view_ = true; if (this_present_view_ || that_present_view_) { if (!(this_present_view_ && that_present_view_)) return false; if (this.view_ != that.view_) return false; } boolean this_present_edit_ = true; boolean that_present_edit_ = true; if (this_present_edit_ || that_present_edit_) { if (!(this_present_edit_ && that_present_edit_)) return false; if (this.edit_ != that.edit_) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((create_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((delete_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((view_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((edit_) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TDashboardPermissions other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetCreate_(), other.isSetCreate_()); if (lastComparison != 0) { return lastComparison; } if (isSetCreate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.create_, other.create_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDelete_(), other.isSetDelete_()); if (lastComparison != 0) { return lastComparison; } if (isSetDelete_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delete_, other.delete_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetView_(), other.isSetView_()); if (lastComparison != 0) { return lastComparison; } if (isSetView_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.view_, other.view_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetEdit_(), other.isSetEdit_()); if (lastComparison != 0) { return lastComparison; } if (isSetEdit_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.edit_, other.edit_); 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("TDashboardPermissions("); boolean first = true; sb.append("create_:"); sb.append(this.create_); first = false; if (!first) sb.append(", "); sb.append("delete_:"); sb.append(this.delete_); first = false; if (!first) sb.append(", "); sb.append("view_:"); sb.append(this.view_); first = false; if (!first) sb.append(", "); sb.append("edit_:"); sb.append(this.edit_); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TDashboardPermissionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDashboardPermissionsStandardScheme getScheme() { return new TDashboardPermissionsStandardScheme(); } } private static class TDashboardPermissionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDashboardPermissions> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDashboardPermissions 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: // CREATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DELETE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // VIEW_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.view_ = iprot.readBool(); struct.setView_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // EDIT_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.edit_ = iprot.readBool(); struct.setEdit_IsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDashboardPermissions struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CREATE__FIELD_DESC); oprot.writeBool(struct.create_); oprot.writeFieldEnd(); oprot.writeFieldBegin(DELETE__FIELD_DESC); oprot.writeBool(struct.delete_); oprot.writeFieldEnd(); oprot.writeFieldBegin(VIEW__FIELD_DESC); oprot.writeBool(struct.view_); oprot.writeFieldEnd(); oprot.writeFieldBegin(EDIT__FIELD_DESC); oprot.writeBool(struct.edit_); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDashboardPermissionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDashboardPermissionsTupleScheme getScheme() { return new TDashboardPermissionsTupleScheme(); } } private static class TDashboardPermissionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDashboardPermissions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDashboardPermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCreate_()) { optionals.set(0); } if (struct.isSetDelete_()) { optionals.set(1); } if (struct.isSetView_()) { optionals.set(2); } if (struct.isSetEdit_()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetCreate_()) { oprot.writeBool(struct.create_); } if (struct.isSetDelete_()) { oprot.writeBool(struct.delete_); } if (struct.isSetView_()) { oprot.writeBool(struct.view_); } if (struct.isSetEdit_()) { oprot.writeBool(struct.edit_); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDashboardPermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } if (incoming.get(1)) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(true); } if (incoming.get(2)) { struct.view_ = iprot.readBool(); struct.setView_IsSet(true); } if (incoming.get(3)) { struct.edit_ = iprot.readBool(); struct.setEdit_IsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDataBlockPtr.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDataBlockPtr extends org.apache.thrift.TUnion<TDataBlockPtr, TDataBlockPtr._Fields> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDataBlockPtr"); private static final org.apache.thrift.protocol.TField FIXED_LEN_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("fixed_len_data", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField VAR_LEN_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("var_len_data", org.apache.thrift.protocol.TType.LIST, (short)2); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FIXED_LEN_DATA((short)1, "fixed_len_data"), VAR_LEN_DATA((short)2, "var_len_data"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // FIXED_LEN_DATA return FIXED_LEN_DATA; case 2: // VAR_LEN_DATA return VAR_LEN_DATA; 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; } } 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.FIXED_LEN_DATA, new org.apache.thrift.meta_data.FieldMetaData("fixed_len_data", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.VAR_LEN_DATA, new org.apache.thrift.meta_data.FieldMetaData("var_len_data", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TVarLen.class)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDataBlockPtr.class, metaDataMap); } public TDataBlockPtr() { super(); } public TDataBlockPtr(_Fields setField, java.lang.Object value) { super(setField, value); } public TDataBlockPtr(TDataBlockPtr other) { super(other); } public TDataBlockPtr deepCopy() { return new TDataBlockPtr(this); } public static TDataBlockPtr fixed_len_data(java.nio.ByteBuffer value) { TDataBlockPtr x = new TDataBlockPtr(); x.setFixed_len_data(value); return x; } public static TDataBlockPtr fixed_len_data(byte[] value) { TDataBlockPtr x = new TDataBlockPtr(); x.setFixed_len_data (java.nio.ByteBuffer.wrap(value.clone())); return x; } public static TDataBlockPtr var_len_data(java.util.List<TVarLen> value) { TDataBlockPtr x = new TDataBlockPtr(); x.setVar_len_data(value); return x; } @Override protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case FIXED_LEN_DATA: if (value instanceof java.nio.ByteBuffer) { break; } throw new java.lang.ClassCastException("Was expecting value of type java.nio.ByteBuffer for field 'fixed_len_data', but got " + value.getClass().getSimpleName()); case VAR_LEN_DATA: if (value instanceof java.util.List) { break; } throw new java.lang.ClassCastException("Was expecting value of type java.util.List<TVarLen> for field 'var_len_data', but got " + value.getClass().getSimpleName()); default: throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { case FIXED_LEN_DATA: if (field.type == FIXED_LEN_DATA_FIELD_DESC.type) { java.nio.ByteBuffer fixed_len_data; fixed_len_data = iprot.readBinary(); return fixed_len_data; } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } case VAR_LEN_DATA: if (field.type == VAR_LEN_DATA_FIELD_DESC.type) { java.util.List<TVarLen> var_len_data; { org.apache.thrift.protocol.TList _list192 = iprot.readListBegin(); var_len_data = new java.util.ArrayList<TVarLen>(_list192.size); @org.apache.thrift.annotation.Nullable TVarLen _elem193; for (int _i194 = 0; _i194 < _list192.size; ++_i194) { _elem193 = new TVarLen(); _elem193.read(iprot); var_len_data.add(_elem193); } iprot.readListEnd(); } return var_len_data; } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } default: throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } } @Override protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case FIXED_LEN_DATA: java.nio.ByteBuffer fixed_len_data = (java.nio.ByteBuffer)value_; oprot.writeBinary(fixed_len_data); return; case VAR_LEN_DATA: java.util.List<TVarLen> var_len_data = (java.util.List<TVarLen>)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, var_len_data.size())); for (TVarLen _iter195 : var_len_data) { _iter195.write(oprot); } oprot.writeListEnd(); } return; default: throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case FIXED_LEN_DATA: java.nio.ByteBuffer fixed_len_data; fixed_len_data = iprot.readBinary(); return fixed_len_data; case VAR_LEN_DATA: java.util.List<TVarLen> var_len_data; { org.apache.thrift.protocol.TList _list196 = iprot.readListBegin(); var_len_data = new java.util.ArrayList<TVarLen>(_list196.size); @org.apache.thrift.annotation.Nullable TVarLen _elem197; for (int _i198 = 0; _i198 < _list196.size; ++_i198) { _elem197 = new TVarLen(); _elem197.read(iprot); var_len_data.add(_elem197); } iprot.readListEnd(); } return var_len_data; default: throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @Override protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case FIXED_LEN_DATA: java.nio.ByteBuffer fixed_len_data = (java.nio.ByteBuffer)value_; oprot.writeBinary(fixed_len_data); return; case VAR_LEN_DATA: java.util.List<TVarLen> var_len_data = (java.util.List<TVarLen>)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, var_len_data.size())); for (TVarLen _iter199 : var_len_data) { _iter199.write(oprot); } oprot.writeListEnd(); } return; default: throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { switch (setField) { case FIXED_LEN_DATA: return FIXED_LEN_DATA_FIELD_DESC; case VAR_LEN_DATA: return VAR_LEN_DATA_FIELD_DESC; default: throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override protected org.apache.thrift.protocol.TStruct getStructDesc() { return STRUCT_DESC; } @Override protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public byte[] getFixed_len_data() { setFixed_len_data(org.apache.thrift.TBaseHelper.rightSize(bufferForFixed_len_data())); java.nio.ByteBuffer b = bufferForFixed_len_data(); return b == null ? null : b.array(); } public java.nio.ByteBuffer bufferForFixed_len_data() { if (getSetField() == _Fields.FIXED_LEN_DATA) { return org.apache.thrift.TBaseHelper.copyBinary((java.nio.ByteBuffer)getFieldValue()); } else { throw new java.lang.RuntimeException("Cannot get field 'fixed_len_data' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setFixed_len_data(byte[] value) { setFixed_len_data (java.nio.ByteBuffer.wrap(value.clone())); } public void setFixed_len_data(java.nio.ByteBuffer value) { setField_ = _Fields.FIXED_LEN_DATA; value_ = java.util.Objects.requireNonNull(value,"_Fields.FIXED_LEN_DATA"); } public java.util.List<TVarLen> getVar_len_data() { if (getSetField() == _Fields.VAR_LEN_DATA) { return (java.util.List<TVarLen>)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'var_len_data' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setVar_len_data(java.util.List<TVarLen> value) { setField_ = _Fields.VAR_LEN_DATA; value_ = java.util.Objects.requireNonNull(value,"_Fields.VAR_LEN_DATA"); } public boolean isSetFixed_len_data() { return setField_ == _Fields.FIXED_LEN_DATA; } public boolean isSetVar_len_data() { return setField_ == _Fields.VAR_LEN_DATA; } public boolean equals(java.lang.Object other) { if (other instanceof TDataBlockPtr) { return equals((TDataBlockPtr)other); } else { return false; } } public boolean equals(TDataBlockPtr other) { return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); } @Override public int compareTo(TDataBlockPtr other) { int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); if (lastComparison == 0) { return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); } return lastComparison; } @Override public int hashCode() { java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { list.add(value); } } return list.hashCode(); } 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 { 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); } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDataFrame.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDataFrame implements org.apache.thrift.TBase<TDataFrame, TDataFrame._Fields>, java.io.Serializable, Cloneable, Comparable<TDataFrame> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDataFrame"); private static final org.apache.thrift.protocol.TField SM_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sm_handle", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField SM_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("sm_size", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField DF_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("df_handle", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField DF_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("df_size", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField EXECUTION_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_time_ms", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField ARROW_CONVERSION_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("arrow_conversion_time_ms", org.apache.thrift.protocol.TType.I64, (short)6); private static final org.apache.thrift.protocol.TField DF_BUFFER_FIELD_DESC = new org.apache.thrift.protocol.TField("df_buffer", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDataFrameStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDataFrameTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer sm_handle; // required public long sm_size; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer df_handle; // required public long df_size; // required public long execution_time_ms; // required public long arrow_conversion_time_ms; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer df_buffer; // 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 { SM_HANDLE((short)1, "sm_handle"), SM_SIZE((short)2, "sm_size"), DF_HANDLE((short)3, "df_handle"), DF_SIZE((short)4, "df_size"), EXECUTION_TIME_MS((short)5, "execution_time_ms"), ARROW_CONVERSION_TIME_MS((short)6, "arrow_conversion_time_ms"), DF_BUFFER((short)7, "df_buffer"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // SM_HANDLE return SM_HANDLE; case 2: // SM_SIZE return SM_SIZE; case 3: // DF_HANDLE return DF_HANDLE; case 4: // DF_SIZE return DF_SIZE; case 5: // EXECUTION_TIME_MS return EXECUTION_TIME_MS; case 6: // ARROW_CONVERSION_TIME_MS return ARROW_CONVERSION_TIME_MS; case 7: // DF_BUFFER return DF_BUFFER; 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 __SM_SIZE_ISSET_ID = 0; private static final int __DF_SIZE_ISSET_ID = 1; private static final int __EXECUTION_TIME_MS_ISSET_ID = 2; private static final int __ARROW_CONVERSION_TIME_MS_ISSET_ID = 3; 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.SM_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sm_handle", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.SM_SIZE, new org.apache.thrift.meta_data.FieldMetaData("sm_size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.DF_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("df_handle", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.DF_SIZE, new org.apache.thrift.meta_data.FieldMetaData("df_size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.EXECUTION_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("execution_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.ARROW_CONVERSION_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("arrow_conversion_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.DF_BUFFER, new org.apache.thrift.meta_data.FieldMetaData("df_buffer", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TDataFrame.class, metaDataMap); } public TDataFrame() { } public TDataFrame( java.nio.ByteBuffer sm_handle, long sm_size, java.nio.ByteBuffer df_handle, long df_size, long execution_time_ms, long arrow_conversion_time_ms, java.nio.ByteBuffer df_buffer) { this(); this.sm_handle = org.apache.thrift.TBaseHelper.copyBinary(sm_handle); this.sm_size = sm_size; setSm_sizeIsSet(true); this.df_handle = org.apache.thrift.TBaseHelper.copyBinary(df_handle); this.df_size = df_size; setDf_sizeIsSet(true); this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); this.arrow_conversion_time_ms = arrow_conversion_time_ms; setArrow_conversion_time_msIsSet(true); this.df_buffer = org.apache.thrift.TBaseHelper.copyBinary(df_buffer); } /** * Performs a deep copy on <i>other</i>. */ public TDataFrame(TDataFrame other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetSm_handle()) { this.sm_handle = org.apache.thrift.TBaseHelper.copyBinary(other.sm_handle); } this.sm_size = other.sm_size; if (other.isSetDf_handle()) { this.df_handle = org.apache.thrift.TBaseHelper.copyBinary(other.df_handle); } this.df_size = other.df_size; this.execution_time_ms = other.execution_time_ms; this.arrow_conversion_time_ms = other.arrow_conversion_time_ms; if (other.isSetDf_buffer()) { this.df_buffer = org.apache.thrift.TBaseHelper.copyBinary(other.df_buffer); } } public TDataFrame deepCopy() { return new TDataFrame(this); } @Override public void clear() { this.sm_handle = null; setSm_sizeIsSet(false); this.sm_size = 0; this.df_handle = null; setDf_sizeIsSet(false); this.df_size = 0; setExecution_time_msIsSet(false); this.execution_time_ms = 0; setArrow_conversion_time_msIsSet(false); this.arrow_conversion_time_ms = 0; this.df_buffer = null; } public byte[] getSm_handle() { setSm_handle(org.apache.thrift.TBaseHelper.rightSize(sm_handle)); return sm_handle == null ? null : sm_handle.array(); } public java.nio.ByteBuffer bufferForSm_handle() { return org.apache.thrift.TBaseHelper.copyBinary(sm_handle); } public TDataFrame setSm_handle(byte[] sm_handle) { this.sm_handle = sm_handle == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(sm_handle.clone()); return this; } public TDataFrame setSm_handle(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer sm_handle) { this.sm_handle = org.apache.thrift.TBaseHelper.copyBinary(sm_handle); return this; } public void unsetSm_handle() { this.sm_handle = null; } /** Returns true if field sm_handle is set (has been assigned a value) and false otherwise */ public boolean isSetSm_handle() { return this.sm_handle != null; } public void setSm_handleIsSet(boolean value) { if (!value) { this.sm_handle = null; } } public long getSm_size() { return this.sm_size; } public TDataFrame setSm_size(long sm_size) { this.sm_size = sm_size; setSm_sizeIsSet(true); return this; } public void unsetSm_size() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SM_SIZE_ISSET_ID); } /** Returns true if field sm_size is set (has been assigned a value) and false otherwise */ public boolean isSetSm_size() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SM_SIZE_ISSET_ID); } public void setSm_sizeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SM_SIZE_ISSET_ID, value); } public byte[] getDf_handle() { setDf_handle(org.apache.thrift.TBaseHelper.rightSize(df_handle)); return df_handle == null ? null : df_handle.array(); } public java.nio.ByteBuffer bufferForDf_handle() { return org.apache.thrift.TBaseHelper.copyBinary(df_handle); } public TDataFrame setDf_handle(byte[] df_handle) { this.df_handle = df_handle == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(df_handle.clone()); return this; } public TDataFrame setDf_handle(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer df_handle) { this.df_handle = org.apache.thrift.TBaseHelper.copyBinary(df_handle); return this; } public void unsetDf_handle() { this.df_handle = null; } /** Returns true if field df_handle is set (has been assigned a value) and false otherwise */ public boolean isSetDf_handle() { return this.df_handle != null; } public void setDf_handleIsSet(boolean value) { if (!value) { this.df_handle = null; } } public long getDf_size() { return this.df_size; } public TDataFrame setDf_size(long df_size) { this.df_size = df_size; setDf_sizeIsSet(true); return this; } public void unsetDf_size() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DF_SIZE_ISSET_ID); } /** Returns true if field df_size is set (has been assigned a value) and false otherwise */ public boolean isSetDf_size() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DF_SIZE_ISSET_ID); } public void setDf_sizeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DF_SIZE_ISSET_ID, value); } public long getExecution_time_ms() { return this.execution_time_ms; } public TDataFrame setExecution_time_ms(long execution_time_ms) { this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); return this; } public void unsetExecution_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } /** Returns true if field execution_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetExecution_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } public void setExecution_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID, value); } public long getArrow_conversion_time_ms() { return this.arrow_conversion_time_ms; } public TDataFrame setArrow_conversion_time_ms(long arrow_conversion_time_ms) { this.arrow_conversion_time_ms = arrow_conversion_time_ms; setArrow_conversion_time_msIsSet(true); return this; } public void unsetArrow_conversion_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ARROW_CONVERSION_TIME_MS_ISSET_ID); } /** Returns true if field arrow_conversion_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetArrow_conversion_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ARROW_CONVERSION_TIME_MS_ISSET_ID); } public void setArrow_conversion_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ARROW_CONVERSION_TIME_MS_ISSET_ID, value); } public byte[] getDf_buffer() { setDf_buffer(org.apache.thrift.TBaseHelper.rightSize(df_buffer)); return df_buffer == null ? null : df_buffer.array(); } public java.nio.ByteBuffer bufferForDf_buffer() { return org.apache.thrift.TBaseHelper.copyBinary(df_buffer); } public TDataFrame setDf_buffer(byte[] df_buffer) { this.df_buffer = df_buffer == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(df_buffer.clone()); return this; } public TDataFrame setDf_buffer(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer df_buffer) { this.df_buffer = org.apache.thrift.TBaseHelper.copyBinary(df_buffer); return this; } public void unsetDf_buffer() { this.df_buffer = null; } /** Returns true if field df_buffer is set (has been assigned a value) and false otherwise */ public boolean isSetDf_buffer() { return this.df_buffer != null; } public void setDf_bufferIsSet(boolean value) { if (!value) { this.df_buffer = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SM_HANDLE: if (value == null) { unsetSm_handle(); } else { if (value instanceof byte[]) { setSm_handle((byte[])value); } else { setSm_handle((java.nio.ByteBuffer)value); } } break; case SM_SIZE: if (value == null) { unsetSm_size(); } else { setSm_size((java.lang.Long)value); } break; case DF_HANDLE: if (value == null) { unsetDf_handle(); } else { if (value instanceof byte[]) { setDf_handle((byte[])value); } else { setDf_handle((java.nio.ByteBuffer)value); } } break; case DF_SIZE: if (value == null) { unsetDf_size(); } else { setDf_size((java.lang.Long)value); } break; case EXECUTION_TIME_MS: if (value == null) { unsetExecution_time_ms(); } else { setExecution_time_ms((java.lang.Long)value); } break; case ARROW_CONVERSION_TIME_MS: if (value == null) { unsetArrow_conversion_time_ms(); } else { setArrow_conversion_time_ms((java.lang.Long)value); } break; case DF_BUFFER: if (value == null) { unsetDf_buffer(); } else { if (value instanceof byte[]) { setDf_buffer((byte[])value); } else { setDf_buffer((java.nio.ByteBuffer)value); } } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SM_HANDLE: return getSm_handle(); case SM_SIZE: return getSm_size(); case DF_HANDLE: return getDf_handle(); case DF_SIZE: return getDf_size(); case EXECUTION_TIME_MS: return getExecution_time_ms(); case ARROW_CONVERSION_TIME_MS: return getArrow_conversion_time_ms(); case DF_BUFFER: return getDf_buffer(); } 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 SM_HANDLE: return isSetSm_handle(); case SM_SIZE: return isSetSm_size(); case DF_HANDLE: return isSetDf_handle(); case DF_SIZE: return isSetDf_size(); case EXECUTION_TIME_MS: return isSetExecution_time_ms(); case ARROW_CONVERSION_TIME_MS: return isSetArrow_conversion_time_ms(); case DF_BUFFER: return isSetDf_buffer(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDataFrame) return this.equals((TDataFrame)that); return false; } public boolean equals(TDataFrame that) { if (that == null) return false; if (this == that) return true; boolean this_present_sm_handle = true && this.isSetSm_handle(); boolean that_present_sm_handle = true && that.isSetSm_handle(); if (this_present_sm_handle || that_present_sm_handle) { if (!(this_present_sm_handle && that_present_sm_handle)) return false; if (!this.sm_handle.equals(that.sm_handle)) return false; } boolean this_present_sm_size = true; boolean that_present_sm_size = true; if (this_present_sm_size || that_present_sm_size) { if (!(this_present_sm_size && that_present_sm_size)) return false; if (this.sm_size != that.sm_size) return false; } boolean this_present_df_handle = true && this.isSetDf_handle(); boolean that_present_df_handle = true && that.isSetDf_handle(); if (this_present_df_handle || that_present_df_handle) { if (!(this_present_df_handle && that_present_df_handle)) return false; if (!this.df_handle.equals(that.df_handle)) return false; } boolean this_present_df_size = true; boolean that_present_df_size = true; if (this_present_df_size || that_present_df_size) { if (!(this_present_df_size && that_present_df_size)) return false; if (this.df_size != that.df_size) return false; } boolean this_present_execution_time_ms = true; boolean that_present_execution_time_ms = true; if (this_present_execution_time_ms || that_present_execution_time_ms) { if (!(this_present_execution_time_ms && that_present_execution_time_ms)) return false; if (this.execution_time_ms != that.execution_time_ms) return false; } boolean this_present_arrow_conversion_time_ms = true; boolean that_present_arrow_conversion_time_ms = true; if (this_present_arrow_conversion_time_ms || that_present_arrow_conversion_time_ms) { if (!(this_present_arrow_conversion_time_ms && that_present_arrow_conversion_time_ms)) return false; if (this.arrow_conversion_time_ms != that.arrow_conversion_time_ms) return false; } boolean this_present_df_buffer = true && this.isSetDf_buffer(); boolean that_present_df_buffer = true && that.isSetDf_buffer(); if (this_present_df_buffer || that_present_df_buffer) { if (!(this_present_df_buffer && that_present_df_buffer)) return false; if (!this.df_buffer.equals(that.df_buffer)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetSm_handle()) ? 131071 : 524287); if (isSetSm_handle()) hashCode = hashCode * 8191 + sm_handle.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sm_size); hashCode = hashCode * 8191 + ((isSetDf_handle()) ? 131071 : 524287); if (isSetDf_handle()) hashCode = hashCode * 8191 + df_handle.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(df_size); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(execution_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(arrow_conversion_time_ms); hashCode = hashCode * 8191 + ((isSetDf_buffer()) ? 131071 : 524287); if (isSetDf_buffer()) hashCode = hashCode * 8191 + df_buffer.hashCode(); return hashCode; } @Override public int compareTo(TDataFrame other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetSm_handle(), other.isSetSm_handle()); if (lastComparison != 0) { return lastComparison; } if (isSetSm_handle()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sm_handle, other.sm_handle); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSm_size(), other.isSetSm_size()); if (lastComparison != 0) { return lastComparison; } if (isSetSm_size()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sm_size, other.sm_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDf_handle(), other.isSetDf_handle()); if (lastComparison != 0) { return lastComparison; } if (isSetDf_handle()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.df_handle, other.df_handle); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDf_size(), other.isSetDf_size()); if (lastComparison != 0) { return lastComparison; } if (isSetDf_size()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.df_size, other.df_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExecution_time_ms(), other.isSetExecution_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetExecution_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_time_ms, other.execution_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetArrow_conversion_time_ms(), other.isSetArrow_conversion_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetArrow_conversion_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arrow_conversion_time_ms, other.arrow_conversion_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDf_buffer(), other.isSetDf_buffer()); if (lastComparison != 0) { return lastComparison; } if (isSetDf_buffer()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.df_buffer, other.df_buffer); 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("TDataFrame("); boolean first = true; sb.append("sm_handle:"); if (this.sm_handle == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.sm_handle, sb); } first = false; if (!first) sb.append(", "); sb.append("sm_size:"); sb.append(this.sm_size); first = false; if (!first) sb.append(", "); sb.append("df_handle:"); if (this.df_handle == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.df_handle, sb); } first = false; if (!first) sb.append(", "); sb.append("df_size:"); sb.append(this.df_size); first = false; if (!first) sb.append(", "); sb.append("execution_time_ms:"); sb.append(this.execution_time_ms); first = false; if (!first) sb.append(", "); sb.append("arrow_conversion_time_ms:"); sb.append(this.arrow_conversion_time_ms); first = false; if (!first) sb.append(", "); sb.append("df_buffer:"); if (this.df_buffer == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.df_buffer, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TDataFrameStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDataFrameStandardScheme getScheme() { return new TDataFrameStandardScheme(); } } private static class TDataFrameStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDataFrame> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDataFrame 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: // SM_HANDLE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.sm_handle = iprot.readBinary(); struct.setSm_handleIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // SM_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.sm_size = iprot.readI64(); struct.setSm_sizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DF_HANDLE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.df_handle = iprot.readBinary(); struct.setDf_handleIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // DF_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.df_size = iprot.readI64(); struct.setDf_sizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // EXECUTION_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // ARROW_CONVERSION_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.arrow_conversion_time_ms = iprot.readI64(); struct.setArrow_conversion_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // DF_BUFFER if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.df_buffer = iprot.readBinary(); struct.setDf_bufferIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDataFrame struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.sm_handle != null) { oprot.writeFieldBegin(SM_HANDLE_FIELD_DESC); oprot.writeBinary(struct.sm_handle); oprot.writeFieldEnd(); } oprot.writeFieldBegin(SM_SIZE_FIELD_DESC); oprot.writeI64(struct.sm_size); oprot.writeFieldEnd(); if (struct.df_handle != null) { oprot.writeFieldBegin(DF_HANDLE_FIELD_DESC); oprot.writeBinary(struct.df_handle); oprot.writeFieldEnd(); } oprot.writeFieldBegin(DF_SIZE_FIELD_DESC); oprot.writeI64(struct.df_size); oprot.writeFieldEnd(); oprot.writeFieldBegin(EXECUTION_TIME_MS_FIELD_DESC); oprot.writeI64(struct.execution_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(ARROW_CONVERSION_TIME_MS_FIELD_DESC); oprot.writeI64(struct.arrow_conversion_time_ms); oprot.writeFieldEnd(); if (struct.df_buffer != null) { oprot.writeFieldBegin(DF_BUFFER_FIELD_DESC); oprot.writeBinary(struct.df_buffer); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDataFrameTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDataFrameTupleScheme getScheme() { return new TDataFrameTupleScheme(); } } private static class TDataFrameTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDataFrame> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDataFrame struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSm_handle()) { optionals.set(0); } if (struct.isSetSm_size()) { optionals.set(1); } if (struct.isSetDf_handle()) { optionals.set(2); } if (struct.isSetDf_size()) { optionals.set(3); } if (struct.isSetExecution_time_ms()) { optionals.set(4); } if (struct.isSetArrow_conversion_time_ms()) { optionals.set(5); } if (struct.isSetDf_buffer()) { optionals.set(6); } oprot.writeBitSet(optionals, 7); if (struct.isSetSm_handle()) { oprot.writeBinary(struct.sm_handle); } if (struct.isSetSm_size()) { oprot.writeI64(struct.sm_size); } if (struct.isSetDf_handle()) { oprot.writeBinary(struct.df_handle); } if (struct.isSetDf_size()) { oprot.writeI64(struct.df_size); } if (struct.isSetExecution_time_ms()) { oprot.writeI64(struct.execution_time_ms); } if (struct.isSetArrow_conversion_time_ms()) { oprot.writeI64(struct.arrow_conversion_time_ms); } if (struct.isSetDf_buffer()) { oprot.writeBinary(struct.df_buffer); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDataFrame struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.sm_handle = iprot.readBinary(); struct.setSm_handleIsSet(true); } if (incoming.get(1)) { struct.sm_size = iprot.readI64(); struct.setSm_sizeIsSet(true); } if (incoming.get(2)) { struct.df_handle = iprot.readBinary(); struct.setDf_handleIsSet(true); } if (incoming.get(3)) { struct.df_size = iprot.readI64(); struct.setDf_sizeIsSet(true); } if (incoming.get(4)) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } if (incoming.get(5)) { struct.arrow_conversion_time_ms = iprot.readI64(); struct.setArrow_conversion_time_msIsSet(true); } if (incoming.get(6)) { struct.df_buffer = iprot.readBinary(); struct.setDf_bufferIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDataSourceType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TDataSourceType implements org.apache.thrift.TEnum { TABLE(0); private final int value; private TDataSourceType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TDataSourceType findByValue(int value) { switch (value) { case 0: return TABLE; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDatabasePermissions.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDatabasePermissions implements org.apache.thrift.TBase<TDatabasePermissions, TDatabasePermissions._Fields>, java.io.Serializable, Cloneable, Comparable<TDatabasePermissions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDatabasePermissions"); private static final org.apache.thrift.protocol.TField CREATE__FIELD_DESC = new org.apache.thrift.protocol.TField("create_", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField DELETE__FIELD_DESC = new org.apache.thrift.protocol.TField("delete_", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField VIEW_SQL_EDITOR__FIELD_DESC = new org.apache.thrift.protocol.TField("view_sql_editor_", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField ACCESS__FIELD_DESC = new org.apache.thrift.protocol.TField("access_", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDatabasePermissionsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDatabasePermissionsTupleSchemeFactory(); public boolean create_; // required public boolean delete_; // required public boolean view_sql_editor_; // required public boolean access_; // 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 { CREATE_((short)1, "create_"), DELETE_((short)2, "delete_"), VIEW_SQL_EDITOR_((short)3, "view_sql_editor_"), ACCESS_((short)4, "access_"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // CREATE_ return CREATE_; case 2: // DELETE_ return DELETE_; case 3: // VIEW_SQL_EDITOR_ return VIEW_SQL_EDITOR_; case 4: // ACCESS_ return ACCESS_; 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 __CREATE__ISSET_ID = 0; private static final int __DELETE__ISSET_ID = 1; private static final int __VIEW_SQL_EDITOR__ISSET_ID = 2; private static final int __ACCESS__ISSET_ID = 3; 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.CREATE_, new org.apache.thrift.meta_data.FieldMetaData("create_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DELETE_, new org.apache.thrift.meta_data.FieldMetaData("delete_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.VIEW_SQL_EDITOR_, new org.apache.thrift.meta_data.FieldMetaData("view_sql_editor_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.ACCESS_, new org.apache.thrift.meta_data.FieldMetaData("access_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDatabasePermissions.class, metaDataMap); } public TDatabasePermissions() { } public TDatabasePermissions( boolean create_, boolean delete_, boolean view_sql_editor_, boolean access_) { this(); this.create_ = create_; setCreate_IsSet(true); this.delete_ = delete_; setDelete_IsSet(true); this.view_sql_editor_ = view_sql_editor_; setView_sql_editor_IsSet(true); this.access_ = access_; setAccess_IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TDatabasePermissions(TDatabasePermissions other) { __isset_bitfield = other.__isset_bitfield; this.create_ = other.create_; this.delete_ = other.delete_; this.view_sql_editor_ = other.view_sql_editor_; this.access_ = other.access_; } public TDatabasePermissions deepCopy() { return new TDatabasePermissions(this); } @Override public void clear() { setCreate_IsSet(false); this.create_ = false; setDelete_IsSet(false); this.delete_ = false; setView_sql_editor_IsSet(false); this.view_sql_editor_ = false; setAccess_IsSet(false); this.access_ = false; } public boolean isCreate_() { return this.create_; } public TDatabasePermissions setCreate_(boolean create_) { this.create_ = create_; setCreate_IsSet(true); return this; } public void unsetCreate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATE__ISSET_ID); } /** Returns true if field create_ is set (has been assigned a value) and false otherwise */ public boolean isSetCreate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATE__ISSET_ID); } public void setCreate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATE__ISSET_ID, value); } public boolean isDelete_() { return this.delete_; } public TDatabasePermissions setDelete_(boolean delete_) { this.delete_ = delete_; setDelete_IsSet(true); return this; } public void unsetDelete_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DELETE__ISSET_ID); } /** Returns true if field delete_ is set (has been assigned a value) and false otherwise */ public boolean isSetDelete_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DELETE__ISSET_ID); } public void setDelete_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DELETE__ISSET_ID, value); } public boolean isView_sql_editor_() { return this.view_sql_editor_; } public TDatabasePermissions setView_sql_editor_(boolean view_sql_editor_) { this.view_sql_editor_ = view_sql_editor_; setView_sql_editor_IsSet(true); return this; } public void unsetView_sql_editor_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VIEW_SQL_EDITOR__ISSET_ID); } /** Returns true if field view_sql_editor_ is set (has been assigned a value) and false otherwise */ public boolean isSetView_sql_editor_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VIEW_SQL_EDITOR__ISSET_ID); } public void setView_sql_editor_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VIEW_SQL_EDITOR__ISSET_ID, value); } public boolean isAccess_() { return this.access_; } public TDatabasePermissions setAccess_(boolean access_) { this.access_ = access_; setAccess_IsSet(true); return this; } public void unsetAccess_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ACCESS__ISSET_ID); } /** Returns true if field access_ is set (has been assigned a value) and false otherwise */ public boolean isSetAccess_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ACCESS__ISSET_ID); } public void setAccess_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ACCESS__ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case CREATE_: if (value == null) { unsetCreate_(); } else { setCreate_((java.lang.Boolean)value); } break; case DELETE_: if (value == null) { unsetDelete_(); } else { setDelete_((java.lang.Boolean)value); } break; case VIEW_SQL_EDITOR_: if (value == null) { unsetView_sql_editor_(); } else { setView_sql_editor_((java.lang.Boolean)value); } break; case ACCESS_: if (value == null) { unsetAccess_(); } else { setAccess_((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case CREATE_: return isCreate_(); case DELETE_: return isDelete_(); case VIEW_SQL_EDITOR_: return isView_sql_editor_(); case ACCESS_: return isAccess_(); } 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 CREATE_: return isSetCreate_(); case DELETE_: return isSetDelete_(); case VIEW_SQL_EDITOR_: return isSetView_sql_editor_(); case ACCESS_: return isSetAccess_(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDatabasePermissions) return this.equals((TDatabasePermissions)that); return false; } public boolean equals(TDatabasePermissions that) { if (that == null) return false; if (this == that) return true; boolean this_present_create_ = true; boolean that_present_create_ = true; if (this_present_create_ || that_present_create_) { if (!(this_present_create_ && that_present_create_)) return false; if (this.create_ != that.create_) return false; } boolean this_present_delete_ = true; boolean that_present_delete_ = true; if (this_present_delete_ || that_present_delete_) { if (!(this_present_delete_ && that_present_delete_)) return false; if (this.delete_ != that.delete_) return false; } boolean this_present_view_sql_editor_ = true; boolean that_present_view_sql_editor_ = true; if (this_present_view_sql_editor_ || that_present_view_sql_editor_) { if (!(this_present_view_sql_editor_ && that_present_view_sql_editor_)) return false; if (this.view_sql_editor_ != that.view_sql_editor_) return false; } boolean this_present_access_ = true; boolean that_present_access_ = true; if (this_present_access_ || that_present_access_) { if (!(this_present_access_ && that_present_access_)) return false; if (this.access_ != that.access_) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((create_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((delete_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((view_sql_editor_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((access_) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TDatabasePermissions other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetCreate_(), other.isSetCreate_()); if (lastComparison != 0) { return lastComparison; } if (isSetCreate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.create_, other.create_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDelete_(), other.isSetDelete_()); if (lastComparison != 0) { return lastComparison; } if (isSetDelete_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delete_, other.delete_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetView_sql_editor_(), other.isSetView_sql_editor_()); if (lastComparison != 0) { return lastComparison; } if (isSetView_sql_editor_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.view_sql_editor_, other.view_sql_editor_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetAccess_(), other.isSetAccess_()); if (lastComparison != 0) { return lastComparison; } if (isSetAccess_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.access_, other.access_); 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("TDatabasePermissions("); boolean first = true; sb.append("create_:"); sb.append(this.create_); first = false; if (!first) sb.append(", "); sb.append("delete_:"); sb.append(this.delete_); first = false; if (!first) sb.append(", "); sb.append("view_sql_editor_:"); sb.append(this.view_sql_editor_); first = false; if (!first) sb.append(", "); sb.append("access_:"); sb.append(this.access_); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TDatabasePermissionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDatabasePermissionsStandardScheme getScheme() { return new TDatabasePermissionsStandardScheme(); } } private static class TDatabasePermissionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDatabasePermissions> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDatabasePermissions 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: // CREATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DELETE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // VIEW_SQL_EDITOR_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.view_sql_editor_ = iprot.readBool(); struct.setView_sql_editor_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // ACCESS_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.access_ = iprot.readBool(); struct.setAccess_IsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDatabasePermissions struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CREATE__FIELD_DESC); oprot.writeBool(struct.create_); oprot.writeFieldEnd(); oprot.writeFieldBegin(DELETE__FIELD_DESC); oprot.writeBool(struct.delete_); oprot.writeFieldEnd(); oprot.writeFieldBegin(VIEW_SQL_EDITOR__FIELD_DESC); oprot.writeBool(struct.view_sql_editor_); oprot.writeFieldEnd(); oprot.writeFieldBegin(ACCESS__FIELD_DESC); oprot.writeBool(struct.access_); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDatabasePermissionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDatabasePermissionsTupleScheme getScheme() { return new TDatabasePermissionsTupleScheme(); } } private static class TDatabasePermissionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDatabasePermissions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDatabasePermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCreate_()) { optionals.set(0); } if (struct.isSetDelete_()) { optionals.set(1); } if (struct.isSetView_sql_editor_()) { optionals.set(2); } if (struct.isSetAccess_()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetCreate_()) { oprot.writeBool(struct.create_); } if (struct.isSetDelete_()) { oprot.writeBool(struct.delete_); } if (struct.isSetView_sql_editor_()) { oprot.writeBool(struct.view_sql_editor_); } if (struct.isSetAccess_()) { oprot.writeBool(struct.access_); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDatabasePermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } if (incoming.get(1)) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(true); } if (incoming.get(2)) { struct.view_sql_editor_ = iprot.readBool(); struct.setView_sql_editor_IsSet(true); } if (incoming.get(3)) { struct.access_ = iprot.readBool(); struct.setAccess_IsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDatum.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDatum implements org.apache.thrift.TBase<TDatum, TDatum._Fields>, java.io.Serializable, Cloneable, Comparable<TDatum> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDatum"); private static final org.apache.thrift.protocol.TField VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("val", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IS_NULL_FIELD_DESC = new org.apache.thrift.protocol.TField("is_null", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDatumStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDatumTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable TDatumVal val; // required public boolean is_null; // 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 { VAL((short)1, "val"), IS_NULL((short)2, "is_null"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // VAL return VAL; case 2: // IS_NULL return IS_NULL; 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 __IS_NULL_ISSET_ID = 0; 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.VAL, new org.apache.thrift.meta_data.FieldMetaData("val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatumVal.class))); tmpMap.put(_Fields.IS_NULL, new org.apache.thrift.meta_data.FieldMetaData("is_null", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDatum.class, metaDataMap); } public TDatum() { } public TDatum( TDatumVal val, boolean is_null) { this(); this.val = val; this.is_null = is_null; setIs_nullIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TDatum(TDatum other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetVal()) { this.val = new TDatumVal(other.val); } this.is_null = other.is_null; } public TDatum deepCopy() { return new TDatum(this); } @Override public void clear() { this.val = null; setIs_nullIsSet(false); this.is_null = false; } @org.apache.thrift.annotation.Nullable public TDatumVal getVal() { return this.val; } public TDatum setVal(@org.apache.thrift.annotation.Nullable TDatumVal val) { this.val = val; return this; } public void unsetVal() { this.val = null; } /** Returns true if field val is set (has been assigned a value) and false otherwise */ public boolean isSetVal() { return this.val != null; } public void setValIsSet(boolean value) { if (!value) { this.val = null; } } public boolean isIs_null() { return this.is_null; } public TDatum setIs_null(boolean is_null) { this.is_null = is_null; setIs_nullIsSet(true); return this; } public void unsetIs_null() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_NULL_ISSET_ID); } /** Returns true if field is_null is set (has been assigned a value) and false otherwise */ public boolean isSetIs_null() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_NULL_ISSET_ID); } public void setIs_nullIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_NULL_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VAL: if (value == null) { unsetVal(); } else { setVal((TDatumVal)value); } break; case IS_NULL: if (value == null) { unsetIs_null(); } else { setIs_null((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VAL: return getVal(); case IS_NULL: return isIs_null(); } 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 VAL: return isSetVal(); case IS_NULL: return isSetIs_null(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDatum) return this.equals((TDatum)that); return false; } public boolean equals(TDatum that) { if (that == null) return false; if (this == that) return true; boolean this_present_val = true && this.isSetVal(); boolean that_present_val = true && that.isSetVal(); if (this_present_val || that_present_val) { if (!(this_present_val && that_present_val)) return false; if (!this.val.equals(that.val)) return false; } boolean this_present_is_null = true; boolean that_present_is_null = true; if (this_present_is_null || that_present_is_null) { if (!(this_present_is_null && that_present_is_null)) return false; if (this.is_null != that.is_null) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetVal()) ? 131071 : 524287); if (isSetVal()) hashCode = hashCode * 8191 + val.hashCode(); hashCode = hashCode * 8191 + ((is_null) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TDatum other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetVal(), other.isSetVal()); if (lastComparison != 0) { return lastComparison; } if (isSetVal()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.val, other.val); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_null(), other.isSetIs_null()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_null()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_null, other.is_null); 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("TDatum("); boolean first = true; sb.append("val:"); if (this.val == null) { sb.append("null"); } else { sb.append(this.val); } first = false; if (!first) sb.append(", "); sb.append("is_null:"); sb.append(this.is_null); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (val != null) { val.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 TDatumStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDatumStandardScheme getScheme() { return new TDatumStandardScheme(); } } private static class TDatumStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDatum> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDatum 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: // VAL if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.val = new TDatumVal(); struct.val.read(iprot); struct.setValIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IS_NULL if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_null = iprot.readBool(); struct.setIs_nullIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDatum struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.val != null) { oprot.writeFieldBegin(VAL_FIELD_DESC); struct.val.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_NULL_FIELD_DESC); oprot.writeBool(struct.is_null); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDatumTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDatumTupleScheme getScheme() { return new TDatumTupleScheme(); } } private static class TDatumTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDatum> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDatum struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetVal()) { optionals.set(0); } if (struct.isSetIs_null()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetVal()) { struct.val.write(oprot); } if (struct.isSetIs_null()) { oprot.writeBool(struct.is_null); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDatum struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.val = new TDatumVal(); struct.val.read(iprot); struct.setValIsSet(true); } if (incoming.get(1)) { struct.is_null = iprot.readBool(); struct.setIs_nullIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDatumType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TDatumType implements org.apache.thrift.TEnum { SMALLINT(0), INT(1), BIGINT(2), FLOAT(3), DECIMAL(4), DOUBLE(5), STR(6), TIME(7), TIMESTAMP(8), DATE(9), BOOL(10), INTERVAL_DAY_TIME(11), INTERVAL_YEAR_MONTH(12), POINT(13), LINESTRING(14), POLYGON(15), MULTIPOLYGON(16), TINYINT(17), GEOMETRY(18), GEOGRAPHY(19), MULTILINESTRING(20); private final int value; private TDatumType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TDatumType findByValue(int value) { switch (value) { case 0: return SMALLINT; case 1: return INT; case 2: return BIGINT; case 3: return FLOAT; case 4: return DECIMAL; case 5: return DOUBLE; case 6: return STR; case 7: return TIME; case 8: return TIMESTAMP; case 9: return DATE; case 10: return BOOL; case 11: return INTERVAL_DAY_TIME; case 12: return INTERVAL_YEAR_MONTH; case 13: return POINT; case 14: return LINESTRING; case 15: return POLYGON; case 16: return MULTIPOLYGON; case 17: return TINYINT; case 18: return GEOMETRY; case 19: return GEOGRAPHY; case 20: return MULTILINESTRING; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDatumVal.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDatumVal implements org.apache.thrift.TBase<TDatumVal, TDatumVal._Fields>, java.io.Serializable, Cloneable, Comparable<TDatumVal> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDatumVal"); private static final org.apache.thrift.protocol.TField INT_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("int_val", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField REAL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("real_val", org.apache.thrift.protocol.TType.DOUBLE, (short)2); private static final org.apache.thrift.protocol.TField STR_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("str_val", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField ARR_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("arr_val", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDatumValStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDatumValTupleSchemeFactory(); public long int_val; // required public double real_val; // required public @org.apache.thrift.annotation.Nullable java.lang.String str_val; // required public @org.apache.thrift.annotation.Nullable java.util.List<TDatum> arr_val; // 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 { INT_VAL((short)1, "int_val"), REAL_VAL((short)2, "real_val"), STR_VAL((short)3, "str_val"), ARR_VAL((short)4, "arr_val"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // INT_VAL return INT_VAL; case 2: // REAL_VAL return REAL_VAL; case 3: // STR_VAL return STR_VAL; case 4: // ARR_VAL return ARR_VAL; 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 __INT_VAL_ISSET_ID = 0; private static final int __REAL_VAL_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.INT_VAL, new org.apache.thrift.meta_data.FieldMetaData("int_val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.REAL_VAL, new org.apache.thrift.meta_data.FieldMetaData("real_val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.STR_VAL, new org.apache.thrift.meta_data.FieldMetaData("str_val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.ARR_VAL, new org.apache.thrift.meta_data.FieldMetaData("arr_val", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.STRUCT , "TDatum")))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDatumVal.class, metaDataMap); } public TDatumVal() { } public TDatumVal( long int_val, double real_val, java.lang.String str_val, java.util.List<TDatum> arr_val) { this(); this.int_val = int_val; setInt_valIsSet(true); this.real_val = real_val; setReal_valIsSet(true); this.str_val = str_val; this.arr_val = arr_val; } /** * Performs a deep copy on <i>other</i>. */ public TDatumVal(TDatumVal other) { __isset_bitfield = other.__isset_bitfield; this.int_val = other.int_val; this.real_val = other.real_val; if (other.isSetStr_val()) { this.str_val = other.str_val; } if (other.isSetArr_val()) { java.util.List<TDatum> __this__arr_val = new java.util.ArrayList<TDatum>(other.arr_val.size()); for (TDatum other_element : other.arr_val) { __this__arr_val.add(new TDatum(other_element)); } this.arr_val = __this__arr_val; } } public TDatumVal deepCopy() { return new TDatumVal(this); } @Override public void clear() { setInt_valIsSet(false); this.int_val = 0; setReal_valIsSet(false); this.real_val = 0.0; this.str_val = null; this.arr_val = null; } public long getInt_val() { return this.int_val; } public TDatumVal setInt_val(long int_val) { this.int_val = int_val; setInt_valIsSet(true); return this; } public void unsetInt_val() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INT_VAL_ISSET_ID); } /** Returns true if field int_val is set (has been assigned a value) and false otherwise */ public boolean isSetInt_val() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INT_VAL_ISSET_ID); } public void setInt_valIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INT_VAL_ISSET_ID, value); } public double getReal_val() { return this.real_val; } public TDatumVal setReal_val(double real_val) { this.real_val = real_val; setReal_valIsSet(true); return this; } public void unsetReal_val() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REAL_VAL_ISSET_ID); } /** Returns true if field real_val is set (has been assigned a value) and false otherwise */ public boolean isSetReal_val() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REAL_VAL_ISSET_ID); } public void setReal_valIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REAL_VAL_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getStr_val() { return this.str_val; } public TDatumVal setStr_val(@org.apache.thrift.annotation.Nullable java.lang.String str_val) { this.str_val = str_val; return this; } public void unsetStr_val() { this.str_val = null; } /** Returns true if field str_val is set (has been assigned a value) and false otherwise */ public boolean isSetStr_val() { return this.str_val != null; } public void setStr_valIsSet(boolean value) { if (!value) { this.str_val = null; } } public int getArr_valSize() { return (this.arr_val == null) ? 0 : this.arr_val.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TDatum> getArr_valIterator() { return (this.arr_val == null) ? null : this.arr_val.iterator(); } public void addToArr_val(TDatum elem) { if (this.arr_val == null) { this.arr_val = new java.util.ArrayList<TDatum>(); } this.arr_val.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TDatum> getArr_val() { return this.arr_val; } public TDatumVal setArr_val(@org.apache.thrift.annotation.Nullable java.util.List<TDatum> arr_val) { this.arr_val = arr_val; return this; } public void unsetArr_val() { this.arr_val = null; } /** Returns true if field arr_val is set (has been assigned a value) and false otherwise */ public boolean isSetArr_val() { return this.arr_val != null; } public void setArr_valIsSet(boolean value) { if (!value) { this.arr_val = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case INT_VAL: if (value == null) { unsetInt_val(); } else { setInt_val((java.lang.Long)value); } break; case REAL_VAL: if (value == null) { unsetReal_val(); } else { setReal_val((java.lang.Double)value); } break; case STR_VAL: if (value == null) { unsetStr_val(); } else { setStr_val((java.lang.String)value); } break; case ARR_VAL: if (value == null) { unsetArr_val(); } else { setArr_val((java.util.List<TDatum>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case INT_VAL: return getInt_val(); case REAL_VAL: return getReal_val(); case STR_VAL: return getStr_val(); case ARR_VAL: return getArr_val(); } 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 INT_VAL: return isSetInt_val(); case REAL_VAL: return isSetReal_val(); case STR_VAL: return isSetStr_val(); case ARR_VAL: return isSetArr_val(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDatumVal) return this.equals((TDatumVal)that); return false; } public boolean equals(TDatumVal that) { if (that == null) return false; if (this == that) return true; boolean this_present_int_val = true; boolean that_present_int_val = true; if (this_present_int_val || that_present_int_val) { if (!(this_present_int_val && that_present_int_val)) return false; if (this.int_val != that.int_val) return false; } boolean this_present_real_val = true; boolean that_present_real_val = true; if (this_present_real_val || that_present_real_val) { if (!(this_present_real_val && that_present_real_val)) return false; if (this.real_val != that.real_val) return false; } boolean this_present_str_val = true && this.isSetStr_val(); boolean that_present_str_val = true && that.isSetStr_val(); if (this_present_str_val || that_present_str_val) { if (!(this_present_str_val && that_present_str_val)) return false; if (!this.str_val.equals(that.str_val)) return false; } boolean this_present_arr_val = true && this.isSetArr_val(); boolean that_present_arr_val = true && that.isSetArr_val(); if (this_present_arr_val || that_present_arr_val) { if (!(this_present_arr_val && that_present_arr_val)) return false; if (!this.arr_val.equals(that.arr_val)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(int_val); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(real_val); hashCode = hashCode * 8191 + ((isSetStr_val()) ? 131071 : 524287); if (isSetStr_val()) hashCode = hashCode * 8191 + str_val.hashCode(); hashCode = hashCode * 8191 + ((isSetArr_val()) ? 131071 : 524287); if (isSetArr_val()) hashCode = hashCode * 8191 + arr_val.hashCode(); return hashCode; } @Override public int compareTo(TDatumVal other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetInt_val(), other.isSetInt_val()); if (lastComparison != 0) { return lastComparison; } if (isSetInt_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.int_val, other.int_val); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetReal_val(), other.isSetReal_val()); if (lastComparison != 0) { return lastComparison; } if (isSetReal_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.real_val, other.real_val); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetStr_val(), other.isSetStr_val()); if (lastComparison != 0) { return lastComparison; } if (isSetStr_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.str_val, other.str_val); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetArr_val(), other.isSetArr_val()); if (lastComparison != 0) { return lastComparison; } if (isSetArr_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arr_val, other.arr_val); 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("TDatumVal("); boolean first = true; sb.append("int_val:"); sb.append(this.int_val); first = false; if (!first) sb.append(", "); sb.append("real_val:"); sb.append(this.real_val); first = false; if (!first) sb.append(", "); sb.append("str_val:"); if (this.str_val == null) { sb.append("null"); } else { sb.append(this.str_val); } first = false; if (!first) sb.append(", "); sb.append("arr_val:"); if (this.arr_val == null) { sb.append("null"); } else { sb.append(this.arr_val); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TDatumValStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDatumValStandardScheme getScheme() { return new TDatumValStandardScheme(); } } private static class TDatumValStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDatumVal> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDatumVal 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: // INT_VAL if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.int_val = iprot.readI64(); struct.setInt_valIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // REAL_VAL if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.real_val = iprot.readDouble(); struct.setReal_valIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // STR_VAL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.str_val = iprot.readString(); struct.setStr_valIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // ARR_VAL if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.arr_val = new java.util.ArrayList<TDatum>(_list0.size); @org.apache.thrift.annotation.Nullable TDatum _elem1; for (int _i2 = 0; _i2 < _list0.size; ++_i2) { _elem1 = new TDatum(); _elem1.read(iprot); struct.arr_val.add(_elem1); } iprot.readListEnd(); } struct.setArr_valIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDatumVal struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(INT_VAL_FIELD_DESC); oprot.writeI64(struct.int_val); oprot.writeFieldEnd(); oprot.writeFieldBegin(REAL_VAL_FIELD_DESC); oprot.writeDouble(struct.real_val); oprot.writeFieldEnd(); if (struct.str_val != null) { oprot.writeFieldBegin(STR_VAL_FIELD_DESC); oprot.writeString(struct.str_val); oprot.writeFieldEnd(); } if (struct.arr_val != null) { oprot.writeFieldBegin(ARR_VAL_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.arr_val.size())); for (TDatum _iter3 : struct.arr_val) { _iter3.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDatumValTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDatumValTupleScheme getScheme() { return new TDatumValTupleScheme(); } } private static class TDatumValTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDatumVal> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDatumVal struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetInt_val()) { optionals.set(0); } if (struct.isSetReal_val()) { optionals.set(1); } if (struct.isSetStr_val()) { optionals.set(2); } if (struct.isSetArr_val()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetInt_val()) { oprot.writeI64(struct.int_val); } if (struct.isSetReal_val()) { oprot.writeDouble(struct.real_val); } if (struct.isSetStr_val()) { oprot.writeString(struct.str_val); } if (struct.isSetArr_val()) { { oprot.writeI32(struct.arr_val.size()); for (TDatum _iter4 : struct.arr_val) { _iter4.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDatumVal struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.int_val = iprot.readI64(); struct.setInt_valIsSet(true); } if (incoming.get(1)) { struct.real_val = iprot.readDouble(); struct.setReal_valIsSet(true); } if (incoming.get(2)) { struct.str_val = iprot.readString(); struct.setStr_valIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list5 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.arr_val = new java.util.ArrayList<TDatum>(_list5.size); @org.apache.thrift.annotation.Nullable TDatum _elem6; for (int _i7 = 0; _i7 < _list5.size; ++_i7) { _elem6 = new TDatum(); _elem6.read(iprot); struct.arr_val.add(_elem6); } } struct.setArr_valIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDetectResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDetectResult implements org.apache.thrift.TBase<TDetectResult, TDetectResult._Fields>, java.io.Serializable, Cloneable, Comparable<TDetectResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDetectResult"); private static final org.apache.thrift.protocol.TField ROW_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("row_set", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField COPY_PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("copy_params", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDetectResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDetectResultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable TRowSet row_set; // required public @org.apache.thrift.annotation.Nullable TCopyParams copy_params; // 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 { ROW_SET((short)1, "row_set"), COPY_PARAMS((short)2, "copy_params"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ROW_SET return ROW_SET; case 2: // COPY_PARAMS return COPY_PARAMS; 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 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.ROW_SET, new org.apache.thrift.meta_data.FieldMetaData("row_set", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); tmpMap.put(_Fields.COPY_PARAMS, new org.apache.thrift.meta_data.FieldMetaData("copy_params", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCopyParams.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDetectResult.class, metaDataMap); } public TDetectResult() { } public TDetectResult( TRowSet row_set, TCopyParams copy_params) { this(); this.row_set = row_set; this.copy_params = copy_params; } /** * Performs a deep copy on <i>other</i>. */ public TDetectResult(TDetectResult other) { if (other.isSetRow_set()) { this.row_set = new TRowSet(other.row_set); } if (other.isSetCopy_params()) { this.copy_params = new TCopyParams(other.copy_params); } } public TDetectResult deepCopy() { return new TDetectResult(this); } @Override public void clear() { this.row_set = null; this.copy_params = null; } @org.apache.thrift.annotation.Nullable public TRowSet getRow_set() { return this.row_set; } public TDetectResult setRow_set(@org.apache.thrift.annotation.Nullable TRowSet row_set) { this.row_set = row_set; return this; } public void unsetRow_set() { this.row_set = null; } /** Returns true if field row_set is set (has been assigned a value) and false otherwise */ public boolean isSetRow_set() { return this.row_set != null; } public void setRow_setIsSet(boolean value) { if (!value) { this.row_set = null; } } @org.apache.thrift.annotation.Nullable public TCopyParams getCopy_params() { return this.copy_params; } public TDetectResult setCopy_params(@org.apache.thrift.annotation.Nullable TCopyParams copy_params) { this.copy_params = copy_params; return this; } public void unsetCopy_params() { this.copy_params = null; } /** Returns true if field copy_params is set (has been assigned a value) and false otherwise */ public boolean isSetCopy_params() { return this.copy_params != null; } public void setCopy_paramsIsSet(boolean value) { if (!value) { this.copy_params = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ROW_SET: if (value == null) { unsetRow_set(); } else { setRow_set((TRowSet)value); } break; case COPY_PARAMS: if (value == null) { unsetCopy_params(); } else { setCopy_params((TCopyParams)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ROW_SET: return getRow_set(); case COPY_PARAMS: return getCopy_params(); } 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 ROW_SET: return isSetRow_set(); case COPY_PARAMS: return isSetCopy_params(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDetectResult) return this.equals((TDetectResult)that); return false; } public boolean equals(TDetectResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_row_set = true && this.isSetRow_set(); boolean that_present_row_set = true && that.isSetRow_set(); if (this_present_row_set || that_present_row_set) { if (!(this_present_row_set && that_present_row_set)) return false; if (!this.row_set.equals(that.row_set)) return false; } boolean this_present_copy_params = true && this.isSetCopy_params(); boolean that_present_copy_params = true && that.isSetCopy_params(); if (this_present_copy_params || that_present_copy_params) { if (!(this_present_copy_params && that_present_copy_params)) return false; if (!this.copy_params.equals(that.copy_params)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetRow_set()) ? 131071 : 524287); if (isSetRow_set()) hashCode = hashCode * 8191 + row_set.hashCode(); hashCode = hashCode * 8191 + ((isSetCopy_params()) ? 131071 : 524287); if (isSetCopy_params()) hashCode = hashCode * 8191 + copy_params.hashCode(); return hashCode; } @Override public int compareTo(TDetectResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetRow_set(), other.isSetRow_set()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_set()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_set, other.row_set); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCopy_params(), other.isSetCopy_params()); if (lastComparison != 0) { return lastComparison; } if (isSetCopy_params()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.copy_params, other.copy_params); 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("TDetectResult("); boolean first = true; sb.append("row_set:"); if (this.row_set == null) { sb.append("null"); } else { sb.append(this.row_set); } first = false; if (!first) sb.append(", "); sb.append("copy_params:"); if (this.copy_params == null) { sb.append("null"); } else { sb.append(this.copy_params); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (row_set != null) { row_set.validate(); } if (copy_params != null) { copy_params.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 { 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 TDetectResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDetectResultStandardScheme getScheme() { return new TDetectResultStandardScheme(); } } private static class TDetectResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDetectResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDetectResult 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: // ROW_SET if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.row_set = new TRowSet(); struct.row_set.read(iprot); struct.setRow_setIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // COPY_PARAMS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.copy_params = new TCopyParams(); struct.copy_params.read(iprot); struct.setCopy_paramsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDetectResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.row_set != null) { oprot.writeFieldBegin(ROW_SET_FIELD_DESC); struct.row_set.write(oprot); oprot.writeFieldEnd(); } if (struct.copy_params != null) { oprot.writeFieldBegin(COPY_PARAMS_FIELD_DESC); struct.copy_params.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDetectResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDetectResultTupleScheme getScheme() { return new TDetectResultTupleScheme(); } } private static class TDetectResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDetectResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDetectResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetRow_set()) { optionals.set(0); } if (struct.isSetCopy_params()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetRow_set()) { struct.row_set.write(oprot); } if (struct.isSetCopy_params()) { struct.copy_params.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDetectResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.row_set = new TRowSet(); struct.row_set.read(iprot); struct.setRow_setIsSet(true); } if (incoming.get(1)) { struct.copy_params = new TCopyParams(); struct.copy_params.read(iprot); struct.setCopy_paramsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDeviceType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TDeviceType implements org.apache.thrift.TEnum { CPU(0), GPU(1); private final int value; private TDeviceType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TDeviceType findByValue(int value) { switch (value) { case 0: return CPU; case 1: return GPU; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TDictionaryGeneration.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TDictionaryGeneration implements org.apache.thrift.TBase<TDictionaryGeneration, TDictionaryGeneration._Fields>, java.io.Serializable, Cloneable, Comparable<TDictionaryGeneration> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDictionaryGeneration"); private static final org.apache.thrift.protocol.TField DICT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dict_id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField ENTRY_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("entry_count", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDictionaryGenerationStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDictionaryGenerationTupleSchemeFactory(); public int dict_id; // required public long entry_count; // 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 { DICT_ID((short)1, "dict_id"), ENTRY_COUNT((short)2, "entry_count"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // DICT_ID return DICT_ID; case 2: // ENTRY_COUNT return ENTRY_COUNT; 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 __DICT_ID_ISSET_ID = 0; private static final int __ENTRY_COUNT_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.DICT_ID, new org.apache.thrift.meta_data.FieldMetaData("dict_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.ENTRY_COUNT, new org.apache.thrift.meta_data.FieldMetaData("entry_count", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDictionaryGeneration.class, metaDataMap); } public TDictionaryGeneration() { } public TDictionaryGeneration( int dict_id, long entry_count) { this(); this.dict_id = dict_id; setDict_idIsSet(true); this.entry_count = entry_count; setEntry_countIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TDictionaryGeneration(TDictionaryGeneration other) { __isset_bitfield = other.__isset_bitfield; this.dict_id = other.dict_id; this.entry_count = other.entry_count; } public TDictionaryGeneration deepCopy() { return new TDictionaryGeneration(this); } @Override public void clear() { setDict_idIsSet(false); this.dict_id = 0; setEntry_countIsSet(false); this.entry_count = 0; } public int getDict_id() { return this.dict_id; } public TDictionaryGeneration setDict_id(int dict_id) { this.dict_id = dict_id; setDict_idIsSet(true); return this; } public void unsetDict_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DICT_ID_ISSET_ID); } /** Returns true if field dict_id is set (has been assigned a value) and false otherwise */ public boolean isSetDict_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DICT_ID_ISSET_ID); } public void setDict_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DICT_ID_ISSET_ID, value); } public long getEntry_count() { return this.entry_count; } public TDictionaryGeneration setEntry_count(long entry_count) { this.entry_count = entry_count; setEntry_countIsSet(true); return this; } public void unsetEntry_count() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENTRY_COUNT_ISSET_ID); } /** Returns true if field entry_count is set (has been assigned a value) and false otherwise */ public boolean isSetEntry_count() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENTRY_COUNT_ISSET_ID); } public void setEntry_countIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENTRY_COUNT_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case DICT_ID: if (value == null) { unsetDict_id(); } else { setDict_id((java.lang.Integer)value); } break; case ENTRY_COUNT: if (value == null) { unsetEntry_count(); } else { setEntry_count((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case DICT_ID: return getDict_id(); case ENTRY_COUNT: return getEntry_count(); } 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 DICT_ID: return isSetDict_id(); case ENTRY_COUNT: return isSetEntry_count(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TDictionaryGeneration) return this.equals((TDictionaryGeneration)that); return false; } public boolean equals(TDictionaryGeneration that) { if (that == null) return false; if (this == that) return true; boolean this_present_dict_id = true; boolean that_present_dict_id = true; if (this_present_dict_id || that_present_dict_id) { if (!(this_present_dict_id && that_present_dict_id)) return false; if (this.dict_id != that.dict_id) return false; } boolean this_present_entry_count = true; boolean that_present_entry_count = true; if (this_present_entry_count || that_present_entry_count) { if (!(this_present_entry_count && that_present_entry_count)) return false; if (this.entry_count != that.entry_count) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + dict_id; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(entry_count); return hashCode; } @Override public int compareTo(TDictionaryGeneration other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetDict_id(), other.isSetDict_id()); if (lastComparison != 0) { return lastComparison; } if (isSetDict_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dict_id, other.dict_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetEntry_count(), other.isSetEntry_count()); if (lastComparison != 0) { return lastComparison; } if (isSetEntry_count()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entry_count, other.entry_count); 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("TDictionaryGeneration("); boolean first = true; sb.append("dict_id:"); sb.append(this.dict_id); first = false; if (!first) sb.append(", "); sb.append("entry_count:"); sb.append(this.entry_count); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TDictionaryGenerationStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDictionaryGenerationStandardScheme getScheme() { return new TDictionaryGenerationStandardScheme(); } } private static class TDictionaryGenerationStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDictionaryGeneration> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDictionaryGeneration 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: // DICT_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.dict_id = iprot.readI32(); struct.setDict_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // ENTRY_COUNT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.entry_count = iprot.readI64(); struct.setEntry_countIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TDictionaryGeneration struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(DICT_ID_FIELD_DESC); oprot.writeI32(struct.dict_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(ENTRY_COUNT_FIELD_DESC); oprot.writeI64(struct.entry_count); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDictionaryGenerationTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDictionaryGenerationTupleScheme getScheme() { return new TDictionaryGenerationTupleScheme(); } } private static class TDictionaryGenerationTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDictionaryGeneration> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDictionaryGeneration struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetDict_id()) { optionals.set(0); } if (struct.isSetEntry_count()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetDict_id()) { oprot.writeI32(struct.dict_id); } if (struct.isSetEntry_count()) { oprot.writeI64(struct.entry_count); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDictionaryGeneration struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.dict_id = iprot.readI32(); struct.setDict_idIsSet(true); } if (incoming.get(1)) { struct.entry_count = iprot.readI64(); struct.setEntry_countIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TEncodingType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TEncodingType implements org.apache.thrift.TEnum { NONE(0), FIXED(1), RL(2), DIFF(3), DICT(4), SPARSE(5), GEOINT(6), DATE_IN_DAYS(7); private final int value; private TEncodingType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TEncodingType findByValue(int value) { switch (value) { case 0: return NONE; case 1: return FIXED; case 2: return RL; case 3: return DIFF; case 4: return DICT; case 5: return SPARSE; case 6: return GEOINT; case 7: return DATE_IN_DAYS; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TExecuteMode.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TExecuteMode implements org.apache.thrift.TEnum { GPU(1), CPU(2); private final int value; private TExecuteMode(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TExecuteMode findByValue(int value) { switch (value) { case 1: return GPU; case 2: return CPU; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TExpressionRangeType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TExpressionRangeType implements org.apache.thrift.TEnum { INVALID(0), INTEGER(1), FLOAT(2), DOUBLE(3); private final int value; private TExpressionRangeType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TExpressionRangeType findByValue(int value) { switch (value) { case 0: return INVALID; case 1: return INTEGER; case 2: return FLOAT; case 3: return DOUBLE; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TFrontendView.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TFrontendView implements org.apache.thrift.TBase<TFrontendView, TFrontendView._Fields>, java.io.Serializable, Cloneable, Comparable<TFrontendView> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFrontendView"); private static final org.apache.thrift.protocol.TField VIEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("view_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField VIEW_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("view_state", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField IMAGE_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("image_hash", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("update_time", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField VIEW_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("view_metadata", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFrontendViewStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFrontendViewTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String view_name; // required public @org.apache.thrift.annotation.Nullable java.lang.String view_state; // required public @org.apache.thrift.annotation.Nullable java.lang.String image_hash; // required public @org.apache.thrift.annotation.Nullable java.lang.String update_time; // required public @org.apache.thrift.annotation.Nullable java.lang.String view_metadata; // 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 { VIEW_NAME((short)1, "view_name"), VIEW_STATE((short)2, "view_state"), IMAGE_HASH((short)3, "image_hash"), UPDATE_TIME((short)4, "update_time"), VIEW_METADATA((short)5, "view_metadata"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // VIEW_NAME return VIEW_NAME; case 2: // VIEW_STATE return VIEW_STATE; case 3: // IMAGE_HASH return IMAGE_HASH; case 4: // UPDATE_TIME return UPDATE_TIME; case 5: // VIEW_METADATA return VIEW_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 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.VIEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("view_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.VIEW_STATE, new org.apache.thrift.meta_data.FieldMetaData("view_state", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IMAGE_HASH, new org.apache.thrift.meta_data.FieldMetaData("image_hash", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("update_time", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.VIEW_METADATA, new org.apache.thrift.meta_data.FieldMetaData("view_metadata", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TFrontendView.class, metaDataMap); } public TFrontendView() { } public TFrontendView( java.lang.String view_name, java.lang.String view_state, java.lang.String image_hash, java.lang.String update_time, java.lang.String view_metadata) { this(); this.view_name = view_name; this.view_state = view_state; this.image_hash = image_hash; this.update_time = update_time; this.view_metadata = view_metadata; } /** * Performs a deep copy on <i>other</i>. */ public TFrontendView(TFrontendView other) { if (other.isSetView_name()) { this.view_name = other.view_name; } if (other.isSetView_state()) { this.view_state = other.view_state; } if (other.isSetImage_hash()) { this.image_hash = other.image_hash; } if (other.isSetUpdate_time()) { this.update_time = other.update_time; } if (other.isSetView_metadata()) { this.view_metadata = other.view_metadata; } } public TFrontendView deepCopy() { return new TFrontendView(this); } @Override public void clear() { this.view_name = null; this.view_state = null; this.image_hash = null; this.update_time = null; this.view_metadata = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getView_name() { return this.view_name; } public TFrontendView setView_name(@org.apache.thrift.annotation.Nullable java.lang.String view_name) { this.view_name = view_name; return this; } public void unsetView_name() { this.view_name = null; } /** Returns true if field view_name is set (has been assigned a value) and false otherwise */ public boolean isSetView_name() { return this.view_name != null; } public void setView_nameIsSet(boolean value) { if (!value) { this.view_name = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getView_state() { return this.view_state; } public TFrontendView setView_state(@org.apache.thrift.annotation.Nullable java.lang.String view_state) { this.view_state = view_state; return this; } public void unsetView_state() { this.view_state = null; } /** Returns true if field view_state is set (has been assigned a value) and false otherwise */ public boolean isSetView_state() { return this.view_state != null; } public void setView_stateIsSet(boolean value) { if (!value) { this.view_state = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getImage_hash() { return this.image_hash; } public TFrontendView setImage_hash(@org.apache.thrift.annotation.Nullable java.lang.String image_hash) { this.image_hash = image_hash; return this; } public void unsetImage_hash() { this.image_hash = null; } /** Returns true if field image_hash is set (has been assigned a value) and false otherwise */ public boolean isSetImage_hash() { return this.image_hash != null; } public void setImage_hashIsSet(boolean value) { if (!value) { this.image_hash = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getUpdate_time() { return this.update_time; } public TFrontendView setUpdate_time(@org.apache.thrift.annotation.Nullable java.lang.String update_time) { this.update_time = update_time; return this; } public void unsetUpdate_time() { this.update_time = null; } /** Returns true if field update_time is set (has been assigned a value) and false otherwise */ public boolean isSetUpdate_time() { return this.update_time != null; } public void setUpdate_timeIsSet(boolean value) { if (!value) { this.update_time = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getView_metadata() { return this.view_metadata; } public TFrontendView setView_metadata(@org.apache.thrift.annotation.Nullable java.lang.String view_metadata) { this.view_metadata = view_metadata; return this; } public void unsetView_metadata() { this.view_metadata = null; } /** Returns true if field view_metadata is set (has been assigned a value) and false otherwise */ public boolean isSetView_metadata() { return this.view_metadata != null; } public void setView_metadataIsSet(boolean value) { if (!value) { this.view_metadata = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VIEW_NAME: if (value == null) { unsetView_name(); } else { setView_name((java.lang.String)value); } break; case VIEW_STATE: if (value == null) { unsetView_state(); } else { setView_state((java.lang.String)value); } break; case IMAGE_HASH: if (value == null) { unsetImage_hash(); } else { setImage_hash((java.lang.String)value); } break; case UPDATE_TIME: if (value == null) { unsetUpdate_time(); } else { setUpdate_time((java.lang.String)value); } break; case VIEW_METADATA: if (value == null) { unsetView_metadata(); } else { setView_metadata((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VIEW_NAME: return getView_name(); case VIEW_STATE: return getView_state(); case IMAGE_HASH: return getImage_hash(); case UPDATE_TIME: return getUpdate_time(); case VIEW_METADATA: return getView_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 VIEW_NAME: return isSetView_name(); case VIEW_STATE: return isSetView_state(); case IMAGE_HASH: return isSetImage_hash(); case UPDATE_TIME: return isSetUpdate_time(); case VIEW_METADATA: return isSetView_metadata(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TFrontendView) return this.equals((TFrontendView)that); return false; } public boolean equals(TFrontendView that) { if (that == null) return false; if (this == that) return true; boolean this_present_view_name = true && this.isSetView_name(); boolean that_present_view_name = true && that.isSetView_name(); if (this_present_view_name || that_present_view_name) { if (!(this_present_view_name && that_present_view_name)) return false; if (!this.view_name.equals(that.view_name)) return false; } boolean this_present_view_state = true && this.isSetView_state(); boolean that_present_view_state = true && that.isSetView_state(); if (this_present_view_state || that_present_view_state) { if (!(this_present_view_state && that_present_view_state)) return false; if (!this.view_state.equals(that.view_state)) return false; } boolean this_present_image_hash = true && this.isSetImage_hash(); boolean that_present_image_hash = true && that.isSetImage_hash(); if (this_present_image_hash || that_present_image_hash) { if (!(this_present_image_hash && that_present_image_hash)) return false; if (!this.image_hash.equals(that.image_hash)) return false; } boolean this_present_update_time = true && this.isSetUpdate_time(); boolean that_present_update_time = true && that.isSetUpdate_time(); if (this_present_update_time || that_present_update_time) { if (!(this_present_update_time && that_present_update_time)) return false; if (!this.update_time.equals(that.update_time)) return false; } boolean this_present_view_metadata = true && this.isSetView_metadata(); boolean that_present_view_metadata = true && that.isSetView_metadata(); if (this_present_view_metadata || that_present_view_metadata) { if (!(this_present_view_metadata && that_present_view_metadata)) return false; if (!this.view_metadata.equals(that.view_metadata)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetView_name()) ? 131071 : 524287); if (isSetView_name()) hashCode = hashCode * 8191 + view_name.hashCode(); hashCode = hashCode * 8191 + ((isSetView_state()) ? 131071 : 524287); if (isSetView_state()) hashCode = hashCode * 8191 + view_state.hashCode(); hashCode = hashCode * 8191 + ((isSetImage_hash()) ? 131071 : 524287); if (isSetImage_hash()) hashCode = hashCode * 8191 + image_hash.hashCode(); hashCode = hashCode * 8191 + ((isSetUpdate_time()) ? 131071 : 524287); if (isSetUpdate_time()) hashCode = hashCode * 8191 + update_time.hashCode(); hashCode = hashCode * 8191 + ((isSetView_metadata()) ? 131071 : 524287); if (isSetView_metadata()) hashCode = hashCode * 8191 + view_metadata.hashCode(); return hashCode; } @Override public int compareTo(TFrontendView other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetView_name(), other.isSetView_name()); if (lastComparison != 0) { return lastComparison; } if (isSetView_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.view_name, other.view_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetView_state(), other.isSetView_state()); if (lastComparison != 0) { return lastComparison; } if (isSetView_state()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.view_state, other.view_state); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetImage_hash(), other.isSetImage_hash()); if (lastComparison != 0) { return lastComparison; } if (isSetImage_hash()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_hash, other.image_hash); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetUpdate_time(), other.isSetUpdate_time()); if (lastComparison != 0) { return lastComparison; } if (isSetUpdate_time()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.update_time, other.update_time); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetView_metadata(), other.isSetView_metadata()); if (lastComparison != 0) { return lastComparison; } if (isSetView_metadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.view_metadata, other.view_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("TFrontendView("); boolean first = true; sb.append("view_name:"); if (this.view_name == null) { sb.append("null"); } else { sb.append(this.view_name); } first = false; if (!first) sb.append(", "); sb.append("view_state:"); if (this.view_state == null) { sb.append("null"); } else { sb.append(this.view_state); } first = false; if (!first) sb.append(", "); sb.append("image_hash:"); if (this.image_hash == null) { sb.append("null"); } else { sb.append(this.image_hash); } first = false; if (!first) sb.append(", "); sb.append("update_time:"); if (this.update_time == null) { sb.append("null"); } else { sb.append(this.update_time); } first = false; if (!first) sb.append(", "); sb.append("view_metadata:"); if (this.view_metadata == null) { sb.append("null"); } else { sb.append(this.view_metadata); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TFrontendViewStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFrontendViewStandardScheme getScheme() { return new TFrontendViewStandardScheme(); } } private static class TFrontendViewStandardScheme extends org.apache.thrift.scheme.StandardScheme<TFrontendView> { public void read(org.apache.thrift.protocol.TProtocol iprot, TFrontendView 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: // VIEW_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.view_name = iprot.readString(); struct.setView_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // VIEW_STATE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.view_state = iprot.readString(); struct.setView_stateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // IMAGE_HASH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.image_hash = iprot.readString(); struct.setImage_hashIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // UPDATE_TIME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.update_time = iprot.readString(); struct.setUpdate_timeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // VIEW_METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.view_metadata = iprot.readString(); struct.setView_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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TFrontendView struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.view_name != null) { oprot.writeFieldBegin(VIEW_NAME_FIELD_DESC); oprot.writeString(struct.view_name); oprot.writeFieldEnd(); } if (struct.view_state != null) { oprot.writeFieldBegin(VIEW_STATE_FIELD_DESC); oprot.writeString(struct.view_state); oprot.writeFieldEnd(); } if (struct.image_hash != null) { oprot.writeFieldBegin(IMAGE_HASH_FIELD_DESC); oprot.writeString(struct.image_hash); oprot.writeFieldEnd(); } if (struct.update_time != null) { oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC); oprot.writeString(struct.update_time); oprot.writeFieldEnd(); } if (struct.view_metadata != null) { oprot.writeFieldBegin(VIEW_METADATA_FIELD_DESC); oprot.writeString(struct.view_metadata); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TFrontendViewTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFrontendViewTupleScheme getScheme() { return new TFrontendViewTupleScheme(); } } private static class TFrontendViewTupleScheme extends org.apache.thrift.scheme.TupleScheme<TFrontendView> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TFrontendView struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetView_name()) { optionals.set(0); } if (struct.isSetView_state()) { optionals.set(1); } if (struct.isSetImage_hash()) { optionals.set(2); } if (struct.isSetUpdate_time()) { optionals.set(3); } if (struct.isSetView_metadata()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetView_name()) { oprot.writeString(struct.view_name); } if (struct.isSetView_state()) { oprot.writeString(struct.view_state); } if (struct.isSetImage_hash()) { oprot.writeString(struct.image_hash); } if (struct.isSetUpdate_time()) { oprot.writeString(struct.update_time); } if (struct.isSetView_metadata()) { oprot.writeString(struct.view_metadata); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TFrontendView struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.view_name = iprot.readString(); struct.setView_nameIsSet(true); } if (incoming.get(1)) { struct.view_state = iprot.readString(); struct.setView_stateIsSet(true); } if (incoming.get(2)) { struct.image_hash = iprot.readString(); struct.setImage_hashIsSet(true); } if (incoming.get(3)) { struct.update_time = iprot.readString(); struct.setUpdate_timeIsSet(true); } if (incoming.get(4)) { struct.view_metadata = iprot.readString(); struct.setView_metadataIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TGeoFileLayerContents.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TGeoFileLayerContents implements org.apache.thrift.TEnum { EMPTY(0), GEO(1), NON_GEO(2), UNSUPPORTED_GEO(3); private final int value; private TGeoFileLayerContents(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TGeoFileLayerContents findByValue(int value) { switch (value) { case 0: return EMPTY; case 1: return GEO; case 2: return NON_GEO; case 3: return UNSUPPORTED_GEO; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TGeoFileLayerInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TGeoFileLayerInfo implements org.apache.thrift.TBase<TGeoFileLayerInfo, TGeoFileLayerInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TGeoFileLayerInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGeoFileLayerInfo"); 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)1); private static final org.apache.thrift.protocol.TField CONTENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("contents", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGeoFileLayerInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGeoFileLayerInfoTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String name; // required /** * * @see TGeoFileLayerContents */ public @org.apache.thrift.annotation.Nullable TGeoFileLayerContents contents; // 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 { NAME((short)1, "name"), /** * * @see TGeoFileLayerContents */ CONTENTS((short)2, "contents"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // NAME return NAME; case 2: // CONTENTS return CONTENTS; 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 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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CONTENTS, new org.apache.thrift.meta_data.FieldMetaData("contents", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGeoFileLayerContents.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGeoFileLayerInfo.class, metaDataMap); } public TGeoFileLayerInfo() { } public TGeoFileLayerInfo( java.lang.String name, TGeoFileLayerContents contents) { this(); this.name = name; this.contents = contents; } /** * Performs a deep copy on <i>other</i>. */ public TGeoFileLayerInfo(TGeoFileLayerInfo other) { if (other.isSetName()) { this.name = other.name; } if (other.isSetContents()) { this.contents = other.contents; } } public TGeoFileLayerInfo deepCopy() { return new TGeoFileLayerInfo(this); } @Override public void clear() { this.name = null; this.contents = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getName() { return this.name; } public TGeoFileLayerInfo 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; } } /** * * @see TGeoFileLayerContents */ @org.apache.thrift.annotation.Nullable public TGeoFileLayerContents getContents() { return this.contents; } /** * * @see TGeoFileLayerContents */ public TGeoFileLayerInfo setContents(@org.apache.thrift.annotation.Nullable TGeoFileLayerContents contents) { this.contents = contents; return this; } public void unsetContents() { this.contents = null; } /** Returns true if field contents is set (has been assigned a value) and false otherwise */ public boolean isSetContents() { return this.contents != null; } public void setContentsIsSet(boolean value) { if (!value) { this.contents = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NAME: if (value == null) { unsetName(); } else { setName((java.lang.String)value); } break; case CONTENTS: if (value == null) { unsetContents(); } else { setContents((TGeoFileLayerContents)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME: return getName(); case CONTENTS: return getContents(); } 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 NAME: return isSetName(); case CONTENTS: return isSetContents(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TGeoFileLayerInfo) return this.equals((TGeoFileLayerInfo)that); return false; } public boolean equals(TGeoFileLayerInfo that) { if (that == null) return false; if (this == that) return true; 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_contents = true && this.isSetContents(); boolean that_present_contents = true && that.isSetContents(); if (this_present_contents || that_present_contents) { if (!(this_present_contents && that_present_contents)) return false; if (!this.contents.equals(that.contents)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); if (isSetName()) hashCode = hashCode * 8191 + name.hashCode(); hashCode = hashCode * 8191 + ((isSetContents()) ? 131071 : 524287); if (isSetContents()) hashCode = hashCode * 8191 + contents.getValue(); return hashCode; } @Override public int compareTo(TGeoFileLayerInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; 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(isSetContents(), other.isSetContents()); if (lastComparison != 0) { return lastComparison; } if (isSetContents()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.contents, other.contents); 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("TGeoFileLayerInfo("); boolean first = true; sb.append("name:"); if (this.name == null) { sb.append("null"); } else { sb.append(this.name); } first = false; if (!first) sb.append(", "); sb.append("contents:"); if (this.contents == null) { sb.append("null"); } else { sb.append(this.contents); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TGeoFileLayerInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGeoFileLayerInfoStandardScheme getScheme() { return new TGeoFileLayerInfoStandardScheme(); } } private static class TGeoFileLayerInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TGeoFileLayerInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TGeoFileLayerInfo 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: // 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 2: // CONTENTS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.contents = ai.heavy.thrift.server.TGeoFileLayerContents.findByValue(iprot.readI32()); struct.setContentsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TGeoFileLayerInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(struct.name); oprot.writeFieldEnd(); } if (struct.contents != null) { oprot.writeFieldBegin(CONTENTS_FIELD_DESC); oprot.writeI32(struct.contents.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TGeoFileLayerInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGeoFileLayerInfoTupleScheme getScheme() { return new TGeoFileLayerInfoTupleScheme(); } } private static class TGeoFileLayerInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TGeoFileLayerInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGeoFileLayerInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetName()) { optionals.set(0); } if (struct.isSetContents()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetName()) { oprot.writeString(struct.name); } if (struct.isSetContents()) { oprot.writeI32(struct.contents.getValue()); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGeoFileLayerInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); } if (incoming.get(1)) { struct.contents = ai.heavy.thrift.server.TGeoFileLayerContents.findByValue(iprot.readI32()); struct.setContentsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TGpuSpecification.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TGpuSpecification implements org.apache.thrift.TBase<TGpuSpecification, TGpuSpecification._Fields>, java.io.Serializable, Cloneable, Comparable<TGpuSpecification> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGpuSpecification"); private static final org.apache.thrift.protocol.TField NUM_SM_FIELD_DESC = new org.apache.thrift.protocol.TField("num_sm", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField CLOCK_FREQUENCY_K_HZ_FIELD_DESC = new org.apache.thrift.protocol.TField("clock_frequency_kHz", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("memory", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField COMPUTE_CAPABILITY_MAJOR_FIELD_DESC = new org.apache.thrift.protocol.TField("compute_capability_major", org.apache.thrift.protocol.TType.I16, (short)4); private static final org.apache.thrift.protocol.TField COMPUTE_CAPABILITY_MINOR_FIELD_DESC = new org.apache.thrift.protocol.TField("compute_capability_minor", org.apache.thrift.protocol.TType.I16, (short)5); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGpuSpecificationStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGpuSpecificationTupleSchemeFactory(); public int num_sm; // required public long clock_frequency_kHz; // required public long memory; // required public short compute_capability_major; // required public short compute_capability_minor; // 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 { NUM_SM((short)1, "num_sm"), CLOCK_FREQUENCY_K_HZ((short)2, "clock_frequency_kHz"), MEMORY((short)3, "memory"), COMPUTE_CAPABILITY_MAJOR((short)4, "compute_capability_major"), COMPUTE_CAPABILITY_MINOR((short)5, "compute_capability_minor"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // NUM_SM return NUM_SM; case 2: // CLOCK_FREQUENCY_K_HZ return CLOCK_FREQUENCY_K_HZ; case 3: // MEMORY return MEMORY; case 4: // COMPUTE_CAPABILITY_MAJOR return COMPUTE_CAPABILITY_MAJOR; case 5: // COMPUTE_CAPABILITY_MINOR return COMPUTE_CAPABILITY_MINOR; 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 __NUM_SM_ISSET_ID = 0; private static final int __CLOCK_FREQUENCY_KHZ_ISSET_ID = 1; private static final int __MEMORY_ISSET_ID = 2; private static final int __COMPUTE_CAPABILITY_MAJOR_ISSET_ID = 3; private static final int __COMPUTE_CAPABILITY_MINOR_ISSET_ID = 4; 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.NUM_SM, new org.apache.thrift.meta_data.FieldMetaData("num_sm", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.CLOCK_FREQUENCY_K_HZ, new org.apache.thrift.meta_data.FieldMetaData("clock_frequency_kHz", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.MEMORY, new org.apache.thrift.meta_data.FieldMetaData("memory", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.COMPUTE_CAPABILITY_MAJOR, new org.apache.thrift.meta_data.FieldMetaData("compute_capability_major", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.COMPUTE_CAPABILITY_MINOR, new org.apache.thrift.meta_data.FieldMetaData("compute_capability_minor", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGpuSpecification.class, metaDataMap); } public TGpuSpecification() { } public TGpuSpecification( int num_sm, long clock_frequency_kHz, long memory, short compute_capability_major, short compute_capability_minor) { this(); this.num_sm = num_sm; setNum_smIsSet(true); this.clock_frequency_kHz = clock_frequency_kHz; setClock_frequency_kHzIsSet(true); this.memory = memory; setMemoryIsSet(true); this.compute_capability_major = compute_capability_major; setCompute_capability_majorIsSet(true); this.compute_capability_minor = compute_capability_minor; setCompute_capability_minorIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TGpuSpecification(TGpuSpecification other) { __isset_bitfield = other.__isset_bitfield; this.num_sm = other.num_sm; this.clock_frequency_kHz = other.clock_frequency_kHz; this.memory = other.memory; this.compute_capability_major = other.compute_capability_major; this.compute_capability_minor = other.compute_capability_minor; } public TGpuSpecification deepCopy() { return new TGpuSpecification(this); } @Override public void clear() { setNum_smIsSet(false); this.num_sm = 0; setClock_frequency_kHzIsSet(false); this.clock_frequency_kHz = 0; setMemoryIsSet(false); this.memory = 0; setCompute_capability_majorIsSet(false); this.compute_capability_major = 0; setCompute_capability_minorIsSet(false); this.compute_capability_minor = 0; } public int getNum_sm() { return this.num_sm; } public TGpuSpecification setNum_sm(int num_sm) { this.num_sm = num_sm; setNum_smIsSet(true); return this; } public void unsetNum_sm() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_SM_ISSET_ID); } /** Returns true if field num_sm is set (has been assigned a value) and false otherwise */ public boolean isSetNum_sm() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_SM_ISSET_ID); } public void setNum_smIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_SM_ISSET_ID, value); } public long getClock_frequency_kHz() { return this.clock_frequency_kHz; } public TGpuSpecification setClock_frequency_kHz(long clock_frequency_kHz) { this.clock_frequency_kHz = clock_frequency_kHz; setClock_frequency_kHzIsSet(true); return this; } public void unsetClock_frequency_kHz() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CLOCK_FREQUENCY_KHZ_ISSET_ID); } /** Returns true if field clock_frequency_kHz is set (has been assigned a value) and false otherwise */ public boolean isSetClock_frequency_kHz() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CLOCK_FREQUENCY_KHZ_ISSET_ID); } public void setClock_frequency_kHzIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CLOCK_FREQUENCY_KHZ_ISSET_ID, value); } public long getMemory() { return this.memory; } public TGpuSpecification setMemory(long memory) { this.memory = memory; setMemoryIsSet(true); return this; } public void unsetMemory() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MEMORY_ISSET_ID); } /** Returns true if field memory is set (has been assigned a value) and false otherwise */ public boolean isSetMemory() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MEMORY_ISSET_ID); } public void setMemoryIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MEMORY_ISSET_ID, value); } public short getCompute_capability_major() { return this.compute_capability_major; } public TGpuSpecification setCompute_capability_major(short compute_capability_major) { this.compute_capability_major = compute_capability_major; setCompute_capability_majorIsSet(true); return this; } public void unsetCompute_capability_major() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COMPUTE_CAPABILITY_MAJOR_ISSET_ID); } /** Returns true if field compute_capability_major is set (has been assigned a value) and false otherwise */ public boolean isSetCompute_capability_major() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPUTE_CAPABILITY_MAJOR_ISSET_ID); } public void setCompute_capability_majorIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COMPUTE_CAPABILITY_MAJOR_ISSET_ID, value); } public short getCompute_capability_minor() { return this.compute_capability_minor; } public TGpuSpecification setCompute_capability_minor(short compute_capability_minor) { this.compute_capability_minor = compute_capability_minor; setCompute_capability_minorIsSet(true); return this; } public void unsetCompute_capability_minor() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COMPUTE_CAPABILITY_MINOR_ISSET_ID); } /** Returns true if field compute_capability_minor is set (has been assigned a value) and false otherwise */ public boolean isSetCompute_capability_minor() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPUTE_CAPABILITY_MINOR_ISSET_ID); } public void setCompute_capability_minorIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COMPUTE_CAPABILITY_MINOR_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NUM_SM: if (value == null) { unsetNum_sm(); } else { setNum_sm((java.lang.Integer)value); } break; case CLOCK_FREQUENCY_K_HZ: if (value == null) { unsetClock_frequency_kHz(); } else { setClock_frequency_kHz((java.lang.Long)value); } break; case MEMORY: if (value == null) { unsetMemory(); } else { setMemory((java.lang.Long)value); } break; case COMPUTE_CAPABILITY_MAJOR: if (value == null) { unsetCompute_capability_major(); } else { setCompute_capability_major((java.lang.Short)value); } break; case COMPUTE_CAPABILITY_MINOR: if (value == null) { unsetCompute_capability_minor(); } else { setCompute_capability_minor((java.lang.Short)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NUM_SM: return getNum_sm(); case CLOCK_FREQUENCY_K_HZ: return getClock_frequency_kHz(); case MEMORY: return getMemory(); case COMPUTE_CAPABILITY_MAJOR: return getCompute_capability_major(); case COMPUTE_CAPABILITY_MINOR: return getCompute_capability_minor(); } 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 NUM_SM: return isSetNum_sm(); case CLOCK_FREQUENCY_K_HZ: return isSetClock_frequency_kHz(); case MEMORY: return isSetMemory(); case COMPUTE_CAPABILITY_MAJOR: return isSetCompute_capability_major(); case COMPUTE_CAPABILITY_MINOR: return isSetCompute_capability_minor(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TGpuSpecification) return this.equals((TGpuSpecification)that); return false; } public boolean equals(TGpuSpecification that) { if (that == null) return false; if (this == that) return true; boolean this_present_num_sm = true; boolean that_present_num_sm = true; if (this_present_num_sm || that_present_num_sm) { if (!(this_present_num_sm && that_present_num_sm)) return false; if (this.num_sm != that.num_sm) return false; } boolean this_present_clock_frequency_kHz = true; boolean that_present_clock_frequency_kHz = true; if (this_present_clock_frequency_kHz || that_present_clock_frequency_kHz) { if (!(this_present_clock_frequency_kHz && that_present_clock_frequency_kHz)) return false; if (this.clock_frequency_kHz != that.clock_frequency_kHz) return false; } boolean this_present_memory = true; boolean that_present_memory = true; if (this_present_memory || that_present_memory) { if (!(this_present_memory && that_present_memory)) return false; if (this.memory != that.memory) return false; } boolean this_present_compute_capability_major = true; boolean that_present_compute_capability_major = true; if (this_present_compute_capability_major || that_present_compute_capability_major) { if (!(this_present_compute_capability_major && that_present_compute_capability_major)) return false; if (this.compute_capability_major != that.compute_capability_major) return false; } boolean this_present_compute_capability_minor = true; boolean that_present_compute_capability_minor = true; if (this_present_compute_capability_minor || that_present_compute_capability_minor) { if (!(this_present_compute_capability_minor && that_present_compute_capability_minor)) return false; if (this.compute_capability_minor != that.compute_capability_minor) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + num_sm; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(clock_frequency_kHz); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(memory); hashCode = hashCode * 8191 + compute_capability_major; hashCode = hashCode * 8191 + compute_capability_minor; return hashCode; } @Override public int compareTo(TGpuSpecification other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetNum_sm(), other.isSetNum_sm()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_sm()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_sm, other.num_sm); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetClock_frequency_kHz(), other.isSetClock_frequency_kHz()); if (lastComparison != 0) { return lastComparison; } if (isSetClock_frequency_kHz()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clock_frequency_kHz, other.clock_frequency_kHz); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMemory(), other.isSetMemory()); if (lastComparison != 0) { return lastComparison; } if (isSetMemory()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.memory, other.memory); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCompute_capability_major(), other.isSetCompute_capability_major()); if (lastComparison != 0) { return lastComparison; } if (isSetCompute_capability_major()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compute_capability_major, other.compute_capability_major); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCompute_capability_minor(), other.isSetCompute_capability_minor()); if (lastComparison != 0) { return lastComparison; } if (isSetCompute_capability_minor()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compute_capability_minor, other.compute_capability_minor); 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("TGpuSpecification("); boolean first = true; sb.append("num_sm:"); sb.append(this.num_sm); first = false; if (!first) sb.append(", "); sb.append("clock_frequency_kHz:"); sb.append(this.clock_frequency_kHz); first = false; if (!first) sb.append(", "); sb.append("memory:"); sb.append(this.memory); first = false; if (!first) sb.append(", "); sb.append("compute_capability_major:"); sb.append(this.compute_capability_major); first = false; if (!first) sb.append(", "); sb.append("compute_capability_minor:"); sb.append(this.compute_capability_minor); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TGpuSpecificationStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGpuSpecificationStandardScheme getScheme() { return new TGpuSpecificationStandardScheme(); } } private static class TGpuSpecificationStandardScheme extends org.apache.thrift.scheme.StandardScheme<TGpuSpecification> { public void read(org.apache.thrift.protocol.TProtocol iprot, TGpuSpecification 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: // NUM_SM if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.num_sm = iprot.readI32(); struct.setNum_smIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // CLOCK_FREQUENCY_K_HZ if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.clock_frequency_kHz = iprot.readI64(); struct.setClock_frequency_kHzIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // MEMORY if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.memory = iprot.readI64(); struct.setMemoryIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // COMPUTE_CAPABILITY_MAJOR if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.compute_capability_major = iprot.readI16(); struct.setCompute_capability_majorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // COMPUTE_CAPABILITY_MINOR if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.compute_capability_minor = iprot.readI16(); struct.setCompute_capability_minorIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TGpuSpecification struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(NUM_SM_FIELD_DESC); oprot.writeI32(struct.num_sm); oprot.writeFieldEnd(); oprot.writeFieldBegin(CLOCK_FREQUENCY_K_HZ_FIELD_DESC); oprot.writeI64(struct.clock_frequency_kHz); oprot.writeFieldEnd(); oprot.writeFieldBegin(MEMORY_FIELD_DESC); oprot.writeI64(struct.memory); oprot.writeFieldEnd(); oprot.writeFieldBegin(COMPUTE_CAPABILITY_MAJOR_FIELD_DESC); oprot.writeI16(struct.compute_capability_major); oprot.writeFieldEnd(); oprot.writeFieldBegin(COMPUTE_CAPABILITY_MINOR_FIELD_DESC); oprot.writeI16(struct.compute_capability_minor); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TGpuSpecificationTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGpuSpecificationTupleScheme getScheme() { return new TGpuSpecificationTupleScheme(); } } private static class TGpuSpecificationTupleScheme extends org.apache.thrift.scheme.TupleScheme<TGpuSpecification> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGpuSpecification struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetNum_sm()) { optionals.set(0); } if (struct.isSetClock_frequency_kHz()) { optionals.set(1); } if (struct.isSetMemory()) { optionals.set(2); } if (struct.isSetCompute_capability_major()) { optionals.set(3); } if (struct.isSetCompute_capability_minor()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetNum_sm()) { oprot.writeI32(struct.num_sm); } if (struct.isSetClock_frequency_kHz()) { oprot.writeI64(struct.clock_frequency_kHz); } if (struct.isSetMemory()) { oprot.writeI64(struct.memory); } if (struct.isSetCompute_capability_major()) { oprot.writeI16(struct.compute_capability_major); } if (struct.isSetCompute_capability_minor()) { oprot.writeI16(struct.compute_capability_minor); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGpuSpecification struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.num_sm = iprot.readI32(); struct.setNum_smIsSet(true); } if (incoming.get(1)) { struct.clock_frequency_kHz = iprot.readI64(); struct.setClock_frequency_kHzIsSet(true); } if (incoming.get(2)) { struct.memory = iprot.readI64(); struct.setMemoryIsSet(true); } if (incoming.get(3)) { struct.compute_capability_major = iprot.readI16(); struct.setCompute_capability_majorIsSet(true); } if (incoming.get(4)) { struct.compute_capability_minor = iprot.readI16(); struct.setCompute_capability_minorIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/THardwareInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class THardwareInfo implements org.apache.thrift.TBase<THardwareInfo, THardwareInfo._Fields>, java.io.Serializable, Cloneable, Comparable<THardwareInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THardwareInfo"); private static final org.apache.thrift.protocol.TField NUM_GPU_HW_FIELD_DESC = new org.apache.thrift.protocol.TField("num_gpu_hw", org.apache.thrift.protocol.TType.I16, (short)1); private static final org.apache.thrift.protocol.TField NUM_CPU_HW_FIELD_DESC = new org.apache.thrift.protocol.TField("num_cpu_hw", org.apache.thrift.protocol.TType.I16, (short)2); private static final org.apache.thrift.protocol.TField NUM_GPU_ALLOCATED_FIELD_DESC = new org.apache.thrift.protocol.TField("num_gpu_allocated", org.apache.thrift.protocol.TType.I16, (short)3); private static final org.apache.thrift.protocol.TField START_GPU_FIELD_DESC = new org.apache.thrift.protocol.TField("start_gpu", org.apache.thrift.protocol.TType.I16, (short)4); private static final org.apache.thrift.protocol.TField HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("host_name", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField GPU_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("gpu_info", org.apache.thrift.protocol.TType.LIST, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new THardwareInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new THardwareInfoTupleSchemeFactory(); public short num_gpu_hw; // required public short num_cpu_hw; // required public short num_gpu_allocated; // required public short start_gpu; // required public @org.apache.thrift.annotation.Nullable java.lang.String host_name; // required public @org.apache.thrift.annotation.Nullable java.util.List<TGpuSpecification> gpu_info; // 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 { NUM_GPU_HW((short)1, "num_gpu_hw"), NUM_CPU_HW((short)2, "num_cpu_hw"), NUM_GPU_ALLOCATED((short)3, "num_gpu_allocated"), START_GPU((short)4, "start_gpu"), HOST_NAME((short)5, "host_name"), GPU_INFO((short)6, "gpu_info"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // NUM_GPU_HW return NUM_GPU_HW; case 2: // NUM_CPU_HW return NUM_CPU_HW; case 3: // NUM_GPU_ALLOCATED return NUM_GPU_ALLOCATED; case 4: // START_GPU return START_GPU; case 5: // HOST_NAME return HOST_NAME; case 6: // GPU_INFO return GPU_INFO; 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 __NUM_GPU_HW_ISSET_ID = 0; private static final int __NUM_CPU_HW_ISSET_ID = 1; private static final int __NUM_GPU_ALLOCATED_ISSET_ID = 2; private static final int __START_GPU_ISSET_ID = 3; 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.NUM_GPU_HW, new org.apache.thrift.meta_data.FieldMetaData("num_gpu_hw", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.NUM_CPU_HW, new org.apache.thrift.meta_data.FieldMetaData("num_cpu_hw", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.NUM_GPU_ALLOCATED, new org.apache.thrift.meta_data.FieldMetaData("num_gpu_allocated", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.START_GPU, new org.apache.thrift.meta_data.FieldMetaData("start_gpu", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("host_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.GPU_INFO, new org.apache.thrift.meta_data.FieldMetaData("gpu_info", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGpuSpecification.class)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THardwareInfo.class, metaDataMap); } public THardwareInfo() { } public THardwareInfo( short num_gpu_hw, short num_cpu_hw, short num_gpu_allocated, short start_gpu, java.lang.String host_name, java.util.List<TGpuSpecification> gpu_info) { this(); this.num_gpu_hw = num_gpu_hw; setNum_gpu_hwIsSet(true); this.num_cpu_hw = num_cpu_hw; setNum_cpu_hwIsSet(true); this.num_gpu_allocated = num_gpu_allocated; setNum_gpu_allocatedIsSet(true); this.start_gpu = start_gpu; setStart_gpuIsSet(true); this.host_name = host_name; this.gpu_info = gpu_info; } /** * Performs a deep copy on <i>other</i>. */ public THardwareInfo(THardwareInfo other) { __isset_bitfield = other.__isset_bitfield; this.num_gpu_hw = other.num_gpu_hw; this.num_cpu_hw = other.num_cpu_hw; this.num_gpu_allocated = other.num_gpu_allocated; this.start_gpu = other.start_gpu; if (other.isSetHost_name()) { this.host_name = other.host_name; } if (other.isSetGpu_info()) { java.util.List<TGpuSpecification> __this__gpu_info = new java.util.ArrayList<TGpuSpecification>(other.gpu_info.size()); for (TGpuSpecification other_element : other.gpu_info) { __this__gpu_info.add(new TGpuSpecification(other_element)); } this.gpu_info = __this__gpu_info; } } public THardwareInfo deepCopy() { return new THardwareInfo(this); } @Override public void clear() { setNum_gpu_hwIsSet(false); this.num_gpu_hw = 0; setNum_cpu_hwIsSet(false); this.num_cpu_hw = 0; setNum_gpu_allocatedIsSet(false); this.num_gpu_allocated = 0; setStart_gpuIsSet(false); this.start_gpu = 0; this.host_name = null; this.gpu_info = null; } public short getNum_gpu_hw() { return this.num_gpu_hw; } public THardwareInfo setNum_gpu_hw(short num_gpu_hw) { this.num_gpu_hw = num_gpu_hw; setNum_gpu_hwIsSet(true); return this; } public void unsetNum_gpu_hw() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_GPU_HW_ISSET_ID); } /** Returns true if field num_gpu_hw is set (has been assigned a value) and false otherwise */ public boolean isSetNum_gpu_hw() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_GPU_HW_ISSET_ID); } public void setNum_gpu_hwIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_GPU_HW_ISSET_ID, value); } public short getNum_cpu_hw() { return this.num_cpu_hw; } public THardwareInfo setNum_cpu_hw(short num_cpu_hw) { this.num_cpu_hw = num_cpu_hw; setNum_cpu_hwIsSet(true); return this; } public void unsetNum_cpu_hw() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_CPU_HW_ISSET_ID); } /** Returns true if field num_cpu_hw is set (has been assigned a value) and false otherwise */ public boolean isSetNum_cpu_hw() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_CPU_HW_ISSET_ID); } public void setNum_cpu_hwIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_CPU_HW_ISSET_ID, value); } public short getNum_gpu_allocated() { return this.num_gpu_allocated; } public THardwareInfo setNum_gpu_allocated(short num_gpu_allocated) { this.num_gpu_allocated = num_gpu_allocated; setNum_gpu_allocatedIsSet(true); return this; } public void unsetNum_gpu_allocated() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_GPU_ALLOCATED_ISSET_ID); } /** Returns true if field num_gpu_allocated is set (has been assigned a value) and false otherwise */ public boolean isSetNum_gpu_allocated() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_GPU_ALLOCATED_ISSET_ID); } public void setNum_gpu_allocatedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_GPU_ALLOCATED_ISSET_ID, value); } public short getStart_gpu() { return this.start_gpu; } public THardwareInfo setStart_gpu(short start_gpu) { this.start_gpu = start_gpu; setStart_gpuIsSet(true); return this; } public void unsetStart_gpu() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_GPU_ISSET_ID); } /** Returns true if field start_gpu is set (has been assigned a value) and false otherwise */ public boolean isSetStart_gpu() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_GPU_ISSET_ID); } public void setStart_gpuIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_GPU_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getHost_name() { return this.host_name; } public THardwareInfo setHost_name(@org.apache.thrift.annotation.Nullable java.lang.String host_name) { this.host_name = host_name; return this; } public void unsetHost_name() { this.host_name = null; } /** Returns true if field host_name is set (has been assigned a value) and false otherwise */ public boolean isSetHost_name() { return this.host_name != null; } public void setHost_nameIsSet(boolean value) { if (!value) { this.host_name = null; } } public int getGpu_infoSize() { return (this.gpu_info == null) ? 0 : this.gpu_info.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TGpuSpecification> getGpu_infoIterator() { return (this.gpu_info == null) ? null : this.gpu_info.iterator(); } public void addToGpu_info(TGpuSpecification elem) { if (this.gpu_info == null) { this.gpu_info = new java.util.ArrayList<TGpuSpecification>(); } this.gpu_info.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TGpuSpecification> getGpu_info() { return this.gpu_info; } public THardwareInfo setGpu_info(@org.apache.thrift.annotation.Nullable java.util.List<TGpuSpecification> gpu_info) { this.gpu_info = gpu_info; return this; } public void unsetGpu_info() { this.gpu_info = null; } /** Returns true if field gpu_info is set (has been assigned a value) and false otherwise */ public boolean isSetGpu_info() { return this.gpu_info != null; } public void setGpu_infoIsSet(boolean value) { if (!value) { this.gpu_info = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NUM_GPU_HW: if (value == null) { unsetNum_gpu_hw(); } else { setNum_gpu_hw((java.lang.Short)value); } break; case NUM_CPU_HW: if (value == null) { unsetNum_cpu_hw(); } else { setNum_cpu_hw((java.lang.Short)value); } break; case NUM_GPU_ALLOCATED: if (value == null) { unsetNum_gpu_allocated(); } else { setNum_gpu_allocated((java.lang.Short)value); } break; case START_GPU: if (value == null) { unsetStart_gpu(); } else { setStart_gpu((java.lang.Short)value); } break; case HOST_NAME: if (value == null) { unsetHost_name(); } else { setHost_name((java.lang.String)value); } break; case GPU_INFO: if (value == null) { unsetGpu_info(); } else { setGpu_info((java.util.List<TGpuSpecification>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NUM_GPU_HW: return getNum_gpu_hw(); case NUM_CPU_HW: return getNum_cpu_hw(); case NUM_GPU_ALLOCATED: return getNum_gpu_allocated(); case START_GPU: return getStart_gpu(); case HOST_NAME: return getHost_name(); case GPU_INFO: return getGpu_info(); } 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 NUM_GPU_HW: return isSetNum_gpu_hw(); case NUM_CPU_HW: return isSetNum_cpu_hw(); case NUM_GPU_ALLOCATED: return isSetNum_gpu_allocated(); case START_GPU: return isSetStart_gpu(); case HOST_NAME: return isSetHost_name(); case GPU_INFO: return isSetGpu_info(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof THardwareInfo) return this.equals((THardwareInfo)that); return false; } public boolean equals(THardwareInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_num_gpu_hw = true; boolean that_present_num_gpu_hw = true; if (this_present_num_gpu_hw || that_present_num_gpu_hw) { if (!(this_present_num_gpu_hw && that_present_num_gpu_hw)) return false; if (this.num_gpu_hw != that.num_gpu_hw) return false; } boolean this_present_num_cpu_hw = true; boolean that_present_num_cpu_hw = true; if (this_present_num_cpu_hw || that_present_num_cpu_hw) { if (!(this_present_num_cpu_hw && that_present_num_cpu_hw)) return false; if (this.num_cpu_hw != that.num_cpu_hw) return false; } boolean this_present_num_gpu_allocated = true; boolean that_present_num_gpu_allocated = true; if (this_present_num_gpu_allocated || that_present_num_gpu_allocated) { if (!(this_present_num_gpu_allocated && that_present_num_gpu_allocated)) return false; if (this.num_gpu_allocated != that.num_gpu_allocated) return false; } boolean this_present_start_gpu = true; boolean that_present_start_gpu = true; if (this_present_start_gpu || that_present_start_gpu) { if (!(this_present_start_gpu && that_present_start_gpu)) return false; if (this.start_gpu != that.start_gpu) return false; } boolean this_present_host_name = true && this.isSetHost_name(); boolean that_present_host_name = true && that.isSetHost_name(); if (this_present_host_name || that_present_host_name) { if (!(this_present_host_name && that_present_host_name)) return false; if (!this.host_name.equals(that.host_name)) return false; } boolean this_present_gpu_info = true && this.isSetGpu_info(); boolean that_present_gpu_info = true && that.isSetGpu_info(); if (this_present_gpu_info || that_present_gpu_info) { if (!(this_present_gpu_info && that_present_gpu_info)) return false; if (!this.gpu_info.equals(that.gpu_info)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + num_gpu_hw; hashCode = hashCode * 8191 + num_cpu_hw; hashCode = hashCode * 8191 + num_gpu_allocated; hashCode = hashCode * 8191 + start_gpu; hashCode = hashCode * 8191 + ((isSetHost_name()) ? 131071 : 524287); if (isSetHost_name()) hashCode = hashCode * 8191 + host_name.hashCode(); hashCode = hashCode * 8191 + ((isSetGpu_info()) ? 131071 : 524287); if (isSetGpu_info()) hashCode = hashCode * 8191 + gpu_info.hashCode(); return hashCode; } @Override public int compareTo(THardwareInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetNum_gpu_hw(), other.isSetNum_gpu_hw()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_gpu_hw()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_gpu_hw, other.num_gpu_hw); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_cpu_hw(), other.isSetNum_cpu_hw()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_cpu_hw()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_cpu_hw, other.num_cpu_hw); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_gpu_allocated(), other.isSetNum_gpu_allocated()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_gpu_allocated()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_gpu_allocated, other.num_gpu_allocated); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetStart_gpu(), other.isSetStart_gpu()); if (lastComparison != 0) { return lastComparison; } if (isSetStart_gpu()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_gpu, other.start_gpu); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetHost_name(), other.isSetHost_name()); if (lastComparison != 0) { return lastComparison; } if (isSetHost_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host_name, other.host_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetGpu_info(), other.isSetGpu_info()); if (lastComparison != 0) { return lastComparison; } if (isSetGpu_info()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gpu_info, other.gpu_info); 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("THardwareInfo("); boolean first = true; sb.append("num_gpu_hw:"); sb.append(this.num_gpu_hw); first = false; if (!first) sb.append(", "); sb.append("num_cpu_hw:"); sb.append(this.num_cpu_hw); first = false; if (!first) sb.append(", "); sb.append("num_gpu_allocated:"); sb.append(this.num_gpu_allocated); first = false; if (!first) sb.append(", "); sb.append("start_gpu:"); sb.append(this.start_gpu); first = false; if (!first) sb.append(", "); sb.append("host_name:"); if (this.host_name == null) { sb.append("null"); } else { sb.append(this.host_name); } first = false; if (!first) sb.append(", "); sb.append("gpu_info:"); if (this.gpu_info == null) { sb.append("null"); } else { sb.append(this.gpu_info); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 THardwareInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public THardwareInfoStandardScheme getScheme() { return new THardwareInfoStandardScheme(); } } private static class THardwareInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<THardwareInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, THardwareInfo 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: // NUM_GPU_HW if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.num_gpu_hw = iprot.readI16(); struct.setNum_gpu_hwIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NUM_CPU_HW if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.num_cpu_hw = iprot.readI16(); struct.setNum_cpu_hwIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // NUM_GPU_ALLOCATED if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.num_gpu_allocated = iprot.readI16(); struct.setNum_gpu_allocatedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // START_GPU if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.start_gpu = iprot.readI16(); struct.setStart_gpuIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // HOST_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.host_name = iprot.readString(); struct.setHost_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // GPU_INFO if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list112 = iprot.readListBegin(); struct.gpu_info = new java.util.ArrayList<TGpuSpecification>(_list112.size); @org.apache.thrift.annotation.Nullable TGpuSpecification _elem113; for (int _i114 = 0; _i114 < _list112.size; ++_i114) { _elem113 = new TGpuSpecification(); _elem113.read(iprot); struct.gpu_info.add(_elem113); } iprot.readListEnd(); } struct.setGpu_infoIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, THardwareInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(NUM_GPU_HW_FIELD_DESC); oprot.writeI16(struct.num_gpu_hw); oprot.writeFieldEnd(); oprot.writeFieldBegin(NUM_CPU_HW_FIELD_DESC); oprot.writeI16(struct.num_cpu_hw); oprot.writeFieldEnd(); oprot.writeFieldBegin(NUM_GPU_ALLOCATED_FIELD_DESC); oprot.writeI16(struct.num_gpu_allocated); oprot.writeFieldEnd(); oprot.writeFieldBegin(START_GPU_FIELD_DESC); oprot.writeI16(struct.start_gpu); oprot.writeFieldEnd(); if (struct.host_name != null) { oprot.writeFieldBegin(HOST_NAME_FIELD_DESC); oprot.writeString(struct.host_name); oprot.writeFieldEnd(); } if (struct.gpu_info != null) { oprot.writeFieldBegin(GPU_INFO_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.gpu_info.size())); for (TGpuSpecification _iter115 : struct.gpu_info) { _iter115.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class THardwareInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public THardwareInfoTupleScheme getScheme() { return new THardwareInfoTupleScheme(); } } private static class THardwareInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<THardwareInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, THardwareInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetNum_gpu_hw()) { optionals.set(0); } if (struct.isSetNum_cpu_hw()) { optionals.set(1); } if (struct.isSetNum_gpu_allocated()) { optionals.set(2); } if (struct.isSetStart_gpu()) { optionals.set(3); } if (struct.isSetHost_name()) { optionals.set(4); } if (struct.isSetGpu_info()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetNum_gpu_hw()) { oprot.writeI16(struct.num_gpu_hw); } if (struct.isSetNum_cpu_hw()) { oprot.writeI16(struct.num_cpu_hw); } if (struct.isSetNum_gpu_allocated()) { oprot.writeI16(struct.num_gpu_allocated); } if (struct.isSetStart_gpu()) { oprot.writeI16(struct.start_gpu); } if (struct.isSetHost_name()) { oprot.writeString(struct.host_name); } if (struct.isSetGpu_info()) { { oprot.writeI32(struct.gpu_info.size()); for (TGpuSpecification _iter116 : struct.gpu_info) { _iter116.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, THardwareInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.num_gpu_hw = iprot.readI16(); struct.setNum_gpu_hwIsSet(true); } if (incoming.get(1)) { struct.num_cpu_hw = iprot.readI16(); struct.setNum_cpu_hwIsSet(true); } if (incoming.get(2)) { struct.num_gpu_allocated = iprot.readI16(); struct.setNum_gpu_allocatedIsSet(true); } if (incoming.get(3)) { struct.start_gpu = iprot.readI16(); struct.setStart_gpuIsSet(true); } if (incoming.get(4)) { struct.host_name = iprot.readString(); struct.setHost_nameIsSet(true); } if (incoming.get(5)) { { org.apache.thrift.protocol.TList _list117 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.gpu_info = new java.util.ArrayList<TGpuSpecification>(_list117.size); @org.apache.thrift.annotation.Nullable TGpuSpecification _elem118; for (int _i119 = 0; _i119 < _list117.size; ++_i119) { _elem118 = new TGpuSpecification(); _elem118.read(iprot); struct.gpu_info.add(_elem118); } } struct.setGpu_infoIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TImportHeaderRow.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TImportHeaderRow implements org.apache.thrift.TEnum { AUTODETECT(0), NO_HEADER(1), HAS_HEADER(2); private final int value; private TImportHeaderRow(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TImportHeaderRow findByValue(int value) { switch (value) { case 0: return AUTODETECT; case 1: return NO_HEADER; case 2: return HAS_HEADER; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TImportStatus.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TImportStatus implements org.apache.thrift.TBase<TImportStatus, TImportStatus._Fields>, java.io.Serializable, Cloneable, Comparable<TImportStatus> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TImportStatus"); private static final org.apache.thrift.protocol.TField ELAPSED_FIELD_DESC = new org.apache.thrift.protocol.TField("elapsed", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField ROWS_COMPLETED_FIELD_DESC = new org.apache.thrift.protocol.TField("rows_completed", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField ROWS_ESTIMATED_FIELD_DESC = new org.apache.thrift.protocol.TField("rows_estimated", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField ROWS_REJECTED_FIELD_DESC = new org.apache.thrift.protocol.TField("rows_rejected", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TImportStatusStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TImportStatusTupleSchemeFactory(); public long elapsed; // required public long rows_completed; // required public long rows_estimated; // required public long rows_rejected; // 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 { ELAPSED((short)1, "elapsed"), ROWS_COMPLETED((short)2, "rows_completed"), ROWS_ESTIMATED((short)3, "rows_estimated"), ROWS_REJECTED((short)4, "rows_rejected"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ELAPSED return ELAPSED; case 2: // ROWS_COMPLETED return ROWS_COMPLETED; case 3: // ROWS_ESTIMATED return ROWS_ESTIMATED; case 4: // ROWS_REJECTED return ROWS_REJECTED; 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 __ELAPSED_ISSET_ID = 0; private static final int __ROWS_COMPLETED_ISSET_ID = 1; private static final int __ROWS_ESTIMATED_ISSET_ID = 2; private static final int __ROWS_REJECTED_ISSET_ID = 3; 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.ELAPSED, new org.apache.thrift.meta_data.FieldMetaData("elapsed", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.ROWS_COMPLETED, new org.apache.thrift.meta_data.FieldMetaData("rows_completed", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.ROWS_ESTIMATED, new org.apache.thrift.meta_data.FieldMetaData("rows_estimated", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.ROWS_REJECTED, new org.apache.thrift.meta_data.FieldMetaData("rows_rejected", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TImportStatus.class, metaDataMap); } public TImportStatus() { } public TImportStatus( long elapsed, long rows_completed, long rows_estimated, long rows_rejected) { this(); this.elapsed = elapsed; setElapsedIsSet(true); this.rows_completed = rows_completed; setRows_completedIsSet(true); this.rows_estimated = rows_estimated; setRows_estimatedIsSet(true); this.rows_rejected = rows_rejected; setRows_rejectedIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TImportStatus(TImportStatus other) { __isset_bitfield = other.__isset_bitfield; this.elapsed = other.elapsed; this.rows_completed = other.rows_completed; this.rows_estimated = other.rows_estimated; this.rows_rejected = other.rows_rejected; } public TImportStatus deepCopy() { return new TImportStatus(this); } @Override public void clear() { setElapsedIsSet(false); this.elapsed = 0; setRows_completedIsSet(false); this.rows_completed = 0; setRows_estimatedIsSet(false); this.rows_estimated = 0; setRows_rejectedIsSet(false); this.rows_rejected = 0; } public long getElapsed() { return this.elapsed; } public TImportStatus setElapsed(long elapsed) { this.elapsed = elapsed; setElapsedIsSet(true); return this; } public void unsetElapsed() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ELAPSED_ISSET_ID); } /** Returns true if field elapsed is set (has been assigned a value) and false otherwise */ public boolean isSetElapsed() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ELAPSED_ISSET_ID); } public void setElapsedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ELAPSED_ISSET_ID, value); } public long getRows_completed() { return this.rows_completed; } public TImportStatus setRows_completed(long rows_completed) { this.rows_completed = rows_completed; setRows_completedIsSet(true); return this; } public void unsetRows_completed() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ROWS_COMPLETED_ISSET_ID); } /** Returns true if field rows_completed is set (has been assigned a value) and false otherwise */ public boolean isSetRows_completed() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ROWS_COMPLETED_ISSET_ID); } public void setRows_completedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ROWS_COMPLETED_ISSET_ID, value); } public long getRows_estimated() { return this.rows_estimated; } public TImportStatus setRows_estimated(long rows_estimated) { this.rows_estimated = rows_estimated; setRows_estimatedIsSet(true); return this; } public void unsetRows_estimated() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ROWS_ESTIMATED_ISSET_ID); } /** Returns true if field rows_estimated is set (has been assigned a value) and false otherwise */ public boolean isSetRows_estimated() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ROWS_ESTIMATED_ISSET_ID); } public void setRows_estimatedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ROWS_ESTIMATED_ISSET_ID, value); } public long getRows_rejected() { return this.rows_rejected; } public TImportStatus setRows_rejected(long rows_rejected) { this.rows_rejected = rows_rejected; setRows_rejectedIsSet(true); return this; } public void unsetRows_rejected() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ROWS_REJECTED_ISSET_ID); } /** Returns true if field rows_rejected is set (has been assigned a value) and false otherwise */ public boolean isSetRows_rejected() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ROWS_REJECTED_ISSET_ID); } public void setRows_rejectedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ROWS_REJECTED_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ELAPSED: if (value == null) { unsetElapsed(); } else { setElapsed((java.lang.Long)value); } break; case ROWS_COMPLETED: if (value == null) { unsetRows_completed(); } else { setRows_completed((java.lang.Long)value); } break; case ROWS_ESTIMATED: if (value == null) { unsetRows_estimated(); } else { setRows_estimated((java.lang.Long)value); } break; case ROWS_REJECTED: if (value == null) { unsetRows_rejected(); } else { setRows_rejected((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ELAPSED: return getElapsed(); case ROWS_COMPLETED: return getRows_completed(); case ROWS_ESTIMATED: return getRows_estimated(); case ROWS_REJECTED: return getRows_rejected(); } 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 ELAPSED: return isSetElapsed(); case ROWS_COMPLETED: return isSetRows_completed(); case ROWS_ESTIMATED: return isSetRows_estimated(); case ROWS_REJECTED: return isSetRows_rejected(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TImportStatus) return this.equals((TImportStatus)that); return false; } public boolean equals(TImportStatus that) { if (that == null) return false; if (this == that) return true; boolean this_present_elapsed = true; boolean that_present_elapsed = true; if (this_present_elapsed || that_present_elapsed) { if (!(this_present_elapsed && that_present_elapsed)) return false; if (this.elapsed != that.elapsed) return false; } boolean this_present_rows_completed = true; boolean that_present_rows_completed = true; if (this_present_rows_completed || that_present_rows_completed) { if (!(this_present_rows_completed && that_present_rows_completed)) return false; if (this.rows_completed != that.rows_completed) return false; } boolean this_present_rows_estimated = true; boolean that_present_rows_estimated = true; if (this_present_rows_estimated || that_present_rows_estimated) { if (!(this_present_rows_estimated && that_present_rows_estimated)) return false; if (this.rows_estimated != that.rows_estimated) return false; } boolean this_present_rows_rejected = true; boolean that_present_rows_rejected = true; if (this_present_rows_rejected || that_present_rows_rejected) { if (!(this_present_rows_rejected && that_present_rows_rejected)) return false; if (this.rows_rejected != that.rows_rejected) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(elapsed); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(rows_completed); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(rows_estimated); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(rows_rejected); return hashCode; } @Override public int compareTo(TImportStatus other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetElapsed(), other.isSetElapsed()); if (lastComparison != 0) { return lastComparison; } if (isSetElapsed()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.elapsed, other.elapsed); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRows_completed(), other.isSetRows_completed()); if (lastComparison != 0) { return lastComparison; } if (isSetRows_completed()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows_completed, other.rows_completed); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRows_estimated(), other.isSetRows_estimated()); if (lastComparison != 0) { return lastComparison; } if (isSetRows_estimated()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows_estimated, other.rows_estimated); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRows_rejected(), other.isSetRows_rejected()); if (lastComparison != 0) { return lastComparison; } if (isSetRows_rejected()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows_rejected, other.rows_rejected); 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("TImportStatus("); boolean first = true; sb.append("elapsed:"); sb.append(this.elapsed); first = false; if (!first) sb.append(", "); sb.append("rows_completed:"); sb.append(this.rows_completed); first = false; if (!first) sb.append(", "); sb.append("rows_estimated:"); sb.append(this.rows_estimated); first = false; if (!first) sb.append(", "); sb.append("rows_rejected:"); sb.append(this.rows_rejected); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TImportStatusStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TImportStatusStandardScheme getScheme() { return new TImportStatusStandardScheme(); } } private static class TImportStatusStandardScheme extends org.apache.thrift.scheme.StandardScheme<TImportStatus> { public void read(org.apache.thrift.protocol.TProtocol iprot, TImportStatus 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: // ELAPSED if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.elapsed = iprot.readI64(); struct.setElapsedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // ROWS_COMPLETED if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.rows_completed = iprot.readI64(); struct.setRows_completedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // ROWS_ESTIMATED if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.rows_estimated = iprot.readI64(); struct.setRows_estimatedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // ROWS_REJECTED if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.rows_rejected = iprot.readI64(); struct.setRows_rejectedIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TImportStatus struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ELAPSED_FIELD_DESC); oprot.writeI64(struct.elapsed); oprot.writeFieldEnd(); oprot.writeFieldBegin(ROWS_COMPLETED_FIELD_DESC); oprot.writeI64(struct.rows_completed); oprot.writeFieldEnd(); oprot.writeFieldBegin(ROWS_ESTIMATED_FIELD_DESC); oprot.writeI64(struct.rows_estimated); oprot.writeFieldEnd(); oprot.writeFieldBegin(ROWS_REJECTED_FIELD_DESC); oprot.writeI64(struct.rows_rejected); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TImportStatusTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TImportStatusTupleScheme getScheme() { return new TImportStatusTupleScheme(); } } private static class TImportStatusTupleScheme extends org.apache.thrift.scheme.TupleScheme<TImportStatus> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TImportStatus struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetElapsed()) { optionals.set(0); } if (struct.isSetRows_completed()) { optionals.set(1); } if (struct.isSetRows_estimated()) { optionals.set(2); } if (struct.isSetRows_rejected()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetElapsed()) { oprot.writeI64(struct.elapsed); } if (struct.isSetRows_completed()) { oprot.writeI64(struct.rows_completed); } if (struct.isSetRows_estimated()) { oprot.writeI64(struct.rows_estimated); } if (struct.isSetRows_rejected()) { oprot.writeI64(struct.rows_rejected); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TImportStatus struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.elapsed = iprot.readI64(); struct.setElapsedIsSet(true); } if (incoming.get(1)) { struct.rows_completed = iprot.readI64(); struct.setRows_completedIsSet(true); } if (incoming.get(2)) { struct.rows_estimated = iprot.readI64(); struct.setRows_estimatedIsSet(true); } if (incoming.get(3)) { struct.rows_rejected = iprot.readI64(); struct.setRows_rejectedIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TInsertChunks.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TInsertChunks implements org.apache.thrift.TBase<TInsertChunks, TInsertChunks._Fields>, java.io.Serializable, Cloneable, Comparable<TInsertChunks> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TInsertChunks"); private static final org.apache.thrift.protocol.TField DB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("db_id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("table_id", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField VALID_INDICES_FIELD_DESC = new org.apache.thrift.protocol.TField("valid_indices", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField NUM_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_rows", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TInsertChunksStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TInsertChunksTupleSchemeFactory(); public int db_id; // required public int table_id; // required public @org.apache.thrift.annotation.Nullable java.util.List<TChunkData> data; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> valid_indices; // required public long num_rows; // 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 { DB_ID((short)1, "db_id"), TABLE_ID((short)2, "table_id"), DATA((short)3, "data"), VALID_INDICES((short)4, "valid_indices"), NUM_ROWS((short)5, "num_rows"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // DB_ID return DB_ID; case 2: // TABLE_ID return TABLE_ID; case 3: // DATA return DATA; case 4: // VALID_INDICES return VALID_INDICES; case 5: // NUM_ROWS return NUM_ROWS; 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 __DB_ID_ISSET_ID = 0; private static final int __TABLE_ID_ISSET_ID = 1; private static final int __NUM_ROWS_ISSET_ID = 2; 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.DB_ID, new org.apache.thrift.meta_data.FieldMetaData("db_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("table_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TChunkData.class)))); tmpMap.put(_Fields.VALID_INDICES, new org.apache.thrift.meta_data.FieldMetaData("valid_indices", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I64)))); tmpMap.put(_Fields.NUM_ROWS, new org.apache.thrift.meta_data.FieldMetaData("num_rows", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TInsertChunks.class, metaDataMap); } public TInsertChunks() { } public TInsertChunks( int db_id, int table_id, java.util.List<TChunkData> data, java.util.List<java.lang.Long> valid_indices, long num_rows) { this(); this.db_id = db_id; setDb_idIsSet(true); this.table_id = table_id; setTable_idIsSet(true); this.data = data; this.valid_indices = valid_indices; this.num_rows = num_rows; setNum_rowsIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TInsertChunks(TInsertChunks other) { __isset_bitfield = other.__isset_bitfield; this.db_id = other.db_id; this.table_id = other.table_id; if (other.isSetData()) { java.util.List<TChunkData> __this__data = new java.util.ArrayList<TChunkData>(other.data.size()); for (TChunkData other_element : other.data) { __this__data.add(new TChunkData(other_element)); } this.data = __this__data; } if (other.isSetValid_indices()) { java.util.List<java.lang.Long> __this__valid_indices = new java.util.ArrayList<java.lang.Long>(other.valid_indices); this.valid_indices = __this__valid_indices; } this.num_rows = other.num_rows; } public TInsertChunks deepCopy() { return new TInsertChunks(this); } @Override public void clear() { setDb_idIsSet(false); this.db_id = 0; setTable_idIsSet(false); this.table_id = 0; this.data = null; this.valid_indices = null; setNum_rowsIsSet(false); this.num_rows = 0; } public int getDb_id() { return this.db_id; } public TInsertChunks setDb_id(int db_id) { this.db_id = db_id; setDb_idIsSet(true); return this; } public void unsetDb_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DB_ID_ISSET_ID); } /** Returns true if field db_id is set (has been assigned a value) and false otherwise */ public boolean isSetDb_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DB_ID_ISSET_ID); } public void setDb_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DB_ID_ISSET_ID, value); } public int getTable_id() { return this.table_id; } public TInsertChunks setTable_id(int table_id) { this.table_id = table_id; setTable_idIsSet(true); return this; } public void unsetTable_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } /** Returns true if field table_id is set (has been assigned a value) and false otherwise */ public boolean isSetTable_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } public void setTable_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLE_ID_ISSET_ID, value); } public int getDataSize() { return (this.data == null) ? 0 : this.data.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TChunkData> getDataIterator() { return (this.data == null) ? null : this.data.iterator(); } public void addToData(TChunkData elem) { if (this.data == null) { this.data = new java.util.ArrayList<TChunkData>(); } this.data.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TChunkData> getData() { return this.data; } public TInsertChunks setData(@org.apache.thrift.annotation.Nullable java.util.List<TChunkData> data) { this.data = data; return this; } public void unsetData() { this.data = null; } /** Returns true if field data is set (has been assigned a value) and false otherwise */ public boolean isSetData() { return this.data != null; } public void setDataIsSet(boolean value) { if (!value) { this.data = null; } } public int getValid_indicesSize() { return (this.valid_indices == null) ? 0 : this.valid_indices.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Long> getValid_indicesIterator() { return (this.valid_indices == null) ? null : this.valid_indices.iterator(); } public void addToValid_indices(long elem) { if (this.valid_indices == null) { this.valid_indices = new java.util.ArrayList<java.lang.Long>(); } this.valid_indices.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Long> getValid_indices() { return this.valid_indices; } public TInsertChunks setValid_indices(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> valid_indices) { this.valid_indices = valid_indices; return this; } public void unsetValid_indices() { this.valid_indices = null; } /** Returns true if field valid_indices is set (has been assigned a value) and false otherwise */ public boolean isSetValid_indices() { return this.valid_indices != null; } public void setValid_indicesIsSet(boolean value) { if (!value) { this.valid_indices = null; } } public long getNum_rows() { return this.num_rows; } public TInsertChunks setNum_rows(long num_rows) { this.num_rows = num_rows; setNum_rowsIsSet(true); return this; } public void unsetNum_rows() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_ROWS_ISSET_ID); } /** Returns true if field num_rows is set (has been assigned a value) and false otherwise */ public boolean isSetNum_rows() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_ROWS_ISSET_ID); } public void setNum_rowsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_ROWS_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case DB_ID: if (value == null) { unsetDb_id(); } else { setDb_id((java.lang.Integer)value); } break; case TABLE_ID: if (value == null) { unsetTable_id(); } else { setTable_id((java.lang.Integer)value); } break; case DATA: if (value == null) { unsetData(); } else { setData((java.util.List<TChunkData>)value); } break; case VALID_INDICES: if (value == null) { unsetValid_indices(); } else { setValid_indices((java.util.List<java.lang.Long>)value); } break; case NUM_ROWS: if (value == null) { unsetNum_rows(); } else { setNum_rows((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case DB_ID: return getDb_id(); case TABLE_ID: return getTable_id(); case DATA: return getData(); case VALID_INDICES: return getValid_indices(); case NUM_ROWS: return getNum_rows(); } 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 DB_ID: return isSetDb_id(); case TABLE_ID: return isSetTable_id(); case DATA: return isSetData(); case VALID_INDICES: return isSetValid_indices(); case NUM_ROWS: return isSetNum_rows(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TInsertChunks) return this.equals((TInsertChunks)that); return false; } public boolean equals(TInsertChunks that) { if (that == null) return false; if (this == that) return true; boolean this_present_db_id = true; boolean that_present_db_id = true; if (this_present_db_id || that_present_db_id) { if (!(this_present_db_id && that_present_db_id)) return false; if (this.db_id != that.db_id) return false; } boolean this_present_table_id = true; boolean that_present_table_id = true; if (this_present_table_id || that_present_table_id) { if (!(this_present_table_id && that_present_table_id)) return false; if (this.table_id != that.table_id) return false; } boolean this_present_data = true && this.isSetData(); boolean that_present_data = true && that.isSetData(); if (this_present_data || that_present_data) { if (!(this_present_data && that_present_data)) return false; if (!this.data.equals(that.data)) return false; } boolean this_present_valid_indices = true && this.isSetValid_indices(); boolean that_present_valid_indices = true && that.isSetValid_indices(); if (this_present_valid_indices || that_present_valid_indices) { if (!(this_present_valid_indices && that_present_valid_indices)) return false; if (!this.valid_indices.equals(that.valid_indices)) return false; } boolean this_present_num_rows = true; boolean that_present_num_rows = true; if (this_present_num_rows || that_present_num_rows) { if (!(this_present_num_rows && that_present_num_rows)) return false; if (this.num_rows != that.num_rows) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + db_id; hashCode = hashCode * 8191 + table_id; hashCode = hashCode * 8191 + ((isSetData()) ? 131071 : 524287); if (isSetData()) hashCode = hashCode * 8191 + data.hashCode(); hashCode = hashCode * 8191 + ((isSetValid_indices()) ? 131071 : 524287); if (isSetValid_indices()) hashCode = hashCode * 8191 + valid_indices.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(num_rows); return hashCode; } @Override public int compareTo(TInsertChunks other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetDb_id(), other.isSetDb_id()); if (lastComparison != 0) { return lastComparison; } if (isSetDb_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_id, other.db_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_id(), other.isSetTable_id()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_id, other.table_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetData(), other.isSetData()); if (lastComparison != 0) { return lastComparison; } if (isSetData()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetValid_indices(), other.isSetValid_indices()); if (lastComparison != 0) { return lastComparison; } if (isSetValid_indices()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valid_indices, other.valid_indices); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_rows(), other.isSetNum_rows()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_rows()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_rows, other.num_rows); 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("TInsertChunks("); boolean first = true; sb.append("db_id:"); sb.append(this.db_id); first = false; if (!first) sb.append(", "); sb.append("table_id:"); sb.append(this.table_id); first = false; if (!first) sb.append(", "); sb.append("data:"); if (this.data == null) { sb.append("null"); } else { sb.append(this.data); } first = false; if (!first) sb.append(", "); sb.append("valid_indices:"); if (this.valid_indices == null) { sb.append("null"); } else { sb.append(this.valid_indices); } first = false; if (!first) sb.append(", "); sb.append("num_rows:"); sb.append(this.num_rows); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TInsertChunksStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TInsertChunksStandardScheme getScheme() { return new TInsertChunksStandardScheme(); } } private static class TInsertChunksStandardScheme extends org.apache.thrift.scheme.StandardScheme<TInsertChunks> { public void read(org.apache.thrift.protocol.TProtocol iprot, TInsertChunks 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: // DB_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.db_id = iprot.readI32(); struct.setDb_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DATA if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list224 = iprot.readListBegin(); struct.data = new java.util.ArrayList<TChunkData>(_list224.size); @org.apache.thrift.annotation.Nullable TChunkData _elem225; for (int _i226 = 0; _i226 < _list224.size; ++_i226) { _elem225 = new TChunkData(); _elem225.read(iprot); struct.data.add(_elem225); } iprot.readListEnd(); } struct.setDataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // VALID_INDICES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list227 = iprot.readListBegin(); struct.valid_indices = new java.util.ArrayList<java.lang.Long>(_list227.size); long _elem228; for (int _i229 = 0; _i229 < _list227.size; ++_i229) { _elem228 = iprot.readI64(); struct.valid_indices.add(_elem228); } iprot.readListEnd(); } struct.setValid_indicesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // NUM_ROWS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.num_rows = iprot.readI64(); struct.setNum_rowsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TInsertChunks struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(DB_ID_FIELD_DESC); oprot.writeI32(struct.db_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); oprot.writeI32(struct.table_id); oprot.writeFieldEnd(); if (struct.data != null) { oprot.writeFieldBegin(DATA_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.data.size())); for (TChunkData _iter230 : struct.data) { _iter230.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.valid_indices != null) { oprot.writeFieldBegin(VALID_INDICES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.valid_indices.size())); for (long _iter231 : struct.valid_indices) { oprot.writeI64(_iter231); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(NUM_ROWS_FIELD_DESC); oprot.writeI64(struct.num_rows); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TInsertChunksTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TInsertChunksTupleScheme getScheme() { return new TInsertChunksTupleScheme(); } } private static class TInsertChunksTupleScheme extends org.apache.thrift.scheme.TupleScheme<TInsertChunks> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TInsertChunks struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetDb_id()) { optionals.set(0); } if (struct.isSetTable_id()) { optionals.set(1); } if (struct.isSetData()) { optionals.set(2); } if (struct.isSetValid_indices()) { optionals.set(3); } if (struct.isSetNum_rows()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetDb_id()) { oprot.writeI32(struct.db_id); } if (struct.isSetTable_id()) { oprot.writeI32(struct.table_id); } if (struct.isSetData()) { { oprot.writeI32(struct.data.size()); for (TChunkData _iter232 : struct.data) { _iter232.write(oprot); } } } if (struct.isSetValid_indices()) { { oprot.writeI32(struct.valid_indices.size()); for (long _iter233 : struct.valid_indices) { oprot.writeI64(_iter233); } } } if (struct.isSetNum_rows()) { oprot.writeI64(struct.num_rows); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TInsertChunks struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.db_id = iprot.readI32(); struct.setDb_idIsSet(true); } if (incoming.get(1)) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list234 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.data = new java.util.ArrayList<TChunkData>(_list234.size); @org.apache.thrift.annotation.Nullable TChunkData _elem235; for (int _i236 = 0; _i236 < _list234.size; ++_i236) { _elem235 = new TChunkData(); _elem235.read(iprot); struct.data.add(_elem235); } } struct.setDataIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list237 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); struct.valid_indices = new java.util.ArrayList<java.lang.Long>(_list237.size); long _elem238; for (int _i239 = 0; _i239 < _list237.size; ++_i239) { _elem238 = iprot.readI64(); struct.valid_indices.add(_elem238); } } struct.setValid_indicesIsSet(true); } if (incoming.get(4)) { struct.num_rows = iprot.readI64(); struct.setNum_rowsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TInsertData.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TInsertData implements org.apache.thrift.TBase<TInsertData, TInsertData._Fields>, java.io.Serializable, Cloneable, Comparable<TInsertData> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TInsertData"); private static final org.apache.thrift.protocol.TField DB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("db_id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("table_id", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField COLUMN_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("column_ids", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField NUM_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_rows", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField IS_DEFAULT_FIELD_DESC = new org.apache.thrift.protocol.TField("is_default", org.apache.thrift.protocol.TType.LIST, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TInsertDataStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TInsertDataTupleSchemeFactory(); public int db_id; // required public int table_id; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> column_ids; // required public @org.apache.thrift.annotation.Nullable java.util.List<TDataBlockPtr> data; // required public long num_rows; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Boolean> is_default; // 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 { DB_ID((short)1, "db_id"), TABLE_ID((short)2, "table_id"), COLUMN_IDS((short)3, "column_ids"), DATA((short)4, "data"), NUM_ROWS((short)5, "num_rows"), IS_DEFAULT((short)6, "is_default"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // DB_ID return DB_ID; case 2: // TABLE_ID return TABLE_ID; case 3: // COLUMN_IDS return COLUMN_IDS; case 4: // DATA return DATA; case 5: // NUM_ROWS return NUM_ROWS; case 6: // IS_DEFAULT return IS_DEFAULT; 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 __DB_ID_ISSET_ID = 0; private static final int __TABLE_ID_ISSET_ID = 1; private static final int __NUM_ROWS_ISSET_ID = 2; 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.DB_ID, new org.apache.thrift.meta_data.FieldMetaData("db_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("table_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.COLUMN_IDS, new org.apache.thrift.meta_data.FieldMetaData("column_ids", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDataBlockPtr.class)))); tmpMap.put(_Fields.NUM_ROWS, new org.apache.thrift.meta_data.FieldMetaData("num_rows", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.IS_DEFAULT, new org.apache.thrift.meta_data.FieldMetaData("is_default", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.BOOL)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TInsertData.class, metaDataMap); } public TInsertData() { } public TInsertData( int db_id, int table_id, java.util.List<java.lang.Integer> column_ids, java.util.List<TDataBlockPtr> data, long num_rows, java.util.List<java.lang.Boolean> is_default) { this(); this.db_id = db_id; setDb_idIsSet(true); this.table_id = table_id; setTable_idIsSet(true); this.column_ids = column_ids; this.data = data; this.num_rows = num_rows; setNum_rowsIsSet(true); this.is_default = is_default; } /** * Performs a deep copy on <i>other</i>. */ public TInsertData(TInsertData other) { __isset_bitfield = other.__isset_bitfield; this.db_id = other.db_id; this.table_id = other.table_id; if (other.isSetColumn_ids()) { java.util.List<java.lang.Integer> __this__column_ids = new java.util.ArrayList<java.lang.Integer>(other.column_ids); this.column_ids = __this__column_ids; } if (other.isSetData()) { java.util.List<TDataBlockPtr> __this__data = new java.util.ArrayList<TDataBlockPtr>(other.data.size()); for (TDataBlockPtr other_element : other.data) { __this__data.add(new TDataBlockPtr(other_element)); } this.data = __this__data; } this.num_rows = other.num_rows; if (other.isSetIs_default()) { java.util.List<java.lang.Boolean> __this__is_default = new java.util.ArrayList<java.lang.Boolean>(other.is_default); this.is_default = __this__is_default; } } public TInsertData deepCopy() { return new TInsertData(this); } @Override public void clear() { setDb_idIsSet(false); this.db_id = 0; setTable_idIsSet(false); this.table_id = 0; this.column_ids = null; this.data = null; setNum_rowsIsSet(false); this.num_rows = 0; this.is_default = null; } public int getDb_id() { return this.db_id; } public TInsertData setDb_id(int db_id) { this.db_id = db_id; setDb_idIsSet(true); return this; } public void unsetDb_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DB_ID_ISSET_ID); } /** Returns true if field db_id is set (has been assigned a value) and false otherwise */ public boolean isSetDb_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DB_ID_ISSET_ID); } public void setDb_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DB_ID_ISSET_ID, value); } public int getTable_id() { return this.table_id; } public TInsertData setTable_id(int table_id) { this.table_id = table_id; setTable_idIsSet(true); return this; } public void unsetTable_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } /** Returns true if field table_id is set (has been assigned a value) and false otherwise */ public boolean isSetTable_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } public void setTable_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLE_ID_ISSET_ID, value); } public int getColumn_idsSize() { return (this.column_ids == null) ? 0 : this.column_ids.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Integer> getColumn_idsIterator() { return (this.column_ids == null) ? null : this.column_ids.iterator(); } public void addToColumn_ids(int elem) { if (this.column_ids == null) { this.column_ids = new java.util.ArrayList<java.lang.Integer>(); } this.column_ids.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Integer> getColumn_ids() { return this.column_ids; } public TInsertData setColumn_ids(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> column_ids) { this.column_ids = column_ids; return this; } public void unsetColumn_ids() { this.column_ids = null; } /** Returns true if field column_ids is set (has been assigned a value) and false otherwise */ public boolean isSetColumn_ids() { return this.column_ids != null; } public void setColumn_idsIsSet(boolean value) { if (!value) { this.column_ids = null; } } public int getDataSize() { return (this.data == null) ? 0 : this.data.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TDataBlockPtr> getDataIterator() { return (this.data == null) ? null : this.data.iterator(); } public void addToData(TDataBlockPtr elem) { if (this.data == null) { this.data = new java.util.ArrayList<TDataBlockPtr>(); } this.data.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TDataBlockPtr> getData() { return this.data; } public TInsertData setData(@org.apache.thrift.annotation.Nullable java.util.List<TDataBlockPtr> data) { this.data = data; return this; } public void unsetData() { this.data = null; } /** Returns true if field data is set (has been assigned a value) and false otherwise */ public boolean isSetData() { return this.data != null; } public void setDataIsSet(boolean value) { if (!value) { this.data = null; } } public long getNum_rows() { return this.num_rows; } public TInsertData setNum_rows(long num_rows) { this.num_rows = num_rows; setNum_rowsIsSet(true); return this; } public void unsetNum_rows() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_ROWS_ISSET_ID); } /** Returns true if field num_rows is set (has been assigned a value) and false otherwise */ public boolean isSetNum_rows() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_ROWS_ISSET_ID); } public void setNum_rowsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_ROWS_ISSET_ID, value); } public int getIs_defaultSize() { return (this.is_default == null) ? 0 : this.is_default.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Boolean> getIs_defaultIterator() { return (this.is_default == null) ? null : this.is_default.iterator(); } public void addToIs_default(boolean elem) { if (this.is_default == null) { this.is_default = new java.util.ArrayList<java.lang.Boolean>(); } this.is_default.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Boolean> getIs_default() { return this.is_default; } public TInsertData setIs_default(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Boolean> is_default) { this.is_default = is_default; return this; } public void unsetIs_default() { this.is_default = null; } /** Returns true if field is_default is set (has been assigned a value) and false otherwise */ public boolean isSetIs_default() { return this.is_default != null; } public void setIs_defaultIsSet(boolean value) { if (!value) { this.is_default = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case DB_ID: if (value == null) { unsetDb_id(); } else { setDb_id((java.lang.Integer)value); } break; case TABLE_ID: if (value == null) { unsetTable_id(); } else { setTable_id((java.lang.Integer)value); } break; case COLUMN_IDS: if (value == null) { unsetColumn_ids(); } else { setColumn_ids((java.util.List<java.lang.Integer>)value); } break; case DATA: if (value == null) { unsetData(); } else { setData((java.util.List<TDataBlockPtr>)value); } break; case NUM_ROWS: if (value == null) { unsetNum_rows(); } else { setNum_rows((java.lang.Long)value); } break; case IS_DEFAULT: if (value == null) { unsetIs_default(); } else { setIs_default((java.util.List<java.lang.Boolean>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case DB_ID: return getDb_id(); case TABLE_ID: return getTable_id(); case COLUMN_IDS: return getColumn_ids(); case DATA: return getData(); case NUM_ROWS: return getNum_rows(); case IS_DEFAULT: return getIs_default(); } 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 DB_ID: return isSetDb_id(); case TABLE_ID: return isSetTable_id(); case COLUMN_IDS: return isSetColumn_ids(); case DATA: return isSetData(); case NUM_ROWS: return isSetNum_rows(); case IS_DEFAULT: return isSetIs_default(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TInsertData) return this.equals((TInsertData)that); return false; } public boolean equals(TInsertData that) { if (that == null) return false; if (this == that) return true; boolean this_present_db_id = true; boolean that_present_db_id = true; if (this_present_db_id || that_present_db_id) { if (!(this_present_db_id && that_present_db_id)) return false; if (this.db_id != that.db_id) return false; } boolean this_present_table_id = true; boolean that_present_table_id = true; if (this_present_table_id || that_present_table_id) { if (!(this_present_table_id && that_present_table_id)) return false; if (this.table_id != that.table_id) return false; } boolean this_present_column_ids = true && this.isSetColumn_ids(); boolean that_present_column_ids = true && that.isSetColumn_ids(); if (this_present_column_ids || that_present_column_ids) { if (!(this_present_column_ids && that_present_column_ids)) return false; if (!this.column_ids.equals(that.column_ids)) return false; } boolean this_present_data = true && this.isSetData(); boolean that_present_data = true && that.isSetData(); if (this_present_data || that_present_data) { if (!(this_present_data && that_present_data)) return false; if (!this.data.equals(that.data)) return false; } boolean this_present_num_rows = true; boolean that_present_num_rows = true; if (this_present_num_rows || that_present_num_rows) { if (!(this_present_num_rows && that_present_num_rows)) return false; if (this.num_rows != that.num_rows) return false; } boolean this_present_is_default = true && this.isSetIs_default(); boolean that_present_is_default = true && that.isSetIs_default(); if (this_present_is_default || that_present_is_default) { if (!(this_present_is_default && that_present_is_default)) return false; if (!this.is_default.equals(that.is_default)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + db_id; hashCode = hashCode * 8191 + table_id; hashCode = hashCode * 8191 + ((isSetColumn_ids()) ? 131071 : 524287); if (isSetColumn_ids()) hashCode = hashCode * 8191 + column_ids.hashCode(); hashCode = hashCode * 8191 + ((isSetData()) ? 131071 : 524287); if (isSetData()) hashCode = hashCode * 8191 + data.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(num_rows); hashCode = hashCode * 8191 + ((isSetIs_default()) ? 131071 : 524287); if (isSetIs_default()) hashCode = hashCode * 8191 + is_default.hashCode(); return hashCode; } @Override public int compareTo(TInsertData other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetDb_id(), other.isSetDb_id()); if (lastComparison != 0) { return lastComparison; } if (isSetDb_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_id, other.db_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_id(), other.isSetTable_id()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_id, other.table_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetColumn_ids(), other.isSetColumn_ids()); if (lastComparison != 0) { return lastComparison; } if (isSetColumn_ids()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_ids, other.column_ids); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetData(), other.isSetData()); if (lastComparison != 0) { return lastComparison; } if (isSetData()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_rows(), other.isSetNum_rows()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_rows()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_rows, other.num_rows); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_default(), other.isSetIs_default()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_default()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_default, other.is_default); 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("TInsertData("); boolean first = true; sb.append("db_id:"); sb.append(this.db_id); first = false; if (!first) sb.append(", "); sb.append("table_id:"); sb.append(this.table_id); first = false; if (!first) sb.append(", "); sb.append("column_ids:"); if (this.column_ids == null) { sb.append("null"); } else { sb.append(this.column_ids); } first = false; if (!first) sb.append(", "); sb.append("data:"); if (this.data == null) { sb.append("null"); } else { sb.append(this.data); } first = false; if (!first) sb.append(", "); sb.append("num_rows:"); sb.append(this.num_rows); first = false; if (!first) sb.append(", "); sb.append("is_default:"); if (this.is_default == null) { sb.append("null"); } else { sb.append(this.is_default); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TInsertDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TInsertDataStandardScheme getScheme() { return new TInsertDataStandardScheme(); } } private static class TInsertDataStandardScheme extends org.apache.thrift.scheme.StandardScheme<TInsertData> { public void read(org.apache.thrift.protocol.TProtocol iprot, TInsertData 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: // DB_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.db_id = iprot.readI32(); struct.setDb_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // COLUMN_IDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list200 = iprot.readListBegin(); struct.column_ids = new java.util.ArrayList<java.lang.Integer>(_list200.size); int _elem201; for (int _i202 = 0; _i202 < _list200.size; ++_i202) { _elem201 = iprot.readI32(); struct.column_ids.add(_elem201); } iprot.readListEnd(); } struct.setColumn_idsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // DATA if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list203 = iprot.readListBegin(); struct.data = new java.util.ArrayList<TDataBlockPtr>(_list203.size); @org.apache.thrift.annotation.Nullable TDataBlockPtr _elem204; for (int _i205 = 0; _i205 < _list203.size; ++_i205) { _elem204 = new TDataBlockPtr(); _elem204.read(iprot); struct.data.add(_elem204); } iprot.readListEnd(); } struct.setDataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // NUM_ROWS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.num_rows = iprot.readI64(); struct.setNum_rowsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // IS_DEFAULT if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list206 = iprot.readListBegin(); struct.is_default = new java.util.ArrayList<java.lang.Boolean>(_list206.size); boolean _elem207; for (int _i208 = 0; _i208 < _list206.size; ++_i208) { _elem207 = iprot.readBool(); struct.is_default.add(_elem207); } iprot.readListEnd(); } struct.setIs_defaultIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TInsertData struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(DB_ID_FIELD_DESC); oprot.writeI32(struct.db_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); oprot.writeI32(struct.table_id); oprot.writeFieldEnd(); if (struct.column_ids != null) { oprot.writeFieldBegin(COLUMN_IDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.column_ids.size())); for (int _iter209 : struct.column_ids) { oprot.writeI32(_iter209); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.data != null) { oprot.writeFieldBegin(DATA_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.data.size())); for (TDataBlockPtr _iter210 : struct.data) { _iter210.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(NUM_ROWS_FIELD_DESC); oprot.writeI64(struct.num_rows); oprot.writeFieldEnd(); if (struct.is_default != null) { oprot.writeFieldBegin(IS_DEFAULT_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.is_default.size())); for (boolean _iter211 : struct.is_default) { oprot.writeBool(_iter211); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TInsertDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TInsertDataTupleScheme getScheme() { return new TInsertDataTupleScheme(); } } private static class TInsertDataTupleScheme extends org.apache.thrift.scheme.TupleScheme<TInsertData> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TInsertData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetDb_id()) { optionals.set(0); } if (struct.isSetTable_id()) { optionals.set(1); } if (struct.isSetColumn_ids()) { optionals.set(2); } if (struct.isSetData()) { optionals.set(3); } if (struct.isSetNum_rows()) { optionals.set(4); } if (struct.isSetIs_default()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetDb_id()) { oprot.writeI32(struct.db_id); } if (struct.isSetTable_id()) { oprot.writeI32(struct.table_id); } if (struct.isSetColumn_ids()) { { oprot.writeI32(struct.column_ids.size()); for (int _iter212 : struct.column_ids) { oprot.writeI32(_iter212); } } } if (struct.isSetData()) { { oprot.writeI32(struct.data.size()); for (TDataBlockPtr _iter213 : struct.data) { _iter213.write(oprot); } } } if (struct.isSetNum_rows()) { oprot.writeI64(struct.num_rows); } if (struct.isSetIs_default()) { { oprot.writeI32(struct.is_default.size()); for (boolean _iter214 : struct.is_default) { oprot.writeBool(_iter214); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TInsertData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.db_id = iprot.readI32(); struct.setDb_idIsSet(true); } if (incoming.get(1)) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list215 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32); struct.column_ids = new java.util.ArrayList<java.lang.Integer>(_list215.size); int _elem216; for (int _i217 = 0; _i217 < _list215.size; ++_i217) { _elem216 = iprot.readI32(); struct.column_ids.add(_elem216); } } struct.setColumn_idsIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list218 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.data = new java.util.ArrayList<TDataBlockPtr>(_list218.size); @org.apache.thrift.annotation.Nullable TDataBlockPtr _elem219; for (int _i220 = 0; _i220 < _list218.size; ++_i220) { _elem219 = new TDataBlockPtr(); _elem219.read(iprot); struct.data.add(_elem219); } } struct.setDataIsSet(true); } if (incoming.get(4)) { struct.num_rows = iprot.readI64(); struct.setNum_rowsIsSet(true); } if (incoming.get(5)) { { org.apache.thrift.protocol.TList _list221 = iprot.readListBegin(org.apache.thrift.protocol.TType.BOOL); struct.is_default = new java.util.ArrayList<java.lang.Boolean>(_list221.size); boolean _elem222; for (int _i223 = 0; _i223 < _list221.size; ++_i223) { _elem222 = iprot.readBool(); struct.is_default.add(_elem222); } } struct.setIs_defaultIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TKrb5Session.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TKrb5Session implements org.apache.thrift.TBase<TKrb5Session, TKrb5Session._Fields>, java.io.Serializable, Cloneable, Comparable<TKrb5Session> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TKrb5Session"); private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField KRB_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("krbToken", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TKrb5SessionStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TKrb5SessionTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String sessionId; // required public @org.apache.thrift.annotation.Nullable java.lang.String krbToken; // 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"), KRB_TOKEN((short)2, "krbToken"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // KRB_TOKEN return KRB_TOKEN; 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 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.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TSessionId"))); tmpMap.put(_Fields.KRB_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("krbToken", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TKrb5Token"))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TKrb5Session.class, metaDataMap); } public TKrb5Session() { } public TKrb5Session( java.lang.String sessionId, java.lang.String krbToken) { this(); this.sessionId = sessionId; this.krbToken = krbToken; } /** * Performs a deep copy on <i>other</i>. */ public TKrb5Session(TKrb5Session other) { if (other.isSetSessionId()) { this.sessionId = other.sessionId; } if (other.isSetKrbToken()) { this.krbToken = other.krbToken; } } public TKrb5Session deepCopy() { return new TKrb5Session(this); } @Override public void clear() { this.sessionId = null; this.krbToken = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getSessionId() { return this.sessionId; } public TKrb5Session setSessionId(@org.apache.thrift.annotation.Nullable java.lang.String sessionId) { this.sessionId = sessionId; return this; } public void unsetSessionId() { this.sessionId = null; } /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ public boolean isSetSessionId() { return this.sessionId != null; } public void setSessionIdIsSet(boolean value) { if (!value) { this.sessionId = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getKrbToken() { return this.krbToken; } public TKrb5Session setKrbToken(@org.apache.thrift.annotation.Nullable java.lang.String krbToken) { this.krbToken = krbToken; return this; } public void unsetKrbToken() { this.krbToken = null; } /** Returns true if field krbToken is set (has been assigned a value) and false otherwise */ public boolean isSetKrbToken() { return this.krbToken != null; } public void setKrbTokenIsSet(boolean value) { if (!value) { this.krbToken = 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.String)value); } break; case KRB_TOKEN: if (value == null) { unsetKrbToken(); } else { setKrbToken((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_ID: return getSessionId(); case KRB_TOKEN: return getKrbToken(); } 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 KRB_TOKEN: return isSetKrbToken(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TKrb5Session) return this.equals((TKrb5Session)that); return false; } public boolean equals(TKrb5Session that) { if (that == null) return false; if (this == that) return true; boolean this_present_sessionId = true && this.isSetSessionId(); boolean that_present_sessionId = true && that.isSetSessionId(); if (this_present_sessionId || that_present_sessionId) { if (!(this_present_sessionId && that_present_sessionId)) return false; if (!this.sessionId.equals(that.sessionId)) return false; } boolean this_present_krbToken = true && this.isSetKrbToken(); boolean that_present_krbToken = true && that.isSetKrbToken(); if (this_present_krbToken || that_present_krbToken) { if (!(this_present_krbToken && that_present_krbToken)) return false; if (!this.krbToken.equals(that.krbToken)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetSessionId()) ? 131071 : 524287); if (isSetSessionId()) hashCode = hashCode * 8191 + sessionId.hashCode(); hashCode = hashCode * 8191 + ((isSetKrbToken()) ? 131071 : 524287); if (isSetKrbToken()) hashCode = hashCode * 8191 + krbToken.hashCode(); return hashCode; } @Override public int compareTo(TKrb5Session 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(isSetKrbToken(), other.isSetKrbToken()); if (lastComparison != 0) { return lastComparison; } if (isSetKrbToken()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.krbToken, other.krbToken); 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("TKrb5Session("); boolean first = true; sb.append("sessionId:"); if (this.sessionId == null) { sb.append("null"); } else { sb.append(this.sessionId); } first = false; if (!first) sb.append(", "); sb.append("krbToken:"); if (this.krbToken == null) { sb.append("null"); } else { sb.append(this.krbToken); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TKrb5SessionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TKrb5SessionStandardScheme getScheme() { return new TKrb5SessionStandardScheme(); } } private static class TKrb5SessionStandardScheme extends org.apache.thrift.scheme.StandardScheme<TKrb5Session> { public void read(org.apache.thrift.protocol.TProtocol iprot, TKrb5Session 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.STRING) { struct.sessionId = iprot.readString(); struct.setSessionIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KRB_TOKEN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.krbToken = iprot.readString(); struct.setKrbTokenIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TKrb5Session struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.sessionId != null) { oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); oprot.writeString(struct.sessionId); oprot.writeFieldEnd(); } if (struct.krbToken != null) { oprot.writeFieldBegin(KRB_TOKEN_FIELD_DESC); oprot.writeString(struct.krbToken); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TKrb5SessionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TKrb5SessionTupleScheme getScheme() { return new TKrb5SessionTupleScheme(); } } private static class TKrb5SessionTupleScheme extends org.apache.thrift.scheme.TupleScheme<TKrb5Session> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TKrb5Session struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSessionId()) { optionals.set(0); } if (struct.isSetKrbToken()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSessionId()) { oprot.writeString(struct.sessionId); } if (struct.isSetKrbToken()) { oprot.writeString(struct.krbToken); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TKrb5Session struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.sessionId = iprot.readString(); struct.setSessionIdIsSet(true); } if (incoming.get(1)) { struct.krbToken = iprot.readString(); struct.setKrbTokenIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TLeafInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TLeafInfo implements org.apache.thrift.TBase<TLeafInfo, TLeafInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TLeafInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TLeafInfo"); private static final org.apache.thrift.protocol.TField LEAF_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leaf_id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField NUM_LEAVES_FIELD_DESC = new org.apache.thrift.protocol.TField("num_leaves", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TLeafInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TLeafInfoTupleSchemeFactory(); public int leaf_id; // required public int num_leaves; // 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 { LEAF_ID((short)1, "leaf_id"), NUM_LEAVES((short)2, "num_leaves"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // LEAF_ID return LEAF_ID; case 2: // NUM_LEAVES return NUM_LEAVES; 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 __LEAF_ID_ISSET_ID = 0; private static final int __NUM_LEAVES_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.LEAF_ID, new org.apache.thrift.meta_data.FieldMetaData("leaf_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.NUM_LEAVES, new org.apache.thrift.meta_data.FieldMetaData("num_leaves", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TLeafInfo.class, metaDataMap); } public TLeafInfo() { } public TLeafInfo( int leaf_id, int num_leaves) { this(); this.leaf_id = leaf_id; setLeaf_idIsSet(true); this.num_leaves = num_leaves; setNum_leavesIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TLeafInfo(TLeafInfo other) { __isset_bitfield = other.__isset_bitfield; this.leaf_id = other.leaf_id; this.num_leaves = other.num_leaves; } public TLeafInfo deepCopy() { return new TLeafInfo(this); } @Override public void clear() { setLeaf_idIsSet(false); this.leaf_id = 0; setNum_leavesIsSet(false); this.num_leaves = 0; } public int getLeaf_id() { return this.leaf_id; } public TLeafInfo setLeaf_id(int leaf_id) { this.leaf_id = leaf_id; setLeaf_idIsSet(true); return this; } public void unsetLeaf_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LEAF_ID_ISSET_ID); } /** Returns true if field leaf_id is set (has been assigned a value) and false otherwise */ public boolean isSetLeaf_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LEAF_ID_ISSET_ID); } public void setLeaf_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LEAF_ID_ISSET_ID, value); } public int getNum_leaves() { return this.num_leaves; } public TLeafInfo setNum_leaves(int num_leaves) { this.num_leaves = num_leaves; setNum_leavesIsSet(true); return this; } public void unsetNum_leaves() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_LEAVES_ISSET_ID); } /** Returns true if field num_leaves is set (has been assigned a value) and false otherwise */ public boolean isSetNum_leaves() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_LEAVES_ISSET_ID); } public void setNum_leavesIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_LEAVES_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case LEAF_ID: if (value == null) { unsetLeaf_id(); } else { setLeaf_id((java.lang.Integer)value); } break; case NUM_LEAVES: if (value == null) { unsetNum_leaves(); } else { setNum_leaves((java.lang.Integer)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case LEAF_ID: return getLeaf_id(); case NUM_LEAVES: return getNum_leaves(); } 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 LEAF_ID: return isSetLeaf_id(); case NUM_LEAVES: return isSetNum_leaves(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TLeafInfo) return this.equals((TLeafInfo)that); return false; } public boolean equals(TLeafInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_leaf_id = true; boolean that_present_leaf_id = true; if (this_present_leaf_id || that_present_leaf_id) { if (!(this_present_leaf_id && that_present_leaf_id)) return false; if (this.leaf_id != that.leaf_id) return false; } boolean this_present_num_leaves = true; boolean that_present_num_leaves = true; if (this_present_num_leaves || that_present_num_leaves) { if (!(this_present_num_leaves && that_present_num_leaves)) return false; if (this.num_leaves != that.num_leaves) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + leaf_id; hashCode = hashCode * 8191 + num_leaves; return hashCode; } @Override public int compareTo(TLeafInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetLeaf_id(), other.isSetLeaf_id()); if (lastComparison != 0) { return lastComparison; } if (isSetLeaf_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leaf_id, other.leaf_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_leaves(), other.isSetNum_leaves()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_leaves()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_leaves, other.num_leaves); 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("TLeafInfo("); boolean first = true; sb.append("leaf_id:"); sb.append(this.leaf_id); first = false; if (!first) sb.append(", "); sb.append("num_leaves:"); sb.append(this.num_leaves); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TLeafInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TLeafInfoStandardScheme getScheme() { return new TLeafInfoStandardScheme(); } } private static class TLeafInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TLeafInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TLeafInfo 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: // LEAF_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.leaf_id = iprot.readI32(); struct.setLeaf_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NUM_LEAVES if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.num_leaves = iprot.readI32(); struct.setNum_leavesIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TLeafInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(LEAF_ID_FIELD_DESC); oprot.writeI32(struct.leaf_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(NUM_LEAVES_FIELD_DESC); oprot.writeI32(struct.num_leaves); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TLeafInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TLeafInfoTupleScheme getScheme() { return new TLeafInfoTupleScheme(); } } private static class TLeafInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TLeafInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TLeafInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetLeaf_id()) { optionals.set(0); } if (struct.isSetNum_leaves()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetLeaf_id()) { oprot.writeI32(struct.leaf_id); } if (struct.isSetNum_leaves()) { oprot.writeI32(struct.num_leaves); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TLeafInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.leaf_id = iprot.readI32(); struct.setLeaf_idIsSet(true); } if (incoming.get(1)) { struct.num_leaves = iprot.readI32(); struct.setNum_leavesIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TLicenseInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TLicenseInfo implements org.apache.thrift.TBase<TLicenseInfo, TLicenseInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TLicenseInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TLicenseInfo"); private static final org.apache.thrift.protocol.TField CLAIMS_FIELD_DESC = new org.apache.thrift.protocol.TField("claims", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TLicenseInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TLicenseInfoTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> claims; // 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 { CLAIMS((short)1, "claims"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // CLAIMS return CLAIMS; 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 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.CLAIMS, new org.apache.thrift.meta_data.FieldMetaData("claims", org.apache.thrift.TFieldRequirementType.DEFAULT, 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)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TLicenseInfo.class, metaDataMap); } public TLicenseInfo() { } public TLicenseInfo( java.util.List<java.lang.String> claims) { this(); this.claims = claims; } /** * Performs a deep copy on <i>other</i>. */ public TLicenseInfo(TLicenseInfo other) { if (other.isSetClaims()) { java.util.List<java.lang.String> __this__claims = new java.util.ArrayList<java.lang.String>(other.claims); this.claims = __this__claims; } } public TLicenseInfo deepCopy() { return new TLicenseInfo(this); } @Override public void clear() { this.claims = null; } public int getClaimsSize() { return (this.claims == null) ? 0 : this.claims.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.String> getClaimsIterator() { return (this.claims == null) ? null : this.claims.iterator(); } public void addToClaims(java.lang.String elem) { if (this.claims == null) { this.claims = new java.util.ArrayList<java.lang.String>(); } this.claims.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.String> getClaims() { return this.claims; } public TLicenseInfo setClaims(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> claims) { this.claims = claims; return this; } public void unsetClaims() { this.claims = null; } /** Returns true if field claims is set (has been assigned a value) and false otherwise */ public boolean isSetClaims() { return this.claims != null; } public void setClaimsIsSet(boolean value) { if (!value) { this.claims = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case CLAIMS: if (value == null) { unsetClaims(); } else { setClaims((java.util.List<java.lang.String>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case CLAIMS: return getClaims(); } 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 CLAIMS: return isSetClaims(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TLicenseInfo) return this.equals((TLicenseInfo)that); return false; } public boolean equals(TLicenseInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_claims = true && this.isSetClaims(); boolean that_present_claims = true && that.isSetClaims(); if (this_present_claims || that_present_claims) { if (!(this_present_claims && that_present_claims)) return false; if (!this.claims.equals(that.claims)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetClaims()) ? 131071 : 524287); if (isSetClaims()) hashCode = hashCode * 8191 + claims.hashCode(); return hashCode; } @Override public int compareTo(TLicenseInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetClaims(), other.isSetClaims()); if (lastComparison != 0) { return lastComparison; } if (isSetClaims()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.claims, other.claims); 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("TLicenseInfo("); boolean first = true; sb.append("claims:"); if (this.claims == null) { sb.append("null"); } else { sb.append(this.claims); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TLicenseInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TLicenseInfoStandardScheme getScheme() { return new TLicenseInfoStandardScheme(); } } private static class TLicenseInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TLicenseInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TLicenseInfo 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: // CLAIMS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list306 = iprot.readListBegin(); struct.claims = new java.util.ArrayList<java.lang.String>(_list306.size); @org.apache.thrift.annotation.Nullable java.lang.String _elem307; for (int _i308 = 0; _i308 < _list306.size; ++_i308) { _elem307 = iprot.readString(); struct.claims.add(_elem307); } iprot.readListEnd(); } struct.setClaimsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TLicenseInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.claims != null) { oprot.writeFieldBegin(CLAIMS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.claims.size())); for (java.lang.String _iter309 : struct.claims) { oprot.writeString(_iter309); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TLicenseInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TLicenseInfoTupleScheme getScheme() { return new TLicenseInfoTupleScheme(); } } private static class TLicenseInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TLicenseInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TLicenseInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetClaims()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetClaims()) { { oprot.writeI32(struct.claims.size()); for (java.lang.String _iter310 : struct.claims) { oprot.writeString(_iter310); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TLicenseInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list311 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); struct.claims = new java.util.ArrayList<java.lang.String>(_list311.size); @org.apache.thrift.annotation.Nullable java.lang.String _elem312; for (int _i313 = 0; _i313 < _list311.size; ++_i313) { _elem312 = iprot.readString(); struct.claims.add(_elem312); } } struct.setClaimsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TMemoryData.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TMemoryData implements org.apache.thrift.TBase<TMemoryData, TMemoryData._Fields>, java.io.Serializable, Cloneable, Comparable<TMemoryData> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMemoryData"); private static final org.apache.thrift.protocol.TField SLAB_FIELD_DESC = new org.apache.thrift.protocol.TField("slab", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField START_PAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("start_page", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField NUM_PAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("num_pages", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField TOUCH_FIELD_DESC = new org.apache.thrift.protocol.TField("touch", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField CHUNK_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("chunk_key", org.apache.thrift.protocol.TType.LIST, (short)5); private static final org.apache.thrift.protocol.TField BUFFER_EPOCH_FIELD_DESC = new org.apache.thrift.protocol.TField("buffer_epoch", org.apache.thrift.protocol.TType.I32, (short)6); private static final org.apache.thrift.protocol.TField IS_FREE_FIELD_DESC = new org.apache.thrift.protocol.TField("is_free", org.apache.thrift.protocol.TType.BOOL, (short)7); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TMemoryDataStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TMemoryDataTupleSchemeFactory(); public long slab; // required public int start_page; // required public long num_pages; // required public int touch; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> chunk_key; // required public int buffer_epoch; // required public boolean is_free; // 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 { SLAB((short)1, "slab"), START_PAGE((short)2, "start_page"), NUM_PAGES((short)3, "num_pages"), TOUCH((short)4, "touch"), CHUNK_KEY((short)5, "chunk_key"), BUFFER_EPOCH((short)6, "buffer_epoch"), IS_FREE((short)7, "is_free"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // SLAB return SLAB; case 2: // START_PAGE return START_PAGE; case 3: // NUM_PAGES return NUM_PAGES; case 4: // TOUCH return TOUCH; case 5: // CHUNK_KEY return CHUNK_KEY; case 6: // BUFFER_EPOCH return BUFFER_EPOCH; case 7: // IS_FREE return IS_FREE; 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 __SLAB_ISSET_ID = 0; private static final int __START_PAGE_ISSET_ID = 1; private static final int __NUM_PAGES_ISSET_ID = 2; private static final int __TOUCH_ISSET_ID = 3; private static final int __BUFFER_EPOCH_ISSET_ID = 4; private static final int __IS_FREE_ISSET_ID = 5; 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.SLAB, new org.apache.thrift.meta_data.FieldMetaData("slab", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.START_PAGE, new org.apache.thrift.meta_data.FieldMetaData("start_page", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.NUM_PAGES, new org.apache.thrift.meta_data.FieldMetaData("num_pages", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TOUCH, new org.apache.thrift.meta_data.FieldMetaData("touch", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.CHUNK_KEY, new org.apache.thrift.meta_data.FieldMetaData("chunk_key", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I64)))); tmpMap.put(_Fields.BUFFER_EPOCH, new org.apache.thrift.meta_data.FieldMetaData("buffer_epoch", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.IS_FREE, new org.apache.thrift.meta_data.FieldMetaData("is_free", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMemoryData.class, metaDataMap); } public TMemoryData() { } public TMemoryData( long slab, int start_page, long num_pages, int touch, java.util.List<java.lang.Long> chunk_key, int buffer_epoch, boolean is_free) { this(); this.slab = slab; setSlabIsSet(true); this.start_page = start_page; setStart_pageIsSet(true); this.num_pages = num_pages; setNum_pagesIsSet(true); this.touch = touch; setTouchIsSet(true); this.chunk_key = chunk_key; this.buffer_epoch = buffer_epoch; setBuffer_epochIsSet(true); this.is_free = is_free; setIs_freeIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TMemoryData(TMemoryData other) { __isset_bitfield = other.__isset_bitfield; this.slab = other.slab; this.start_page = other.start_page; this.num_pages = other.num_pages; this.touch = other.touch; if (other.isSetChunk_key()) { java.util.List<java.lang.Long> __this__chunk_key = new java.util.ArrayList<java.lang.Long>(other.chunk_key); this.chunk_key = __this__chunk_key; } this.buffer_epoch = other.buffer_epoch; this.is_free = other.is_free; } public TMemoryData deepCopy() { return new TMemoryData(this); } @Override public void clear() { setSlabIsSet(false); this.slab = 0; setStart_pageIsSet(false); this.start_page = 0; setNum_pagesIsSet(false); this.num_pages = 0; setTouchIsSet(false); this.touch = 0; this.chunk_key = null; setBuffer_epochIsSet(false); this.buffer_epoch = 0; setIs_freeIsSet(false); this.is_free = false; } public long getSlab() { return this.slab; } public TMemoryData setSlab(long slab) { this.slab = slab; setSlabIsSet(true); return this; } public void unsetSlab() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SLAB_ISSET_ID); } /** Returns true if field slab is set (has been assigned a value) and false otherwise */ public boolean isSetSlab() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SLAB_ISSET_ID); } public void setSlabIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SLAB_ISSET_ID, value); } public int getStart_page() { return this.start_page; } public TMemoryData setStart_page(int start_page) { this.start_page = start_page; setStart_pageIsSet(true); return this; } public void unsetStart_page() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_PAGE_ISSET_ID); } /** Returns true if field start_page is set (has been assigned a value) and false otherwise */ public boolean isSetStart_page() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_PAGE_ISSET_ID); } public void setStart_pageIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_PAGE_ISSET_ID, value); } public long getNum_pages() { return this.num_pages; } public TMemoryData setNum_pages(long num_pages) { this.num_pages = num_pages; setNum_pagesIsSet(true); return this; } public void unsetNum_pages() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_PAGES_ISSET_ID); } /** Returns true if field num_pages is set (has been assigned a value) and false otherwise */ public boolean isSetNum_pages() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_PAGES_ISSET_ID); } public void setNum_pagesIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_PAGES_ISSET_ID, value); } public int getTouch() { return this.touch; } public TMemoryData setTouch(int touch) { this.touch = touch; setTouchIsSet(true); return this; } public void unsetTouch() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TOUCH_ISSET_ID); } /** Returns true if field touch is set (has been assigned a value) and false otherwise */ public boolean isSetTouch() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TOUCH_ISSET_ID); } public void setTouchIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TOUCH_ISSET_ID, value); } public int getChunk_keySize() { return (this.chunk_key == null) ? 0 : this.chunk_key.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Long> getChunk_keyIterator() { return (this.chunk_key == null) ? null : this.chunk_key.iterator(); } public void addToChunk_key(long elem) { if (this.chunk_key == null) { this.chunk_key = new java.util.ArrayList<java.lang.Long>(); } this.chunk_key.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Long> getChunk_key() { return this.chunk_key; } public TMemoryData setChunk_key(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> chunk_key) { this.chunk_key = chunk_key; return this; } public void unsetChunk_key() { this.chunk_key = null; } /** Returns true if field chunk_key is set (has been assigned a value) and false otherwise */ public boolean isSetChunk_key() { return this.chunk_key != null; } public void setChunk_keyIsSet(boolean value) { if (!value) { this.chunk_key = null; } } public int getBuffer_epoch() { return this.buffer_epoch; } public TMemoryData setBuffer_epoch(int buffer_epoch) { this.buffer_epoch = buffer_epoch; setBuffer_epochIsSet(true); return this; } public void unsetBuffer_epoch() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BUFFER_EPOCH_ISSET_ID); } /** Returns true if field buffer_epoch is set (has been assigned a value) and false otherwise */ public boolean isSetBuffer_epoch() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BUFFER_EPOCH_ISSET_ID); } public void setBuffer_epochIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BUFFER_EPOCH_ISSET_ID, value); } public boolean isIs_free() { return this.is_free; } public TMemoryData setIs_free(boolean is_free) { this.is_free = is_free; setIs_freeIsSet(true); return this; } public void unsetIs_free() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_FREE_ISSET_ID); } /** Returns true if field is_free is set (has been assigned a value) and false otherwise */ public boolean isSetIs_free() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_FREE_ISSET_ID); } public void setIs_freeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_FREE_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SLAB: if (value == null) { unsetSlab(); } else { setSlab((java.lang.Long)value); } break; case START_PAGE: if (value == null) { unsetStart_page(); } else { setStart_page((java.lang.Integer)value); } break; case NUM_PAGES: if (value == null) { unsetNum_pages(); } else { setNum_pages((java.lang.Long)value); } break; case TOUCH: if (value == null) { unsetTouch(); } else { setTouch((java.lang.Integer)value); } break; case CHUNK_KEY: if (value == null) { unsetChunk_key(); } else { setChunk_key((java.util.List<java.lang.Long>)value); } break; case BUFFER_EPOCH: if (value == null) { unsetBuffer_epoch(); } else { setBuffer_epoch((java.lang.Integer)value); } break; case IS_FREE: if (value == null) { unsetIs_free(); } else { setIs_free((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SLAB: return getSlab(); case START_PAGE: return getStart_page(); case NUM_PAGES: return getNum_pages(); case TOUCH: return getTouch(); case CHUNK_KEY: return getChunk_key(); case BUFFER_EPOCH: return getBuffer_epoch(); case IS_FREE: return isIs_free(); } 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 SLAB: return isSetSlab(); case START_PAGE: return isSetStart_page(); case NUM_PAGES: return isSetNum_pages(); case TOUCH: return isSetTouch(); case CHUNK_KEY: return isSetChunk_key(); case BUFFER_EPOCH: return isSetBuffer_epoch(); case IS_FREE: return isSetIs_free(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TMemoryData) return this.equals((TMemoryData)that); return false; } public boolean equals(TMemoryData that) { if (that == null) return false; if (this == that) return true; boolean this_present_slab = true; boolean that_present_slab = true; if (this_present_slab || that_present_slab) { if (!(this_present_slab && that_present_slab)) return false; if (this.slab != that.slab) return false; } boolean this_present_start_page = true; boolean that_present_start_page = true; if (this_present_start_page || that_present_start_page) { if (!(this_present_start_page && that_present_start_page)) return false; if (this.start_page != that.start_page) return false; } boolean this_present_num_pages = true; boolean that_present_num_pages = true; if (this_present_num_pages || that_present_num_pages) { if (!(this_present_num_pages && that_present_num_pages)) return false; if (this.num_pages != that.num_pages) return false; } boolean this_present_touch = true; boolean that_present_touch = true; if (this_present_touch || that_present_touch) { if (!(this_present_touch && that_present_touch)) return false; if (this.touch != that.touch) return false; } boolean this_present_chunk_key = true && this.isSetChunk_key(); boolean that_present_chunk_key = true && that.isSetChunk_key(); if (this_present_chunk_key || that_present_chunk_key) { if (!(this_present_chunk_key && that_present_chunk_key)) return false; if (!this.chunk_key.equals(that.chunk_key)) return false; } boolean this_present_buffer_epoch = true; boolean that_present_buffer_epoch = true; if (this_present_buffer_epoch || that_present_buffer_epoch) { if (!(this_present_buffer_epoch && that_present_buffer_epoch)) return false; if (this.buffer_epoch != that.buffer_epoch) return false; } boolean this_present_is_free = true; boolean that_present_is_free = true; if (this_present_is_free || that_present_is_free) { if (!(this_present_is_free && that_present_is_free)) return false; if (this.is_free != that.is_free) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(slab); hashCode = hashCode * 8191 + start_page; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(num_pages); hashCode = hashCode * 8191 + touch; hashCode = hashCode * 8191 + ((isSetChunk_key()) ? 131071 : 524287); if (isSetChunk_key()) hashCode = hashCode * 8191 + chunk_key.hashCode(); hashCode = hashCode * 8191 + buffer_epoch; hashCode = hashCode * 8191 + ((is_free) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TMemoryData other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetSlab(), other.isSetSlab()); if (lastComparison != 0) { return lastComparison; } if (isSetSlab()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.slab, other.slab); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetStart_page(), other.isSetStart_page()); if (lastComparison != 0) { return lastComparison; } if (isSetStart_page()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_page, other.start_page); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_pages(), other.isSetNum_pages()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_pages()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_pages, other.num_pages); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTouch(), other.isSetTouch()); if (lastComparison != 0) { return lastComparison; } if (isSetTouch()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.touch, other.touch); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetChunk_key(), other.isSetChunk_key()); if (lastComparison != 0) { return lastComparison; } if (isSetChunk_key()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chunk_key, other.chunk_key); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetBuffer_epoch(), other.isSetBuffer_epoch()); if (lastComparison != 0) { return lastComparison; } if (isSetBuffer_epoch()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buffer_epoch, other.buffer_epoch); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_free(), other.isSetIs_free()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_free()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_free, other.is_free); 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("TMemoryData("); boolean first = true; sb.append("slab:"); sb.append(this.slab); first = false; if (!first) sb.append(", "); sb.append("start_page:"); sb.append(this.start_page); first = false; if (!first) sb.append(", "); sb.append("num_pages:"); sb.append(this.num_pages); first = false; if (!first) sb.append(", "); sb.append("touch:"); sb.append(this.touch); first = false; if (!first) sb.append(", "); sb.append("chunk_key:"); if (this.chunk_key == null) { sb.append("null"); } else { sb.append(this.chunk_key); } first = false; if (!first) sb.append(", "); sb.append("buffer_epoch:"); sb.append(this.buffer_epoch); first = false; if (!first) sb.append(", "); sb.append("is_free:"); sb.append(this.is_free); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TMemoryDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TMemoryDataStandardScheme getScheme() { return new TMemoryDataStandardScheme(); } } private static class TMemoryDataStandardScheme extends org.apache.thrift.scheme.StandardScheme<TMemoryData> { public void read(org.apache.thrift.protocol.TProtocol iprot, TMemoryData 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: // SLAB if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.slab = iprot.readI64(); struct.setSlabIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // START_PAGE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.start_page = iprot.readI32(); struct.setStart_pageIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // NUM_PAGES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.num_pages = iprot.readI64(); struct.setNum_pagesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // TOUCH if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.touch = iprot.readI32(); struct.setTouchIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // CHUNK_KEY if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list128 = iprot.readListBegin(); struct.chunk_key = new java.util.ArrayList<java.lang.Long>(_list128.size); long _elem129; for (int _i130 = 0; _i130 < _list128.size; ++_i130) { _elem129 = iprot.readI64(); struct.chunk_key.add(_elem129); } iprot.readListEnd(); } struct.setChunk_keyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // BUFFER_EPOCH if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.buffer_epoch = iprot.readI32(); struct.setBuffer_epochIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // IS_FREE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_free = iprot.readBool(); struct.setIs_freeIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TMemoryData struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(SLAB_FIELD_DESC); oprot.writeI64(struct.slab); oprot.writeFieldEnd(); oprot.writeFieldBegin(START_PAGE_FIELD_DESC); oprot.writeI32(struct.start_page); oprot.writeFieldEnd(); oprot.writeFieldBegin(NUM_PAGES_FIELD_DESC); oprot.writeI64(struct.num_pages); oprot.writeFieldEnd(); oprot.writeFieldBegin(TOUCH_FIELD_DESC); oprot.writeI32(struct.touch); oprot.writeFieldEnd(); if (struct.chunk_key != null) { oprot.writeFieldBegin(CHUNK_KEY_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.chunk_key.size())); for (long _iter131 : struct.chunk_key) { oprot.writeI64(_iter131); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(BUFFER_EPOCH_FIELD_DESC); oprot.writeI32(struct.buffer_epoch); oprot.writeFieldEnd(); oprot.writeFieldBegin(IS_FREE_FIELD_DESC); oprot.writeBool(struct.is_free); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TMemoryDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TMemoryDataTupleScheme getScheme() { return new TMemoryDataTupleScheme(); } } private static class TMemoryDataTupleScheme extends org.apache.thrift.scheme.TupleScheme<TMemoryData> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TMemoryData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSlab()) { optionals.set(0); } if (struct.isSetStart_page()) { optionals.set(1); } if (struct.isSetNum_pages()) { optionals.set(2); } if (struct.isSetTouch()) { optionals.set(3); } if (struct.isSetChunk_key()) { optionals.set(4); } if (struct.isSetBuffer_epoch()) { optionals.set(5); } if (struct.isSetIs_free()) { optionals.set(6); } oprot.writeBitSet(optionals, 7); if (struct.isSetSlab()) { oprot.writeI64(struct.slab); } if (struct.isSetStart_page()) { oprot.writeI32(struct.start_page); } if (struct.isSetNum_pages()) { oprot.writeI64(struct.num_pages); } if (struct.isSetTouch()) { oprot.writeI32(struct.touch); } if (struct.isSetChunk_key()) { { oprot.writeI32(struct.chunk_key.size()); for (long _iter132 : struct.chunk_key) { oprot.writeI64(_iter132); } } } if (struct.isSetBuffer_epoch()) { oprot.writeI32(struct.buffer_epoch); } if (struct.isSetIs_free()) { oprot.writeBool(struct.is_free); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TMemoryData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.slab = iprot.readI64(); struct.setSlabIsSet(true); } if (incoming.get(1)) { struct.start_page = iprot.readI32(); struct.setStart_pageIsSet(true); } if (incoming.get(2)) { struct.num_pages = iprot.readI64(); struct.setNum_pagesIsSet(true); } if (incoming.get(3)) { struct.touch = iprot.readI32(); struct.setTouchIsSet(true); } if (incoming.get(4)) { { org.apache.thrift.protocol.TList _list133 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); struct.chunk_key = new java.util.ArrayList<java.lang.Long>(_list133.size); long _elem134; for (int _i135 = 0; _i135 < _list133.size; ++_i135) { _elem134 = iprot.readI64(); struct.chunk_key.add(_elem134); } } struct.setChunk_keyIsSet(true); } if (incoming.get(5)) { struct.buffer_epoch = iprot.readI32(); struct.setBuffer_epochIsSet(true); } if (incoming.get(6)) { struct.is_free = iprot.readBool(); struct.setIs_freeIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TMergeType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TMergeType implements org.apache.thrift.TEnum { UNION(0), REDUCE(1); private final int value; private TMergeType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TMergeType findByValue(int value) { switch (value) { case 0: return UNION; case 1: return REDUCE; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TNodeMemoryInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TNodeMemoryInfo implements org.apache.thrift.TBase<TNodeMemoryInfo, TNodeMemoryInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TNodeMemoryInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TNodeMemoryInfo"); private static final org.apache.thrift.protocol.TField HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("host_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField PAGE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("page_size", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField MAX_NUM_PAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("max_num_pages", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField NUM_PAGES_ALLOCATED_FIELD_DESC = new org.apache.thrift.protocol.TField("num_pages_allocated", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField IS_ALLOCATION_CAPPED_FIELD_DESC = new org.apache.thrift.protocol.TField("is_allocation_capped", org.apache.thrift.protocol.TType.BOOL, (short)5); private static final org.apache.thrift.protocol.TField NODE_MEMORY_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("node_memory_data", org.apache.thrift.protocol.TType.LIST, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TNodeMemoryInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TNodeMemoryInfoTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String host_name; // required public long page_size; // required public long max_num_pages; // required public long num_pages_allocated; // required public boolean is_allocation_capped; // required public @org.apache.thrift.annotation.Nullable java.util.List<TMemoryData> node_memory_data; // 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 { HOST_NAME((short)1, "host_name"), PAGE_SIZE((short)2, "page_size"), MAX_NUM_PAGES((short)3, "max_num_pages"), NUM_PAGES_ALLOCATED((short)4, "num_pages_allocated"), IS_ALLOCATION_CAPPED((short)5, "is_allocation_capped"), NODE_MEMORY_DATA((short)6, "node_memory_data"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // HOST_NAME return HOST_NAME; case 2: // PAGE_SIZE return PAGE_SIZE; case 3: // MAX_NUM_PAGES return MAX_NUM_PAGES; case 4: // NUM_PAGES_ALLOCATED return NUM_PAGES_ALLOCATED; case 5: // IS_ALLOCATION_CAPPED return IS_ALLOCATION_CAPPED; case 6: // NODE_MEMORY_DATA return NODE_MEMORY_DATA; 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 __PAGE_SIZE_ISSET_ID = 0; private static final int __MAX_NUM_PAGES_ISSET_ID = 1; private static final int __NUM_PAGES_ALLOCATED_ISSET_ID = 2; private static final int __IS_ALLOCATION_CAPPED_ISSET_ID = 3; 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.HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("host_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PAGE_SIZE, new org.apache.thrift.meta_data.FieldMetaData("page_size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.MAX_NUM_PAGES, new org.apache.thrift.meta_data.FieldMetaData("max_num_pages", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.NUM_PAGES_ALLOCATED, new org.apache.thrift.meta_data.FieldMetaData("num_pages_allocated", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.IS_ALLOCATION_CAPPED, new org.apache.thrift.meta_data.FieldMetaData("is_allocation_capped", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.NODE_MEMORY_DATA, new org.apache.thrift.meta_data.FieldMetaData("node_memory_data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMemoryData.class)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TNodeMemoryInfo.class, metaDataMap); } public TNodeMemoryInfo() { } public TNodeMemoryInfo( java.lang.String host_name, long page_size, long max_num_pages, long num_pages_allocated, boolean is_allocation_capped, java.util.List<TMemoryData> node_memory_data) { this(); this.host_name = host_name; this.page_size = page_size; setPage_sizeIsSet(true); this.max_num_pages = max_num_pages; setMax_num_pagesIsSet(true); this.num_pages_allocated = num_pages_allocated; setNum_pages_allocatedIsSet(true); this.is_allocation_capped = is_allocation_capped; setIs_allocation_cappedIsSet(true); this.node_memory_data = node_memory_data; } /** * Performs a deep copy on <i>other</i>. */ public TNodeMemoryInfo(TNodeMemoryInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHost_name()) { this.host_name = other.host_name; } this.page_size = other.page_size; this.max_num_pages = other.max_num_pages; this.num_pages_allocated = other.num_pages_allocated; this.is_allocation_capped = other.is_allocation_capped; if (other.isSetNode_memory_data()) { java.util.List<TMemoryData> __this__node_memory_data = new java.util.ArrayList<TMemoryData>(other.node_memory_data.size()); for (TMemoryData other_element : other.node_memory_data) { __this__node_memory_data.add(new TMemoryData(other_element)); } this.node_memory_data = __this__node_memory_data; } } public TNodeMemoryInfo deepCopy() { return new TNodeMemoryInfo(this); } @Override public void clear() { this.host_name = null; setPage_sizeIsSet(false); this.page_size = 0; setMax_num_pagesIsSet(false); this.max_num_pages = 0; setNum_pages_allocatedIsSet(false); this.num_pages_allocated = 0; setIs_allocation_cappedIsSet(false); this.is_allocation_capped = false; this.node_memory_data = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getHost_name() { return this.host_name; } public TNodeMemoryInfo setHost_name(@org.apache.thrift.annotation.Nullable java.lang.String host_name) { this.host_name = host_name; return this; } public void unsetHost_name() { this.host_name = null; } /** Returns true if field host_name is set (has been assigned a value) and false otherwise */ public boolean isSetHost_name() { return this.host_name != null; } public void setHost_nameIsSet(boolean value) { if (!value) { this.host_name = null; } } public long getPage_size() { return this.page_size; } public TNodeMemoryInfo setPage_size(long page_size) { this.page_size = page_size; setPage_sizeIsSet(true); return this; } public void unsetPage_size() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PAGE_SIZE_ISSET_ID); } /** Returns true if field page_size is set (has been assigned a value) and false otherwise */ public boolean isSetPage_size() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PAGE_SIZE_ISSET_ID); } public void setPage_sizeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PAGE_SIZE_ISSET_ID, value); } public long getMax_num_pages() { return this.max_num_pages; } public TNodeMemoryInfo setMax_num_pages(long max_num_pages) { this.max_num_pages = max_num_pages; setMax_num_pagesIsSet(true); return this; } public void unsetMax_num_pages() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_NUM_PAGES_ISSET_ID); } /** Returns true if field max_num_pages is set (has been assigned a value) and false otherwise */ public boolean isSetMax_num_pages() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_NUM_PAGES_ISSET_ID); } public void setMax_num_pagesIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_NUM_PAGES_ISSET_ID, value); } public long getNum_pages_allocated() { return this.num_pages_allocated; } public TNodeMemoryInfo setNum_pages_allocated(long num_pages_allocated) { this.num_pages_allocated = num_pages_allocated; setNum_pages_allocatedIsSet(true); return this; } public void unsetNum_pages_allocated() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_PAGES_ALLOCATED_ISSET_ID); } /** Returns true if field num_pages_allocated is set (has been assigned a value) and false otherwise */ public boolean isSetNum_pages_allocated() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_PAGES_ALLOCATED_ISSET_ID); } public void setNum_pages_allocatedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_PAGES_ALLOCATED_ISSET_ID, value); } public boolean isIs_allocation_capped() { return this.is_allocation_capped; } public TNodeMemoryInfo setIs_allocation_capped(boolean is_allocation_capped) { this.is_allocation_capped = is_allocation_capped; setIs_allocation_cappedIsSet(true); return this; } public void unsetIs_allocation_capped() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_ALLOCATION_CAPPED_ISSET_ID); } /** Returns true if field is_allocation_capped is set (has been assigned a value) and false otherwise */ public boolean isSetIs_allocation_capped() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_ALLOCATION_CAPPED_ISSET_ID); } public void setIs_allocation_cappedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_ALLOCATION_CAPPED_ISSET_ID, value); } public int getNode_memory_dataSize() { return (this.node_memory_data == null) ? 0 : this.node_memory_data.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TMemoryData> getNode_memory_dataIterator() { return (this.node_memory_data == null) ? null : this.node_memory_data.iterator(); } public void addToNode_memory_data(TMemoryData elem) { if (this.node_memory_data == null) { this.node_memory_data = new java.util.ArrayList<TMemoryData>(); } this.node_memory_data.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TMemoryData> getNode_memory_data() { return this.node_memory_data; } public TNodeMemoryInfo setNode_memory_data(@org.apache.thrift.annotation.Nullable java.util.List<TMemoryData> node_memory_data) { this.node_memory_data = node_memory_data; return this; } public void unsetNode_memory_data() { this.node_memory_data = null; } /** Returns true if field node_memory_data is set (has been assigned a value) and false otherwise */ public boolean isSetNode_memory_data() { return this.node_memory_data != null; } public void setNode_memory_dataIsSet(boolean value) { if (!value) { this.node_memory_data = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case HOST_NAME: if (value == null) { unsetHost_name(); } else { setHost_name((java.lang.String)value); } break; case PAGE_SIZE: if (value == null) { unsetPage_size(); } else { setPage_size((java.lang.Long)value); } break; case MAX_NUM_PAGES: if (value == null) { unsetMax_num_pages(); } else { setMax_num_pages((java.lang.Long)value); } break; case NUM_PAGES_ALLOCATED: if (value == null) { unsetNum_pages_allocated(); } else { setNum_pages_allocated((java.lang.Long)value); } break; case IS_ALLOCATION_CAPPED: if (value == null) { unsetIs_allocation_capped(); } else { setIs_allocation_capped((java.lang.Boolean)value); } break; case NODE_MEMORY_DATA: if (value == null) { unsetNode_memory_data(); } else { setNode_memory_data((java.util.List<TMemoryData>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case HOST_NAME: return getHost_name(); case PAGE_SIZE: return getPage_size(); case MAX_NUM_PAGES: return getMax_num_pages(); case NUM_PAGES_ALLOCATED: return getNum_pages_allocated(); case IS_ALLOCATION_CAPPED: return isIs_allocation_capped(); case NODE_MEMORY_DATA: return getNode_memory_data(); } 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 HOST_NAME: return isSetHost_name(); case PAGE_SIZE: return isSetPage_size(); case MAX_NUM_PAGES: return isSetMax_num_pages(); case NUM_PAGES_ALLOCATED: return isSetNum_pages_allocated(); case IS_ALLOCATION_CAPPED: return isSetIs_allocation_capped(); case NODE_MEMORY_DATA: return isSetNode_memory_data(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TNodeMemoryInfo) return this.equals((TNodeMemoryInfo)that); return false; } public boolean equals(TNodeMemoryInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_host_name = true && this.isSetHost_name(); boolean that_present_host_name = true && that.isSetHost_name(); if (this_present_host_name || that_present_host_name) { if (!(this_present_host_name && that_present_host_name)) return false; if (!this.host_name.equals(that.host_name)) return false; } boolean this_present_page_size = true; boolean that_present_page_size = true; if (this_present_page_size || that_present_page_size) { if (!(this_present_page_size && that_present_page_size)) return false; if (this.page_size != that.page_size) return false; } boolean this_present_max_num_pages = true; boolean that_present_max_num_pages = true; if (this_present_max_num_pages || that_present_max_num_pages) { if (!(this_present_max_num_pages && that_present_max_num_pages)) return false; if (this.max_num_pages != that.max_num_pages) return false; } boolean this_present_num_pages_allocated = true; boolean that_present_num_pages_allocated = true; if (this_present_num_pages_allocated || that_present_num_pages_allocated) { if (!(this_present_num_pages_allocated && that_present_num_pages_allocated)) return false; if (this.num_pages_allocated != that.num_pages_allocated) return false; } boolean this_present_is_allocation_capped = true; boolean that_present_is_allocation_capped = true; if (this_present_is_allocation_capped || that_present_is_allocation_capped) { if (!(this_present_is_allocation_capped && that_present_is_allocation_capped)) return false; if (this.is_allocation_capped != that.is_allocation_capped) return false; } boolean this_present_node_memory_data = true && this.isSetNode_memory_data(); boolean that_present_node_memory_data = true && that.isSetNode_memory_data(); if (this_present_node_memory_data || that_present_node_memory_data) { if (!(this_present_node_memory_data && that_present_node_memory_data)) return false; if (!this.node_memory_data.equals(that.node_memory_data)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetHost_name()) ? 131071 : 524287); if (isSetHost_name()) hashCode = hashCode * 8191 + host_name.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(page_size); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_num_pages); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(num_pages_allocated); hashCode = hashCode * 8191 + ((is_allocation_capped) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetNode_memory_data()) ? 131071 : 524287); if (isSetNode_memory_data()) hashCode = hashCode * 8191 + node_memory_data.hashCode(); return hashCode; } @Override public int compareTo(TNodeMemoryInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetHost_name(), other.isSetHost_name()); if (lastComparison != 0) { return lastComparison; } if (isSetHost_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host_name, other.host_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPage_size(), other.isSetPage_size()); if (lastComparison != 0) { return lastComparison; } if (isSetPage_size()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.page_size, other.page_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMax_num_pages(), other.isSetMax_num_pages()); if (lastComparison != 0) { return lastComparison; } if (isSetMax_num_pages()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_num_pages, other.max_num_pages); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_pages_allocated(), other.isSetNum_pages_allocated()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_pages_allocated()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_pages_allocated, other.num_pages_allocated); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_allocation_capped(), other.isSetIs_allocation_capped()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_allocation_capped()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_allocation_capped, other.is_allocation_capped); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNode_memory_data(), other.isSetNode_memory_data()); if (lastComparison != 0) { return lastComparison; } if (isSetNode_memory_data()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.node_memory_data, other.node_memory_data); 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("TNodeMemoryInfo("); boolean first = true; sb.append("host_name:"); if (this.host_name == null) { sb.append("null"); } else { sb.append(this.host_name); } first = false; if (!first) sb.append(", "); sb.append("page_size:"); sb.append(this.page_size); first = false; if (!first) sb.append(", "); sb.append("max_num_pages:"); sb.append(this.max_num_pages); first = false; if (!first) sb.append(", "); sb.append("num_pages_allocated:"); sb.append(this.num_pages_allocated); first = false; if (!first) sb.append(", "); sb.append("is_allocation_capped:"); sb.append(this.is_allocation_capped); first = false; if (!first) sb.append(", "); sb.append("node_memory_data:"); if (this.node_memory_data == null) { sb.append("null"); } else { sb.append(this.node_memory_data); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TNodeMemoryInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TNodeMemoryInfoStandardScheme getScheme() { return new TNodeMemoryInfoStandardScheme(); } } private static class TNodeMemoryInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TNodeMemoryInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TNodeMemoryInfo 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: // HOST_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.host_name = iprot.readString(); struct.setHost_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PAGE_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.page_size = iprot.readI64(); struct.setPage_sizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // MAX_NUM_PAGES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.max_num_pages = iprot.readI64(); struct.setMax_num_pagesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // NUM_PAGES_ALLOCATED if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.num_pages_allocated = iprot.readI64(); struct.setNum_pages_allocatedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // IS_ALLOCATION_CAPPED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_allocation_capped = iprot.readBool(); struct.setIs_allocation_cappedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // NODE_MEMORY_DATA if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list136 = iprot.readListBegin(); struct.node_memory_data = new java.util.ArrayList<TMemoryData>(_list136.size); @org.apache.thrift.annotation.Nullable TMemoryData _elem137; for (int _i138 = 0; _i138 < _list136.size; ++_i138) { _elem137 = new TMemoryData(); _elem137.read(iprot); struct.node_memory_data.add(_elem137); } iprot.readListEnd(); } struct.setNode_memory_dataIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TNodeMemoryInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.host_name != null) { oprot.writeFieldBegin(HOST_NAME_FIELD_DESC); oprot.writeString(struct.host_name); oprot.writeFieldEnd(); } oprot.writeFieldBegin(PAGE_SIZE_FIELD_DESC); oprot.writeI64(struct.page_size); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAX_NUM_PAGES_FIELD_DESC); oprot.writeI64(struct.max_num_pages); oprot.writeFieldEnd(); oprot.writeFieldBegin(NUM_PAGES_ALLOCATED_FIELD_DESC); oprot.writeI64(struct.num_pages_allocated); oprot.writeFieldEnd(); oprot.writeFieldBegin(IS_ALLOCATION_CAPPED_FIELD_DESC); oprot.writeBool(struct.is_allocation_capped); oprot.writeFieldEnd(); if (struct.node_memory_data != null) { oprot.writeFieldBegin(NODE_MEMORY_DATA_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.node_memory_data.size())); for (TMemoryData _iter139 : struct.node_memory_data) { _iter139.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TNodeMemoryInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TNodeMemoryInfoTupleScheme getScheme() { return new TNodeMemoryInfoTupleScheme(); } } private static class TNodeMemoryInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TNodeMemoryInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TNodeMemoryInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetHost_name()) { optionals.set(0); } if (struct.isSetPage_size()) { optionals.set(1); } if (struct.isSetMax_num_pages()) { optionals.set(2); } if (struct.isSetNum_pages_allocated()) { optionals.set(3); } if (struct.isSetIs_allocation_capped()) { optionals.set(4); } if (struct.isSetNode_memory_data()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetHost_name()) { oprot.writeString(struct.host_name); } if (struct.isSetPage_size()) { oprot.writeI64(struct.page_size); } if (struct.isSetMax_num_pages()) { oprot.writeI64(struct.max_num_pages); } if (struct.isSetNum_pages_allocated()) { oprot.writeI64(struct.num_pages_allocated); } if (struct.isSetIs_allocation_capped()) { oprot.writeBool(struct.is_allocation_capped); } if (struct.isSetNode_memory_data()) { { oprot.writeI32(struct.node_memory_data.size()); for (TMemoryData _iter140 : struct.node_memory_data) { _iter140.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TNodeMemoryInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.host_name = iprot.readString(); struct.setHost_nameIsSet(true); } if (incoming.get(1)) { struct.page_size = iprot.readI64(); struct.setPage_sizeIsSet(true); } if (incoming.get(2)) { struct.max_num_pages = iprot.readI64(); struct.setMax_num_pagesIsSet(true); } if (incoming.get(3)) { struct.num_pages_allocated = iprot.readI64(); struct.setNum_pages_allocatedIsSet(true); } if (incoming.get(4)) { struct.is_allocation_capped = iprot.readBool(); struct.setIs_allocation_cappedIsSet(true); } if (incoming.get(5)) { { org.apache.thrift.protocol.TList _list141 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.node_memory_data = new java.util.ArrayList<TMemoryData>(_list141.size); @org.apache.thrift.annotation.Nullable TMemoryData _elem142; for (int _i143 = 0; _i143 < _list141.size; ++_i143) { _elem142 = new TMemoryData(); _elem142.read(iprot); struct.node_memory_data.add(_elem142); } } struct.setNode_memory_dataIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TPartitionDetail.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TPartitionDetail implements org.apache.thrift.TEnum { DEFAULT(0), REPLICATED(1), SHARDED(2), OTHER(3); private final int value; private TPartitionDetail(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TPartitionDetail findByValue(int value) { switch (value) { case 0: return DEFAULT; case 1: return REPLICATED; case 2: return SHARDED; case 3: return OTHER; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TPendingQuery.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TPendingQuery implements org.apache.thrift.TBase<TPendingQuery, TPendingQuery._Fields>, java.io.Serializable, Cloneable, Comparable<TPendingQuery> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPendingQuery"); private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField COLUMN_RANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("column_ranges", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.protocol.TField DICTIONARY_GENERATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("dictionary_generations", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField TABLE_GENERATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("table_generations", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField PARENT_SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parent_session_id", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPendingQueryStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPendingQueryTupleSchemeFactory(); public long id; // required public @org.apache.thrift.annotation.Nullable java.util.List<TColumnRange> column_ranges; // required public @org.apache.thrift.annotation.Nullable java.util.List<TDictionaryGeneration> dictionary_generations; // required public @org.apache.thrift.annotation.Nullable java.util.List<TTableGeneration> table_generations; // required public @org.apache.thrift.annotation.Nullable java.lang.String parent_session_id; // 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 { ID((short)1, "id"), COLUMN_RANGES((short)2, "column_ranges"), DICTIONARY_GENERATIONS((short)3, "dictionary_generations"), TABLE_GENERATIONS((short)4, "table_generations"), PARENT_SESSION_ID((short)5, "parent_session_id"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ID return ID; case 2: // COLUMN_RANGES return COLUMN_RANGES; case 3: // DICTIONARY_GENERATIONS return DICTIONARY_GENERATIONS; case 4: // TABLE_GENERATIONS return TABLE_GENERATIONS; case 5: // PARENT_SESSION_ID return PARENT_SESSION_ID; 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 __ID_ISSET_ID = 0; 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "TQueryId"))); tmpMap.put(_Fields.COLUMN_RANGES, new org.apache.thrift.meta_data.FieldMetaData("column_ranges", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnRange.class)))); tmpMap.put(_Fields.DICTIONARY_GENERATIONS, new org.apache.thrift.meta_data.FieldMetaData("dictionary_generations", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDictionaryGeneration.class)))); tmpMap.put(_Fields.TABLE_GENERATIONS, new org.apache.thrift.meta_data.FieldMetaData("table_generations", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableGeneration.class)))); tmpMap.put(_Fields.PARENT_SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("parent_session_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TSessionId"))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPendingQuery.class, metaDataMap); } public TPendingQuery() { } public TPendingQuery( long id, java.util.List<TColumnRange> column_ranges, java.util.List<TDictionaryGeneration> dictionary_generations, java.util.List<TTableGeneration> table_generations, java.lang.String parent_session_id) { this(); this.id = id; setIdIsSet(true); this.column_ranges = column_ranges; this.dictionary_generations = dictionary_generations; this.table_generations = table_generations; this.parent_session_id = parent_session_id; } /** * Performs a deep copy on <i>other</i>. */ public TPendingQuery(TPendingQuery other) { __isset_bitfield = other.__isset_bitfield; this.id = other.id; if (other.isSetColumn_ranges()) { java.util.List<TColumnRange> __this__column_ranges = new java.util.ArrayList<TColumnRange>(other.column_ranges.size()); for (TColumnRange other_element : other.column_ranges) { __this__column_ranges.add(new TColumnRange(other_element)); } this.column_ranges = __this__column_ranges; } if (other.isSetDictionary_generations()) { java.util.List<TDictionaryGeneration> __this__dictionary_generations = new java.util.ArrayList<TDictionaryGeneration>(other.dictionary_generations.size()); for (TDictionaryGeneration other_element : other.dictionary_generations) { __this__dictionary_generations.add(new TDictionaryGeneration(other_element)); } this.dictionary_generations = __this__dictionary_generations; } if (other.isSetTable_generations()) { java.util.List<TTableGeneration> __this__table_generations = new java.util.ArrayList<TTableGeneration>(other.table_generations.size()); for (TTableGeneration other_element : other.table_generations) { __this__table_generations.add(new TTableGeneration(other_element)); } this.table_generations = __this__table_generations; } if (other.isSetParent_session_id()) { this.parent_session_id = other.parent_session_id; } } public TPendingQuery deepCopy() { return new TPendingQuery(this); } @Override public void clear() { setIdIsSet(false); this.id = 0; this.column_ranges = null; this.dictionary_generations = null; this.table_generations = null; this.parent_session_id = null; } public long getId() { return this.id; } public TPendingQuery setId(long id) { this.id = id; setIdIsSet(true); return this; } public void unsetId() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public int getColumn_rangesSize() { return (this.column_ranges == null) ? 0 : this.column_ranges.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TColumnRange> getColumn_rangesIterator() { return (this.column_ranges == null) ? null : this.column_ranges.iterator(); } public void addToColumn_ranges(TColumnRange elem) { if (this.column_ranges == null) { this.column_ranges = new java.util.ArrayList<TColumnRange>(); } this.column_ranges.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TColumnRange> getColumn_ranges() { return this.column_ranges; } public TPendingQuery setColumn_ranges(@org.apache.thrift.annotation.Nullable java.util.List<TColumnRange> column_ranges) { this.column_ranges = column_ranges; return this; } public void unsetColumn_ranges() { this.column_ranges = null; } /** Returns true if field column_ranges is set (has been assigned a value) and false otherwise */ public boolean isSetColumn_ranges() { return this.column_ranges != null; } public void setColumn_rangesIsSet(boolean value) { if (!value) { this.column_ranges = null; } } public int getDictionary_generationsSize() { return (this.dictionary_generations == null) ? 0 : this.dictionary_generations.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TDictionaryGeneration> getDictionary_generationsIterator() { return (this.dictionary_generations == null) ? null : this.dictionary_generations.iterator(); } public void addToDictionary_generations(TDictionaryGeneration elem) { if (this.dictionary_generations == null) { this.dictionary_generations = new java.util.ArrayList<TDictionaryGeneration>(); } this.dictionary_generations.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TDictionaryGeneration> getDictionary_generations() { return this.dictionary_generations; } public TPendingQuery setDictionary_generations(@org.apache.thrift.annotation.Nullable java.util.List<TDictionaryGeneration> dictionary_generations) { this.dictionary_generations = dictionary_generations; return this; } public void unsetDictionary_generations() { this.dictionary_generations = null; } /** Returns true if field dictionary_generations is set (has been assigned a value) and false otherwise */ public boolean isSetDictionary_generations() { return this.dictionary_generations != null; } public void setDictionary_generationsIsSet(boolean value) { if (!value) { this.dictionary_generations = null; } } public int getTable_generationsSize() { return (this.table_generations == null) ? 0 : this.table_generations.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TTableGeneration> getTable_generationsIterator() { return (this.table_generations == null) ? null : this.table_generations.iterator(); } public void addToTable_generations(TTableGeneration elem) { if (this.table_generations == null) { this.table_generations = new java.util.ArrayList<TTableGeneration>(); } this.table_generations.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TTableGeneration> getTable_generations() { return this.table_generations; } public TPendingQuery setTable_generations(@org.apache.thrift.annotation.Nullable java.util.List<TTableGeneration> table_generations) { this.table_generations = table_generations; return this; } public void unsetTable_generations() { this.table_generations = null; } /** Returns true if field table_generations is set (has been assigned a value) and false otherwise */ public boolean isSetTable_generations() { return this.table_generations != null; } public void setTable_generationsIsSet(boolean value) { if (!value) { this.table_generations = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getParent_session_id() { return this.parent_session_id; } public TPendingQuery setParent_session_id(@org.apache.thrift.annotation.Nullable java.lang.String parent_session_id) { this.parent_session_id = parent_session_id; return this; } public void unsetParent_session_id() { this.parent_session_id = null; } /** Returns true if field parent_session_id is set (has been assigned a value) and false otherwise */ public boolean isSetParent_session_id() { return this.parent_session_id != null; } public void setParent_session_idIsSet(boolean value) { if (!value) { this.parent_session_id = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ID: if (value == null) { unsetId(); } else { setId((java.lang.Long)value); } break; case COLUMN_RANGES: if (value == null) { unsetColumn_ranges(); } else { setColumn_ranges((java.util.List<TColumnRange>)value); } break; case DICTIONARY_GENERATIONS: if (value == null) { unsetDictionary_generations(); } else { setDictionary_generations((java.util.List<TDictionaryGeneration>)value); } break; case TABLE_GENERATIONS: if (value == null) { unsetTable_generations(); } else { setTable_generations((java.util.List<TTableGeneration>)value); } break; case PARENT_SESSION_ID: if (value == null) { unsetParent_session_id(); } else { setParent_session_id((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ID: return getId(); case COLUMN_RANGES: return getColumn_ranges(); case DICTIONARY_GENERATIONS: return getDictionary_generations(); case TABLE_GENERATIONS: return getTable_generations(); case PARENT_SESSION_ID: return getParent_session_id(); } 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 ID: return isSetId(); case COLUMN_RANGES: return isSetColumn_ranges(); case DICTIONARY_GENERATIONS: return isSetDictionary_generations(); case TABLE_GENERATIONS: return isSetTable_generations(); case PARENT_SESSION_ID: return isSetParent_session_id(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TPendingQuery) return this.equals((TPendingQuery)that); return false; } public boolean equals(TPendingQuery that) { if (that == null) return false; if (this == that) return true; boolean this_present_id = true; boolean that_present_id = true; if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } boolean this_present_column_ranges = true && this.isSetColumn_ranges(); boolean that_present_column_ranges = true && that.isSetColumn_ranges(); if (this_present_column_ranges || that_present_column_ranges) { if (!(this_present_column_ranges && that_present_column_ranges)) return false; if (!this.column_ranges.equals(that.column_ranges)) return false; } boolean this_present_dictionary_generations = true && this.isSetDictionary_generations(); boolean that_present_dictionary_generations = true && that.isSetDictionary_generations(); if (this_present_dictionary_generations || that_present_dictionary_generations) { if (!(this_present_dictionary_generations && that_present_dictionary_generations)) return false; if (!this.dictionary_generations.equals(that.dictionary_generations)) return false; } boolean this_present_table_generations = true && this.isSetTable_generations(); boolean that_present_table_generations = true && that.isSetTable_generations(); if (this_present_table_generations || that_present_table_generations) { if (!(this_present_table_generations && that_present_table_generations)) return false; if (!this.table_generations.equals(that.table_generations)) return false; } boolean this_present_parent_session_id = true && this.isSetParent_session_id(); boolean that_present_parent_session_id = true && that.isSetParent_session_id(); if (this_present_parent_session_id || that_present_parent_session_id) { if (!(this_present_parent_session_id && that_present_parent_session_id)) return false; if (!this.parent_session_id.equals(that.parent_session_id)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(id); hashCode = hashCode * 8191 + ((isSetColumn_ranges()) ? 131071 : 524287); if (isSetColumn_ranges()) hashCode = hashCode * 8191 + column_ranges.hashCode(); hashCode = hashCode * 8191 + ((isSetDictionary_generations()) ? 131071 : 524287); if (isSetDictionary_generations()) hashCode = hashCode * 8191 + dictionary_generations.hashCode(); hashCode = hashCode * 8191 + ((isSetTable_generations()) ? 131071 : 524287); if (isSetTable_generations()) hashCode = hashCode * 8191 + table_generations.hashCode(); hashCode = hashCode * 8191 + ((isSetParent_session_id()) ? 131071 : 524287); if (isSetParent_session_id()) hashCode = hashCode * 8191 + parent_session_id.hashCode(); return hashCode; } @Override public int compareTo(TPendingQuery other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetId(), other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetColumn_ranges(), other.isSetColumn_ranges()); if (lastComparison != 0) { return lastComparison; } if (isSetColumn_ranges()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_ranges, other.column_ranges); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDictionary_generations(), other.isSetDictionary_generations()); if (lastComparison != 0) { return lastComparison; } if (isSetDictionary_generations()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dictionary_generations, other.dictionary_generations); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_generations(), other.isSetTable_generations()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_generations()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_generations, other.table_generations); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetParent_session_id(), other.isSetParent_session_id()); if (lastComparison != 0) { return lastComparison; } if (isSetParent_session_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parent_session_id, other.parent_session_id); 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("TPendingQuery("); boolean first = true; sb.append("id:"); sb.append(this.id); first = false; if (!first) sb.append(", "); sb.append("column_ranges:"); if (this.column_ranges == null) { sb.append("null"); } else { sb.append(this.column_ranges); } first = false; if (!first) sb.append(", "); sb.append("dictionary_generations:"); if (this.dictionary_generations == null) { sb.append("null"); } else { sb.append(this.dictionary_generations); } first = false; if (!first) sb.append(", "); sb.append("table_generations:"); if (this.table_generations == null) { sb.append("null"); } else { sb.append(this.table_generations); } first = false; if (!first) sb.append(", "); sb.append("parent_session_id:"); if (this.parent_session_id == null) { sb.append("null"); } else { sb.append(this.parent_session_id); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TPendingQueryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPendingQueryStandardScheme getScheme() { return new TPendingQueryStandardScheme(); } } private static class TPendingQueryStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPendingQuery> { public void read(org.apache.thrift.protocol.TProtocol iprot, TPendingQuery 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: // ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.id = iprot.readI64(); struct.setIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // COLUMN_RANGES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list168 = iprot.readListBegin(); struct.column_ranges = new java.util.ArrayList<TColumnRange>(_list168.size); @org.apache.thrift.annotation.Nullable TColumnRange _elem169; for (int _i170 = 0; _i170 < _list168.size; ++_i170) { _elem169 = new TColumnRange(); _elem169.read(iprot); struct.column_ranges.add(_elem169); } iprot.readListEnd(); } struct.setColumn_rangesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DICTIONARY_GENERATIONS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list171 = iprot.readListBegin(); struct.dictionary_generations = new java.util.ArrayList<TDictionaryGeneration>(_list171.size); @org.apache.thrift.annotation.Nullable TDictionaryGeneration _elem172; for (int _i173 = 0; _i173 < _list171.size; ++_i173) { _elem172 = new TDictionaryGeneration(); _elem172.read(iprot); struct.dictionary_generations.add(_elem172); } iprot.readListEnd(); } struct.setDictionary_generationsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // TABLE_GENERATIONS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list174 = iprot.readListBegin(); struct.table_generations = new java.util.ArrayList<TTableGeneration>(_list174.size); @org.apache.thrift.annotation.Nullable TTableGeneration _elem175; for (int _i176 = 0; _i176 < _list174.size; ++_i176) { _elem175 = new TTableGeneration(); _elem175.read(iprot); struct.table_generations.add(_elem175); } iprot.readListEnd(); } struct.setTable_generationsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // PARENT_SESSION_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.parent_session_id = iprot.readString(); struct.setParent_session_idIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TPendingQuery struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeI64(struct.id); oprot.writeFieldEnd(); if (struct.column_ranges != null) { oprot.writeFieldBegin(COLUMN_RANGES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.column_ranges.size())); for (TColumnRange _iter177 : struct.column_ranges) { _iter177.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.dictionary_generations != null) { oprot.writeFieldBegin(DICTIONARY_GENERATIONS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.dictionary_generations.size())); for (TDictionaryGeneration _iter178 : struct.dictionary_generations) { _iter178.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.table_generations != null) { oprot.writeFieldBegin(TABLE_GENERATIONS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.table_generations.size())); for (TTableGeneration _iter179 : struct.table_generations) { _iter179.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.parent_session_id != null) { oprot.writeFieldBegin(PARENT_SESSION_ID_FIELD_DESC); oprot.writeString(struct.parent_session_id); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TPendingQueryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPendingQueryTupleScheme getScheme() { return new TPendingQueryTupleScheme(); } } private static class TPendingQueryTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPendingQuery> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TPendingQuery struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetId()) { optionals.set(0); } if (struct.isSetColumn_ranges()) { optionals.set(1); } if (struct.isSetDictionary_generations()) { optionals.set(2); } if (struct.isSetTable_generations()) { optionals.set(3); } if (struct.isSetParent_session_id()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetId()) { oprot.writeI64(struct.id); } if (struct.isSetColumn_ranges()) { { oprot.writeI32(struct.column_ranges.size()); for (TColumnRange _iter180 : struct.column_ranges) { _iter180.write(oprot); } } } if (struct.isSetDictionary_generations()) { { oprot.writeI32(struct.dictionary_generations.size()); for (TDictionaryGeneration _iter181 : struct.dictionary_generations) { _iter181.write(oprot); } } } if (struct.isSetTable_generations()) { { oprot.writeI32(struct.table_generations.size()); for (TTableGeneration _iter182 : struct.table_generations) { _iter182.write(oprot); } } } if (struct.isSetParent_session_id()) { oprot.writeString(struct.parent_session_id); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TPendingQuery struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.id = iprot.readI64(); struct.setIdIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list183 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.column_ranges = new java.util.ArrayList<TColumnRange>(_list183.size); @org.apache.thrift.annotation.Nullable TColumnRange _elem184; for (int _i185 = 0; _i185 < _list183.size; ++_i185) { _elem184 = new TColumnRange(); _elem184.read(iprot); struct.column_ranges.add(_elem184); } } struct.setColumn_rangesIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list186 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.dictionary_generations = new java.util.ArrayList<TDictionaryGeneration>(_list186.size); @org.apache.thrift.annotation.Nullable TDictionaryGeneration _elem187; for (int _i188 = 0; _i188 < _list186.size; ++_i188) { _elem187 = new TDictionaryGeneration(); _elem187.read(iprot); struct.dictionary_generations.add(_elem187); } } struct.setDictionary_generationsIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list189 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.table_generations = new java.util.ArrayList<TTableGeneration>(_list189.size); @org.apache.thrift.annotation.Nullable TTableGeneration _elem190; for (int _i191 = 0; _i191 < _list189.size; ++_i191) { _elem190 = new TTableGeneration(); _elem190.read(iprot); struct.table_generations.add(_elem190); } } struct.setTable_generationsIsSet(true); } if (incoming.get(4)) { struct.parent_session_id = iprot.readString(); struct.setParent_session_idIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TPendingRenderQuery.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TPendingRenderQuery implements org.apache.thrift.TBase<TPendingRenderQuery, TPendingRenderQuery._Fields>, java.io.Serializable, Cloneable, Comparable<TPendingRenderQuery> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPendingRenderQuery"); private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPendingRenderQueryStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPendingRenderQueryTupleSchemeFactory(); public long id; // 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 { ID((short)1, "id"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ID return ID; 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 __ID_ISSET_ID = 0; 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "TQueryId"))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPendingRenderQuery.class, metaDataMap); } public TPendingRenderQuery() { } public TPendingRenderQuery( long id) { this(); this.id = id; setIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TPendingRenderQuery(TPendingRenderQuery other) { __isset_bitfield = other.__isset_bitfield; this.id = other.id; } public TPendingRenderQuery deepCopy() { return new TPendingRenderQuery(this); } @Override public void clear() { setIdIsSet(false); this.id = 0; } public long getId() { return this.id; } public TPendingRenderQuery setId(long id) { this.id = id; setIdIsSet(true); return this; } public void unsetId() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ID: if (value == null) { unsetId(); } else { setId((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ID: return getId(); } 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 ID: return isSetId(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TPendingRenderQuery) return this.equals((TPendingRenderQuery)that); return false; } public boolean equals(TPendingRenderQuery that) { if (that == null) return false; if (this == that) return true; boolean this_present_id = true; boolean that_present_id = true; if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(id); return hashCode; } @Override public int compareTo(TPendingRenderQuery other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetId(), other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); 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("TPendingRenderQuery("); boolean first = true; sb.append("id:"); sb.append(this.id); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TPendingRenderQueryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPendingRenderQueryStandardScheme getScheme() { return new TPendingRenderQueryStandardScheme(); } } private static class TPendingRenderQueryStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPendingRenderQuery> { public void read(org.apache.thrift.protocol.TProtocol iprot, TPendingRenderQuery 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: // ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.id = iprot.readI64(); struct.setIdIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TPendingRenderQuery struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeI64(struct.id); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TPendingRenderQueryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPendingRenderQueryTupleScheme getScheme() { return new TPendingRenderQueryTupleScheme(); } } private static class TPendingRenderQueryTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPendingRenderQuery> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TPendingRenderQuery struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetId()) { oprot.writeI64(struct.id); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TPendingRenderQuery struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.id = iprot.readI64(); struct.setIdIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TPixel.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TPixel implements org.apache.thrift.TBase<TPixel, TPixel._Fields>, java.io.Serializable, Cloneable, Comparable<TPixel> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPixel"); private static final org.apache.thrift.protocol.TField X_FIELD_DESC = new org.apache.thrift.protocol.TField("x", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField Y_FIELD_DESC = new org.apache.thrift.protocol.TField("y", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPixelStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPixelTupleSchemeFactory(); public long x; // required public long y; // 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 { X((short)1, "x"), Y((short)2, "y"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // X return X; case 2: // Y return Y; 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 __X_ISSET_ID = 0; private static final int __Y_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.X, new org.apache.thrift.meta_data.FieldMetaData("x", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.Y, new org.apache.thrift.meta_data.FieldMetaData("y", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPixel.class, metaDataMap); } public TPixel() { } public TPixel( long x, long y) { this(); this.x = x; setXIsSet(true); this.y = y; setYIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TPixel(TPixel other) { __isset_bitfield = other.__isset_bitfield; this.x = other.x; this.y = other.y; } public TPixel deepCopy() { return new TPixel(this); } @Override public void clear() { setXIsSet(false); this.x = 0; setYIsSet(false); this.y = 0; } public long getX() { return this.x; } public TPixel setX(long x) { this.x = x; setXIsSet(true); return this; } public void unsetX() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __X_ISSET_ID); } /** Returns true if field x is set (has been assigned a value) and false otherwise */ public boolean isSetX() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __X_ISSET_ID); } public void setXIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __X_ISSET_ID, value); } public long getY() { return this.y; } public TPixel setY(long y) { this.y = y; setYIsSet(true); return this; } public void unsetY() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __Y_ISSET_ID); } /** Returns true if field y is set (has been assigned a value) and false otherwise */ public boolean isSetY() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __Y_ISSET_ID); } public void setYIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __Y_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case X: if (value == null) { unsetX(); } else { setX((java.lang.Long)value); } break; case Y: if (value == null) { unsetY(); } else { setY((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case X: return getX(); case Y: return getY(); } 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 X: return isSetX(); case Y: return isSetY(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TPixel) return this.equals((TPixel)that); return false; } public boolean equals(TPixel that) { if (that == null) return false; if (this == that) return true; boolean this_present_x = true; boolean that_present_x = true; if (this_present_x || that_present_x) { if (!(this_present_x && that_present_x)) return false; if (this.x != that.x) return false; } boolean this_present_y = true; boolean that_present_y = true; if (this_present_y || that_present_y) { if (!(this_present_y && that_present_y)) return false; if (this.y != that.y) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(x); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(y); return hashCode; } @Override public int compareTo(TPixel other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetX(), other.isSetX()); if (lastComparison != 0) { return lastComparison; } if (isSetX()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.x, other.x); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetY(), other.isSetY()); if (lastComparison != 0) { return lastComparison; } if (isSetY()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.y, other.y); 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("TPixel("); boolean first = true; sb.append("x:"); sb.append(this.x); first = false; if (!first) sb.append(", "); sb.append("y:"); sb.append(this.y); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TPixelStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPixelStandardScheme getScheme() { return new TPixelStandardScheme(); } } private static class TPixelStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPixel> { public void read(org.apache.thrift.protocol.TProtocol iprot, TPixel 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: // X if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.x = iprot.readI64(); struct.setXIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // Y if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.y = iprot.readI64(); struct.setYIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TPixel struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(X_FIELD_DESC); oprot.writeI64(struct.x); oprot.writeFieldEnd(); oprot.writeFieldBegin(Y_FIELD_DESC); oprot.writeI64(struct.y); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TPixelTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPixelTupleScheme getScheme() { return new TPixelTupleScheme(); } } private static class TPixelTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPixel> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TPixel struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetX()) { optionals.set(0); } if (struct.isSetY()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetX()) { oprot.writeI64(struct.x); } if (struct.isSetY()) { oprot.writeI64(struct.y); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TPixel struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.x = iprot.readI64(); struct.setXIsSet(true); } if (incoming.get(1)) { struct.y = iprot.readI64(); struct.setYIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TPixelTableRowResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TPixelTableRowResult implements org.apache.thrift.TBase<TPixelTableRowResult, TPixelTableRowResult._Fields>, java.io.Serializable, Cloneable, Comparable<TPixelTableRowResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPixelTableRowResult"); private static final org.apache.thrift.protocol.TField PIXEL_FIELD_DESC = new org.apache.thrift.protocol.TField("pixel", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField VEGA_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("vega_table_name", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("table_id", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField ROW_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("row_id", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField ROW_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("row_set", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final org.apache.thrift.protocol.TField NONCE_FIELD_DESC = new org.apache.thrift.protocol.TField("nonce", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPixelTableRowResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPixelTableRowResultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable TPixel pixel; // required public @org.apache.thrift.annotation.Nullable java.lang.String vega_table_name; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> table_id; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> row_id; // required public @org.apache.thrift.annotation.Nullable TRowSet row_set; // required public @org.apache.thrift.annotation.Nullable java.lang.String nonce; // 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 { PIXEL((short)1, "pixel"), VEGA_TABLE_NAME((short)2, "vega_table_name"), TABLE_ID((short)3, "table_id"), ROW_ID((short)4, "row_id"), ROW_SET((short)5, "row_set"), NONCE((short)6, "nonce"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // PIXEL return PIXEL; case 2: // VEGA_TABLE_NAME return VEGA_TABLE_NAME; case 3: // TABLE_ID return TABLE_ID; case 4: // ROW_ID return ROW_ID; case 5: // ROW_SET return ROW_SET; case 6: // NONCE return NONCE; 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 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.PIXEL, new org.apache.thrift.meta_data.FieldMetaData("pixel", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPixel.class))); tmpMap.put(_Fields.VEGA_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("vega_table_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("table_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I64)))); tmpMap.put(_Fields.ROW_ID, new org.apache.thrift.meta_data.FieldMetaData("row_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I64)))); tmpMap.put(_Fields.ROW_SET, new org.apache.thrift.meta_data.FieldMetaData("row_set", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); tmpMap.put(_Fields.NONCE, new org.apache.thrift.meta_data.FieldMetaData("nonce", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TPixelTableRowResult.class, metaDataMap); } public TPixelTableRowResult() { } public TPixelTableRowResult( TPixel pixel, java.lang.String vega_table_name, java.util.List<java.lang.Long> table_id, java.util.List<java.lang.Long> row_id, TRowSet row_set, java.lang.String nonce) { this(); this.pixel = pixel; this.vega_table_name = vega_table_name; this.table_id = table_id; this.row_id = row_id; this.row_set = row_set; this.nonce = nonce; } /** * Performs a deep copy on <i>other</i>. */ public TPixelTableRowResult(TPixelTableRowResult other) { if (other.isSetPixel()) { this.pixel = new TPixel(other.pixel); } if (other.isSetVega_table_name()) { this.vega_table_name = other.vega_table_name; } if (other.isSetTable_id()) { java.util.List<java.lang.Long> __this__table_id = new java.util.ArrayList<java.lang.Long>(other.table_id); this.table_id = __this__table_id; } if (other.isSetRow_id()) { java.util.List<java.lang.Long> __this__row_id = new java.util.ArrayList<java.lang.Long>(other.row_id); this.row_id = __this__row_id; } if (other.isSetRow_set()) { this.row_set = new TRowSet(other.row_set); } if (other.isSetNonce()) { this.nonce = other.nonce; } } public TPixelTableRowResult deepCopy() { return new TPixelTableRowResult(this); } @Override public void clear() { this.pixel = null; this.vega_table_name = null; this.table_id = null; this.row_id = null; this.row_set = null; this.nonce = null; } @org.apache.thrift.annotation.Nullable public TPixel getPixel() { return this.pixel; } public TPixelTableRowResult setPixel(@org.apache.thrift.annotation.Nullable TPixel pixel) { this.pixel = pixel; return this; } public void unsetPixel() { this.pixel = null; } /** Returns true if field pixel is set (has been assigned a value) and false otherwise */ public boolean isSetPixel() { return this.pixel != null; } public void setPixelIsSet(boolean value) { if (!value) { this.pixel = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getVega_table_name() { return this.vega_table_name; } public TPixelTableRowResult setVega_table_name(@org.apache.thrift.annotation.Nullable java.lang.String vega_table_name) { this.vega_table_name = vega_table_name; return this; } public void unsetVega_table_name() { this.vega_table_name = null; } /** Returns true if field vega_table_name is set (has been assigned a value) and false otherwise */ public boolean isSetVega_table_name() { return this.vega_table_name != null; } public void setVega_table_nameIsSet(boolean value) { if (!value) { this.vega_table_name = null; } } public int getTable_idSize() { return (this.table_id == null) ? 0 : this.table_id.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Long> getTable_idIterator() { return (this.table_id == null) ? null : this.table_id.iterator(); } public void addToTable_id(long elem) { if (this.table_id == null) { this.table_id = new java.util.ArrayList<java.lang.Long>(); } this.table_id.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Long> getTable_id() { return this.table_id; } public TPixelTableRowResult setTable_id(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> table_id) { this.table_id = table_id; return this; } public void unsetTable_id() { this.table_id = null; } /** Returns true if field table_id is set (has been assigned a value) and false otherwise */ public boolean isSetTable_id() { return this.table_id != null; } public void setTable_idIsSet(boolean value) { if (!value) { this.table_id = null; } } public int getRow_idSize() { return (this.row_id == null) ? 0 : this.row_id.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Long> getRow_idIterator() { return (this.row_id == null) ? null : this.row_id.iterator(); } public void addToRow_id(long elem) { if (this.row_id == null) { this.row_id = new java.util.ArrayList<java.lang.Long>(); } this.row_id.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Long> getRow_id() { return this.row_id; } public TPixelTableRowResult setRow_id(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> row_id) { this.row_id = row_id; return this; } public void unsetRow_id() { this.row_id = null; } /** Returns true if field row_id is set (has been assigned a value) and false otherwise */ public boolean isSetRow_id() { return this.row_id != null; } public void setRow_idIsSet(boolean value) { if (!value) { this.row_id = null; } } @org.apache.thrift.annotation.Nullable public TRowSet getRow_set() { return this.row_set; } public TPixelTableRowResult setRow_set(@org.apache.thrift.annotation.Nullable TRowSet row_set) { this.row_set = row_set; return this; } public void unsetRow_set() { this.row_set = null; } /** Returns true if field row_set is set (has been assigned a value) and false otherwise */ public boolean isSetRow_set() { return this.row_set != null; } public void setRow_setIsSet(boolean value) { if (!value) { this.row_set = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getNonce() { return this.nonce; } public TPixelTableRowResult setNonce(@org.apache.thrift.annotation.Nullable java.lang.String nonce) { this.nonce = nonce; return this; } public void unsetNonce() { this.nonce = null; } /** Returns true if field nonce is set (has been assigned a value) and false otherwise */ public boolean isSetNonce() { return this.nonce != null; } public void setNonceIsSet(boolean value) { if (!value) { this.nonce = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case PIXEL: if (value == null) { unsetPixel(); } else { setPixel((TPixel)value); } break; case VEGA_TABLE_NAME: if (value == null) { unsetVega_table_name(); } else { setVega_table_name((java.lang.String)value); } break; case TABLE_ID: if (value == null) { unsetTable_id(); } else { setTable_id((java.util.List<java.lang.Long>)value); } break; case ROW_ID: if (value == null) { unsetRow_id(); } else { setRow_id((java.util.List<java.lang.Long>)value); } break; case ROW_SET: if (value == null) { unsetRow_set(); } else { setRow_set((TRowSet)value); } break; case NONCE: if (value == null) { unsetNonce(); } else { setNonce((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case PIXEL: return getPixel(); case VEGA_TABLE_NAME: return getVega_table_name(); case TABLE_ID: return getTable_id(); case ROW_ID: return getRow_id(); case ROW_SET: return getRow_set(); case NONCE: return getNonce(); } 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 PIXEL: return isSetPixel(); case VEGA_TABLE_NAME: return isSetVega_table_name(); case TABLE_ID: return isSetTable_id(); case ROW_ID: return isSetRow_id(); case ROW_SET: return isSetRow_set(); case NONCE: return isSetNonce(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TPixelTableRowResult) return this.equals((TPixelTableRowResult)that); return false; } public boolean equals(TPixelTableRowResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_pixel = true && this.isSetPixel(); boolean that_present_pixel = true && that.isSetPixel(); if (this_present_pixel || that_present_pixel) { if (!(this_present_pixel && that_present_pixel)) return false; if (!this.pixel.equals(that.pixel)) return false; } boolean this_present_vega_table_name = true && this.isSetVega_table_name(); boolean that_present_vega_table_name = true && that.isSetVega_table_name(); if (this_present_vega_table_name || that_present_vega_table_name) { if (!(this_present_vega_table_name && that_present_vega_table_name)) return false; if (!this.vega_table_name.equals(that.vega_table_name)) return false; } boolean this_present_table_id = true && this.isSetTable_id(); boolean that_present_table_id = true && that.isSetTable_id(); if (this_present_table_id || that_present_table_id) { if (!(this_present_table_id && that_present_table_id)) return false; if (!this.table_id.equals(that.table_id)) return false; } boolean this_present_row_id = true && this.isSetRow_id(); boolean that_present_row_id = true && that.isSetRow_id(); if (this_present_row_id || that_present_row_id) { if (!(this_present_row_id && that_present_row_id)) return false; if (!this.row_id.equals(that.row_id)) return false; } boolean this_present_row_set = true && this.isSetRow_set(); boolean that_present_row_set = true && that.isSetRow_set(); if (this_present_row_set || that_present_row_set) { if (!(this_present_row_set && that_present_row_set)) return false; if (!this.row_set.equals(that.row_set)) return false; } boolean this_present_nonce = true && this.isSetNonce(); boolean that_present_nonce = true && that.isSetNonce(); if (this_present_nonce || that_present_nonce) { if (!(this_present_nonce && that_present_nonce)) return false; if (!this.nonce.equals(that.nonce)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetPixel()) ? 131071 : 524287); if (isSetPixel()) hashCode = hashCode * 8191 + pixel.hashCode(); hashCode = hashCode * 8191 + ((isSetVega_table_name()) ? 131071 : 524287); if (isSetVega_table_name()) hashCode = hashCode * 8191 + vega_table_name.hashCode(); hashCode = hashCode * 8191 + ((isSetTable_id()) ? 131071 : 524287); if (isSetTable_id()) hashCode = hashCode * 8191 + table_id.hashCode(); hashCode = hashCode * 8191 + ((isSetRow_id()) ? 131071 : 524287); if (isSetRow_id()) hashCode = hashCode * 8191 + row_id.hashCode(); hashCode = hashCode * 8191 + ((isSetRow_set()) ? 131071 : 524287); if (isSetRow_set()) hashCode = hashCode * 8191 + row_set.hashCode(); hashCode = hashCode * 8191 + ((isSetNonce()) ? 131071 : 524287); if (isSetNonce()) hashCode = hashCode * 8191 + nonce.hashCode(); return hashCode; } @Override public int compareTo(TPixelTableRowResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetPixel(), other.isSetPixel()); if (lastComparison != 0) { return lastComparison; } if (isSetPixel()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pixel, other.pixel); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetVega_table_name(), other.isSetVega_table_name()); if (lastComparison != 0) { return lastComparison; } if (isSetVega_table_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vega_table_name, other.vega_table_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_id(), other.isSetTable_id()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_id, other.table_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRow_id(), other.isSetRow_id()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_id, other.row_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRow_set(), other.isSetRow_set()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_set()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_set, other.row_set); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNonce(), other.isSetNonce()); if (lastComparison != 0) { return lastComparison; } if (isSetNonce()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonce, other.nonce); 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("TPixelTableRowResult("); boolean first = true; sb.append("pixel:"); if (this.pixel == null) { sb.append("null"); } else { sb.append(this.pixel); } first = false; if (!first) sb.append(", "); sb.append("vega_table_name:"); if (this.vega_table_name == null) { sb.append("null"); } else { sb.append(this.vega_table_name); } first = false; if (!first) sb.append(", "); sb.append("table_id:"); if (this.table_id == null) { sb.append("null"); } else { sb.append(this.table_id); } first = false; if (!first) sb.append(", "); sb.append("row_id:"); if (this.row_id == null) { sb.append("null"); } else { sb.append(this.row_id); } first = false; if (!first) sb.append(", "); sb.append("row_set:"); if (this.row_set == null) { sb.append("null"); } else { sb.append(this.row_set); } first = false; if (!first) sb.append(", "); sb.append("nonce:"); if (this.nonce == null) { sb.append("null"); } else { sb.append(this.nonce); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (pixel != null) { pixel.validate(); } if (row_set != null) { row_set.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 { 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 TPixelTableRowResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPixelTableRowResultStandardScheme getScheme() { return new TPixelTableRowResultStandardScheme(); } } private static class TPixelTableRowResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPixelTableRowResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TPixelTableRowResult 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: // PIXEL if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.pixel = new TPixel(); struct.pixel.read(iprot); struct.setPixelIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // VEGA_TABLE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.vega_table_name = iprot.readString(); struct.setVega_table_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list96 = iprot.readListBegin(); struct.table_id = new java.util.ArrayList<java.lang.Long>(_list96.size); long _elem97; for (int _i98 = 0; _i98 < _list96.size; ++_i98) { _elem97 = iprot.readI64(); struct.table_id.add(_elem97); } iprot.readListEnd(); } struct.setTable_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // ROW_ID if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list99 = iprot.readListBegin(); struct.row_id = new java.util.ArrayList<java.lang.Long>(_list99.size); long _elem100; for (int _i101 = 0; _i101 < _list99.size; ++_i101) { _elem100 = iprot.readI64(); struct.row_id.add(_elem100); } iprot.readListEnd(); } struct.setRow_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // ROW_SET if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.row_set = new TRowSet(); struct.row_set.read(iprot); struct.setRow_setIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // NONCE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nonce = iprot.readString(); struct.setNonceIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TPixelTableRowResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.pixel != null) { oprot.writeFieldBegin(PIXEL_FIELD_DESC); struct.pixel.write(oprot); oprot.writeFieldEnd(); } if (struct.vega_table_name != null) { oprot.writeFieldBegin(VEGA_TABLE_NAME_FIELD_DESC); oprot.writeString(struct.vega_table_name); oprot.writeFieldEnd(); } if (struct.table_id != null) { oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.table_id.size())); for (long _iter102 : struct.table_id) { oprot.writeI64(_iter102); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.row_id != null) { oprot.writeFieldBegin(ROW_ID_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.row_id.size())); for (long _iter103 : struct.row_id) { oprot.writeI64(_iter103); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.row_set != null) { oprot.writeFieldBegin(ROW_SET_FIELD_DESC); struct.row_set.write(oprot); oprot.writeFieldEnd(); } if (struct.nonce != null) { oprot.writeFieldBegin(NONCE_FIELD_DESC); oprot.writeString(struct.nonce); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TPixelTableRowResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPixelTableRowResultTupleScheme getScheme() { return new TPixelTableRowResultTupleScheme(); } } private static class TPixelTableRowResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPixelTableRowResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TPixelTableRowResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetPixel()) { optionals.set(0); } if (struct.isSetVega_table_name()) { optionals.set(1); } if (struct.isSetTable_id()) { optionals.set(2); } if (struct.isSetRow_id()) { optionals.set(3); } if (struct.isSetRow_set()) { optionals.set(4); } if (struct.isSetNonce()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetPixel()) { struct.pixel.write(oprot); } if (struct.isSetVega_table_name()) { oprot.writeString(struct.vega_table_name); } if (struct.isSetTable_id()) { { oprot.writeI32(struct.table_id.size()); for (long _iter104 : struct.table_id) { oprot.writeI64(_iter104); } } } if (struct.isSetRow_id()) { { oprot.writeI32(struct.row_id.size()); for (long _iter105 : struct.row_id) { oprot.writeI64(_iter105); } } } if (struct.isSetRow_set()) { struct.row_set.write(oprot); } if (struct.isSetNonce()) { oprot.writeString(struct.nonce); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TPixelTableRowResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.pixel = new TPixel(); struct.pixel.read(iprot); struct.setPixelIsSet(true); } if (incoming.get(1)) { struct.vega_table_name = iprot.readString(); struct.setVega_table_nameIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list106 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); struct.table_id = new java.util.ArrayList<java.lang.Long>(_list106.size); long _elem107; for (int _i108 = 0; _i108 < _list106.size; ++_i108) { _elem107 = iprot.readI64(); struct.table_id.add(_elem107); } } struct.setTable_idIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list109 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); struct.row_id = new java.util.ArrayList<java.lang.Long>(_list109.size); long _elem110; for (int _i111 = 0; _i111 < _list109.size; ++_i111) { _elem110 = iprot.readI64(); struct.row_id.add(_elem110); } } struct.setRow_idIsSet(true); } if (incoming.get(4)) { struct.row_set = new TRowSet(); struct.row_set.read(iprot); struct.setRow_setIsSet(true); } if (incoming.get(5)) { struct.nonce = iprot.readString(); struct.setNonceIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TQueryInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TQueryInfo implements org.apache.thrift.TBase<TQueryInfo, TQueryInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TQueryInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TQueryInfo"); private static final org.apache.thrift.protocol.TField QUERY_SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("query_session_id", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField QUERY_PUBLIC_SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("query_public_session_id", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField CURRENT_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("current_status", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField EXECUTOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("executor_id", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField SUBMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("submitted", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField QUERY_STR_FIELD_DESC = new org.apache.thrift.protocol.TField("query_str", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField LOGIN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("login_name", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField CLIENT_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("client_address", org.apache.thrift.protocol.TType.STRING, (short)8); private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)9); private static final org.apache.thrift.protocol.TField EXEC_DEVICE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("exec_device_type", org.apache.thrift.protocol.TType.STRING, (short)10); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TQueryInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TQueryInfoTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String query_session_id; // required public @org.apache.thrift.annotation.Nullable java.lang.String query_public_session_id; // required public @org.apache.thrift.annotation.Nullable java.lang.String current_status; // required public int executor_id; // required public @org.apache.thrift.annotation.Nullable java.lang.String submitted; // required public @org.apache.thrift.annotation.Nullable java.lang.String query_str; // required public @org.apache.thrift.annotation.Nullable java.lang.String login_name; // required public @org.apache.thrift.annotation.Nullable java.lang.String client_address; // required public @org.apache.thrift.annotation.Nullable java.lang.String db_name; // required public @org.apache.thrift.annotation.Nullable java.lang.String exec_device_type; // 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 { QUERY_SESSION_ID((short)1, "query_session_id"), QUERY_PUBLIC_SESSION_ID((short)2, "query_public_session_id"), CURRENT_STATUS((short)3, "current_status"), EXECUTOR_ID((short)4, "executor_id"), SUBMITTED((short)5, "submitted"), QUERY_STR((short)6, "query_str"), LOGIN_NAME((short)7, "login_name"), CLIENT_ADDRESS((short)8, "client_address"), DB_NAME((short)9, "db_name"), EXEC_DEVICE_TYPE((short)10, "exec_device_type"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // QUERY_SESSION_ID return QUERY_SESSION_ID; case 2: // QUERY_PUBLIC_SESSION_ID return QUERY_PUBLIC_SESSION_ID; case 3: // CURRENT_STATUS return CURRENT_STATUS; case 4: // EXECUTOR_ID return EXECUTOR_ID; case 5: // SUBMITTED return SUBMITTED; case 6: // QUERY_STR return QUERY_STR; case 7: // LOGIN_NAME return LOGIN_NAME; case 8: // CLIENT_ADDRESS return CLIENT_ADDRESS; case 9: // DB_NAME return DB_NAME; case 10: // EXEC_DEVICE_TYPE return EXEC_DEVICE_TYPE; 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 __EXECUTOR_ID_ISSET_ID = 0; 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.QUERY_SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("query_session_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.QUERY_PUBLIC_SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("query_public_session_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CURRENT_STATUS, new org.apache.thrift.meta_data.FieldMetaData("current_status", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.EXECUTOR_ID, new org.apache.thrift.meta_data.FieldMetaData("executor_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SUBMITTED, new org.apache.thrift.meta_data.FieldMetaData("submitted", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.QUERY_STR, new org.apache.thrift.meta_data.FieldMetaData("query_str", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.LOGIN_NAME, new org.apache.thrift.meta_data.FieldMetaData("login_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CLIENT_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("client_address", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("db_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.EXEC_DEVICE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("exec_device_type", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TQueryInfo.class, metaDataMap); } public TQueryInfo() { } public TQueryInfo( java.lang.String query_session_id, java.lang.String query_public_session_id, java.lang.String current_status, int executor_id, java.lang.String submitted, java.lang.String query_str, java.lang.String login_name, java.lang.String client_address, java.lang.String db_name, java.lang.String exec_device_type) { this(); this.query_session_id = query_session_id; this.query_public_session_id = query_public_session_id; this.current_status = current_status; this.executor_id = executor_id; setExecutor_idIsSet(true); this.submitted = submitted; this.query_str = query_str; this.login_name = login_name; this.client_address = client_address; this.db_name = db_name; this.exec_device_type = exec_device_type; } /** * Performs a deep copy on <i>other</i>. */ public TQueryInfo(TQueryInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetQuery_session_id()) { this.query_session_id = other.query_session_id; } if (other.isSetQuery_public_session_id()) { this.query_public_session_id = other.query_public_session_id; } if (other.isSetCurrent_status()) { this.current_status = other.current_status; } this.executor_id = other.executor_id; if (other.isSetSubmitted()) { this.submitted = other.submitted; } if (other.isSetQuery_str()) { this.query_str = other.query_str; } if (other.isSetLogin_name()) { this.login_name = other.login_name; } if (other.isSetClient_address()) { this.client_address = other.client_address; } if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetExec_device_type()) { this.exec_device_type = other.exec_device_type; } } public TQueryInfo deepCopy() { return new TQueryInfo(this); } @Override public void clear() { this.query_session_id = null; this.query_public_session_id = null; this.current_status = null; setExecutor_idIsSet(false); this.executor_id = 0; this.submitted = null; this.query_str = null; this.login_name = null; this.client_address = null; this.db_name = null; this.exec_device_type = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getQuery_session_id() { return this.query_session_id; } public TQueryInfo setQuery_session_id(@org.apache.thrift.annotation.Nullable java.lang.String query_session_id) { this.query_session_id = query_session_id; return this; } public void unsetQuery_session_id() { this.query_session_id = null; } /** Returns true if field query_session_id is set (has been assigned a value) and false otherwise */ public boolean isSetQuery_session_id() { return this.query_session_id != null; } public void setQuery_session_idIsSet(boolean value) { if (!value) { this.query_session_id = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getQuery_public_session_id() { return this.query_public_session_id; } public TQueryInfo setQuery_public_session_id(@org.apache.thrift.annotation.Nullable java.lang.String query_public_session_id) { this.query_public_session_id = query_public_session_id; return this; } public void unsetQuery_public_session_id() { this.query_public_session_id = null; } /** Returns true if field query_public_session_id is set (has been assigned a value) and false otherwise */ public boolean isSetQuery_public_session_id() { return this.query_public_session_id != null; } public void setQuery_public_session_idIsSet(boolean value) { if (!value) { this.query_public_session_id = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getCurrent_status() { return this.current_status; } public TQueryInfo setCurrent_status(@org.apache.thrift.annotation.Nullable java.lang.String current_status) { this.current_status = current_status; return this; } public void unsetCurrent_status() { this.current_status = null; } /** Returns true if field current_status is set (has been assigned a value) and false otherwise */ public boolean isSetCurrent_status() { return this.current_status != null; } public void setCurrent_statusIsSet(boolean value) { if (!value) { this.current_status = null; } } public int getExecutor_id() { return this.executor_id; } public TQueryInfo setExecutor_id(int executor_id) { this.executor_id = executor_id; setExecutor_idIsSet(true); return this; } public void unsetExecutor_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTOR_ID_ISSET_ID); } /** Returns true if field executor_id is set (has been assigned a value) and false otherwise */ public boolean isSetExecutor_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTOR_ID_ISSET_ID); } public void setExecutor_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTOR_ID_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getSubmitted() { return this.submitted; } public TQueryInfo setSubmitted(@org.apache.thrift.annotation.Nullable java.lang.String submitted) { this.submitted = submitted; return this; } public void unsetSubmitted() { this.submitted = null; } /** Returns true if field submitted is set (has been assigned a value) and false otherwise */ public boolean isSetSubmitted() { return this.submitted != null; } public void setSubmittedIsSet(boolean value) { if (!value) { this.submitted = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getQuery_str() { return this.query_str; } public TQueryInfo setQuery_str(@org.apache.thrift.annotation.Nullable java.lang.String query_str) { this.query_str = query_str; return this; } public void unsetQuery_str() { this.query_str = null; } /** Returns true if field query_str is set (has been assigned a value) and false otherwise */ public boolean isSetQuery_str() { return this.query_str != null; } public void setQuery_strIsSet(boolean value) { if (!value) { this.query_str = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getLogin_name() { return this.login_name; } public TQueryInfo setLogin_name(@org.apache.thrift.annotation.Nullable java.lang.String login_name) { this.login_name = login_name; return this; } public void unsetLogin_name() { this.login_name = null; } /** Returns true if field login_name is set (has been assigned a value) and false otherwise */ public boolean isSetLogin_name() { return this.login_name != null; } public void setLogin_nameIsSet(boolean value) { if (!value) { this.login_name = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getClient_address() { return this.client_address; } public TQueryInfo setClient_address(@org.apache.thrift.annotation.Nullable java.lang.String client_address) { this.client_address = client_address; return this; } public void unsetClient_address() { this.client_address = null; } /** Returns true if field client_address is set (has been assigned a value) and false otherwise */ public boolean isSetClient_address() { return this.client_address != null; } public void setClient_addressIsSet(boolean value) { if (!value) { this.client_address = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getDb_name() { return this.db_name; } public TQueryInfo setDb_name(@org.apache.thrift.annotation.Nullable java.lang.String db_name) { this.db_name = db_name; return this; } public void unsetDb_name() { this.db_name = null; } /** Returns true if field db_name is set (has been assigned a value) and false otherwise */ public boolean isSetDb_name() { return this.db_name != null; } public void setDb_nameIsSet(boolean value) { if (!value) { this.db_name = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getExec_device_type() { return this.exec_device_type; } public TQueryInfo setExec_device_type(@org.apache.thrift.annotation.Nullable java.lang.String exec_device_type) { this.exec_device_type = exec_device_type; return this; } public void unsetExec_device_type() { this.exec_device_type = null; } /** Returns true if field exec_device_type is set (has been assigned a value) and false otherwise */ public boolean isSetExec_device_type() { return this.exec_device_type != null; } public void setExec_device_typeIsSet(boolean value) { if (!value) { this.exec_device_type = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case QUERY_SESSION_ID: if (value == null) { unsetQuery_session_id(); } else { setQuery_session_id((java.lang.String)value); } break; case QUERY_PUBLIC_SESSION_ID: if (value == null) { unsetQuery_public_session_id(); } else { setQuery_public_session_id((java.lang.String)value); } break; case CURRENT_STATUS: if (value == null) { unsetCurrent_status(); } else { setCurrent_status((java.lang.String)value); } break; case EXECUTOR_ID: if (value == null) { unsetExecutor_id(); } else { setExecutor_id((java.lang.Integer)value); } break; case SUBMITTED: if (value == null) { unsetSubmitted(); } else { setSubmitted((java.lang.String)value); } break; case QUERY_STR: if (value == null) { unsetQuery_str(); } else { setQuery_str((java.lang.String)value); } break; case LOGIN_NAME: if (value == null) { unsetLogin_name(); } else { setLogin_name((java.lang.String)value); } break; case CLIENT_ADDRESS: if (value == null) { unsetClient_address(); } else { setClient_address((java.lang.String)value); } break; case DB_NAME: if (value == null) { unsetDb_name(); } else { setDb_name((java.lang.String)value); } break; case EXEC_DEVICE_TYPE: if (value == null) { unsetExec_device_type(); } else { setExec_device_type((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case QUERY_SESSION_ID: return getQuery_session_id(); case QUERY_PUBLIC_SESSION_ID: return getQuery_public_session_id(); case CURRENT_STATUS: return getCurrent_status(); case EXECUTOR_ID: return getExecutor_id(); case SUBMITTED: return getSubmitted(); case QUERY_STR: return getQuery_str(); case LOGIN_NAME: return getLogin_name(); case CLIENT_ADDRESS: return getClient_address(); case DB_NAME: return getDb_name(); case EXEC_DEVICE_TYPE: return getExec_device_type(); } 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 QUERY_SESSION_ID: return isSetQuery_session_id(); case QUERY_PUBLIC_SESSION_ID: return isSetQuery_public_session_id(); case CURRENT_STATUS: return isSetCurrent_status(); case EXECUTOR_ID: return isSetExecutor_id(); case SUBMITTED: return isSetSubmitted(); case QUERY_STR: return isSetQuery_str(); case LOGIN_NAME: return isSetLogin_name(); case CLIENT_ADDRESS: return isSetClient_address(); case DB_NAME: return isSetDb_name(); case EXEC_DEVICE_TYPE: return isSetExec_device_type(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TQueryInfo) return this.equals((TQueryInfo)that); return false; } public boolean equals(TQueryInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_query_session_id = true && this.isSetQuery_session_id(); boolean that_present_query_session_id = true && that.isSetQuery_session_id(); if (this_present_query_session_id || that_present_query_session_id) { if (!(this_present_query_session_id && that_present_query_session_id)) return false; if (!this.query_session_id.equals(that.query_session_id)) return false; } boolean this_present_query_public_session_id = true && this.isSetQuery_public_session_id(); boolean that_present_query_public_session_id = true && that.isSetQuery_public_session_id(); if (this_present_query_public_session_id || that_present_query_public_session_id) { if (!(this_present_query_public_session_id && that_present_query_public_session_id)) return false; if (!this.query_public_session_id.equals(that.query_public_session_id)) return false; } boolean this_present_current_status = true && this.isSetCurrent_status(); boolean that_present_current_status = true && that.isSetCurrent_status(); if (this_present_current_status || that_present_current_status) { if (!(this_present_current_status && that_present_current_status)) return false; if (!this.current_status.equals(that.current_status)) return false; } boolean this_present_executor_id = true; boolean that_present_executor_id = true; if (this_present_executor_id || that_present_executor_id) { if (!(this_present_executor_id && that_present_executor_id)) return false; if (this.executor_id != that.executor_id) return false; } boolean this_present_submitted = true && this.isSetSubmitted(); boolean that_present_submitted = true && that.isSetSubmitted(); if (this_present_submitted || that_present_submitted) { if (!(this_present_submitted && that_present_submitted)) return false; if (!this.submitted.equals(that.submitted)) return false; } boolean this_present_query_str = true && this.isSetQuery_str(); boolean that_present_query_str = true && that.isSetQuery_str(); if (this_present_query_str || that_present_query_str) { if (!(this_present_query_str && that_present_query_str)) return false; if (!this.query_str.equals(that.query_str)) return false; } boolean this_present_login_name = true && this.isSetLogin_name(); boolean that_present_login_name = true && that.isSetLogin_name(); if (this_present_login_name || that_present_login_name) { if (!(this_present_login_name && that_present_login_name)) return false; if (!this.login_name.equals(that.login_name)) return false; } boolean this_present_client_address = true && this.isSetClient_address(); boolean that_present_client_address = true && that.isSetClient_address(); if (this_present_client_address || that_present_client_address) { if (!(this_present_client_address && that_present_client_address)) return false; if (!this.client_address.equals(that.client_address)) return false; } boolean this_present_db_name = true && this.isSetDb_name(); boolean that_present_db_name = true && that.isSetDb_name(); if (this_present_db_name || that_present_db_name) { if (!(this_present_db_name && that_present_db_name)) return false; if (!this.db_name.equals(that.db_name)) return false; } boolean this_present_exec_device_type = true && this.isSetExec_device_type(); boolean that_present_exec_device_type = true && that.isSetExec_device_type(); if (this_present_exec_device_type || that_present_exec_device_type) { if (!(this_present_exec_device_type && that_present_exec_device_type)) return false; if (!this.exec_device_type.equals(that.exec_device_type)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetQuery_session_id()) ? 131071 : 524287); if (isSetQuery_session_id()) hashCode = hashCode * 8191 + query_session_id.hashCode(); hashCode = hashCode * 8191 + ((isSetQuery_public_session_id()) ? 131071 : 524287); if (isSetQuery_public_session_id()) hashCode = hashCode * 8191 + query_public_session_id.hashCode(); hashCode = hashCode * 8191 + ((isSetCurrent_status()) ? 131071 : 524287); if (isSetCurrent_status()) hashCode = hashCode * 8191 + current_status.hashCode(); hashCode = hashCode * 8191 + executor_id; hashCode = hashCode * 8191 + ((isSetSubmitted()) ? 131071 : 524287); if (isSetSubmitted()) hashCode = hashCode * 8191 + submitted.hashCode(); hashCode = hashCode * 8191 + ((isSetQuery_str()) ? 131071 : 524287); if (isSetQuery_str()) hashCode = hashCode * 8191 + query_str.hashCode(); hashCode = hashCode * 8191 + ((isSetLogin_name()) ? 131071 : 524287); if (isSetLogin_name()) hashCode = hashCode * 8191 + login_name.hashCode(); hashCode = hashCode * 8191 + ((isSetClient_address()) ? 131071 : 524287); if (isSetClient_address()) hashCode = hashCode * 8191 + client_address.hashCode(); hashCode = hashCode * 8191 + ((isSetDb_name()) ? 131071 : 524287); if (isSetDb_name()) hashCode = hashCode * 8191 + db_name.hashCode(); hashCode = hashCode * 8191 + ((isSetExec_device_type()) ? 131071 : 524287); if (isSetExec_device_type()) hashCode = hashCode * 8191 + exec_device_type.hashCode(); return hashCode; } @Override public int compareTo(TQueryInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetQuery_session_id(), other.isSetQuery_session_id()); if (lastComparison != 0) { return lastComparison; } if (isSetQuery_session_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_session_id, other.query_session_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetQuery_public_session_id(), other.isSetQuery_public_session_id()); if (lastComparison != 0) { return lastComparison; } if (isSetQuery_public_session_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_public_session_id, other.query_public_session_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCurrent_status(), other.isSetCurrent_status()); if (lastComparison != 0) { return lastComparison; } if (isSetCurrent_status()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.current_status, other.current_status); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExecutor_id(), other.isSetExecutor_id()); if (lastComparison != 0) { return lastComparison; } if (isSetExecutor_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executor_id, other.executor_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSubmitted(), other.isSetSubmitted()); if (lastComparison != 0) { return lastComparison; } if (isSetSubmitted()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.submitted, other.submitted); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetQuery_str(), other.isSetQuery_str()); if (lastComparison != 0) { return lastComparison; } if (isSetQuery_str()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_str, other.query_str); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetLogin_name(), other.isSetLogin_name()); if (lastComparison != 0) { return lastComparison; } if (isSetLogin_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login_name, other.login_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetClient_address(), other.isSetClient_address()); if (lastComparison != 0) { return lastComparison; } if (isSetClient_address()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_address, other.client_address); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDb_name(), other.isSetDb_name()); if (lastComparison != 0) { return lastComparison; } if (isSetDb_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_name, other.db_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExec_device_type(), other.isSetExec_device_type()); if (lastComparison != 0) { return lastComparison; } if (isSetExec_device_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.exec_device_type, other.exec_device_type); 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("TQueryInfo("); boolean first = true; sb.append("query_session_id:"); if (this.query_session_id == null) { sb.append("null"); } else { sb.append(this.query_session_id); } first = false; if (!first) sb.append(", "); sb.append("query_public_session_id:"); if (this.query_public_session_id == null) { sb.append("null"); } else { sb.append(this.query_public_session_id); } first = false; if (!first) sb.append(", "); sb.append("current_status:"); if (this.current_status == null) { sb.append("null"); } else { sb.append(this.current_status); } first = false; if (!first) sb.append(", "); sb.append("executor_id:"); sb.append(this.executor_id); first = false; if (!first) sb.append(", "); sb.append("submitted:"); if (this.submitted == null) { sb.append("null"); } else { sb.append(this.submitted); } first = false; if (!first) sb.append(", "); sb.append("query_str:"); if (this.query_str == null) { sb.append("null"); } else { sb.append(this.query_str); } first = false; if (!first) sb.append(", "); sb.append("login_name:"); if (this.login_name == null) { sb.append("null"); } else { sb.append(this.login_name); } first = false; if (!first) sb.append(", "); sb.append("client_address:"); if (this.client_address == null) { sb.append("null"); } else { sb.append(this.client_address); } first = false; if (!first) sb.append(", "); sb.append("db_name:"); if (this.db_name == null) { sb.append("null"); } else { sb.append(this.db_name); } first = false; if (!first) sb.append(", "); sb.append("exec_device_type:"); if (this.exec_device_type == null) { sb.append("null"); } else { sb.append(this.exec_device_type); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TQueryInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TQueryInfoStandardScheme getScheme() { return new TQueryInfoStandardScheme(); } } private static class TQueryInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TQueryInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TQueryInfo 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: // QUERY_SESSION_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.query_session_id = iprot.readString(); struct.setQuery_session_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // QUERY_PUBLIC_SESSION_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.query_public_session_id = iprot.readString(); struct.setQuery_public_session_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // CURRENT_STATUS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.current_status = iprot.readString(); struct.setCurrent_statusIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // EXECUTOR_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.executor_id = iprot.readI32(); struct.setExecutor_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // SUBMITTED if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.submitted = iprot.readString(); struct.setSubmittedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // QUERY_STR if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.query_str = iprot.readString(); struct.setQuery_strIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // LOGIN_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.login_name = iprot.readString(); struct.setLogin_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // CLIENT_ADDRESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.client_address = iprot.readString(); struct.setClient_addressIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // DB_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.db_name = iprot.readString(); struct.setDb_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // EXEC_DEVICE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.exec_device_type = iprot.readString(); struct.setExec_device_typeIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TQueryInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.query_session_id != null) { oprot.writeFieldBegin(QUERY_SESSION_ID_FIELD_DESC); oprot.writeString(struct.query_session_id); oprot.writeFieldEnd(); } if (struct.query_public_session_id != null) { oprot.writeFieldBegin(QUERY_PUBLIC_SESSION_ID_FIELD_DESC); oprot.writeString(struct.query_public_session_id); oprot.writeFieldEnd(); } if (struct.current_status != null) { oprot.writeFieldBegin(CURRENT_STATUS_FIELD_DESC); oprot.writeString(struct.current_status); oprot.writeFieldEnd(); } oprot.writeFieldBegin(EXECUTOR_ID_FIELD_DESC); oprot.writeI32(struct.executor_id); oprot.writeFieldEnd(); if (struct.submitted != null) { oprot.writeFieldBegin(SUBMITTED_FIELD_DESC); oprot.writeString(struct.submitted); oprot.writeFieldEnd(); } if (struct.query_str != null) { oprot.writeFieldBegin(QUERY_STR_FIELD_DESC); oprot.writeString(struct.query_str); oprot.writeFieldEnd(); } if (struct.login_name != null) { oprot.writeFieldBegin(LOGIN_NAME_FIELD_DESC); oprot.writeString(struct.login_name); oprot.writeFieldEnd(); } if (struct.client_address != null) { oprot.writeFieldBegin(CLIENT_ADDRESS_FIELD_DESC); oprot.writeString(struct.client_address); oprot.writeFieldEnd(); } if (struct.db_name != null) { oprot.writeFieldBegin(DB_NAME_FIELD_DESC); oprot.writeString(struct.db_name); oprot.writeFieldEnd(); } if (struct.exec_device_type != null) { oprot.writeFieldBegin(EXEC_DEVICE_TYPE_FIELD_DESC); oprot.writeString(struct.exec_device_type); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TQueryInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TQueryInfoTupleScheme getScheme() { return new TQueryInfoTupleScheme(); } } private static class TQueryInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TQueryInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TQueryInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetQuery_session_id()) { optionals.set(0); } if (struct.isSetQuery_public_session_id()) { optionals.set(1); } if (struct.isSetCurrent_status()) { optionals.set(2); } if (struct.isSetExecutor_id()) { optionals.set(3); } if (struct.isSetSubmitted()) { optionals.set(4); } if (struct.isSetQuery_str()) { optionals.set(5); } if (struct.isSetLogin_name()) { optionals.set(6); } if (struct.isSetClient_address()) { optionals.set(7); } if (struct.isSetDb_name()) { optionals.set(8); } if (struct.isSetExec_device_type()) { optionals.set(9); } oprot.writeBitSet(optionals, 10); if (struct.isSetQuery_session_id()) { oprot.writeString(struct.query_session_id); } if (struct.isSetQuery_public_session_id()) { oprot.writeString(struct.query_public_session_id); } if (struct.isSetCurrent_status()) { oprot.writeString(struct.current_status); } if (struct.isSetExecutor_id()) { oprot.writeI32(struct.executor_id); } if (struct.isSetSubmitted()) { oprot.writeString(struct.submitted); } if (struct.isSetQuery_str()) { oprot.writeString(struct.query_str); } if (struct.isSetLogin_name()) { oprot.writeString(struct.login_name); } if (struct.isSetClient_address()) { oprot.writeString(struct.client_address); } if (struct.isSetDb_name()) { oprot.writeString(struct.db_name); } if (struct.isSetExec_device_type()) { oprot.writeString(struct.exec_device_type); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TQueryInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(10); if (incoming.get(0)) { struct.query_session_id = iprot.readString(); struct.setQuery_session_idIsSet(true); } if (incoming.get(1)) { struct.query_public_session_id = iprot.readString(); struct.setQuery_public_session_idIsSet(true); } if (incoming.get(2)) { struct.current_status = iprot.readString(); struct.setCurrent_statusIsSet(true); } if (incoming.get(3)) { struct.executor_id = iprot.readI32(); struct.setExecutor_idIsSet(true); } if (incoming.get(4)) { struct.submitted = iprot.readString(); struct.setSubmittedIsSet(true); } if (incoming.get(5)) { struct.query_str = iprot.readString(); struct.setQuery_strIsSet(true); } if (incoming.get(6)) { struct.login_name = iprot.readString(); struct.setLogin_nameIsSet(true); } if (incoming.get(7)) { struct.client_address = iprot.readString(); struct.setClient_addressIsSet(true); } if (incoming.get(8)) { struct.db_name = iprot.readString(); struct.setDb_nameIsSet(true); } if (incoming.get(9)) { struct.exec_device_type = iprot.readString(); struct.setExec_device_typeIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TQueryResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TQueryResult implements org.apache.thrift.TBase<TQueryResult, TQueryResult._Fields>, java.io.Serializable, Cloneable, Comparable<TQueryResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TQueryResult"); private static final org.apache.thrift.protocol.TField ROW_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("row_set", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EXECUTION_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_time_ms", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField TOTAL_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("total_time_ms", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField NONCE_FIELD_DESC = new org.apache.thrift.protocol.TField("nonce", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField DEBUG_FIELD_DESC = new org.apache.thrift.protocol.TField("debug", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)6); private static final org.apache.thrift.protocol.TField QUERY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("query_type", org.apache.thrift.protocol.TType.I32, (short)7); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TQueryResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TQueryResultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable TRowSet row_set; // required public long execution_time_ms; // required public long total_time_ms; // required public @org.apache.thrift.annotation.Nullable java.lang.String nonce; // required public @org.apache.thrift.annotation.Nullable java.lang.String debug; // required public boolean success; // required /** * * @see TQueryType */ public @org.apache.thrift.annotation.Nullable TQueryType query_type; // 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 { ROW_SET((short)1, "row_set"), EXECUTION_TIME_MS((short)2, "execution_time_ms"), TOTAL_TIME_MS((short)3, "total_time_ms"), NONCE((short)4, "nonce"), DEBUG((short)5, "debug"), SUCCESS((short)6, "success"), /** * * @see TQueryType */ QUERY_TYPE((short)7, "query_type"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ROW_SET return ROW_SET; case 2: // EXECUTION_TIME_MS return EXECUTION_TIME_MS; case 3: // TOTAL_TIME_MS return TOTAL_TIME_MS; case 4: // NONCE return NONCE; case 5: // DEBUG return DEBUG; case 6: // SUCCESS return SUCCESS; case 7: // QUERY_TYPE return QUERY_TYPE; 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 __EXECUTION_TIME_MS_ISSET_ID = 0; private static final int __TOTAL_TIME_MS_ISSET_ID = 1; private static final int __SUCCESS_ISSET_ID = 2; 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.ROW_SET, new org.apache.thrift.meta_data.FieldMetaData("row_set", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); tmpMap.put(_Fields.EXECUTION_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("execution_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TOTAL_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("total_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.NONCE, new org.apache.thrift.meta_data.FieldMetaData("nonce", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DEBUG, new org.apache.thrift.meta_data.FieldMetaData("debug", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.QUERY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("query_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TQueryType.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TQueryResult.class, metaDataMap); } public TQueryResult() { this.success = true; this.query_type = ai.heavy.thrift.server.TQueryType.UNKNOWN; } public TQueryResult( TRowSet row_set, long execution_time_ms, long total_time_ms, java.lang.String nonce, java.lang.String debug, boolean success, TQueryType query_type) { this(); this.row_set = row_set; this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); this.nonce = nonce; this.debug = debug; this.success = success; setSuccessIsSet(true); this.query_type = query_type; } /** * Performs a deep copy on <i>other</i>. */ public TQueryResult(TQueryResult other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetRow_set()) { this.row_set = new TRowSet(other.row_set); } this.execution_time_ms = other.execution_time_ms; this.total_time_ms = other.total_time_ms; if (other.isSetNonce()) { this.nonce = other.nonce; } if (other.isSetDebug()) { this.debug = other.debug; } this.success = other.success; if (other.isSetQuery_type()) { this.query_type = other.query_type; } } public TQueryResult deepCopy() { return new TQueryResult(this); } @Override public void clear() { this.row_set = null; setExecution_time_msIsSet(false); this.execution_time_ms = 0; setTotal_time_msIsSet(false); this.total_time_ms = 0; this.nonce = null; this.debug = null; this.success = true; this.query_type = ai.heavy.thrift.server.TQueryType.UNKNOWN; } @org.apache.thrift.annotation.Nullable public TRowSet getRow_set() { return this.row_set; } public TQueryResult setRow_set(@org.apache.thrift.annotation.Nullable TRowSet row_set) { this.row_set = row_set; return this; } public void unsetRow_set() { this.row_set = null; } /** Returns true if field row_set is set (has been assigned a value) and false otherwise */ public boolean isSetRow_set() { return this.row_set != null; } public void setRow_setIsSet(boolean value) { if (!value) { this.row_set = null; } } public long getExecution_time_ms() { return this.execution_time_ms; } public TQueryResult setExecution_time_ms(long execution_time_ms) { this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); return this; } public void unsetExecution_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } /** Returns true if field execution_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetExecution_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } public void setExecution_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID, value); } public long getTotal_time_ms() { return this.total_time_ms; } public TQueryResult setTotal_time_ms(long total_time_ms) { this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); return this; } public void unsetTotal_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } /** Returns true if field total_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetTotal_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } public void setTotal_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getNonce() { return this.nonce; } public TQueryResult setNonce(@org.apache.thrift.annotation.Nullable java.lang.String nonce) { this.nonce = nonce; return this; } public void unsetNonce() { this.nonce = null; } /** Returns true if field nonce is set (has been assigned a value) and false otherwise */ public boolean isSetNonce() { return this.nonce != null; } public void setNonceIsSet(boolean value) { if (!value) { this.nonce = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getDebug() { return this.debug; } public TQueryResult setDebug(@org.apache.thrift.annotation.Nullable java.lang.String debug) { this.debug = debug; return this; } public void unsetDebug() { this.debug = null; } /** Returns true if field debug is set (has been assigned a value) and false otherwise */ public boolean isSetDebug() { return this.debug != null; } public void setDebugIsSet(boolean value) { if (!value) { this.debug = null; } } public boolean isSuccess() { return this.success; } public TQueryResult setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } /** * * @see TQueryType */ @org.apache.thrift.annotation.Nullable public TQueryType getQuery_type() { return this.query_type; } /** * * @see TQueryType */ public TQueryResult setQuery_type(@org.apache.thrift.annotation.Nullable TQueryType query_type) { this.query_type = query_type; return this; } public void unsetQuery_type() { this.query_type = null; } /** Returns true if field query_type is set (has been assigned a value) and false otherwise */ public boolean isSetQuery_type() { return this.query_type != null; } public void setQuery_typeIsSet(boolean value) { if (!value) { this.query_type = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ROW_SET: if (value == null) { unsetRow_set(); } else { setRow_set((TRowSet)value); } break; case EXECUTION_TIME_MS: if (value == null) { unsetExecution_time_ms(); } else { setExecution_time_ms((java.lang.Long)value); } break; case TOTAL_TIME_MS: if (value == null) { unsetTotal_time_ms(); } else { setTotal_time_ms((java.lang.Long)value); } break; case NONCE: if (value == null) { unsetNonce(); } else { setNonce((java.lang.String)value); } break; case DEBUG: if (value == null) { unsetDebug(); } else { setDebug((java.lang.String)value); } break; case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((java.lang.Boolean)value); } break; case QUERY_TYPE: if (value == null) { unsetQuery_type(); } else { setQuery_type((TQueryType)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ROW_SET: return getRow_set(); case EXECUTION_TIME_MS: return getExecution_time_ms(); case TOTAL_TIME_MS: return getTotal_time_ms(); case NONCE: return getNonce(); case DEBUG: return getDebug(); case SUCCESS: return isSuccess(); case QUERY_TYPE: return getQuery_type(); } 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 ROW_SET: return isSetRow_set(); case EXECUTION_TIME_MS: return isSetExecution_time_ms(); case TOTAL_TIME_MS: return isSetTotal_time_ms(); case NONCE: return isSetNonce(); case DEBUG: return isSetDebug(); case SUCCESS: return isSetSuccess(); case QUERY_TYPE: return isSetQuery_type(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TQueryResult) return this.equals((TQueryResult)that); return false; } public boolean equals(TQueryResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_row_set = true && this.isSetRow_set(); boolean that_present_row_set = true && that.isSetRow_set(); if (this_present_row_set || that_present_row_set) { if (!(this_present_row_set && that_present_row_set)) return false; if (!this.row_set.equals(that.row_set)) return false; } boolean this_present_execution_time_ms = true; boolean that_present_execution_time_ms = true; if (this_present_execution_time_ms || that_present_execution_time_ms) { if (!(this_present_execution_time_ms && that_present_execution_time_ms)) return false; if (this.execution_time_ms != that.execution_time_ms) return false; } boolean this_present_total_time_ms = true; boolean that_present_total_time_ms = true; if (this_present_total_time_ms || that_present_total_time_ms) { if (!(this_present_total_time_ms && that_present_total_time_ms)) return false; if (this.total_time_ms != that.total_time_ms) return false; } boolean this_present_nonce = true && this.isSetNonce(); boolean that_present_nonce = true && that.isSetNonce(); if (this_present_nonce || that_present_nonce) { if (!(this_present_nonce && that_present_nonce)) return false; if (!this.nonce.equals(that.nonce)) return false; } boolean this_present_debug = true && this.isSetDebug(); boolean that_present_debug = true && that.isSetDebug(); if (this_present_debug || that_present_debug) { if (!(this_present_debug && that_present_debug)) return false; if (!this.debug.equals(that.debug)) return false; } boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_query_type = true && this.isSetQuery_type(); boolean that_present_query_type = true && that.isSetQuery_type(); if (this_present_query_type || that_present_query_type) { if (!(this_present_query_type && that_present_query_type)) return false; if (!this.query_type.equals(that.query_type)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetRow_set()) ? 131071 : 524287); if (isSetRow_set()) hashCode = hashCode * 8191 + row_set.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(execution_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(total_time_ms); hashCode = hashCode * 8191 + ((isSetNonce()) ? 131071 : 524287); if (isSetNonce()) hashCode = hashCode * 8191 + nonce.hashCode(); hashCode = hashCode * 8191 + ((isSetDebug()) ? 131071 : 524287); if (isSetDebug()) hashCode = hashCode * 8191 + debug.hashCode(); hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetQuery_type()) ? 131071 : 524287); if (isSetQuery_type()) hashCode = hashCode * 8191 + query_type.getValue(); return hashCode; } @Override public int compareTo(TQueryResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetRow_set(), other.isSetRow_set()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_set()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_set, other.row_set); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExecution_time_ms(), other.isSetExecution_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetExecution_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_time_ms, other.execution_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTotal_time_ms(), other.isSetTotal_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetTotal_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_time_ms, other.total_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNonce(), other.isSetNonce()); if (lastComparison != 0) { return lastComparison; } if (isSetNonce()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonce, other.nonce); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDebug(), other.isSetDebug()); if (lastComparison != 0) { return lastComparison; } if (isSetDebug()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.debug, other.debug); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetQuery_type(), other.isSetQuery_type()); if (lastComparison != 0) { return lastComparison; } if (isSetQuery_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_type, other.query_type); 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("TQueryResult("); boolean first = true; sb.append("row_set:"); if (this.row_set == null) { sb.append("null"); } else { sb.append(this.row_set); } first = false; if (!first) sb.append(", "); sb.append("execution_time_ms:"); sb.append(this.execution_time_ms); first = false; if (!first) sb.append(", "); sb.append("total_time_ms:"); sb.append(this.total_time_ms); first = false; if (!first) sb.append(", "); sb.append("nonce:"); if (this.nonce == null) { sb.append("null"); } else { sb.append(this.nonce); } first = false; if (!first) sb.append(", "); sb.append("debug:"); if (this.debug == null) { sb.append("null"); } else { sb.append(this.debug); } first = false; if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("query_type:"); if (this.query_type == null) { sb.append("null"); } else { sb.append(this.query_type); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (row_set != null) { row_set.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 TQueryResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TQueryResultStandardScheme getScheme() { return new TQueryResultStandardScheme(); } } private static class TQueryResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TQueryResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TQueryResult 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: // ROW_SET if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.row_set = new TRowSet(); struct.row_set.read(iprot); struct.setRow_setIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // EXECUTION_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // TOTAL_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // NONCE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nonce = iprot.readString(); struct.setNonceIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // DEBUG if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.debug = iprot.readString(); struct.setDebugIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // QUERY_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.query_type = ai.heavy.thrift.server.TQueryType.findByValue(iprot.readI32()); struct.setQuery_typeIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TQueryResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.row_set != null) { oprot.writeFieldBegin(ROW_SET_FIELD_DESC); struct.row_set.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(EXECUTION_TIME_MS_FIELD_DESC); oprot.writeI64(struct.execution_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(TOTAL_TIME_MS_FIELD_DESC); oprot.writeI64(struct.total_time_ms); oprot.writeFieldEnd(); if (struct.nonce != null) { oprot.writeFieldBegin(NONCE_FIELD_DESC); oprot.writeString(struct.nonce); oprot.writeFieldEnd(); } if (struct.debug != null) { oprot.writeFieldBegin(DEBUG_FIELD_DESC); oprot.writeString(struct.debug); oprot.writeFieldEnd(); } oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); if (struct.query_type != null) { oprot.writeFieldBegin(QUERY_TYPE_FIELD_DESC); oprot.writeI32(struct.query_type.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TQueryResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TQueryResultTupleScheme getScheme() { return new TQueryResultTupleScheme(); } } private static class TQueryResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TQueryResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TQueryResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetRow_set()) { optionals.set(0); } if (struct.isSetExecution_time_ms()) { optionals.set(1); } if (struct.isSetTotal_time_ms()) { optionals.set(2); } if (struct.isSetNonce()) { optionals.set(3); } if (struct.isSetDebug()) { optionals.set(4); } if (struct.isSetSuccess()) { optionals.set(5); } if (struct.isSetQuery_type()) { optionals.set(6); } oprot.writeBitSet(optionals, 7); if (struct.isSetRow_set()) { struct.row_set.write(oprot); } if (struct.isSetExecution_time_ms()) { oprot.writeI64(struct.execution_time_ms); } if (struct.isSetTotal_time_ms()) { oprot.writeI64(struct.total_time_ms); } if (struct.isSetNonce()) { oprot.writeString(struct.nonce); } if (struct.isSetDebug()) { oprot.writeString(struct.debug); } if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetQuery_type()) { oprot.writeI32(struct.query_type.getValue()); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TQueryResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.row_set = new TRowSet(); struct.row_set.read(iprot); struct.setRow_setIsSet(true); } if (incoming.get(1)) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } if (incoming.get(2)) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(true); } if (incoming.get(3)) { struct.nonce = iprot.readString(); struct.setNonceIsSet(true); } if (incoming.get(4)) { struct.debug = iprot.readString(); struct.setDebugIsSet(true); } if (incoming.get(5)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(6)) { struct.query_type = ai.heavy.thrift.server.TQueryType.findByValue(iprot.readI32()); struct.setQuery_typeIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TQueryType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TQueryType implements org.apache.thrift.TEnum { UNKNOWN(0), READ(1), WRITE(2), SCHEMA_READ(3), SCHEMA_WRITE(4); private final int value; private TQueryType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TQueryType findByValue(int value) { switch (value) { case 0: return UNKNOWN; case 1: return READ; case 2: return WRITE; case 3: return SCHEMA_READ; case 4: return SCHEMA_WRITE; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRasterPointTransform.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TRasterPointTransform implements org.apache.thrift.TEnum { NONE(0), AUTO(1), FILE(2), WORLD(3); private final int value; private TRasterPointTransform(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TRasterPointTransform findByValue(int value) { switch (value) { case 0: return NONE; case 1: return AUTO; case 2: return FILE; case 3: return WORLD; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRasterPointType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TRasterPointType implements org.apache.thrift.TEnum { NONE(0), AUTO(1), SMALLINT(2), INT(3), FLOAT(4), DOUBLE(5), POINT(6); private final int value; private TRasterPointType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TRasterPointType findByValue(int value) { switch (value) { case 0: return NONE; case 1: return AUTO; case 2: return SMALLINT; case 3: return INT; case 4: return FLOAT; case 5: return DOUBLE; case 6: return POINT; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRawPixelData.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRawPixelData implements org.apache.thrift.TBase<TRawPixelData, TRawPixelData._Fields>, java.io.Serializable, Cloneable, Comparable<TRawPixelData> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRawPixelData"); private static final org.apache.thrift.protocol.TField WIDTH_FIELD_DESC = new org.apache.thrift.protocol.TField("width", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField HEIGHT_FIELD_DESC = new org.apache.thrift.protocol.TField("height", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField RENDER_PASS_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("render_pass_map", org.apache.thrift.protocol.TType.MAP, (short)3); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRawPixelDataStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRawPixelDataTupleSchemeFactory(); public int width; // required public int height; // required public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,TRawRenderPassDataResult> render_pass_map; // 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 { WIDTH((short)1, "width"), HEIGHT((short)2, "height"), RENDER_PASS_MAP((short)3, "render_pass_map"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // WIDTH return WIDTH; case 2: // HEIGHT return HEIGHT; case 3: // RENDER_PASS_MAP return RENDER_PASS_MAP; 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 __WIDTH_ISSET_ID = 0; private static final int __HEIGHT_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.WIDTH, new org.apache.thrift.meta_data.FieldMetaData("width", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.HEIGHT, new org.apache.thrift.meta_data.FieldMetaData("height", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.RENDER_PASS_MAP, new org.apache.thrift.meta_data.FieldMetaData("render_pass_map", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.MAP , "TRenderPassMap"))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRawPixelData.class, metaDataMap); } public TRawPixelData() { } public TRawPixelData( int width, int height, java.util.Map<java.lang.Integer,TRawRenderPassDataResult> render_pass_map) { this(); this.width = width; setWidthIsSet(true); this.height = height; setHeightIsSet(true); this.render_pass_map = render_pass_map; } /** * Performs a deep copy on <i>other</i>. */ public TRawPixelData(TRawPixelData other) { __isset_bitfield = other.__isset_bitfield; this.width = other.width; this.height = other.height; if (other.isSetRender_pass_map()) { java.util.Map<java.lang.Integer,TRawRenderPassDataResult> __this__render_pass_map = new java.util.HashMap<java.lang.Integer,TRawRenderPassDataResult>(other.render_pass_map.size()); for (java.util.Map.Entry<java.lang.Integer, TRawRenderPassDataResult> other_element : other.render_pass_map.entrySet()) { java.lang.Integer other_element_key = other_element.getKey(); TRawRenderPassDataResult other_element_value = other_element.getValue(); java.lang.Integer __this__render_pass_map_copy_key = other_element_key; TRawRenderPassDataResult __this__render_pass_map_copy_value = new TRawRenderPassDataResult(other_element_value); __this__render_pass_map.put(__this__render_pass_map_copy_key, __this__render_pass_map_copy_value); } this.render_pass_map = __this__render_pass_map; } } public TRawPixelData deepCopy() { return new TRawPixelData(this); } @Override public void clear() { setWidthIsSet(false); this.width = 0; setHeightIsSet(false); this.height = 0; this.render_pass_map = null; } public int getWidth() { return this.width; } public TRawPixelData setWidth(int width) { this.width = width; setWidthIsSet(true); return this; } public void unsetWidth() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __WIDTH_ISSET_ID); } /** Returns true if field width is set (has been assigned a value) and false otherwise */ public boolean isSetWidth() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __WIDTH_ISSET_ID); } public void setWidthIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __WIDTH_ISSET_ID, value); } public int getHeight() { return this.height; } public TRawPixelData setHeight(int height) { this.height = height; setHeightIsSet(true); return this; } public void unsetHeight() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HEIGHT_ISSET_ID); } /** Returns true if field height is set (has been assigned a value) and false otherwise */ public boolean isSetHeight() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HEIGHT_ISSET_ID); } public void setHeightIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HEIGHT_ISSET_ID, value); } public int getRender_pass_mapSize() { return (this.render_pass_map == null) ? 0 : this.render_pass_map.size(); } public void putToRender_pass_map(int key, TRawRenderPassDataResult val) { if (this.render_pass_map == null) { this.render_pass_map = new java.util.HashMap<java.lang.Integer,TRawRenderPassDataResult>(); } this.render_pass_map.put(key, val); } @org.apache.thrift.annotation.Nullable public java.util.Map<java.lang.Integer,TRawRenderPassDataResult> getRender_pass_map() { return this.render_pass_map; } public TRawPixelData setRender_pass_map(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,TRawRenderPassDataResult> render_pass_map) { this.render_pass_map = render_pass_map; return this; } public void unsetRender_pass_map() { this.render_pass_map = null; } /** Returns true if field render_pass_map is set (has been assigned a value) and false otherwise */ public boolean isSetRender_pass_map() { return this.render_pass_map != null; } public void setRender_pass_mapIsSet(boolean value) { if (!value) { this.render_pass_map = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case WIDTH: if (value == null) { unsetWidth(); } else { setWidth((java.lang.Integer)value); } break; case HEIGHT: if (value == null) { unsetHeight(); } else { setHeight((java.lang.Integer)value); } break; case RENDER_PASS_MAP: if (value == null) { unsetRender_pass_map(); } else { setRender_pass_map((java.util.Map<java.lang.Integer,TRawRenderPassDataResult>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case WIDTH: return getWidth(); case HEIGHT: return getHeight(); case RENDER_PASS_MAP: return getRender_pass_map(); } 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 WIDTH: return isSetWidth(); case HEIGHT: return isSetHeight(); case RENDER_PASS_MAP: return isSetRender_pass_map(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRawPixelData) return this.equals((TRawPixelData)that); return false; } public boolean equals(TRawPixelData that) { if (that == null) return false; if (this == that) return true; boolean this_present_width = true; boolean that_present_width = true; if (this_present_width || that_present_width) { if (!(this_present_width && that_present_width)) return false; if (this.width != that.width) return false; } boolean this_present_height = true; boolean that_present_height = true; if (this_present_height || that_present_height) { if (!(this_present_height && that_present_height)) return false; if (this.height != that.height) return false; } boolean this_present_render_pass_map = true && this.isSetRender_pass_map(); boolean that_present_render_pass_map = true && that.isSetRender_pass_map(); if (this_present_render_pass_map || that_present_render_pass_map) { if (!(this_present_render_pass_map && that_present_render_pass_map)) return false; if (!this.render_pass_map.equals(that.render_pass_map)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + width; hashCode = hashCode * 8191 + height; hashCode = hashCode * 8191 + ((isSetRender_pass_map()) ? 131071 : 524287); if (isSetRender_pass_map()) hashCode = hashCode * 8191 + render_pass_map.hashCode(); return hashCode; } @Override public int compareTo(TRawPixelData other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetWidth(), other.isSetWidth()); if (lastComparison != 0) { return lastComparison; } if (isSetWidth()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.width, other.width); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetHeight(), other.isSetHeight()); if (lastComparison != 0) { return lastComparison; } if (isSetHeight()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.height, other.height); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRender_pass_map(), other.isSetRender_pass_map()); if (lastComparison != 0) { return lastComparison; } if (isSetRender_pass_map()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.render_pass_map, other.render_pass_map); 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("TRawPixelData("); boolean first = true; sb.append("width:"); sb.append(this.width); first = false; if (!first) sb.append(", "); sb.append("height:"); sb.append(this.height); first = false; if (!first) sb.append(", "); sb.append("render_pass_map:"); if (this.render_pass_map == null) { sb.append("null"); } else { sb.append(this.render_pass_map); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TRawPixelDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRawPixelDataStandardScheme getScheme() { return new TRawPixelDataStandardScheme(); } } private static class TRawPixelDataStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRawPixelData> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRawPixelData 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: // WIDTH if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.width = iprot.readI32(); struct.setWidthIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // HEIGHT if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.height = iprot.readI32(); struct.setHeightIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // RENDER_PASS_MAP if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map240 = iprot.readMapBegin(); struct.render_pass_map = new java.util.HashMap<java.lang.Integer,TRawRenderPassDataResult>(2*_map240.size); int _key241; @org.apache.thrift.annotation.Nullable TRawRenderPassDataResult _val242; for (int _i243 = 0; _i243 < _map240.size; ++_i243) { _key241 = iprot.readI32(); _val242 = new TRawRenderPassDataResult(); _val242.read(iprot); struct.render_pass_map.put(_key241, _val242); } iprot.readMapEnd(); } struct.setRender_pass_mapIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRawPixelData struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(WIDTH_FIELD_DESC); oprot.writeI32(struct.width); oprot.writeFieldEnd(); oprot.writeFieldBegin(HEIGHT_FIELD_DESC); oprot.writeI32(struct.height); oprot.writeFieldEnd(); if (struct.render_pass_map != null) { oprot.writeFieldBegin(RENDER_PASS_MAP_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.render_pass_map.size())); for (java.util.Map.Entry<java.lang.Integer, TRawRenderPassDataResult> _iter244 : struct.render_pass_map.entrySet()) { oprot.writeI32(_iter244.getKey()); _iter244.getValue().write(oprot); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRawPixelDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRawPixelDataTupleScheme getScheme() { return new TRawPixelDataTupleScheme(); } } private static class TRawPixelDataTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRawPixelData> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRawPixelData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetWidth()) { optionals.set(0); } if (struct.isSetHeight()) { optionals.set(1); } if (struct.isSetRender_pass_map()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetWidth()) { oprot.writeI32(struct.width); } if (struct.isSetHeight()) { oprot.writeI32(struct.height); } if (struct.isSetRender_pass_map()) { { oprot.writeI32(struct.render_pass_map.size()); for (java.util.Map.Entry<java.lang.Integer, TRawRenderPassDataResult> _iter245 : struct.render_pass_map.entrySet()) { oprot.writeI32(_iter245.getKey()); _iter245.getValue().write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRawPixelData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.width = iprot.readI32(); struct.setWidthIsSet(true); } if (incoming.get(1)) { struct.height = iprot.readI32(); struct.setHeightIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TMap _map246 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT); struct.render_pass_map = new java.util.HashMap<java.lang.Integer,TRawRenderPassDataResult>(2*_map246.size); int _key247; @org.apache.thrift.annotation.Nullable TRawRenderPassDataResult _val248; for (int _i249 = 0; _i249 < _map246.size; ++_i249) { _key247 = iprot.readI32(); _val248 = new TRawRenderPassDataResult(); _val248.read(iprot); struct.render_pass_map.put(_key247, _val248); } } struct.setRender_pass_mapIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRawRenderPassDataResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRawRenderPassDataResult implements org.apache.thrift.TBase<TRawRenderPassDataResult, TRawRenderPassDataResult._Fields>, java.io.Serializable, Cloneable, Comparable<TRawRenderPassDataResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRawRenderPassDataResult"); private static final org.apache.thrift.protocol.TField NUM_PIXEL_CHANNELS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_pixel_channels", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField NUM_PIXEL_SAMPLES_FIELD_DESC = new org.apache.thrift.protocol.TField("num_pixel_samples", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField PIXELS_FIELD_DESC = new org.apache.thrift.protocol.TField("pixels", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField ROW_IDS__A_FIELD_DESC = new org.apache.thrift.protocol.TField("row_ids_A", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField ROW_IDS__B_FIELD_DESC = new org.apache.thrift.protocol.TField("row_ids_B", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField TABLE_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("table_ids", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField ACCUM_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("accum_data", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField ACCUM_DEPTH_FIELD_DESC = new org.apache.thrift.protocol.TField("accum_depth", org.apache.thrift.protocol.TType.I32, (short)8); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRawRenderPassDataResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRawRenderPassDataResultTupleSchemeFactory(); public int num_pixel_channels; // required public int num_pixel_samples; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer pixels; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer row_ids_A; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer row_ids_B; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer table_ids; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer accum_data; // required public int accum_depth; // 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 { NUM_PIXEL_CHANNELS((short)1, "num_pixel_channels"), NUM_PIXEL_SAMPLES((short)2, "num_pixel_samples"), PIXELS((short)3, "pixels"), ROW_IDS__A((short)4, "row_ids_A"), ROW_IDS__B((short)5, "row_ids_B"), TABLE_IDS((short)6, "table_ids"), ACCUM_DATA((short)7, "accum_data"), ACCUM_DEPTH((short)8, "accum_depth"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // NUM_PIXEL_CHANNELS return NUM_PIXEL_CHANNELS; case 2: // NUM_PIXEL_SAMPLES return NUM_PIXEL_SAMPLES; case 3: // PIXELS return PIXELS; case 4: // ROW_IDS__A return ROW_IDS__A; case 5: // ROW_IDS__B return ROW_IDS__B; case 6: // TABLE_IDS return TABLE_IDS; case 7: // ACCUM_DATA return ACCUM_DATA; case 8: // ACCUM_DEPTH return ACCUM_DEPTH; 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 __NUM_PIXEL_CHANNELS_ISSET_ID = 0; private static final int __NUM_PIXEL_SAMPLES_ISSET_ID = 1; private static final int __ACCUM_DEPTH_ISSET_ID = 2; 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.NUM_PIXEL_CHANNELS, new org.apache.thrift.meta_data.FieldMetaData("num_pixel_channels", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.NUM_PIXEL_SAMPLES, new org.apache.thrift.meta_data.FieldMetaData("num_pixel_samples", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PIXELS, new org.apache.thrift.meta_data.FieldMetaData("pixels", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.ROW_IDS__A, new org.apache.thrift.meta_data.FieldMetaData("row_ids_A", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.ROW_IDS__B, new org.apache.thrift.meta_data.FieldMetaData("row_ids_B", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.TABLE_IDS, new org.apache.thrift.meta_data.FieldMetaData("table_ids", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.ACCUM_DATA, new org.apache.thrift.meta_data.FieldMetaData("accum_data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.ACCUM_DEPTH, new org.apache.thrift.meta_data.FieldMetaData("accum_depth", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TRawRenderPassDataResult.class, metaDataMap); } public TRawRenderPassDataResult() { } public TRawRenderPassDataResult( int num_pixel_channels, int num_pixel_samples, java.nio.ByteBuffer pixels, java.nio.ByteBuffer row_ids_A, java.nio.ByteBuffer row_ids_B, java.nio.ByteBuffer table_ids, java.nio.ByteBuffer accum_data, int accum_depth) { this(); this.num_pixel_channels = num_pixel_channels; setNum_pixel_channelsIsSet(true); this.num_pixel_samples = num_pixel_samples; setNum_pixel_samplesIsSet(true); this.pixels = org.apache.thrift.TBaseHelper.copyBinary(pixels); this.row_ids_A = org.apache.thrift.TBaseHelper.copyBinary(row_ids_A); this.row_ids_B = org.apache.thrift.TBaseHelper.copyBinary(row_ids_B); this.table_ids = org.apache.thrift.TBaseHelper.copyBinary(table_ids); this.accum_data = org.apache.thrift.TBaseHelper.copyBinary(accum_data); this.accum_depth = accum_depth; setAccum_depthIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TRawRenderPassDataResult(TRawRenderPassDataResult other) { __isset_bitfield = other.__isset_bitfield; this.num_pixel_channels = other.num_pixel_channels; this.num_pixel_samples = other.num_pixel_samples; if (other.isSetPixels()) { this.pixels = org.apache.thrift.TBaseHelper.copyBinary(other.pixels); } if (other.isSetRow_ids_A()) { this.row_ids_A = org.apache.thrift.TBaseHelper.copyBinary(other.row_ids_A); } if (other.isSetRow_ids_B()) { this.row_ids_B = org.apache.thrift.TBaseHelper.copyBinary(other.row_ids_B); } if (other.isSetTable_ids()) { this.table_ids = org.apache.thrift.TBaseHelper.copyBinary(other.table_ids); } if (other.isSetAccum_data()) { this.accum_data = org.apache.thrift.TBaseHelper.copyBinary(other.accum_data); } this.accum_depth = other.accum_depth; } public TRawRenderPassDataResult deepCopy() { return new TRawRenderPassDataResult(this); } @Override public void clear() { setNum_pixel_channelsIsSet(false); this.num_pixel_channels = 0; setNum_pixel_samplesIsSet(false); this.num_pixel_samples = 0; this.pixels = null; this.row_ids_A = null; this.row_ids_B = null; this.table_ids = null; this.accum_data = null; setAccum_depthIsSet(false); this.accum_depth = 0; } public int getNum_pixel_channels() { return this.num_pixel_channels; } public TRawRenderPassDataResult setNum_pixel_channels(int num_pixel_channels) { this.num_pixel_channels = num_pixel_channels; setNum_pixel_channelsIsSet(true); return this; } public void unsetNum_pixel_channels() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_PIXEL_CHANNELS_ISSET_ID); } /** Returns true if field num_pixel_channels is set (has been assigned a value) and false otherwise */ public boolean isSetNum_pixel_channels() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_PIXEL_CHANNELS_ISSET_ID); } public void setNum_pixel_channelsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_PIXEL_CHANNELS_ISSET_ID, value); } public int getNum_pixel_samples() { return this.num_pixel_samples; } public TRawRenderPassDataResult setNum_pixel_samples(int num_pixel_samples) { this.num_pixel_samples = num_pixel_samples; setNum_pixel_samplesIsSet(true); return this; } public void unsetNum_pixel_samples() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_PIXEL_SAMPLES_ISSET_ID); } /** Returns true if field num_pixel_samples is set (has been assigned a value) and false otherwise */ public boolean isSetNum_pixel_samples() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_PIXEL_SAMPLES_ISSET_ID); } public void setNum_pixel_samplesIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_PIXEL_SAMPLES_ISSET_ID, value); } public byte[] getPixels() { setPixels(org.apache.thrift.TBaseHelper.rightSize(pixels)); return pixels == null ? null : pixels.array(); } public java.nio.ByteBuffer bufferForPixels() { return org.apache.thrift.TBaseHelper.copyBinary(pixels); } public TRawRenderPassDataResult setPixels(byte[] pixels) { this.pixels = pixels == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(pixels.clone()); return this; } public TRawRenderPassDataResult setPixels(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer pixels) { this.pixels = org.apache.thrift.TBaseHelper.copyBinary(pixels); return this; } public void unsetPixels() { this.pixels = null; } /** Returns true if field pixels is set (has been assigned a value) and false otherwise */ public boolean isSetPixels() { return this.pixels != null; } public void setPixelsIsSet(boolean value) { if (!value) { this.pixels = null; } } public byte[] getRow_ids_A() { setRow_ids_A(org.apache.thrift.TBaseHelper.rightSize(row_ids_A)); return row_ids_A == null ? null : row_ids_A.array(); } public java.nio.ByteBuffer bufferForRow_ids_A() { return org.apache.thrift.TBaseHelper.copyBinary(row_ids_A); } public TRawRenderPassDataResult setRow_ids_A(byte[] row_ids_A) { this.row_ids_A = row_ids_A == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(row_ids_A.clone()); return this; } public TRawRenderPassDataResult setRow_ids_A(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer row_ids_A) { this.row_ids_A = org.apache.thrift.TBaseHelper.copyBinary(row_ids_A); return this; } public void unsetRow_ids_A() { this.row_ids_A = null; } /** Returns true if field row_ids_A is set (has been assigned a value) and false otherwise */ public boolean isSetRow_ids_A() { return this.row_ids_A != null; } public void setRow_ids_AIsSet(boolean value) { if (!value) { this.row_ids_A = null; } } public byte[] getRow_ids_B() { setRow_ids_B(org.apache.thrift.TBaseHelper.rightSize(row_ids_B)); return row_ids_B == null ? null : row_ids_B.array(); } public java.nio.ByteBuffer bufferForRow_ids_B() { return org.apache.thrift.TBaseHelper.copyBinary(row_ids_B); } public TRawRenderPassDataResult setRow_ids_B(byte[] row_ids_B) { this.row_ids_B = row_ids_B == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(row_ids_B.clone()); return this; } public TRawRenderPassDataResult setRow_ids_B(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer row_ids_B) { this.row_ids_B = org.apache.thrift.TBaseHelper.copyBinary(row_ids_B); return this; } public void unsetRow_ids_B() { this.row_ids_B = null; } /** Returns true if field row_ids_B is set (has been assigned a value) and false otherwise */ public boolean isSetRow_ids_B() { return this.row_ids_B != null; } public void setRow_ids_BIsSet(boolean value) { if (!value) { this.row_ids_B = null; } } public byte[] getTable_ids() { setTable_ids(org.apache.thrift.TBaseHelper.rightSize(table_ids)); return table_ids == null ? null : table_ids.array(); } public java.nio.ByteBuffer bufferForTable_ids() { return org.apache.thrift.TBaseHelper.copyBinary(table_ids); } public TRawRenderPassDataResult setTable_ids(byte[] table_ids) { this.table_ids = table_ids == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(table_ids.clone()); return this; } public TRawRenderPassDataResult setTable_ids(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer table_ids) { this.table_ids = org.apache.thrift.TBaseHelper.copyBinary(table_ids); return this; } public void unsetTable_ids() { this.table_ids = null; } /** Returns true if field table_ids is set (has been assigned a value) and false otherwise */ public boolean isSetTable_ids() { return this.table_ids != null; } public void setTable_idsIsSet(boolean value) { if (!value) { this.table_ids = null; } } public byte[] getAccum_data() { setAccum_data(org.apache.thrift.TBaseHelper.rightSize(accum_data)); return accum_data == null ? null : accum_data.array(); } public java.nio.ByteBuffer bufferForAccum_data() { return org.apache.thrift.TBaseHelper.copyBinary(accum_data); } public TRawRenderPassDataResult setAccum_data(byte[] accum_data) { this.accum_data = accum_data == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(accum_data.clone()); return this; } public TRawRenderPassDataResult setAccum_data(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer accum_data) { this.accum_data = org.apache.thrift.TBaseHelper.copyBinary(accum_data); return this; } public void unsetAccum_data() { this.accum_data = null; } /** Returns true if field accum_data is set (has been assigned a value) and false otherwise */ public boolean isSetAccum_data() { return this.accum_data != null; } public void setAccum_dataIsSet(boolean value) { if (!value) { this.accum_data = null; } } public int getAccum_depth() { return this.accum_depth; } public TRawRenderPassDataResult setAccum_depth(int accum_depth) { this.accum_depth = accum_depth; setAccum_depthIsSet(true); return this; } public void unsetAccum_depth() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ACCUM_DEPTH_ISSET_ID); } /** Returns true if field accum_depth is set (has been assigned a value) and false otherwise */ public boolean isSetAccum_depth() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ACCUM_DEPTH_ISSET_ID); } public void setAccum_depthIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ACCUM_DEPTH_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NUM_PIXEL_CHANNELS: if (value == null) { unsetNum_pixel_channels(); } else { setNum_pixel_channels((java.lang.Integer)value); } break; case NUM_PIXEL_SAMPLES: if (value == null) { unsetNum_pixel_samples(); } else { setNum_pixel_samples((java.lang.Integer)value); } break; case PIXELS: if (value == null) { unsetPixels(); } else { if (value instanceof byte[]) { setPixels((byte[])value); } else { setPixels((java.nio.ByteBuffer)value); } } break; case ROW_IDS__A: if (value == null) { unsetRow_ids_A(); } else { if (value instanceof byte[]) { setRow_ids_A((byte[])value); } else { setRow_ids_A((java.nio.ByteBuffer)value); } } break; case ROW_IDS__B: if (value == null) { unsetRow_ids_B(); } else { if (value instanceof byte[]) { setRow_ids_B((byte[])value); } else { setRow_ids_B((java.nio.ByteBuffer)value); } } break; case TABLE_IDS: if (value == null) { unsetTable_ids(); } else { if (value instanceof byte[]) { setTable_ids((byte[])value); } else { setTable_ids((java.nio.ByteBuffer)value); } } break; case ACCUM_DATA: if (value == null) { unsetAccum_data(); } else { if (value instanceof byte[]) { setAccum_data((byte[])value); } else { setAccum_data((java.nio.ByteBuffer)value); } } break; case ACCUM_DEPTH: if (value == null) { unsetAccum_depth(); } else { setAccum_depth((java.lang.Integer)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NUM_PIXEL_CHANNELS: return getNum_pixel_channels(); case NUM_PIXEL_SAMPLES: return getNum_pixel_samples(); case PIXELS: return getPixels(); case ROW_IDS__A: return getRow_ids_A(); case ROW_IDS__B: return getRow_ids_B(); case TABLE_IDS: return getTable_ids(); case ACCUM_DATA: return getAccum_data(); case ACCUM_DEPTH: return getAccum_depth(); } 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 NUM_PIXEL_CHANNELS: return isSetNum_pixel_channels(); case NUM_PIXEL_SAMPLES: return isSetNum_pixel_samples(); case PIXELS: return isSetPixels(); case ROW_IDS__A: return isSetRow_ids_A(); case ROW_IDS__B: return isSetRow_ids_B(); case TABLE_IDS: return isSetTable_ids(); case ACCUM_DATA: return isSetAccum_data(); case ACCUM_DEPTH: return isSetAccum_depth(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRawRenderPassDataResult) return this.equals((TRawRenderPassDataResult)that); return false; } public boolean equals(TRawRenderPassDataResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_num_pixel_channels = true; boolean that_present_num_pixel_channels = true; if (this_present_num_pixel_channels || that_present_num_pixel_channels) { if (!(this_present_num_pixel_channels && that_present_num_pixel_channels)) return false; if (this.num_pixel_channels != that.num_pixel_channels) return false; } boolean this_present_num_pixel_samples = true; boolean that_present_num_pixel_samples = true; if (this_present_num_pixel_samples || that_present_num_pixel_samples) { if (!(this_present_num_pixel_samples && that_present_num_pixel_samples)) return false; if (this.num_pixel_samples != that.num_pixel_samples) return false; } boolean this_present_pixels = true && this.isSetPixels(); boolean that_present_pixels = true && that.isSetPixels(); if (this_present_pixels || that_present_pixels) { if (!(this_present_pixels && that_present_pixels)) return false; if (!this.pixels.equals(that.pixels)) return false; } boolean this_present_row_ids_A = true && this.isSetRow_ids_A(); boolean that_present_row_ids_A = true && that.isSetRow_ids_A(); if (this_present_row_ids_A || that_present_row_ids_A) { if (!(this_present_row_ids_A && that_present_row_ids_A)) return false; if (!this.row_ids_A.equals(that.row_ids_A)) return false; } boolean this_present_row_ids_B = true && this.isSetRow_ids_B(); boolean that_present_row_ids_B = true && that.isSetRow_ids_B(); if (this_present_row_ids_B || that_present_row_ids_B) { if (!(this_present_row_ids_B && that_present_row_ids_B)) return false; if (!this.row_ids_B.equals(that.row_ids_B)) return false; } boolean this_present_table_ids = true && this.isSetTable_ids(); boolean that_present_table_ids = true && that.isSetTable_ids(); if (this_present_table_ids || that_present_table_ids) { if (!(this_present_table_ids && that_present_table_ids)) return false; if (!this.table_ids.equals(that.table_ids)) return false; } boolean this_present_accum_data = true && this.isSetAccum_data(); boolean that_present_accum_data = true && that.isSetAccum_data(); if (this_present_accum_data || that_present_accum_data) { if (!(this_present_accum_data && that_present_accum_data)) return false; if (!this.accum_data.equals(that.accum_data)) return false; } boolean this_present_accum_depth = true; boolean that_present_accum_depth = true; if (this_present_accum_depth || that_present_accum_depth) { if (!(this_present_accum_depth && that_present_accum_depth)) return false; if (this.accum_depth != that.accum_depth) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + num_pixel_channels; hashCode = hashCode * 8191 + num_pixel_samples; hashCode = hashCode * 8191 + ((isSetPixels()) ? 131071 : 524287); if (isSetPixels()) hashCode = hashCode * 8191 + pixels.hashCode(); hashCode = hashCode * 8191 + ((isSetRow_ids_A()) ? 131071 : 524287); if (isSetRow_ids_A()) hashCode = hashCode * 8191 + row_ids_A.hashCode(); hashCode = hashCode * 8191 + ((isSetRow_ids_B()) ? 131071 : 524287); if (isSetRow_ids_B()) hashCode = hashCode * 8191 + row_ids_B.hashCode(); hashCode = hashCode * 8191 + ((isSetTable_ids()) ? 131071 : 524287); if (isSetTable_ids()) hashCode = hashCode * 8191 + table_ids.hashCode(); hashCode = hashCode * 8191 + ((isSetAccum_data()) ? 131071 : 524287); if (isSetAccum_data()) hashCode = hashCode * 8191 + accum_data.hashCode(); hashCode = hashCode * 8191 + accum_depth; return hashCode; } @Override public int compareTo(TRawRenderPassDataResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetNum_pixel_channels(), other.isSetNum_pixel_channels()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_pixel_channels()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_pixel_channels, other.num_pixel_channels); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_pixel_samples(), other.isSetNum_pixel_samples()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_pixel_samples()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_pixel_samples, other.num_pixel_samples); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPixels(), other.isSetPixels()); if (lastComparison != 0) { return lastComparison; } if (isSetPixels()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pixels, other.pixels); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRow_ids_A(), other.isSetRow_ids_A()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_ids_A()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_ids_A, other.row_ids_A); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRow_ids_B(), other.isSetRow_ids_B()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_ids_B()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_ids_B, other.row_ids_B); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_ids(), other.isSetTable_ids()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_ids()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_ids, other.table_ids); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetAccum_data(), other.isSetAccum_data()); if (lastComparison != 0) { return lastComparison; } if (isSetAccum_data()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.accum_data, other.accum_data); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetAccum_depth(), other.isSetAccum_depth()); if (lastComparison != 0) { return lastComparison; } if (isSetAccum_depth()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.accum_depth, other.accum_depth); 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("TRawRenderPassDataResult("); boolean first = true; sb.append("num_pixel_channels:"); sb.append(this.num_pixel_channels); first = false; if (!first) sb.append(", "); sb.append("num_pixel_samples:"); sb.append(this.num_pixel_samples); first = false; if (!first) sb.append(", "); sb.append("pixels:"); if (this.pixels == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.pixels, sb); } first = false; if (!first) sb.append(", "); sb.append("row_ids_A:"); if (this.row_ids_A == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.row_ids_A, sb); } first = false; if (!first) sb.append(", "); sb.append("row_ids_B:"); if (this.row_ids_B == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.row_ids_B, sb); } first = false; if (!first) sb.append(", "); sb.append("table_ids:"); if (this.table_ids == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.table_ids, sb); } first = false; if (!first) sb.append(", "); sb.append("accum_data:"); if (this.accum_data == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.accum_data, sb); } first = false; if (!first) sb.append(", "); sb.append("accum_depth:"); sb.append(this.accum_depth); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TRawRenderPassDataResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRawRenderPassDataResultStandardScheme getScheme() { return new TRawRenderPassDataResultStandardScheme(); } } private static class TRawRenderPassDataResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRawRenderPassDataResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRawRenderPassDataResult 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: // NUM_PIXEL_CHANNELS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.num_pixel_channels = iprot.readI32(); struct.setNum_pixel_channelsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NUM_PIXEL_SAMPLES if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.num_pixel_samples = iprot.readI32(); struct.setNum_pixel_samplesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PIXELS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.pixels = iprot.readBinary(); struct.setPixelsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // ROW_IDS__A if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.row_ids_A = iprot.readBinary(); struct.setRow_ids_AIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // ROW_IDS__B if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.row_ids_B = iprot.readBinary(); struct.setRow_ids_BIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // TABLE_IDS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.table_ids = iprot.readBinary(); struct.setTable_idsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // ACCUM_DATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.accum_data = iprot.readBinary(); struct.setAccum_dataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // ACCUM_DEPTH if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.accum_depth = iprot.readI32(); struct.setAccum_depthIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRawRenderPassDataResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(NUM_PIXEL_CHANNELS_FIELD_DESC); oprot.writeI32(struct.num_pixel_channels); oprot.writeFieldEnd(); oprot.writeFieldBegin(NUM_PIXEL_SAMPLES_FIELD_DESC); oprot.writeI32(struct.num_pixel_samples); oprot.writeFieldEnd(); if (struct.pixels != null) { oprot.writeFieldBegin(PIXELS_FIELD_DESC); oprot.writeBinary(struct.pixels); oprot.writeFieldEnd(); } if (struct.row_ids_A != null) { oprot.writeFieldBegin(ROW_IDS__A_FIELD_DESC); oprot.writeBinary(struct.row_ids_A); oprot.writeFieldEnd(); } if (struct.row_ids_B != null) { oprot.writeFieldBegin(ROW_IDS__B_FIELD_DESC); oprot.writeBinary(struct.row_ids_B); oprot.writeFieldEnd(); } if (struct.table_ids != null) { oprot.writeFieldBegin(TABLE_IDS_FIELD_DESC); oprot.writeBinary(struct.table_ids); oprot.writeFieldEnd(); } if (struct.accum_data != null) { oprot.writeFieldBegin(ACCUM_DATA_FIELD_DESC); oprot.writeBinary(struct.accum_data); oprot.writeFieldEnd(); } oprot.writeFieldBegin(ACCUM_DEPTH_FIELD_DESC); oprot.writeI32(struct.accum_depth); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRawRenderPassDataResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRawRenderPassDataResultTupleScheme getScheme() { return new TRawRenderPassDataResultTupleScheme(); } } private static class TRawRenderPassDataResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRawRenderPassDataResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRawRenderPassDataResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetNum_pixel_channels()) { optionals.set(0); } if (struct.isSetNum_pixel_samples()) { optionals.set(1); } if (struct.isSetPixels()) { optionals.set(2); } if (struct.isSetRow_ids_A()) { optionals.set(3); } if (struct.isSetRow_ids_B()) { optionals.set(4); } if (struct.isSetTable_ids()) { optionals.set(5); } if (struct.isSetAccum_data()) { optionals.set(6); } if (struct.isSetAccum_depth()) { optionals.set(7); } oprot.writeBitSet(optionals, 8); if (struct.isSetNum_pixel_channels()) { oprot.writeI32(struct.num_pixel_channels); } if (struct.isSetNum_pixel_samples()) { oprot.writeI32(struct.num_pixel_samples); } if (struct.isSetPixels()) { oprot.writeBinary(struct.pixels); } if (struct.isSetRow_ids_A()) { oprot.writeBinary(struct.row_ids_A); } if (struct.isSetRow_ids_B()) { oprot.writeBinary(struct.row_ids_B); } if (struct.isSetTable_ids()) { oprot.writeBinary(struct.table_ids); } if (struct.isSetAccum_data()) { oprot.writeBinary(struct.accum_data); } if (struct.isSetAccum_depth()) { oprot.writeI32(struct.accum_depth); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRawRenderPassDataResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.num_pixel_channels = iprot.readI32(); struct.setNum_pixel_channelsIsSet(true); } if (incoming.get(1)) { struct.num_pixel_samples = iprot.readI32(); struct.setNum_pixel_samplesIsSet(true); } if (incoming.get(2)) { struct.pixels = iprot.readBinary(); struct.setPixelsIsSet(true); } if (incoming.get(3)) { struct.row_ids_A = iprot.readBinary(); struct.setRow_ids_AIsSet(true); } if (incoming.get(4)) { struct.row_ids_B = iprot.readBinary(); struct.setRow_ids_BIsSet(true); } if (incoming.get(5)) { struct.table_ids = iprot.readBinary(); struct.setTable_idsIsSet(true); } if (incoming.get(6)) { struct.accum_data = iprot.readBinary(); struct.setAccum_dataIsSet(true); } if (incoming.get(7)) { struct.accum_depth = iprot.readI32(); struct.setAccum_depthIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRenderDatum.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRenderDatum implements org.apache.thrift.TBase<TRenderDatum, TRenderDatum._Fields>, java.io.Serializable, Cloneable, Comparable<TRenderDatum> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenderDatum"); private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField CNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cnt", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenderDatumStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenderDatumTupleSchemeFactory(); /** * * @see ai.heavy.thrift.server.TDatumType */ public @org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TDatumType type; // required public int cnt; // required public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value; // 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 { /** * * @see ai.heavy.thrift.server.TDatumType */ TYPE((short)1, "type"), CNT((short)2, "cnt"), VALUE((short)3, "value"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // TYPE return TYPE; case 2: // CNT return CNT; case 3: // VALUE return VALUE; 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 __CNT_ISSET_ID = 0; 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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ai.heavy.thrift.server.TDatumType.class))); tmpMap.put(_Fields.CNT, new org.apache.thrift.meta_data.FieldMetaData("cnt", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TRenderDatum.class, metaDataMap); } public TRenderDatum() { } public TRenderDatum( ai.heavy.thrift.server.TDatumType type, int cnt, java.nio.ByteBuffer value) { this(); this.type = type; this.cnt = cnt; setCntIsSet(true); this.value = org.apache.thrift.TBaseHelper.copyBinary(value); } /** * Performs a deep copy on <i>other</i>. */ public TRenderDatum(TRenderDatum other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetType()) { this.type = other.type; } this.cnt = other.cnt; if (other.isSetValue()) { this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); } } public TRenderDatum deepCopy() { return new TRenderDatum(this); } @Override public void clear() { this.type = null; setCntIsSet(false); this.cnt = 0; this.value = null; } /** * * @see ai.heavy.thrift.server.TDatumType */ @org.apache.thrift.annotation.Nullable public ai.heavy.thrift.server.TDatumType getType() { return this.type; } /** * * @see ai.heavy.thrift.server.TDatumType */ public TRenderDatum setType(@org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TDatumType type) { this.type = type; return this; } public void unsetType() { this.type = null; } /** Returns true if field type is set (has been assigned a value) and false otherwise */ public boolean isSetType() { return this.type != null; } public void setTypeIsSet(boolean value) { if (!value) { this.type = null; } } public int getCnt() { return this.cnt; } public TRenderDatum setCnt(int cnt) { this.cnt = cnt; setCntIsSet(true); return this; } public void unsetCnt() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CNT_ISSET_ID); } /** Returns true if field cnt is set (has been assigned a value) and false otherwise */ public boolean isSetCnt() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CNT_ISSET_ID); } public void setCntIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CNT_ISSET_ID, value); } public byte[] getValue() { setValue(org.apache.thrift.TBaseHelper.rightSize(value)); return value == null ? null : value.array(); } public java.nio.ByteBuffer bufferForValue() { return org.apache.thrift.TBaseHelper.copyBinary(value); } public TRenderDatum setValue(byte[] value) { this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone()); return this; } public TRenderDatum setValue(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer value) { this.value = org.apache.thrift.TBaseHelper.copyBinary(value); return this; } public void unsetValue() { this.value = null; } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { return this.value != null; } public void setValueIsSet(boolean value) { if (!value) { this.value = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TYPE: if (value == null) { unsetType(); } else { setType((ai.heavy.thrift.server.TDatumType)value); } break; case CNT: if (value == null) { unsetCnt(); } else { setCnt((java.lang.Integer)value); } break; case VALUE: if (value == null) { unsetValue(); } else { if (value instanceof byte[]) { setValue((byte[])value); } else { setValue((java.nio.ByteBuffer)value); } } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case CNT: return getCnt(); case VALUE: return getValue(); } 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 TYPE: return isSetType(); case CNT: return isSetCnt(); case VALUE: return isSetValue(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRenderDatum) return this.equals((TRenderDatum)that); return false; } public boolean equals(TRenderDatum that) { if (that == null) return false; if (this == that) return true; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } boolean this_present_cnt = true; boolean that_present_cnt = true; if (this_present_cnt || that_present_cnt) { if (!(this_present_cnt && that_present_cnt)) return false; if (this.cnt != that.cnt) return false; } boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); if (this_present_value || that_present_value) { if (!(this_present_value && that_present_value)) return false; if (!this.value.equals(that.value)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); if (isSetType()) hashCode = hashCode * 8191 + type.getValue(); hashCode = hashCode * 8191 + cnt; hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); if (isSetValue()) hashCode = hashCode * 8191 + value.hashCode(); return hashCode; } @Override public int compareTo(TRenderDatum other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType()); if (lastComparison != 0) { return lastComparison; } if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCnt(), other.isSetCnt()); if (lastComparison != 0) { return lastComparison; } if (isSetCnt()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cnt, other.cnt); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue()); if (lastComparison != 0) { return lastComparison; } if (isSetValue()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); 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("TRenderDatum("); boolean first = true; sb.append("type:"); if (this.type == null) { sb.append("null"); } else { sb.append(this.type); } first = false; if (!first) sb.append(", "); sb.append("cnt:"); sb.append(this.cnt); first = false; if (!first) sb.append(", "); sb.append("value:"); if (this.value == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.value, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TRenderDatumStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderDatumStandardScheme getScheme() { return new TRenderDatumStandardScheme(); } } private static class TRenderDatumStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRenderDatum> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenderDatum 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: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = ai.heavy.thrift.server.TDatumType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // CNT if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.cnt = iprot.readI32(); struct.setCntIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // VALUE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.value = iprot.readBinary(); struct.setValueIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRenderDatum struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeI32(struct.type.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(CNT_FIELD_DESC); oprot.writeI32(struct.cnt); oprot.writeFieldEnd(); if (struct.value != null) { oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeBinary(struct.value); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRenderDatumTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderDatumTupleScheme getScheme() { return new TRenderDatumTupleScheme(); } } private static class TRenderDatumTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRenderDatum> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenderDatum struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetType()) { optionals.set(0); } if (struct.isSetCnt()) { optionals.set(1); } if (struct.isSetValue()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetType()) { oprot.writeI32(struct.type.getValue()); } if (struct.isSetCnt()) { oprot.writeI32(struct.cnt); } if (struct.isSetValue()) { oprot.writeBinary(struct.value); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenderDatum struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.type = ai.heavy.thrift.server.TDatumType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } if (incoming.get(1)) { struct.cnt = iprot.readI32(); struct.setCntIsSet(true); } if (incoming.get(2)) { struct.value = iprot.readBinary(); struct.setValueIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRenderParseResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRenderParseResult implements org.apache.thrift.TBase<TRenderParseResult, TRenderParseResult._Fields>, java.io.Serializable, Cloneable, Comparable<TRenderParseResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenderParseResult"); private static final org.apache.thrift.protocol.TField MERGE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("merge_type", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("node_id", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField EXECUTION_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_time_ms", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField RENDER_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("render_time_ms", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField TOTAL_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("total_time_ms", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenderParseResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenderParseResultTupleSchemeFactory(); /** * * @see TMergeType */ public @org.apache.thrift.annotation.Nullable TMergeType merge_type; // required public int node_id; // required public long execution_time_ms; // required public long render_time_ms; // required public long total_time_ms; // 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 { /** * * @see TMergeType */ MERGE_TYPE((short)1, "merge_type"), NODE_ID((short)2, "node_id"), EXECUTION_TIME_MS((short)3, "execution_time_ms"), RENDER_TIME_MS((short)4, "render_time_ms"), TOTAL_TIME_MS((short)5, "total_time_ms"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // MERGE_TYPE return MERGE_TYPE; case 2: // NODE_ID return NODE_ID; case 3: // EXECUTION_TIME_MS return EXECUTION_TIME_MS; case 4: // RENDER_TIME_MS return RENDER_TIME_MS; case 5: // TOTAL_TIME_MS return TOTAL_TIME_MS; 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 __NODE_ID_ISSET_ID = 0; private static final int __EXECUTION_TIME_MS_ISSET_ID = 1; private static final int __RENDER_TIME_MS_ISSET_ID = 2; private static final int __TOTAL_TIME_MS_ISSET_ID = 3; 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.MERGE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("merge_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TMergeType.class))); tmpMap.put(_Fields.NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("node_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.EXECUTION_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("execution_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.RENDER_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("render_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TOTAL_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("total_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenderParseResult.class, metaDataMap); } public TRenderParseResult() { } public TRenderParseResult( TMergeType merge_type, int node_id, long execution_time_ms, long render_time_ms, long total_time_ms) { this(); this.merge_type = merge_type; this.node_id = node_id; setNode_idIsSet(true); this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); this.render_time_ms = render_time_ms; setRender_time_msIsSet(true); this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TRenderParseResult(TRenderParseResult other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetMerge_type()) { this.merge_type = other.merge_type; } this.node_id = other.node_id; this.execution_time_ms = other.execution_time_ms; this.render_time_ms = other.render_time_ms; this.total_time_ms = other.total_time_ms; } public TRenderParseResult deepCopy() { return new TRenderParseResult(this); } @Override public void clear() { this.merge_type = null; setNode_idIsSet(false); this.node_id = 0; setExecution_time_msIsSet(false); this.execution_time_ms = 0; setRender_time_msIsSet(false); this.render_time_ms = 0; setTotal_time_msIsSet(false); this.total_time_ms = 0; } /** * * @see TMergeType */ @org.apache.thrift.annotation.Nullable public TMergeType getMerge_type() { return this.merge_type; } /** * * @see TMergeType */ public TRenderParseResult setMerge_type(@org.apache.thrift.annotation.Nullable TMergeType merge_type) { this.merge_type = merge_type; return this; } public void unsetMerge_type() { this.merge_type = null; } /** Returns true if field merge_type is set (has been assigned a value) and false otherwise */ public boolean isSetMerge_type() { return this.merge_type != null; } public void setMerge_typeIsSet(boolean value) { if (!value) { this.merge_type = null; } } public int getNode_id() { return this.node_id; } public TRenderParseResult setNode_id(int node_id) { this.node_id = node_id; setNode_idIsSet(true); return this; } public void unsetNode_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NODE_ID_ISSET_ID); } /** Returns true if field node_id is set (has been assigned a value) and false otherwise */ public boolean isSetNode_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NODE_ID_ISSET_ID); } public void setNode_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NODE_ID_ISSET_ID, value); } public long getExecution_time_ms() { return this.execution_time_ms; } public TRenderParseResult setExecution_time_ms(long execution_time_ms) { this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); return this; } public void unsetExecution_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } /** Returns true if field execution_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetExecution_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } public void setExecution_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID, value); } public long getRender_time_ms() { return this.render_time_ms; } public TRenderParseResult setRender_time_ms(long render_time_ms) { this.render_time_ms = render_time_ms; setRender_time_msIsSet(true); return this; } public void unsetRender_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID); } /** Returns true if field render_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetRender_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID); } public void setRender_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID, value); } public long getTotal_time_ms() { return this.total_time_ms; } public TRenderParseResult setTotal_time_ms(long total_time_ms) { this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); return this; } public void unsetTotal_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } /** Returns true if field total_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetTotal_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } public void setTotal_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case MERGE_TYPE: if (value == null) { unsetMerge_type(); } else { setMerge_type((TMergeType)value); } break; case NODE_ID: if (value == null) { unsetNode_id(); } else { setNode_id((java.lang.Integer)value); } break; case EXECUTION_TIME_MS: if (value == null) { unsetExecution_time_ms(); } else { setExecution_time_ms((java.lang.Long)value); } break; case RENDER_TIME_MS: if (value == null) { unsetRender_time_ms(); } else { setRender_time_ms((java.lang.Long)value); } break; case TOTAL_TIME_MS: if (value == null) { unsetTotal_time_ms(); } else { setTotal_time_ms((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MERGE_TYPE: return getMerge_type(); case NODE_ID: return getNode_id(); case EXECUTION_TIME_MS: return getExecution_time_ms(); case RENDER_TIME_MS: return getRender_time_ms(); case TOTAL_TIME_MS: return getTotal_time_ms(); } 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 MERGE_TYPE: return isSetMerge_type(); case NODE_ID: return isSetNode_id(); case EXECUTION_TIME_MS: return isSetExecution_time_ms(); case RENDER_TIME_MS: return isSetRender_time_ms(); case TOTAL_TIME_MS: return isSetTotal_time_ms(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRenderParseResult) return this.equals((TRenderParseResult)that); return false; } public boolean equals(TRenderParseResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_merge_type = true && this.isSetMerge_type(); boolean that_present_merge_type = true && that.isSetMerge_type(); if (this_present_merge_type || that_present_merge_type) { if (!(this_present_merge_type && that_present_merge_type)) return false; if (!this.merge_type.equals(that.merge_type)) return false; } boolean this_present_node_id = true; boolean that_present_node_id = true; if (this_present_node_id || that_present_node_id) { if (!(this_present_node_id && that_present_node_id)) return false; if (this.node_id != that.node_id) return false; } boolean this_present_execution_time_ms = true; boolean that_present_execution_time_ms = true; if (this_present_execution_time_ms || that_present_execution_time_ms) { if (!(this_present_execution_time_ms && that_present_execution_time_ms)) return false; if (this.execution_time_ms != that.execution_time_ms) return false; } boolean this_present_render_time_ms = true; boolean that_present_render_time_ms = true; if (this_present_render_time_ms || that_present_render_time_ms) { if (!(this_present_render_time_ms && that_present_render_time_ms)) return false; if (this.render_time_ms != that.render_time_ms) return false; } boolean this_present_total_time_ms = true; boolean that_present_total_time_ms = true; if (this_present_total_time_ms || that_present_total_time_ms) { if (!(this_present_total_time_ms && that_present_total_time_ms)) return false; if (this.total_time_ms != that.total_time_ms) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetMerge_type()) ? 131071 : 524287); if (isSetMerge_type()) hashCode = hashCode * 8191 + merge_type.getValue(); hashCode = hashCode * 8191 + node_id; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(execution_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(render_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(total_time_ms); return hashCode; } @Override public int compareTo(TRenderParseResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetMerge_type(), other.isSetMerge_type()); if (lastComparison != 0) { return lastComparison; } if (isSetMerge_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merge_type, other.merge_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNode_id(), other.isSetNode_id()); if (lastComparison != 0) { return lastComparison; } if (isSetNode_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.node_id, other.node_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExecution_time_ms(), other.isSetExecution_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetExecution_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_time_ms, other.execution_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRender_time_ms(), other.isSetRender_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetRender_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.render_time_ms, other.render_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTotal_time_ms(), other.isSetTotal_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetTotal_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_time_ms, other.total_time_ms); 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("TRenderParseResult("); boolean first = true; sb.append("merge_type:"); if (this.merge_type == null) { sb.append("null"); } else { sb.append(this.merge_type); } first = false; if (!first) sb.append(", "); sb.append("node_id:"); sb.append(this.node_id); first = false; if (!first) sb.append(", "); sb.append("execution_time_ms:"); sb.append(this.execution_time_ms); first = false; if (!first) sb.append(", "); sb.append("render_time_ms:"); sb.append(this.render_time_ms); first = false; if (!first) sb.append(", "); sb.append("total_time_ms:"); sb.append(this.total_time_ms); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TRenderParseResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderParseResultStandardScheme getScheme() { return new TRenderParseResultStandardScheme(); } } private static class TRenderParseResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRenderParseResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenderParseResult 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: // MERGE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.merge_type = ai.heavy.thrift.server.TMergeType.findByValue(iprot.readI32()); struct.setMerge_typeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NODE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.node_id = iprot.readI32(); struct.setNode_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // EXECUTION_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // RENDER_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.render_time_ms = iprot.readI64(); struct.setRender_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // TOTAL_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRenderParseResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.merge_type != null) { oprot.writeFieldBegin(MERGE_TYPE_FIELD_DESC); oprot.writeI32(struct.merge_type.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(NODE_ID_FIELD_DESC); oprot.writeI32(struct.node_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(EXECUTION_TIME_MS_FIELD_DESC); oprot.writeI64(struct.execution_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(RENDER_TIME_MS_FIELD_DESC); oprot.writeI64(struct.render_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(TOTAL_TIME_MS_FIELD_DESC); oprot.writeI64(struct.total_time_ms); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRenderParseResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderParseResultTupleScheme getScheme() { return new TRenderParseResultTupleScheme(); } } private static class TRenderParseResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRenderParseResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenderParseResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetMerge_type()) { optionals.set(0); } if (struct.isSetNode_id()) { optionals.set(1); } if (struct.isSetExecution_time_ms()) { optionals.set(2); } if (struct.isSetRender_time_ms()) { optionals.set(3); } if (struct.isSetTotal_time_ms()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetMerge_type()) { oprot.writeI32(struct.merge_type.getValue()); } if (struct.isSetNode_id()) { oprot.writeI32(struct.node_id); } if (struct.isSetExecution_time_ms()) { oprot.writeI64(struct.execution_time_ms); } if (struct.isSetRender_time_ms()) { oprot.writeI64(struct.render_time_ms); } if (struct.isSetTotal_time_ms()) { oprot.writeI64(struct.total_time_ms); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenderParseResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.merge_type = ai.heavy.thrift.server.TMergeType.findByValue(iprot.readI32()); struct.setMerge_typeIsSet(true); } if (incoming.get(1)) { struct.node_id = iprot.readI32(); struct.setNode_idIsSet(true); } if (incoming.get(2)) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } if (incoming.get(3)) { struct.render_time_ms = iprot.readI64(); struct.setRender_time_msIsSet(true); } if (incoming.get(4)) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRenderResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRenderResult implements org.apache.thrift.TBase<TRenderResult, TRenderResult._Fields>, java.io.Serializable, Cloneable, Comparable<TRenderResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenderResult"); private static final org.apache.thrift.protocol.TField IMAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("image", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField NONCE_FIELD_DESC = new org.apache.thrift.protocol.TField("nonce", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField EXECUTION_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_time_ms", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField RENDER_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("render_time_ms", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField TOTAL_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("total_time_ms", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField VEGA_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("vega_metadata", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenderResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenderResultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer image; // required public @org.apache.thrift.annotation.Nullable java.lang.String nonce; // required public long execution_time_ms; // required public long render_time_ms; // required public long total_time_ms; // required public @org.apache.thrift.annotation.Nullable java.lang.String vega_metadata; // 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 { IMAGE((short)1, "image"), NONCE((short)2, "nonce"), EXECUTION_TIME_MS((short)3, "execution_time_ms"), RENDER_TIME_MS((short)4, "render_time_ms"), TOTAL_TIME_MS((short)5, "total_time_ms"), VEGA_METADATA((short)6, "vega_metadata"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // IMAGE return IMAGE; case 2: // NONCE return NONCE; case 3: // EXECUTION_TIME_MS return EXECUTION_TIME_MS; case 4: // RENDER_TIME_MS return RENDER_TIME_MS; case 5: // TOTAL_TIME_MS return TOTAL_TIME_MS; case 6: // VEGA_METADATA return VEGA_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 __EXECUTION_TIME_MS_ISSET_ID = 0; private static final int __RENDER_TIME_MS_ISSET_ID = 1; private static final int __TOTAL_TIME_MS_ISSET_ID = 2; 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.IMAGE, new org.apache.thrift.meta_data.FieldMetaData("image", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.NONCE, new org.apache.thrift.meta_data.FieldMetaData("nonce", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.EXECUTION_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("execution_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.RENDER_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("render_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TOTAL_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("total_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.VEGA_METADATA, new org.apache.thrift.meta_data.FieldMetaData("vega_metadata", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TRenderResult.class, metaDataMap); } public TRenderResult() { } public TRenderResult( java.nio.ByteBuffer image, java.lang.String nonce, long execution_time_ms, long render_time_ms, long total_time_ms, java.lang.String vega_metadata) { this(); this.image = org.apache.thrift.TBaseHelper.copyBinary(image); this.nonce = nonce; this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); this.render_time_ms = render_time_ms; setRender_time_msIsSet(true); this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); this.vega_metadata = vega_metadata; } /** * Performs a deep copy on <i>other</i>. */ public TRenderResult(TRenderResult other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetImage()) { this.image = org.apache.thrift.TBaseHelper.copyBinary(other.image); } if (other.isSetNonce()) { this.nonce = other.nonce; } this.execution_time_ms = other.execution_time_ms; this.render_time_ms = other.render_time_ms; this.total_time_ms = other.total_time_ms; if (other.isSetVega_metadata()) { this.vega_metadata = other.vega_metadata; } } public TRenderResult deepCopy() { return new TRenderResult(this); } @Override public void clear() { this.image = null; this.nonce = null; setExecution_time_msIsSet(false); this.execution_time_ms = 0; setRender_time_msIsSet(false); this.render_time_ms = 0; setTotal_time_msIsSet(false); this.total_time_ms = 0; this.vega_metadata = null; } public byte[] getImage() { setImage(org.apache.thrift.TBaseHelper.rightSize(image)); return image == null ? null : image.array(); } public java.nio.ByteBuffer bufferForImage() { return org.apache.thrift.TBaseHelper.copyBinary(image); } public TRenderResult setImage(byte[] image) { this.image = image == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(image.clone()); return this; } public TRenderResult setImage(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer image) { this.image = org.apache.thrift.TBaseHelper.copyBinary(image); return this; } public void unsetImage() { this.image = null; } /** Returns true if field image is set (has been assigned a value) and false otherwise */ public boolean isSetImage() { return this.image != null; } public void setImageIsSet(boolean value) { if (!value) { this.image = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getNonce() { return this.nonce; } public TRenderResult setNonce(@org.apache.thrift.annotation.Nullable java.lang.String nonce) { this.nonce = nonce; return this; } public void unsetNonce() { this.nonce = null; } /** Returns true if field nonce is set (has been assigned a value) and false otherwise */ public boolean isSetNonce() { return this.nonce != null; } public void setNonceIsSet(boolean value) { if (!value) { this.nonce = null; } } public long getExecution_time_ms() { return this.execution_time_ms; } public TRenderResult setExecution_time_ms(long execution_time_ms) { this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); return this; } public void unsetExecution_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } /** Returns true if field execution_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetExecution_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } public void setExecution_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID, value); } public long getRender_time_ms() { return this.render_time_ms; } public TRenderResult setRender_time_ms(long render_time_ms) { this.render_time_ms = render_time_ms; setRender_time_msIsSet(true); return this; } public void unsetRender_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID); } /** Returns true if field render_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetRender_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID); } public void setRender_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID, value); } public long getTotal_time_ms() { return this.total_time_ms; } public TRenderResult setTotal_time_ms(long total_time_ms) { this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); return this; } public void unsetTotal_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } /** Returns true if field total_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetTotal_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } public void setTotal_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getVega_metadata() { return this.vega_metadata; } public TRenderResult setVega_metadata(@org.apache.thrift.annotation.Nullable java.lang.String vega_metadata) { this.vega_metadata = vega_metadata; return this; } public void unsetVega_metadata() { this.vega_metadata = null; } /** Returns true if field vega_metadata is set (has been assigned a value) and false otherwise */ public boolean isSetVega_metadata() { return this.vega_metadata != null; } public void setVega_metadataIsSet(boolean value) { if (!value) { this.vega_metadata = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case IMAGE: if (value == null) { unsetImage(); } else { if (value instanceof byte[]) { setImage((byte[])value); } else { setImage((java.nio.ByteBuffer)value); } } break; case NONCE: if (value == null) { unsetNonce(); } else { setNonce((java.lang.String)value); } break; case EXECUTION_TIME_MS: if (value == null) { unsetExecution_time_ms(); } else { setExecution_time_ms((java.lang.Long)value); } break; case RENDER_TIME_MS: if (value == null) { unsetRender_time_ms(); } else { setRender_time_ms((java.lang.Long)value); } break; case TOTAL_TIME_MS: if (value == null) { unsetTotal_time_ms(); } else { setTotal_time_ms((java.lang.Long)value); } break; case VEGA_METADATA: if (value == null) { unsetVega_metadata(); } else { setVega_metadata((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case IMAGE: return getImage(); case NONCE: return getNonce(); case EXECUTION_TIME_MS: return getExecution_time_ms(); case RENDER_TIME_MS: return getRender_time_ms(); case TOTAL_TIME_MS: return getTotal_time_ms(); case VEGA_METADATA: return getVega_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 IMAGE: return isSetImage(); case NONCE: return isSetNonce(); case EXECUTION_TIME_MS: return isSetExecution_time_ms(); case RENDER_TIME_MS: return isSetRender_time_ms(); case TOTAL_TIME_MS: return isSetTotal_time_ms(); case VEGA_METADATA: return isSetVega_metadata(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRenderResult) return this.equals((TRenderResult)that); return false; } public boolean equals(TRenderResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_image = true && this.isSetImage(); boolean that_present_image = true && that.isSetImage(); if (this_present_image || that_present_image) { if (!(this_present_image && that_present_image)) return false; if (!this.image.equals(that.image)) return false; } boolean this_present_nonce = true && this.isSetNonce(); boolean that_present_nonce = true && that.isSetNonce(); if (this_present_nonce || that_present_nonce) { if (!(this_present_nonce && that_present_nonce)) return false; if (!this.nonce.equals(that.nonce)) return false; } boolean this_present_execution_time_ms = true; boolean that_present_execution_time_ms = true; if (this_present_execution_time_ms || that_present_execution_time_ms) { if (!(this_present_execution_time_ms && that_present_execution_time_ms)) return false; if (this.execution_time_ms != that.execution_time_ms) return false; } boolean this_present_render_time_ms = true; boolean that_present_render_time_ms = true; if (this_present_render_time_ms || that_present_render_time_ms) { if (!(this_present_render_time_ms && that_present_render_time_ms)) return false; if (this.render_time_ms != that.render_time_ms) return false; } boolean this_present_total_time_ms = true; boolean that_present_total_time_ms = true; if (this_present_total_time_ms || that_present_total_time_ms) { if (!(this_present_total_time_ms && that_present_total_time_ms)) return false; if (this.total_time_ms != that.total_time_ms) return false; } boolean this_present_vega_metadata = true && this.isSetVega_metadata(); boolean that_present_vega_metadata = true && that.isSetVega_metadata(); if (this_present_vega_metadata || that_present_vega_metadata) { if (!(this_present_vega_metadata && that_present_vega_metadata)) return false; if (!this.vega_metadata.equals(that.vega_metadata)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetImage()) ? 131071 : 524287); if (isSetImage()) hashCode = hashCode * 8191 + image.hashCode(); hashCode = hashCode * 8191 + ((isSetNonce()) ? 131071 : 524287); if (isSetNonce()) hashCode = hashCode * 8191 + nonce.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(execution_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(render_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(total_time_ms); hashCode = hashCode * 8191 + ((isSetVega_metadata()) ? 131071 : 524287); if (isSetVega_metadata()) hashCode = hashCode * 8191 + vega_metadata.hashCode(); return hashCode; } @Override public int compareTo(TRenderResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetImage(), other.isSetImage()); if (lastComparison != 0) { return lastComparison; } if (isSetImage()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image, other.image); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNonce(), other.isSetNonce()); if (lastComparison != 0) { return lastComparison; } if (isSetNonce()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonce, other.nonce); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExecution_time_ms(), other.isSetExecution_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetExecution_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_time_ms, other.execution_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRender_time_ms(), other.isSetRender_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetRender_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.render_time_ms, other.render_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTotal_time_ms(), other.isSetTotal_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetTotal_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_time_ms, other.total_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetVega_metadata(), other.isSetVega_metadata()); if (lastComparison != 0) { return lastComparison; } if (isSetVega_metadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vega_metadata, other.vega_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("TRenderResult("); boolean first = true; sb.append("image:"); if (this.image == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.image, sb); } first = false; if (!first) sb.append(", "); sb.append("nonce:"); if (this.nonce == null) { sb.append("null"); } else { sb.append(this.nonce); } first = false; if (!first) sb.append(", "); sb.append("execution_time_ms:"); sb.append(this.execution_time_ms); first = false; if (!first) sb.append(", "); sb.append("render_time_ms:"); sb.append(this.render_time_ms); first = false; if (!first) sb.append(", "); sb.append("total_time_ms:"); sb.append(this.total_time_ms); first = false; if (!first) sb.append(", "); sb.append("vega_metadata:"); if (this.vega_metadata == null) { sb.append("null"); } else { sb.append(this.vega_metadata); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TRenderResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderResultStandardScheme getScheme() { return new TRenderResultStandardScheme(); } } private static class TRenderResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRenderResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenderResult 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: // IMAGE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.image = iprot.readBinary(); struct.setImageIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NONCE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nonce = iprot.readString(); struct.setNonceIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // EXECUTION_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // RENDER_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.render_time_ms = iprot.readI64(); struct.setRender_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // TOTAL_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // VEGA_METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.vega_metadata = iprot.readString(); struct.setVega_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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRenderResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.image != null) { oprot.writeFieldBegin(IMAGE_FIELD_DESC); oprot.writeBinary(struct.image); oprot.writeFieldEnd(); } if (struct.nonce != null) { oprot.writeFieldBegin(NONCE_FIELD_DESC); oprot.writeString(struct.nonce); oprot.writeFieldEnd(); } oprot.writeFieldBegin(EXECUTION_TIME_MS_FIELD_DESC); oprot.writeI64(struct.execution_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(RENDER_TIME_MS_FIELD_DESC); oprot.writeI64(struct.render_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(TOTAL_TIME_MS_FIELD_DESC); oprot.writeI64(struct.total_time_ms); oprot.writeFieldEnd(); if (struct.vega_metadata != null) { oprot.writeFieldBegin(VEGA_METADATA_FIELD_DESC); oprot.writeString(struct.vega_metadata); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRenderResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderResultTupleScheme getScheme() { return new TRenderResultTupleScheme(); } } private static class TRenderResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRenderResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenderResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetImage()) { optionals.set(0); } if (struct.isSetNonce()) { optionals.set(1); } if (struct.isSetExecution_time_ms()) { optionals.set(2); } if (struct.isSetRender_time_ms()) { optionals.set(3); } if (struct.isSetTotal_time_ms()) { optionals.set(4); } if (struct.isSetVega_metadata()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetImage()) { oprot.writeBinary(struct.image); } if (struct.isSetNonce()) { oprot.writeString(struct.nonce); } if (struct.isSetExecution_time_ms()) { oprot.writeI64(struct.execution_time_ms); } if (struct.isSetRender_time_ms()) { oprot.writeI64(struct.render_time_ms); } if (struct.isSetTotal_time_ms()) { oprot.writeI64(struct.total_time_ms); } if (struct.isSetVega_metadata()) { oprot.writeString(struct.vega_metadata); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenderResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.image = iprot.readBinary(); struct.setImageIsSet(true); } if (incoming.get(1)) { struct.nonce = iprot.readString(); struct.setNonceIsSet(true); } if (incoming.get(2)) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } if (incoming.get(3)) { struct.render_time_ms = iprot.readI64(); struct.setRender_time_msIsSet(true); } if (incoming.get(4)) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(true); } if (incoming.get(5)) { struct.vega_metadata = iprot.readString(); struct.setVega_metadataIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRenderStepResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRenderStepResult implements org.apache.thrift.TBase<TRenderStepResult, TRenderStepResult._Fields>, java.io.Serializable, Cloneable, Comparable<TRenderStepResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenderStepResult"); private static final org.apache.thrift.protocol.TField MERGE_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("merge_data", org.apache.thrift.protocol.TType.MAP, (short)1); private static final org.apache.thrift.protocol.TField RAW_PIXEL_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("raw_pixel_data", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField EXECUTION_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_time_ms", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField RENDER_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("render_time_ms", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField TOTAL_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("total_time_ms", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenderStepResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenderStepResultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> merge_data; // required public @org.apache.thrift.annotation.Nullable TRawPixelData raw_pixel_data; // required public long execution_time_ms; // required public long render_time_ms; // required public long total_time_ms; // 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 { MERGE_DATA((short)1, "merge_data"), RAW_PIXEL_DATA((short)2, "raw_pixel_data"), EXECUTION_TIME_MS((short)3, "execution_time_ms"), RENDER_TIME_MS((short)4, "render_time_ms"), TOTAL_TIME_MS((short)5, "total_time_ms"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // MERGE_DATA return MERGE_DATA; case 2: // RAW_PIXEL_DATA return RAW_PIXEL_DATA; case 3: // EXECUTION_TIME_MS return EXECUTION_TIME_MS; case 4: // RENDER_TIME_MS return RENDER_TIME_MS; case 5: // TOTAL_TIME_MS return TOTAL_TIME_MS; 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 __EXECUTION_TIME_MS_ISSET_ID = 0; private static final int __RENDER_TIME_MS_ISSET_ID = 1; private static final int __TOTAL_TIME_MS_ISSET_ID = 2; 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.MERGE_DATA, new org.apache.thrift.meta_data.FieldMetaData("merge_data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.MAP , "TRenderAggDataMap"))); tmpMap.put(_Fields.RAW_PIXEL_DATA, new org.apache.thrift.meta_data.FieldMetaData("raw_pixel_data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRawPixelData.class))); tmpMap.put(_Fields.EXECUTION_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("execution_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.RENDER_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("render_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TOTAL_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("total_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenderStepResult.class, metaDataMap); } public TRenderStepResult() { } public TRenderStepResult( java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> merge_data, TRawPixelData raw_pixel_data, long execution_time_ms, long render_time_ms, long total_time_ms) { this(); this.merge_data = merge_data; this.raw_pixel_data = raw_pixel_data; this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); this.render_time_ms = render_time_ms; setRender_time_msIsSet(true); this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TRenderStepResult(TRenderStepResult other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetMerge_data()) { java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> __this__merge_data = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>>(other.merge_data.size()); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> other_element : other.merge_data.entrySet()) { java.lang.String other_element_key = other_element.getKey(); java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> other_element_value = other_element.getValue(); java.lang.String __this__merge_data_copy_key = other_element_key; java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> __this__merge_data_copy_value = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>(other_element_value.size()); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> other_element_value_element : other_element_value.entrySet()) { java.lang.String other_element_value_element_key = other_element_value_element.getKey(); java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>> other_element_value_element_value = other_element_value_element.getValue(); java.lang.String __this__merge_data_copy_value_copy_key = other_element_value_element_key; java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>> __this__merge_data_copy_value_copy_value = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>(other_element_value_element_value.size()); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.List<TRenderDatum>>> other_element_value_element_value_element : other_element_value_element_value.entrySet()) { java.lang.String other_element_value_element_value_element_key = other_element_value_element_value_element.getKey(); java.util.Map<java.lang.String,java.util.List<TRenderDatum>> other_element_value_element_value_element_value = other_element_value_element_value_element.getValue(); java.lang.String __this__merge_data_copy_value_copy_value_copy_key = other_element_value_element_value_element_key; java.util.Map<java.lang.String,java.util.List<TRenderDatum>> __this__merge_data_copy_value_copy_value_copy_value = new java.util.HashMap<java.lang.String,java.util.List<TRenderDatum>>(other_element_value_element_value_element_value.size()); for (java.util.Map.Entry<java.lang.String, java.util.List<TRenderDatum>> other_element_value_element_value_element_value_element : other_element_value_element_value_element_value.entrySet()) { java.lang.String other_element_value_element_value_element_value_element_key = other_element_value_element_value_element_value_element.getKey(); java.util.List<TRenderDatum> other_element_value_element_value_element_value_element_value = other_element_value_element_value_element_value_element.getValue(); java.lang.String __this__merge_data_copy_value_copy_value_copy_value_copy_key = other_element_value_element_value_element_value_element_key; java.util.List<TRenderDatum> __this__merge_data_copy_value_copy_value_copy_value_copy_value = new java.util.ArrayList<TRenderDatum>(other_element_value_element_value_element_value_element_value.size()); for (TRenderDatum other_element_value_element_value_element_value_element_value_element : other_element_value_element_value_element_value_element_value) { __this__merge_data_copy_value_copy_value_copy_value_copy_value.add(new TRenderDatum(other_element_value_element_value_element_value_element_value_element)); } __this__merge_data_copy_value_copy_value_copy_value.put(__this__merge_data_copy_value_copy_value_copy_value_copy_key, __this__merge_data_copy_value_copy_value_copy_value_copy_value); } __this__merge_data_copy_value_copy_value.put(__this__merge_data_copy_value_copy_value_copy_key, __this__merge_data_copy_value_copy_value_copy_value); } __this__merge_data_copy_value.put(__this__merge_data_copy_value_copy_key, __this__merge_data_copy_value_copy_value); } __this__merge_data.put(__this__merge_data_copy_key, __this__merge_data_copy_value); } this.merge_data = __this__merge_data; } if (other.isSetRaw_pixel_data()) { this.raw_pixel_data = new TRawPixelData(other.raw_pixel_data); } this.execution_time_ms = other.execution_time_ms; this.render_time_ms = other.render_time_ms; this.total_time_ms = other.total_time_ms; } public TRenderStepResult deepCopy() { return new TRenderStepResult(this); } @Override public void clear() { this.merge_data = null; this.raw_pixel_data = null; setExecution_time_msIsSet(false); this.execution_time_ms = 0; setRender_time_msIsSet(false); this.render_time_ms = 0; setTotal_time_msIsSet(false); this.total_time_ms = 0; } public int getMerge_dataSize() { return (this.merge_data == null) ? 0 : this.merge_data.size(); } public void putToMerge_data(java.lang.String key, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> val) { if (this.merge_data == null) { this.merge_data = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>>(); } this.merge_data.put(key, val); } @org.apache.thrift.annotation.Nullable public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> getMerge_data() { return this.merge_data; } public TRenderStepResult setMerge_data(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> merge_data) { this.merge_data = merge_data; return this; } public void unsetMerge_data() { this.merge_data = null; } /** Returns true if field merge_data is set (has been assigned a value) and false otherwise */ public boolean isSetMerge_data() { return this.merge_data != null; } public void setMerge_dataIsSet(boolean value) { if (!value) { this.merge_data = null; } } @org.apache.thrift.annotation.Nullable public TRawPixelData getRaw_pixel_data() { return this.raw_pixel_data; } public TRenderStepResult setRaw_pixel_data(@org.apache.thrift.annotation.Nullable TRawPixelData raw_pixel_data) { this.raw_pixel_data = raw_pixel_data; return this; } public void unsetRaw_pixel_data() { this.raw_pixel_data = null; } /** Returns true if field raw_pixel_data is set (has been assigned a value) and false otherwise */ public boolean isSetRaw_pixel_data() { return this.raw_pixel_data != null; } public void setRaw_pixel_dataIsSet(boolean value) { if (!value) { this.raw_pixel_data = null; } } public long getExecution_time_ms() { return this.execution_time_ms; } public TRenderStepResult setExecution_time_ms(long execution_time_ms) { this.execution_time_ms = execution_time_ms; setExecution_time_msIsSet(true); return this; } public void unsetExecution_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } /** Returns true if field execution_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetExecution_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID); } public void setExecution_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTION_TIME_MS_ISSET_ID, value); } public long getRender_time_ms() { return this.render_time_ms; } public TRenderStepResult setRender_time_ms(long render_time_ms) { this.render_time_ms = render_time_ms; setRender_time_msIsSet(true); return this; } public void unsetRender_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID); } /** Returns true if field render_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetRender_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID); } public void setRender_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RENDER_TIME_MS_ISSET_ID, value); } public long getTotal_time_ms() { return this.total_time_ms; } public TRenderStepResult setTotal_time_ms(long total_time_ms) { this.total_time_ms = total_time_ms; setTotal_time_msIsSet(true); return this; } public void unsetTotal_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } /** Returns true if field total_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetTotal_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID); } public void setTotal_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TOTAL_TIME_MS_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case MERGE_DATA: if (value == null) { unsetMerge_data(); } else { setMerge_data((java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>>)value); } break; case RAW_PIXEL_DATA: if (value == null) { unsetRaw_pixel_data(); } else { setRaw_pixel_data((TRawPixelData)value); } break; case EXECUTION_TIME_MS: if (value == null) { unsetExecution_time_ms(); } else { setExecution_time_ms((java.lang.Long)value); } break; case RENDER_TIME_MS: if (value == null) { unsetRender_time_ms(); } else { setRender_time_ms((java.lang.Long)value); } break; case TOTAL_TIME_MS: if (value == null) { unsetTotal_time_ms(); } else { setTotal_time_ms((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MERGE_DATA: return getMerge_data(); case RAW_PIXEL_DATA: return getRaw_pixel_data(); case EXECUTION_TIME_MS: return getExecution_time_ms(); case RENDER_TIME_MS: return getRender_time_ms(); case TOTAL_TIME_MS: return getTotal_time_ms(); } 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 MERGE_DATA: return isSetMerge_data(); case RAW_PIXEL_DATA: return isSetRaw_pixel_data(); case EXECUTION_TIME_MS: return isSetExecution_time_ms(); case RENDER_TIME_MS: return isSetRender_time_ms(); case TOTAL_TIME_MS: return isSetTotal_time_ms(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRenderStepResult) return this.equals((TRenderStepResult)that); return false; } public boolean equals(TRenderStepResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_merge_data = true && this.isSetMerge_data(); boolean that_present_merge_data = true && that.isSetMerge_data(); if (this_present_merge_data || that_present_merge_data) { if (!(this_present_merge_data && that_present_merge_data)) return false; if (!this.merge_data.equals(that.merge_data)) return false; } boolean this_present_raw_pixel_data = true && this.isSetRaw_pixel_data(); boolean that_present_raw_pixel_data = true && that.isSetRaw_pixel_data(); if (this_present_raw_pixel_data || that_present_raw_pixel_data) { if (!(this_present_raw_pixel_data && that_present_raw_pixel_data)) return false; if (!this.raw_pixel_data.equals(that.raw_pixel_data)) return false; } boolean this_present_execution_time_ms = true; boolean that_present_execution_time_ms = true; if (this_present_execution_time_ms || that_present_execution_time_ms) { if (!(this_present_execution_time_ms && that_present_execution_time_ms)) return false; if (this.execution_time_ms != that.execution_time_ms) return false; } boolean this_present_render_time_ms = true; boolean that_present_render_time_ms = true; if (this_present_render_time_ms || that_present_render_time_ms) { if (!(this_present_render_time_ms && that_present_render_time_ms)) return false; if (this.render_time_ms != that.render_time_ms) return false; } boolean this_present_total_time_ms = true; boolean that_present_total_time_ms = true; if (this_present_total_time_ms || that_present_total_time_ms) { if (!(this_present_total_time_ms && that_present_total_time_ms)) return false; if (this.total_time_ms != that.total_time_ms) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetMerge_data()) ? 131071 : 524287); if (isSetMerge_data()) hashCode = hashCode * 8191 + merge_data.hashCode(); hashCode = hashCode * 8191 + ((isSetRaw_pixel_data()) ? 131071 : 524287); if (isSetRaw_pixel_data()) hashCode = hashCode * 8191 + raw_pixel_data.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(execution_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(render_time_ms); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(total_time_ms); return hashCode; } @Override public int compareTo(TRenderStepResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetMerge_data(), other.isSetMerge_data()); if (lastComparison != 0) { return lastComparison; } if (isSetMerge_data()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merge_data, other.merge_data); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRaw_pixel_data(), other.isSetRaw_pixel_data()); if (lastComparison != 0) { return lastComparison; } if (isSetRaw_pixel_data()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.raw_pixel_data, other.raw_pixel_data); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExecution_time_ms(), other.isSetExecution_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetExecution_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_time_ms, other.execution_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRender_time_ms(), other.isSetRender_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetRender_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.render_time_ms, other.render_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTotal_time_ms(), other.isSetTotal_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetTotal_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_time_ms, other.total_time_ms); 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("TRenderStepResult("); boolean first = true; sb.append("merge_data:"); if (this.merge_data == null) { sb.append("null"); } else { sb.append(this.merge_data); } first = false; if (!first) sb.append(", "); sb.append("raw_pixel_data:"); if (this.raw_pixel_data == null) { sb.append("null"); } else { sb.append(this.raw_pixel_data); } first = false; if (!first) sb.append(", "); sb.append("execution_time_ms:"); sb.append(this.execution_time_ms); first = false; if (!first) sb.append(", "); sb.append("render_time_ms:"); sb.append(this.render_time_ms); first = false; if (!first) sb.append(", "); sb.append("total_time_ms:"); sb.append(this.total_time_ms); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (raw_pixel_data != null) { raw_pixel_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 TRenderStepResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderStepResultStandardScheme getScheme() { return new TRenderStepResultStandardScheme(); } } private static class TRenderStepResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRenderStepResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenderStepResult 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: // MERGE_DATA if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map250 = iprot.readMapBegin(); struct.merge_data = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>>(2*_map250.size); @org.apache.thrift.annotation.Nullable java.lang.String _key251; @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> _val252; for (int _i253 = 0; _i253 < _map250.size; ++_i253) { _key251 = iprot.readString(); { org.apache.thrift.protocol.TMap _map254 = iprot.readMapBegin(); _val252 = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>(2*_map254.size); @org.apache.thrift.annotation.Nullable java.lang.String _key255; @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>> _val256; for (int _i257 = 0; _i257 < _map254.size; ++_i257) { _key255 = iprot.readString(); { org.apache.thrift.protocol.TMap _map258 = iprot.readMapBegin(); _val256 = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>(2*_map258.size); @org.apache.thrift.annotation.Nullable java.lang.String _key259; @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.List<TRenderDatum>> _val260; for (int _i261 = 0; _i261 < _map258.size; ++_i261) { _key259 = iprot.readString(); { org.apache.thrift.protocol.TMap _map262 = iprot.readMapBegin(); _val260 = new java.util.HashMap<java.lang.String,java.util.List<TRenderDatum>>(2*_map262.size); @org.apache.thrift.annotation.Nullable java.lang.String _key263; @org.apache.thrift.annotation.Nullable java.util.List<TRenderDatum> _val264; for (int _i265 = 0; _i265 < _map262.size; ++_i265) { _key263 = iprot.readString(); { org.apache.thrift.protocol.TList _list266 = iprot.readListBegin(); _val264 = new java.util.ArrayList<TRenderDatum>(_list266.size); @org.apache.thrift.annotation.Nullable TRenderDatum _elem267; for (int _i268 = 0; _i268 < _list266.size; ++_i268) { _elem267 = new TRenderDatum(); _elem267.read(iprot); _val264.add(_elem267); } iprot.readListEnd(); } _val260.put(_key263, _val264); } iprot.readMapEnd(); } _val256.put(_key259, _val260); } iprot.readMapEnd(); } _val252.put(_key255, _val256); } iprot.readMapEnd(); } struct.merge_data.put(_key251, _val252); } iprot.readMapEnd(); } struct.setMerge_dataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // RAW_PIXEL_DATA if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.raw_pixel_data = new TRawPixelData(); struct.raw_pixel_data.read(iprot); struct.setRaw_pixel_dataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // EXECUTION_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // RENDER_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.render_time_ms = iprot.readI64(); struct.setRender_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // TOTAL_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRenderStepResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.merge_data != null) { oprot.writeFieldBegin(MERGE_DATA_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.merge_data.size())); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> _iter269 : struct.merge_data.entrySet()) { oprot.writeString(_iter269.getKey()); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, _iter269.getValue().size())); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> _iter270 : _iter269.getValue().entrySet()) { oprot.writeString(_iter270.getKey()); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, _iter270.getValue().size())); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.List<TRenderDatum>>> _iter271 : _iter270.getValue().entrySet()) { oprot.writeString(_iter271.getKey()); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, _iter271.getValue().size())); for (java.util.Map.Entry<java.lang.String, java.util.List<TRenderDatum>> _iter272 : _iter271.getValue().entrySet()) { oprot.writeString(_iter272.getKey()); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter272.getValue().size())); for (TRenderDatum _iter273 : _iter272.getValue()) { _iter273.write(oprot); } oprot.writeListEnd(); } } oprot.writeMapEnd(); } } oprot.writeMapEnd(); } } oprot.writeMapEnd(); } } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (struct.raw_pixel_data != null) { oprot.writeFieldBegin(RAW_PIXEL_DATA_FIELD_DESC); struct.raw_pixel_data.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(EXECUTION_TIME_MS_FIELD_DESC); oprot.writeI64(struct.execution_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(RENDER_TIME_MS_FIELD_DESC); oprot.writeI64(struct.render_time_ms); oprot.writeFieldEnd(); oprot.writeFieldBegin(TOTAL_TIME_MS_FIELD_DESC); oprot.writeI64(struct.total_time_ms); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRenderStepResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenderStepResultTupleScheme getScheme() { return new TRenderStepResultTupleScheme(); } } private static class TRenderStepResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRenderStepResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenderStepResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetMerge_data()) { optionals.set(0); } if (struct.isSetRaw_pixel_data()) { optionals.set(1); } if (struct.isSetExecution_time_ms()) { optionals.set(2); } if (struct.isSetRender_time_ms()) { optionals.set(3); } if (struct.isSetTotal_time_ms()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetMerge_data()) { { oprot.writeI32(struct.merge_data.size()); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>> _iter274 : struct.merge_data.entrySet()) { oprot.writeString(_iter274.getKey()); { oprot.writeI32(_iter274.getValue().size()); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> _iter275 : _iter274.getValue().entrySet()) { oprot.writeString(_iter275.getKey()); { oprot.writeI32(_iter275.getValue().size()); for (java.util.Map.Entry<java.lang.String, java.util.Map<java.lang.String,java.util.List<TRenderDatum>>> _iter276 : _iter275.getValue().entrySet()) { oprot.writeString(_iter276.getKey()); { oprot.writeI32(_iter276.getValue().size()); for (java.util.Map.Entry<java.lang.String, java.util.List<TRenderDatum>> _iter277 : _iter276.getValue().entrySet()) { oprot.writeString(_iter277.getKey()); { oprot.writeI32(_iter277.getValue().size()); for (TRenderDatum _iter278 : _iter277.getValue()) { _iter278.write(oprot); } } } } } } } } } } } if (struct.isSetRaw_pixel_data()) { struct.raw_pixel_data.write(oprot); } if (struct.isSetExecution_time_ms()) { oprot.writeI64(struct.execution_time_ms); } if (struct.isSetRender_time_ms()) { oprot.writeI64(struct.render_time_ms); } if (struct.isSetTotal_time_ms()) { oprot.writeI64(struct.total_time_ms); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenderStepResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map279 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP); struct.merge_data = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>>(2*_map279.size); @org.apache.thrift.annotation.Nullable java.lang.String _key280; @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>> _val281; for (int _i282 = 0; _i282 < _map279.size; ++_i282) { _key280 = iprot.readString(); { org.apache.thrift.protocol.TMap _map283 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP); _val281 = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>>(2*_map283.size); @org.apache.thrift.annotation.Nullable java.lang.String _key284; @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>> _val285; for (int _i286 = 0; _i286 < _map283.size; ++_i286) { _key284 = iprot.readString(); { org.apache.thrift.protocol.TMap _map287 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP); _val285 = new java.util.HashMap<java.lang.String,java.util.Map<java.lang.String,java.util.List<TRenderDatum>>>(2*_map287.size); @org.apache.thrift.annotation.Nullable java.lang.String _key288; @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.util.List<TRenderDatum>> _val289; for (int _i290 = 0; _i290 < _map287.size; ++_i290) { _key288 = iprot.readString(); { org.apache.thrift.protocol.TMap _map291 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST); _val289 = new java.util.HashMap<java.lang.String,java.util.List<TRenderDatum>>(2*_map291.size); @org.apache.thrift.annotation.Nullable java.lang.String _key292; @org.apache.thrift.annotation.Nullable java.util.List<TRenderDatum> _val293; for (int _i294 = 0; _i294 < _map291.size; ++_i294) { _key292 = iprot.readString(); { org.apache.thrift.protocol.TList _list295 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); _val293 = new java.util.ArrayList<TRenderDatum>(_list295.size); @org.apache.thrift.annotation.Nullable TRenderDatum _elem296; for (int _i297 = 0; _i297 < _list295.size; ++_i297) { _elem296 = new TRenderDatum(); _elem296.read(iprot); _val293.add(_elem296); } } _val289.put(_key292, _val293); } } _val285.put(_key288, _val289); } } _val281.put(_key284, _val285); } } struct.merge_data.put(_key280, _val281); } } struct.setMerge_dataIsSet(true); } if (incoming.get(1)) { struct.raw_pixel_data = new TRawPixelData(); struct.raw_pixel_data.read(iprot); struct.setRaw_pixel_dataIsSet(true); } if (incoming.get(2)) { struct.execution_time_ms = iprot.readI64(); struct.setExecution_time_msIsSet(true); } if (incoming.get(3)) { struct.render_time_ms = iprot.readI64(); struct.setRender_time_msIsSet(true); } if (incoming.get(4)) { struct.total_time_ms = iprot.readI64(); struct.setTotal_time_msIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TResultSetBufferDescriptor.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TResultSetBufferDescriptor implements org.apache.thrift.TBase<TResultSetBufferDescriptor, TResultSetBufferDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<TResultSetBufferDescriptor> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TResultSetBufferDescriptor"); private static final org.apache.thrift.protocol.TField LAYOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("layout", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField KEYLESS_FIELD_DESC = new org.apache.thrift.protocol.TField("keyless", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField ENTRY_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("entry_count", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.protocol.TField IDX_TARGET_AS_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("idx_target_as_key", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField MIN_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("min_val", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField MAX_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("max_val", org.apache.thrift.protocol.TType.I64, (short)6); private static final org.apache.thrift.protocol.TField BUCKET_FIELD_DESC = new org.apache.thrift.protocol.TField("bucket", org.apache.thrift.protocol.TType.I64, (short)7); private static final org.apache.thrift.protocol.TField GROUP_COL_WIDTHS_FIELD_DESC = new org.apache.thrift.protocol.TField("group_col_widths", org.apache.thrift.protocol.TType.LIST, (short)8); private static final org.apache.thrift.protocol.TField KEY_BYTEWIDTH_FIELD_DESC = new org.apache.thrift.protocol.TField("key_bytewidth", org.apache.thrift.protocol.TType.I16, (short)9); private static final org.apache.thrift.protocol.TField COL_SLOT_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("col_slot_context", org.apache.thrift.protocol.TType.STRUCT, (short)10); private static final org.apache.thrift.protocol.TField TARGET_GROUPBY_INDICES_FIELD_DESC = new org.apache.thrift.protocol.TField("target_groupby_indices", org.apache.thrift.protocol.TType.LIST, (short)11); private static final org.apache.thrift.protocol.TField COUNT_DISTINCT_DESCRIPTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("count_distinct_descriptors", org.apache.thrift.protocol.TType.LIST, (short)12); private static final org.apache.thrift.protocol.TField FORCE_4BYTE_FLOAT_FIELD_DESC = new org.apache.thrift.protocol.TField("force_4byte_float", org.apache.thrift.protocol.TType.BOOL, (short)13); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TResultSetBufferDescriptorStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TResultSetBufferDescriptorTupleSchemeFactory(); /** * * @see TResultSetLayout */ public @org.apache.thrift.annotation.Nullable TResultSetLayout layout; // required public boolean keyless; // required public int entry_count; // required public int idx_target_as_key; // required public long min_val; // required public long max_val; // required public long bucket; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Short> group_col_widths; // required public short key_bytewidth; // required public @org.apache.thrift.annotation.Nullable TColSlotContext col_slot_context; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> target_groupby_indices; // required public @org.apache.thrift.annotation.Nullable java.util.List<TCountDistinctDescriptor> count_distinct_descriptors; // required public boolean force_4byte_float; // 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 { /** * * @see TResultSetLayout */ LAYOUT((short)1, "layout"), KEYLESS((short)2, "keyless"), ENTRY_COUNT((short)3, "entry_count"), IDX_TARGET_AS_KEY((short)4, "idx_target_as_key"), MIN_VAL((short)5, "min_val"), MAX_VAL((short)6, "max_val"), BUCKET((short)7, "bucket"), GROUP_COL_WIDTHS((short)8, "group_col_widths"), KEY_BYTEWIDTH((short)9, "key_bytewidth"), COL_SLOT_CONTEXT((short)10, "col_slot_context"), TARGET_GROUPBY_INDICES((short)11, "target_groupby_indices"), COUNT_DISTINCT_DESCRIPTORS((short)12, "count_distinct_descriptors"), FORCE_4BYTE_FLOAT((short)13, "force_4byte_float"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // LAYOUT return LAYOUT; case 2: // KEYLESS return KEYLESS; case 3: // ENTRY_COUNT return ENTRY_COUNT; case 4: // IDX_TARGET_AS_KEY return IDX_TARGET_AS_KEY; case 5: // MIN_VAL return MIN_VAL; case 6: // MAX_VAL return MAX_VAL; case 7: // BUCKET return BUCKET; case 8: // GROUP_COL_WIDTHS return GROUP_COL_WIDTHS; case 9: // KEY_BYTEWIDTH return KEY_BYTEWIDTH; case 10: // COL_SLOT_CONTEXT return COL_SLOT_CONTEXT; case 11: // TARGET_GROUPBY_INDICES return TARGET_GROUPBY_INDICES; case 12: // COUNT_DISTINCT_DESCRIPTORS return COUNT_DISTINCT_DESCRIPTORS; case 13: // FORCE_4BYTE_FLOAT return FORCE_4BYTE_FLOAT; 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 __KEYLESS_ISSET_ID = 0; private static final int __ENTRY_COUNT_ISSET_ID = 1; private static final int __IDX_TARGET_AS_KEY_ISSET_ID = 2; private static final int __MIN_VAL_ISSET_ID = 3; private static final int __MAX_VAL_ISSET_ID = 4; private static final int __BUCKET_ISSET_ID = 5; private static final int __KEY_BYTEWIDTH_ISSET_ID = 6; private static final int __FORCE_4BYTE_FLOAT_ISSET_ID = 7; 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.LAYOUT, new org.apache.thrift.meta_data.FieldMetaData("layout", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TResultSetLayout.class))); tmpMap.put(_Fields.KEYLESS, new org.apache.thrift.meta_data.FieldMetaData("keyless", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.ENTRY_COUNT, new org.apache.thrift.meta_data.FieldMetaData("entry_count", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.IDX_TARGET_AS_KEY, new org.apache.thrift.meta_data.FieldMetaData("idx_target_as_key", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.MIN_VAL, new org.apache.thrift.meta_data.FieldMetaData("min_val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.MAX_VAL, new org.apache.thrift.meta_data.FieldMetaData("max_val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.BUCKET, new org.apache.thrift.meta_data.FieldMetaData("bucket", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.GROUP_COL_WIDTHS, new org.apache.thrift.meta_data.FieldMetaData("group_col_widths", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I16)))); tmpMap.put(_Fields.KEY_BYTEWIDTH, new org.apache.thrift.meta_data.FieldMetaData("key_bytewidth", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.COL_SLOT_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("col_slot_context", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColSlotContext.class))); tmpMap.put(_Fields.TARGET_GROUPBY_INDICES, new org.apache.thrift.meta_data.FieldMetaData("target_groupby_indices", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.COUNT_DISTINCT_DESCRIPTORS, new org.apache.thrift.meta_data.FieldMetaData("count_distinct_descriptors", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST , "TCountDistinctDescriptors"))); tmpMap.put(_Fields.FORCE_4BYTE_FLOAT, new org.apache.thrift.meta_data.FieldMetaData("force_4byte_float", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TResultSetBufferDescriptor.class, metaDataMap); } public TResultSetBufferDescriptor() { } public TResultSetBufferDescriptor( TResultSetLayout layout, boolean keyless, int entry_count, int idx_target_as_key, long min_val, long max_val, long bucket, java.util.List<java.lang.Short> group_col_widths, short key_bytewidth, TColSlotContext col_slot_context, java.util.List<java.lang.Integer> target_groupby_indices, java.util.List<TCountDistinctDescriptor> count_distinct_descriptors, boolean force_4byte_float) { this(); this.layout = layout; this.keyless = keyless; setKeylessIsSet(true); this.entry_count = entry_count; setEntry_countIsSet(true); this.idx_target_as_key = idx_target_as_key; setIdx_target_as_keyIsSet(true); this.min_val = min_val; setMin_valIsSet(true); this.max_val = max_val; setMax_valIsSet(true); this.bucket = bucket; setBucketIsSet(true); this.group_col_widths = group_col_widths; this.key_bytewidth = key_bytewidth; setKey_bytewidthIsSet(true); this.col_slot_context = col_slot_context; this.target_groupby_indices = target_groupby_indices; this.count_distinct_descriptors = count_distinct_descriptors; this.force_4byte_float = force_4byte_float; setForce_4byte_floatIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TResultSetBufferDescriptor(TResultSetBufferDescriptor other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetLayout()) { this.layout = other.layout; } this.keyless = other.keyless; this.entry_count = other.entry_count; this.idx_target_as_key = other.idx_target_as_key; this.min_val = other.min_val; this.max_val = other.max_val; this.bucket = other.bucket; if (other.isSetGroup_col_widths()) { java.util.List<java.lang.Short> __this__group_col_widths = new java.util.ArrayList<java.lang.Short>(other.group_col_widths); this.group_col_widths = __this__group_col_widths; } this.key_bytewidth = other.key_bytewidth; if (other.isSetCol_slot_context()) { this.col_slot_context = new TColSlotContext(other.col_slot_context); } if (other.isSetTarget_groupby_indices()) { java.util.List<java.lang.Integer> __this__target_groupby_indices = new java.util.ArrayList<java.lang.Integer>(other.target_groupby_indices); this.target_groupby_indices = __this__target_groupby_indices; } if (other.isSetCount_distinct_descriptors()) { java.util.List<TCountDistinctDescriptor> __this__count_distinct_descriptors = new java.util.ArrayList<TCountDistinctDescriptor>(other.count_distinct_descriptors.size()); for (TCountDistinctDescriptor other_element : other.count_distinct_descriptors) { __this__count_distinct_descriptors.add(new TCountDistinctDescriptor(other_element)); } this.count_distinct_descriptors = __this__count_distinct_descriptors; } this.force_4byte_float = other.force_4byte_float; } public TResultSetBufferDescriptor deepCopy() { return new TResultSetBufferDescriptor(this); } @Override public void clear() { this.layout = null; setKeylessIsSet(false); this.keyless = false; setEntry_countIsSet(false); this.entry_count = 0; setIdx_target_as_keyIsSet(false); this.idx_target_as_key = 0; setMin_valIsSet(false); this.min_val = 0; setMax_valIsSet(false); this.max_val = 0; setBucketIsSet(false); this.bucket = 0; this.group_col_widths = null; setKey_bytewidthIsSet(false); this.key_bytewidth = 0; this.col_slot_context = null; this.target_groupby_indices = null; this.count_distinct_descriptors = null; setForce_4byte_floatIsSet(false); this.force_4byte_float = false; } /** * * @see TResultSetLayout */ @org.apache.thrift.annotation.Nullable public TResultSetLayout getLayout() { return this.layout; } /** * * @see TResultSetLayout */ public TResultSetBufferDescriptor setLayout(@org.apache.thrift.annotation.Nullable TResultSetLayout layout) { this.layout = layout; return this; } public void unsetLayout() { this.layout = null; } /** Returns true if field layout is set (has been assigned a value) and false otherwise */ public boolean isSetLayout() { return this.layout != null; } public void setLayoutIsSet(boolean value) { if (!value) { this.layout = null; } } public boolean isKeyless() { return this.keyless; } public TResultSetBufferDescriptor setKeyless(boolean keyless) { this.keyless = keyless; setKeylessIsSet(true); return this; } public void unsetKeyless() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEYLESS_ISSET_ID); } /** Returns true if field keyless is set (has been assigned a value) and false otherwise */ public boolean isSetKeyless() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEYLESS_ISSET_ID); } public void setKeylessIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEYLESS_ISSET_ID, value); } public int getEntry_count() { return this.entry_count; } public TResultSetBufferDescriptor setEntry_count(int entry_count) { this.entry_count = entry_count; setEntry_countIsSet(true); return this; } public void unsetEntry_count() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENTRY_COUNT_ISSET_ID); } /** Returns true if field entry_count is set (has been assigned a value) and false otherwise */ public boolean isSetEntry_count() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENTRY_COUNT_ISSET_ID); } public void setEntry_countIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENTRY_COUNT_ISSET_ID, value); } public int getIdx_target_as_key() { return this.idx_target_as_key; } public TResultSetBufferDescriptor setIdx_target_as_key(int idx_target_as_key) { this.idx_target_as_key = idx_target_as_key; setIdx_target_as_keyIsSet(true); return this; } public void unsetIdx_target_as_key() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IDX_TARGET_AS_KEY_ISSET_ID); } /** Returns true if field idx_target_as_key is set (has been assigned a value) and false otherwise */ public boolean isSetIdx_target_as_key() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IDX_TARGET_AS_KEY_ISSET_ID); } public void setIdx_target_as_keyIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IDX_TARGET_AS_KEY_ISSET_ID, value); } public long getMin_val() { return this.min_val; } public TResultSetBufferDescriptor setMin_val(long min_val) { this.min_val = min_val; setMin_valIsSet(true); return this; } public void unsetMin_val() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MIN_VAL_ISSET_ID); } /** Returns true if field min_val is set (has been assigned a value) and false otherwise */ public boolean isSetMin_val() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MIN_VAL_ISSET_ID); } public void setMin_valIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MIN_VAL_ISSET_ID, value); } public long getMax_val() { return this.max_val; } public TResultSetBufferDescriptor setMax_val(long max_val) { this.max_val = max_val; setMax_valIsSet(true); return this; } public void unsetMax_val() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_VAL_ISSET_ID); } /** Returns true if field max_val is set (has been assigned a value) and false otherwise */ public boolean isSetMax_val() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_VAL_ISSET_ID); } public void setMax_valIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_VAL_ISSET_ID, value); } public long getBucket() { return this.bucket; } public TResultSetBufferDescriptor setBucket(long bucket) { this.bucket = bucket; setBucketIsSet(true); return this; } public void unsetBucket() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BUCKET_ISSET_ID); } /** Returns true if field bucket is set (has been assigned a value) and false otherwise */ public boolean isSetBucket() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BUCKET_ISSET_ID); } public void setBucketIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BUCKET_ISSET_ID, value); } public int getGroup_col_widthsSize() { return (this.group_col_widths == null) ? 0 : this.group_col_widths.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Short> getGroup_col_widthsIterator() { return (this.group_col_widths == null) ? null : this.group_col_widths.iterator(); } public void addToGroup_col_widths(short elem) { if (this.group_col_widths == null) { this.group_col_widths = new java.util.ArrayList<java.lang.Short>(); } this.group_col_widths.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Short> getGroup_col_widths() { return this.group_col_widths; } public TResultSetBufferDescriptor setGroup_col_widths(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Short> group_col_widths) { this.group_col_widths = group_col_widths; return this; } public void unsetGroup_col_widths() { this.group_col_widths = null; } /** Returns true if field group_col_widths is set (has been assigned a value) and false otherwise */ public boolean isSetGroup_col_widths() { return this.group_col_widths != null; } public void setGroup_col_widthsIsSet(boolean value) { if (!value) { this.group_col_widths = null; } } public short getKey_bytewidth() { return this.key_bytewidth; } public TResultSetBufferDescriptor setKey_bytewidth(short key_bytewidth) { this.key_bytewidth = key_bytewidth; setKey_bytewidthIsSet(true); return this; } public void unsetKey_bytewidth() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEY_BYTEWIDTH_ISSET_ID); } /** Returns true if field key_bytewidth is set (has been assigned a value) and false otherwise */ public boolean isSetKey_bytewidth() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEY_BYTEWIDTH_ISSET_ID); } public void setKey_bytewidthIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEY_BYTEWIDTH_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public TColSlotContext getCol_slot_context() { return this.col_slot_context; } public TResultSetBufferDescriptor setCol_slot_context(@org.apache.thrift.annotation.Nullable TColSlotContext col_slot_context) { this.col_slot_context = col_slot_context; return this; } public void unsetCol_slot_context() { this.col_slot_context = null; } /** Returns true if field col_slot_context is set (has been assigned a value) and false otherwise */ public boolean isSetCol_slot_context() { return this.col_slot_context != null; } public void setCol_slot_contextIsSet(boolean value) { if (!value) { this.col_slot_context = null; } } public int getTarget_groupby_indicesSize() { return (this.target_groupby_indices == null) ? 0 : this.target_groupby_indices.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Integer> getTarget_groupby_indicesIterator() { return (this.target_groupby_indices == null) ? null : this.target_groupby_indices.iterator(); } public void addToTarget_groupby_indices(int elem) { if (this.target_groupby_indices == null) { this.target_groupby_indices = new java.util.ArrayList<java.lang.Integer>(); } this.target_groupby_indices.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Integer> getTarget_groupby_indices() { return this.target_groupby_indices; } public TResultSetBufferDescriptor setTarget_groupby_indices(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Integer> target_groupby_indices) { this.target_groupby_indices = target_groupby_indices; return this; } public void unsetTarget_groupby_indices() { this.target_groupby_indices = null; } /** Returns true if field target_groupby_indices is set (has been assigned a value) and false otherwise */ public boolean isSetTarget_groupby_indices() { return this.target_groupby_indices != null; } public void setTarget_groupby_indicesIsSet(boolean value) { if (!value) { this.target_groupby_indices = null; } } public int getCount_distinct_descriptorsSize() { return (this.count_distinct_descriptors == null) ? 0 : this.count_distinct_descriptors.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TCountDistinctDescriptor> getCount_distinct_descriptorsIterator() { return (this.count_distinct_descriptors == null) ? null : this.count_distinct_descriptors.iterator(); } public void addToCount_distinct_descriptors(TCountDistinctDescriptor elem) { if (this.count_distinct_descriptors == null) { this.count_distinct_descriptors = new java.util.ArrayList<TCountDistinctDescriptor>(); } this.count_distinct_descriptors.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TCountDistinctDescriptor> getCount_distinct_descriptors() { return this.count_distinct_descriptors; } public TResultSetBufferDescriptor setCount_distinct_descriptors(@org.apache.thrift.annotation.Nullable java.util.List<TCountDistinctDescriptor> count_distinct_descriptors) { this.count_distinct_descriptors = count_distinct_descriptors; return this; } public void unsetCount_distinct_descriptors() { this.count_distinct_descriptors = null; } /** Returns true if field count_distinct_descriptors is set (has been assigned a value) and false otherwise */ public boolean isSetCount_distinct_descriptors() { return this.count_distinct_descriptors != null; } public void setCount_distinct_descriptorsIsSet(boolean value) { if (!value) { this.count_distinct_descriptors = null; } } public boolean isForce_4byte_float() { return this.force_4byte_float; } public TResultSetBufferDescriptor setForce_4byte_float(boolean force_4byte_float) { this.force_4byte_float = force_4byte_float; setForce_4byte_floatIsSet(true); return this; } public void unsetForce_4byte_float() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FORCE_4BYTE_FLOAT_ISSET_ID); } /** Returns true if field force_4byte_float is set (has been assigned a value) and false otherwise */ public boolean isSetForce_4byte_float() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FORCE_4BYTE_FLOAT_ISSET_ID); } public void setForce_4byte_floatIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FORCE_4BYTE_FLOAT_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case LAYOUT: if (value == null) { unsetLayout(); } else { setLayout((TResultSetLayout)value); } break; case KEYLESS: if (value == null) { unsetKeyless(); } else { setKeyless((java.lang.Boolean)value); } break; case ENTRY_COUNT: if (value == null) { unsetEntry_count(); } else { setEntry_count((java.lang.Integer)value); } break; case IDX_TARGET_AS_KEY: if (value == null) { unsetIdx_target_as_key(); } else { setIdx_target_as_key((java.lang.Integer)value); } break; case MIN_VAL: if (value == null) { unsetMin_val(); } else { setMin_val((java.lang.Long)value); } break; case MAX_VAL: if (value == null) { unsetMax_val(); } else { setMax_val((java.lang.Long)value); } break; case BUCKET: if (value == null) { unsetBucket(); } else { setBucket((java.lang.Long)value); } break; case GROUP_COL_WIDTHS: if (value == null) { unsetGroup_col_widths(); } else { setGroup_col_widths((java.util.List<java.lang.Short>)value); } break; case KEY_BYTEWIDTH: if (value == null) { unsetKey_bytewidth(); } else { setKey_bytewidth((java.lang.Short)value); } break; case COL_SLOT_CONTEXT: if (value == null) { unsetCol_slot_context(); } else { setCol_slot_context((TColSlotContext)value); } break; case TARGET_GROUPBY_INDICES: if (value == null) { unsetTarget_groupby_indices(); } else { setTarget_groupby_indices((java.util.List<java.lang.Integer>)value); } break; case COUNT_DISTINCT_DESCRIPTORS: if (value == null) { unsetCount_distinct_descriptors(); } else { setCount_distinct_descriptors((java.util.List<TCountDistinctDescriptor>)value); } break; case FORCE_4BYTE_FLOAT: if (value == null) { unsetForce_4byte_float(); } else { setForce_4byte_float((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case LAYOUT: return getLayout(); case KEYLESS: return isKeyless(); case ENTRY_COUNT: return getEntry_count(); case IDX_TARGET_AS_KEY: return getIdx_target_as_key(); case MIN_VAL: return getMin_val(); case MAX_VAL: return getMax_val(); case BUCKET: return getBucket(); case GROUP_COL_WIDTHS: return getGroup_col_widths(); case KEY_BYTEWIDTH: return getKey_bytewidth(); case COL_SLOT_CONTEXT: return getCol_slot_context(); case TARGET_GROUPBY_INDICES: return getTarget_groupby_indices(); case COUNT_DISTINCT_DESCRIPTORS: return getCount_distinct_descriptors(); case FORCE_4BYTE_FLOAT: return isForce_4byte_float(); } 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 LAYOUT: return isSetLayout(); case KEYLESS: return isSetKeyless(); case ENTRY_COUNT: return isSetEntry_count(); case IDX_TARGET_AS_KEY: return isSetIdx_target_as_key(); case MIN_VAL: return isSetMin_val(); case MAX_VAL: return isSetMax_val(); case BUCKET: return isSetBucket(); case GROUP_COL_WIDTHS: return isSetGroup_col_widths(); case KEY_BYTEWIDTH: return isSetKey_bytewidth(); case COL_SLOT_CONTEXT: return isSetCol_slot_context(); case TARGET_GROUPBY_INDICES: return isSetTarget_groupby_indices(); case COUNT_DISTINCT_DESCRIPTORS: return isSetCount_distinct_descriptors(); case FORCE_4BYTE_FLOAT: return isSetForce_4byte_float(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TResultSetBufferDescriptor) return this.equals((TResultSetBufferDescriptor)that); return false; } public boolean equals(TResultSetBufferDescriptor that) { if (that == null) return false; if (this == that) return true; boolean this_present_layout = true && this.isSetLayout(); boolean that_present_layout = true && that.isSetLayout(); if (this_present_layout || that_present_layout) { if (!(this_present_layout && that_present_layout)) return false; if (!this.layout.equals(that.layout)) return false; } boolean this_present_keyless = true; boolean that_present_keyless = true; if (this_present_keyless || that_present_keyless) { if (!(this_present_keyless && that_present_keyless)) return false; if (this.keyless != that.keyless) return false; } boolean this_present_entry_count = true; boolean that_present_entry_count = true; if (this_present_entry_count || that_present_entry_count) { if (!(this_present_entry_count && that_present_entry_count)) return false; if (this.entry_count != that.entry_count) return false; } boolean this_present_idx_target_as_key = true; boolean that_present_idx_target_as_key = true; if (this_present_idx_target_as_key || that_present_idx_target_as_key) { if (!(this_present_idx_target_as_key && that_present_idx_target_as_key)) return false; if (this.idx_target_as_key != that.idx_target_as_key) return false; } boolean this_present_min_val = true; boolean that_present_min_val = true; if (this_present_min_val || that_present_min_val) { if (!(this_present_min_val && that_present_min_val)) return false; if (this.min_val != that.min_val) return false; } boolean this_present_max_val = true; boolean that_present_max_val = true; if (this_present_max_val || that_present_max_val) { if (!(this_present_max_val && that_present_max_val)) return false; if (this.max_val != that.max_val) return false; } boolean this_present_bucket = true; boolean that_present_bucket = true; if (this_present_bucket || that_present_bucket) { if (!(this_present_bucket && that_present_bucket)) return false; if (this.bucket != that.bucket) return false; } boolean this_present_group_col_widths = true && this.isSetGroup_col_widths(); boolean that_present_group_col_widths = true && that.isSetGroup_col_widths(); if (this_present_group_col_widths || that_present_group_col_widths) { if (!(this_present_group_col_widths && that_present_group_col_widths)) return false; if (!this.group_col_widths.equals(that.group_col_widths)) return false; } boolean this_present_key_bytewidth = true; boolean that_present_key_bytewidth = true; if (this_present_key_bytewidth || that_present_key_bytewidth) { if (!(this_present_key_bytewidth && that_present_key_bytewidth)) return false; if (this.key_bytewidth != that.key_bytewidth) return false; } boolean this_present_col_slot_context = true && this.isSetCol_slot_context(); boolean that_present_col_slot_context = true && that.isSetCol_slot_context(); if (this_present_col_slot_context || that_present_col_slot_context) { if (!(this_present_col_slot_context && that_present_col_slot_context)) return false; if (!this.col_slot_context.equals(that.col_slot_context)) return false; } boolean this_present_target_groupby_indices = true && this.isSetTarget_groupby_indices(); boolean that_present_target_groupby_indices = true && that.isSetTarget_groupby_indices(); if (this_present_target_groupby_indices || that_present_target_groupby_indices) { if (!(this_present_target_groupby_indices && that_present_target_groupby_indices)) return false; if (!this.target_groupby_indices.equals(that.target_groupby_indices)) return false; } boolean this_present_count_distinct_descriptors = true && this.isSetCount_distinct_descriptors(); boolean that_present_count_distinct_descriptors = true && that.isSetCount_distinct_descriptors(); if (this_present_count_distinct_descriptors || that_present_count_distinct_descriptors) { if (!(this_present_count_distinct_descriptors && that_present_count_distinct_descriptors)) return false; if (!this.count_distinct_descriptors.equals(that.count_distinct_descriptors)) return false; } boolean this_present_force_4byte_float = true; boolean that_present_force_4byte_float = true; if (this_present_force_4byte_float || that_present_force_4byte_float) { if (!(this_present_force_4byte_float && that_present_force_4byte_float)) return false; if (this.force_4byte_float != that.force_4byte_float) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetLayout()) ? 131071 : 524287); if (isSetLayout()) hashCode = hashCode * 8191 + layout.getValue(); hashCode = hashCode * 8191 + ((keyless) ? 131071 : 524287); hashCode = hashCode * 8191 + entry_count; hashCode = hashCode * 8191 + idx_target_as_key; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(min_val); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_val); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(bucket); hashCode = hashCode * 8191 + ((isSetGroup_col_widths()) ? 131071 : 524287); if (isSetGroup_col_widths()) hashCode = hashCode * 8191 + group_col_widths.hashCode(); hashCode = hashCode * 8191 + key_bytewidth; hashCode = hashCode * 8191 + ((isSetCol_slot_context()) ? 131071 : 524287); if (isSetCol_slot_context()) hashCode = hashCode * 8191 + col_slot_context.hashCode(); hashCode = hashCode * 8191 + ((isSetTarget_groupby_indices()) ? 131071 : 524287); if (isSetTarget_groupby_indices()) hashCode = hashCode * 8191 + target_groupby_indices.hashCode(); hashCode = hashCode * 8191 + ((isSetCount_distinct_descriptors()) ? 131071 : 524287); if (isSetCount_distinct_descriptors()) hashCode = hashCode * 8191 + count_distinct_descriptors.hashCode(); hashCode = hashCode * 8191 + ((force_4byte_float) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TResultSetBufferDescriptor other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetLayout(), other.isSetLayout()); if (lastComparison != 0) { return lastComparison; } if (isSetLayout()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.layout, other.layout); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetKeyless(), other.isSetKeyless()); if (lastComparison != 0) { return lastComparison; } if (isSetKeyless()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyless, other.keyless); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetEntry_count(), other.isSetEntry_count()); if (lastComparison != 0) { return lastComparison; } if (isSetEntry_count()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entry_count, other.entry_count); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIdx_target_as_key(), other.isSetIdx_target_as_key()); if (lastComparison != 0) { return lastComparison; } if (isSetIdx_target_as_key()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.idx_target_as_key, other.idx_target_as_key); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMin_val(), other.isSetMin_val()); if (lastComparison != 0) { return lastComparison; } if (isSetMin_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.min_val, other.min_val); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMax_val(), other.isSetMax_val()); if (lastComparison != 0) { return lastComparison; } if (isSetMax_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_val, other.max_val); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetBucket(), other.isSetBucket()); if (lastComparison != 0) { return lastComparison; } if (isSetBucket()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bucket, other.bucket); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetGroup_col_widths(), other.isSetGroup_col_widths()); if (lastComparison != 0) { return lastComparison; } if (isSetGroup_col_widths()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.group_col_widths, other.group_col_widths); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetKey_bytewidth(), other.isSetKey_bytewidth()); if (lastComparison != 0) { return lastComparison; } if (isSetKey_bytewidth()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key_bytewidth, other.key_bytewidth); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCol_slot_context(), other.isSetCol_slot_context()); if (lastComparison != 0) { return lastComparison; } if (isSetCol_slot_context()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.col_slot_context, other.col_slot_context); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTarget_groupby_indices(), other.isSetTarget_groupby_indices()); if (lastComparison != 0) { return lastComparison; } if (isSetTarget_groupby_indices()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.target_groupby_indices, other.target_groupby_indices); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCount_distinct_descriptors(), other.isSetCount_distinct_descriptors()); if (lastComparison != 0) { return lastComparison; } if (isSetCount_distinct_descriptors()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count_distinct_descriptors, other.count_distinct_descriptors); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetForce_4byte_float(), other.isSetForce_4byte_float()); if (lastComparison != 0) { return lastComparison; } if (isSetForce_4byte_float()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.force_4byte_float, other.force_4byte_float); 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("TResultSetBufferDescriptor("); boolean first = true; sb.append("layout:"); if (this.layout == null) { sb.append("null"); } else { sb.append(this.layout); } first = false; if (!first) sb.append(", "); sb.append("keyless:"); sb.append(this.keyless); first = false; if (!first) sb.append(", "); sb.append("entry_count:"); sb.append(this.entry_count); first = false; if (!first) sb.append(", "); sb.append("idx_target_as_key:"); sb.append(this.idx_target_as_key); first = false; if (!first) sb.append(", "); sb.append("min_val:"); sb.append(this.min_val); first = false; if (!first) sb.append(", "); sb.append("max_val:"); sb.append(this.max_val); first = false; if (!first) sb.append(", "); sb.append("bucket:"); sb.append(this.bucket); first = false; if (!first) sb.append(", "); sb.append("group_col_widths:"); if (this.group_col_widths == null) { sb.append("null"); } else { sb.append(this.group_col_widths); } first = false; if (!first) sb.append(", "); sb.append("key_bytewidth:"); sb.append(this.key_bytewidth); first = false; if (!first) sb.append(", "); sb.append("col_slot_context:"); if (this.col_slot_context == null) { sb.append("null"); } else { sb.append(this.col_slot_context); } first = false; if (!first) sb.append(", "); sb.append("target_groupby_indices:"); if (this.target_groupby_indices == null) { sb.append("null"); } else { sb.append(this.target_groupby_indices); } first = false; if (!first) sb.append(", "); sb.append("count_distinct_descriptors:"); if (this.count_distinct_descriptors == null) { sb.append("null"); } else { sb.append(this.count_distinct_descriptors); } first = false; if (!first) sb.append(", "); sb.append("force_4byte_float:"); sb.append(this.force_4byte_float); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (col_slot_context != null) { col_slot_context.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 TResultSetBufferDescriptorStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TResultSetBufferDescriptorStandardScheme getScheme() { return new TResultSetBufferDescriptorStandardScheme(); } } private static class TResultSetBufferDescriptorStandardScheme extends org.apache.thrift.scheme.StandardScheme<TResultSetBufferDescriptor> { public void read(org.apache.thrift.protocol.TProtocol iprot, TResultSetBufferDescriptor 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: // LAYOUT if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.layout = ai.heavy.thrift.server.TResultSetLayout.findByValue(iprot.readI32()); struct.setLayoutIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEYLESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.keyless = iprot.readBool(); struct.setKeylessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // ENTRY_COUNT if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.entry_count = iprot.readI32(); struct.setEntry_countIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // IDX_TARGET_AS_KEY if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.idx_target_as_key = iprot.readI32(); struct.setIdx_target_as_keyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // MIN_VAL if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.min_val = iprot.readI64(); struct.setMin_valIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // MAX_VAL if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.max_val = iprot.readI64(); struct.setMax_valIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // BUCKET if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.bucket = iprot.readI64(); struct.setBucketIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // GROUP_COL_WIDTHS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); struct.group_col_widths = new java.util.ArrayList<java.lang.Short>(_list24.size); short _elem25; for (int _i26 = 0; _i26 < _list24.size; ++_i26) { _elem25 = iprot.readI16(); struct.group_col_widths.add(_elem25); } iprot.readListEnd(); } struct.setGroup_col_widthsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // KEY_BYTEWIDTH if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.key_bytewidth = iprot.readI16(); struct.setKey_bytewidthIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // COL_SLOT_CONTEXT if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.col_slot_context = new TColSlotContext(); struct.col_slot_context.read(iprot); struct.setCol_slot_contextIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 11: // TARGET_GROUPBY_INDICES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list27 = iprot.readListBegin(); struct.target_groupby_indices = new java.util.ArrayList<java.lang.Integer>(_list27.size); int _elem28; for (int _i29 = 0; _i29 < _list27.size; ++_i29) { _elem28 = iprot.readI32(); struct.target_groupby_indices.add(_elem28); } iprot.readListEnd(); } struct.setTarget_groupby_indicesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 12: // COUNT_DISTINCT_DESCRIPTORS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); struct.count_distinct_descriptors = new java.util.ArrayList<TCountDistinctDescriptor>(_list30.size); @org.apache.thrift.annotation.Nullable TCountDistinctDescriptor _elem31; for (int _i32 = 0; _i32 < _list30.size; ++_i32) { _elem31 = new TCountDistinctDescriptor(); _elem31.read(iprot); struct.count_distinct_descriptors.add(_elem31); } iprot.readListEnd(); } struct.setCount_distinct_descriptorsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 13: // FORCE_4BYTE_FLOAT if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.force_4byte_float = iprot.readBool(); struct.setForce_4byte_floatIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TResultSetBufferDescriptor struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.layout != null) { oprot.writeFieldBegin(LAYOUT_FIELD_DESC); oprot.writeI32(struct.layout.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(KEYLESS_FIELD_DESC); oprot.writeBool(struct.keyless); oprot.writeFieldEnd(); oprot.writeFieldBegin(ENTRY_COUNT_FIELD_DESC); oprot.writeI32(struct.entry_count); oprot.writeFieldEnd(); oprot.writeFieldBegin(IDX_TARGET_AS_KEY_FIELD_DESC); oprot.writeI32(struct.idx_target_as_key); oprot.writeFieldEnd(); oprot.writeFieldBegin(MIN_VAL_FIELD_DESC); oprot.writeI64(struct.min_val); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAX_VAL_FIELD_DESC); oprot.writeI64(struct.max_val); oprot.writeFieldEnd(); oprot.writeFieldBegin(BUCKET_FIELD_DESC); oprot.writeI64(struct.bucket); oprot.writeFieldEnd(); if (struct.group_col_widths != null) { oprot.writeFieldBegin(GROUP_COL_WIDTHS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.group_col_widths.size())); for (short _iter33 : struct.group_col_widths) { oprot.writeI16(_iter33); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(KEY_BYTEWIDTH_FIELD_DESC); oprot.writeI16(struct.key_bytewidth); oprot.writeFieldEnd(); if (struct.col_slot_context != null) { oprot.writeFieldBegin(COL_SLOT_CONTEXT_FIELD_DESC); struct.col_slot_context.write(oprot); oprot.writeFieldEnd(); } if (struct.target_groupby_indices != null) { oprot.writeFieldBegin(TARGET_GROUPBY_INDICES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.target_groupby_indices.size())); for (int _iter34 : struct.target_groupby_indices) { oprot.writeI32(_iter34); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.count_distinct_descriptors != null) { oprot.writeFieldBegin(COUNT_DISTINCT_DESCRIPTORS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.count_distinct_descriptors.size())); for (TCountDistinctDescriptor _iter35 : struct.count_distinct_descriptors) { _iter35.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(FORCE_4BYTE_FLOAT_FIELD_DESC); oprot.writeBool(struct.force_4byte_float); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TResultSetBufferDescriptorTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TResultSetBufferDescriptorTupleScheme getScheme() { return new TResultSetBufferDescriptorTupleScheme(); } } private static class TResultSetBufferDescriptorTupleScheme extends org.apache.thrift.scheme.TupleScheme<TResultSetBufferDescriptor> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TResultSetBufferDescriptor struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetLayout()) { optionals.set(0); } if (struct.isSetKeyless()) { optionals.set(1); } if (struct.isSetEntry_count()) { optionals.set(2); } if (struct.isSetIdx_target_as_key()) { optionals.set(3); } if (struct.isSetMin_val()) { optionals.set(4); } if (struct.isSetMax_val()) { optionals.set(5); } if (struct.isSetBucket()) { optionals.set(6); } if (struct.isSetGroup_col_widths()) { optionals.set(7); } if (struct.isSetKey_bytewidth()) { optionals.set(8); } if (struct.isSetCol_slot_context()) { optionals.set(9); } if (struct.isSetTarget_groupby_indices()) { optionals.set(10); } if (struct.isSetCount_distinct_descriptors()) { optionals.set(11); } if (struct.isSetForce_4byte_float()) { optionals.set(12); } oprot.writeBitSet(optionals, 13); if (struct.isSetLayout()) { oprot.writeI32(struct.layout.getValue()); } if (struct.isSetKeyless()) { oprot.writeBool(struct.keyless); } if (struct.isSetEntry_count()) { oprot.writeI32(struct.entry_count); } if (struct.isSetIdx_target_as_key()) { oprot.writeI32(struct.idx_target_as_key); } if (struct.isSetMin_val()) { oprot.writeI64(struct.min_val); } if (struct.isSetMax_val()) { oprot.writeI64(struct.max_val); } if (struct.isSetBucket()) { oprot.writeI64(struct.bucket); } if (struct.isSetGroup_col_widths()) { { oprot.writeI32(struct.group_col_widths.size()); for (short _iter36 : struct.group_col_widths) { oprot.writeI16(_iter36); } } } if (struct.isSetKey_bytewidth()) { oprot.writeI16(struct.key_bytewidth); } if (struct.isSetCol_slot_context()) { struct.col_slot_context.write(oprot); } if (struct.isSetTarget_groupby_indices()) { { oprot.writeI32(struct.target_groupby_indices.size()); for (int _iter37 : struct.target_groupby_indices) { oprot.writeI32(_iter37); } } } if (struct.isSetCount_distinct_descriptors()) { { oprot.writeI32(struct.count_distinct_descriptors.size()); for (TCountDistinctDescriptor _iter38 : struct.count_distinct_descriptors) { _iter38.write(oprot); } } } if (struct.isSetForce_4byte_float()) { oprot.writeBool(struct.force_4byte_float); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TResultSetBufferDescriptor struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(13); if (incoming.get(0)) { struct.layout = ai.heavy.thrift.server.TResultSetLayout.findByValue(iprot.readI32()); struct.setLayoutIsSet(true); } if (incoming.get(1)) { struct.keyless = iprot.readBool(); struct.setKeylessIsSet(true); } if (incoming.get(2)) { struct.entry_count = iprot.readI32(); struct.setEntry_countIsSet(true); } if (incoming.get(3)) { struct.idx_target_as_key = iprot.readI32(); struct.setIdx_target_as_keyIsSet(true); } if (incoming.get(4)) { struct.min_val = iprot.readI64(); struct.setMin_valIsSet(true); } if (incoming.get(5)) { struct.max_val = iprot.readI64(); struct.setMax_valIsSet(true); } if (incoming.get(6)) { struct.bucket = iprot.readI64(); struct.setBucketIsSet(true); } if (incoming.get(7)) { { org.apache.thrift.protocol.TList _list39 = iprot.readListBegin(org.apache.thrift.protocol.TType.I16); struct.group_col_widths = new java.util.ArrayList<java.lang.Short>(_list39.size); short _elem40; for (int _i41 = 0; _i41 < _list39.size; ++_i41) { _elem40 = iprot.readI16(); struct.group_col_widths.add(_elem40); } } struct.setGroup_col_widthsIsSet(true); } if (incoming.get(8)) { struct.key_bytewidth = iprot.readI16(); struct.setKey_bytewidthIsSet(true); } if (incoming.get(9)) { struct.col_slot_context = new TColSlotContext(); struct.col_slot_context.read(iprot); struct.setCol_slot_contextIsSet(true); } if (incoming.get(10)) { { org.apache.thrift.protocol.TList _list42 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32); struct.target_groupby_indices = new java.util.ArrayList<java.lang.Integer>(_list42.size); int _elem43; for (int _i44 = 0; _i44 < _list42.size; ++_i44) { _elem43 = iprot.readI32(); struct.target_groupby_indices.add(_elem43); } } struct.setTarget_groupby_indicesIsSet(true); } if (incoming.get(11)) { { org.apache.thrift.protocol.TList _list45 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.count_distinct_descriptors = new java.util.ArrayList<TCountDistinctDescriptor>(_list45.size); @org.apache.thrift.annotation.Nullable TCountDistinctDescriptor _elem46; for (int _i47 = 0; _i47 < _list45.size; ++_i47) { _elem46 = new TCountDistinctDescriptor(); _elem46.read(iprot); struct.count_distinct_descriptors.add(_elem46); } } struct.setCount_distinct_descriptorsIsSet(true); } if (incoming.get(12)) { struct.force_4byte_float = iprot.readBool(); struct.setForce_4byte_floatIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TResultSetLayout.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TResultSetLayout implements org.apache.thrift.TEnum { GroupByPerfectHash(0), GroupByBaselineHash(1), Projection(2), NonGroupedAggregate(3); private final int value; private TResultSetLayout(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TResultSetLayout findByValue(int value) { switch (value) { case 0: return GroupByPerfectHash; case 1: return GroupByBaselineHash; case 2: return Projection; case 3: return NonGroupedAggregate; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRole.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TRole implements org.apache.thrift.TEnum { SERVER(0), AGGREGATOR(1), LEAF(2), STRING_DICTIONARY(3); private final int value; private TRole(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TRole findByValue(int value) { switch (value) { case 0: return SERVER; case 1: return AGGREGATOR; case 2: return LEAF; case 3: return STRING_DICTIONARY; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRow.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRow implements org.apache.thrift.TBase<TRow, TRow._Fields>, java.io.Serializable, Cloneable, Comparable<TRow> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); private static final org.apache.thrift.protocol.TField COLS_FIELD_DESC = new org.apache.thrift.protocol.TField("cols", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List<TDatum> cols; // 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 { COLS((short)1, "cols"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // COLS return COLS; 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 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.COLS, new org.apache.thrift.meta_data.FieldMetaData("cols", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatum.class)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); } public TRow() { } public TRow( java.util.List<TDatum> cols) { this(); this.cols = cols; } /** * Performs a deep copy on <i>other</i>. */ public TRow(TRow other) { if (other.isSetCols()) { java.util.List<TDatum> __this__cols = new java.util.ArrayList<TDatum>(other.cols.size()); for (TDatum other_element : other.cols) { __this__cols.add(new TDatum(other_element)); } this.cols = __this__cols; } } public TRow deepCopy() { return new TRow(this); } @Override public void clear() { this.cols = null; } public int getColsSize() { return (this.cols == null) ? 0 : this.cols.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TDatum> getColsIterator() { return (this.cols == null) ? null : this.cols.iterator(); } public void addToCols(TDatum elem) { if (this.cols == null) { this.cols = new java.util.ArrayList<TDatum>(); } this.cols.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TDatum> getCols() { return this.cols; } public TRow setCols(@org.apache.thrift.annotation.Nullable java.util.List<TDatum> cols) { this.cols = cols; return this; } public void unsetCols() { this.cols = null; } /** Returns true if field cols is set (has been assigned a value) and false otherwise */ public boolean isSetCols() { return this.cols != null; } public void setColsIsSet(boolean value) { if (!value) { this.cols = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case COLS: if (value == null) { unsetCols(); } else { setCols((java.util.List<TDatum>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case COLS: return getCols(); } 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 COLS: return isSetCols(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRow) return this.equals((TRow)that); return false; } public boolean equals(TRow that) { if (that == null) return false; if (this == that) return true; boolean this_present_cols = true && this.isSetCols(); boolean that_present_cols = true && that.isSetCols(); if (this_present_cols || that_present_cols) { if (!(this_present_cols && that_present_cols)) return false; if (!this.cols.equals(that.cols)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetCols()) ? 131071 : 524287); if (isSetCols()) hashCode = hashCode * 8191 + cols.hashCode(); return hashCode; } @Override public int compareTo(TRow other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetCols(), other.isSetCols()); if (lastComparison != 0) { return lastComparison; } if (isSetCols()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cols, other.cols); 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("TRow("); boolean first = true; sb.append("cols:"); if (this.cols == null) { sb.append("null"); } else { sb.append(this.cols); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TRowStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowStandardScheme getScheme() { return new TRowStandardScheme(); } } private static class TRowStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRow> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRow 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: // COLS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); struct.cols = new java.util.ArrayList<TDatum>(_list8.size); @org.apache.thrift.annotation.Nullable TDatum _elem9; for (int _i10 = 0; _i10 < _list8.size; ++_i10) { _elem9 = new TDatum(); _elem9.read(iprot); struct.cols.add(_elem9); } iprot.readListEnd(); } struct.setColsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRow struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.cols != null) { oprot.writeFieldBegin(COLS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.cols.size())); for (TDatum _iter11 : struct.cols) { _iter11.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRowTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowTupleScheme getScheme() { return new TRowTupleScheme(); } } private static class TRowTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRow> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCols()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetCols()) { { oprot.writeI32(struct.cols.size()); for (TDatum _iter12 : struct.cols) { _iter12.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list13 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.cols = new java.util.ArrayList<TDatum>(_list13.size); @org.apache.thrift.annotation.Nullable TDatum _elem14; for (int _i15 = 0; _i15 < _list13.size; ++_i15) { _elem14 = new TDatum(); _elem14.read(iprot); struct.cols.add(_elem14); } } struct.setColsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TRowSet.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TRowSet implements org.apache.thrift.TBase<TRowSet, TRowSet._Fields>, java.io.Serializable, Cloneable, Comparable<TRowSet> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); private static final org.apache.thrift.protocol.TField ROW_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("row_desc", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField IS_COLUMNAR_FIELD_DESC = new org.apache.thrift.protocol.TField("is_columnar", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowSetStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowSetTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List<TColumnType> row_desc; // required public @org.apache.thrift.annotation.Nullable java.util.List<TRow> rows; // required public @org.apache.thrift.annotation.Nullable java.util.List<TColumn> columns; // required public boolean is_columnar; // 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 { ROW_DESC((short)1, "row_desc"), ROWS((short)2, "rows"), COLUMNS((short)3, "columns"), IS_COLUMNAR((short)4, "is_columnar"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ROW_DESC return ROW_DESC; case 2: // ROWS return ROWS; case 3: // COLUMNS return COLUMNS; case 4: // IS_COLUMNAR return IS_COLUMNAR; 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 __IS_COLUMNAR_ISSET_ID = 0; 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.ROW_DESC, new org.apache.thrift.meta_data.FieldMetaData("row_desc", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST , "TRowDescriptor"))); tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRow.class)))); tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class)))); tmpMap.put(_Fields.IS_COLUMNAR, new org.apache.thrift.meta_data.FieldMetaData("is_columnar", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); } public TRowSet() { } public TRowSet( java.util.List<TColumnType> row_desc, java.util.List<TRow> rows, java.util.List<TColumn> columns, boolean is_columnar) { this(); this.row_desc = row_desc; this.rows = rows; this.columns = columns; this.is_columnar = is_columnar; setIs_columnarIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TRowSet(TRowSet other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetRow_desc()) { java.util.List<TColumnType> __this__row_desc = new java.util.ArrayList<TColumnType>(other.row_desc.size()); for (TColumnType other_element : other.row_desc) { __this__row_desc.add(new TColumnType(other_element)); } this.row_desc = __this__row_desc; } if (other.isSetRows()) { java.util.List<TRow> __this__rows = new java.util.ArrayList<TRow>(other.rows.size()); for (TRow other_element : other.rows) { __this__rows.add(new TRow(other_element)); } this.rows = __this__rows; } if (other.isSetColumns()) { java.util.List<TColumn> __this__columns = new java.util.ArrayList<TColumn>(other.columns.size()); for (TColumn other_element : other.columns) { __this__columns.add(new TColumn(other_element)); } this.columns = __this__columns; } this.is_columnar = other.is_columnar; } public TRowSet deepCopy() { return new TRowSet(this); } @Override public void clear() { this.row_desc = null; this.rows = null; this.columns = null; setIs_columnarIsSet(false); this.is_columnar = false; } public int getRow_descSize() { return (this.row_desc == null) ? 0 : this.row_desc.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TColumnType> getRow_descIterator() { return (this.row_desc == null) ? null : this.row_desc.iterator(); } public void addToRow_desc(TColumnType elem) { if (this.row_desc == null) { this.row_desc = new java.util.ArrayList<TColumnType>(); } this.row_desc.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TColumnType> getRow_desc() { return this.row_desc; } public TRowSet setRow_desc(@org.apache.thrift.annotation.Nullable java.util.List<TColumnType> row_desc) { this.row_desc = row_desc; return this; } public void unsetRow_desc() { this.row_desc = null; } /** Returns true if field row_desc is set (has been assigned a value) and false otherwise */ public boolean isSetRow_desc() { return this.row_desc != null; } public void setRow_descIsSet(boolean value) { if (!value) { this.row_desc = null; } } public int getRowsSize() { return (this.rows == null) ? 0 : this.rows.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TRow> getRowsIterator() { return (this.rows == null) ? null : this.rows.iterator(); } public void addToRows(TRow elem) { if (this.rows == null) { this.rows = new java.util.ArrayList<TRow>(); } this.rows.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TRow> getRows() { return this.rows; } public TRowSet setRows(@org.apache.thrift.annotation.Nullable java.util.List<TRow> rows) { this.rows = rows; return this; } public void unsetRows() { this.rows = null; } /** Returns true if field rows is set (has been assigned a value) and false otherwise */ public boolean isSetRows() { return this.rows != null; } public void setRowsIsSet(boolean value) { if (!value) { this.rows = null; } } public int getColumnsSize() { return (this.columns == null) ? 0 : this.columns.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TColumn> getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } public void addToColumns(TColumn elem) { if (this.columns == null) { this.columns = new java.util.ArrayList<TColumn>(); } this.columns.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TColumn> getColumns() { return this.columns; } public TRowSet setColumns(@org.apache.thrift.annotation.Nullable java.util.List<TColumn> columns) { this.columns = columns; return this; } public void unsetColumns() { this.columns = null; } /** Returns true if field columns is set (has been assigned a value) and false otherwise */ public boolean isSetColumns() { return this.columns != null; } public void setColumnsIsSet(boolean value) { if (!value) { this.columns = null; } } public boolean isIs_columnar() { return this.is_columnar; } public TRowSet setIs_columnar(boolean is_columnar) { this.is_columnar = is_columnar; setIs_columnarIsSet(true); return this; } public void unsetIs_columnar() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_COLUMNAR_ISSET_ID); } /** Returns true if field is_columnar is set (has been assigned a value) and false otherwise */ public boolean isSetIs_columnar() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_COLUMNAR_ISSET_ID); } public void setIs_columnarIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_COLUMNAR_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ROW_DESC: if (value == null) { unsetRow_desc(); } else { setRow_desc((java.util.List<TColumnType>)value); } break; case ROWS: if (value == null) { unsetRows(); } else { setRows((java.util.List<TRow>)value); } break; case COLUMNS: if (value == null) { unsetColumns(); } else { setColumns((java.util.List<TColumn>)value); } break; case IS_COLUMNAR: if (value == null) { unsetIs_columnar(); } else { setIs_columnar((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ROW_DESC: return getRow_desc(); case ROWS: return getRows(); case COLUMNS: return getColumns(); case IS_COLUMNAR: return isIs_columnar(); } 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 ROW_DESC: return isSetRow_desc(); case ROWS: return isSetRows(); case COLUMNS: return isSetColumns(); case IS_COLUMNAR: return isSetIs_columnar(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TRowSet) return this.equals((TRowSet)that); return false; } public boolean equals(TRowSet that) { if (that == null) return false; if (this == that) return true; boolean this_present_row_desc = true && this.isSetRow_desc(); boolean that_present_row_desc = true && that.isSetRow_desc(); if (this_present_row_desc || that_present_row_desc) { if (!(this_present_row_desc && that_present_row_desc)) return false; if (!this.row_desc.equals(that.row_desc)) return false; } boolean this_present_rows = true && this.isSetRows(); boolean that_present_rows = true && that.isSetRows(); if (this_present_rows || that_present_rows) { if (!(this_present_rows && that_present_rows)) return false; if (!this.rows.equals(that.rows)) return false; } boolean this_present_columns = true && this.isSetColumns(); boolean that_present_columns = true && that.isSetColumns(); if (this_present_columns || that_present_columns) { if (!(this_present_columns && that_present_columns)) return false; if (!this.columns.equals(that.columns)) return false; } boolean this_present_is_columnar = true; boolean that_present_is_columnar = true; if (this_present_is_columnar || that_present_is_columnar) { if (!(this_present_is_columnar && that_present_is_columnar)) return false; if (this.is_columnar != that.is_columnar) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetRow_desc()) ? 131071 : 524287); if (isSetRow_desc()) hashCode = hashCode * 8191 + row_desc.hashCode(); hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); if (isSetRows()) hashCode = hashCode * 8191 + rows.hashCode(); hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); if (isSetColumns()) hashCode = hashCode * 8191 + columns.hashCode(); hashCode = hashCode * 8191 + ((is_columnar) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TRowSet other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetRow_desc(), other.isSetRow_desc()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_desc()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_desc, other.row_desc); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRows(), other.isSetRows()); if (lastComparison != 0) { return lastComparison; } if (isSetRows()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetColumns(), other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } if (isSetColumns()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_columnar(), other.isSetIs_columnar()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_columnar()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_columnar, other.is_columnar); 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("TRowSet("); boolean first = true; sb.append("row_desc:"); if (this.row_desc == null) { sb.append("null"); } else { sb.append(this.row_desc); } first = false; if (!first) sb.append(", "); sb.append("rows:"); if (this.rows == null) { sb.append("null"); } else { sb.append(this.rows); } first = false; if (!first) sb.append(", "); sb.append("columns:"); if (this.columns == null) { sb.append("null"); } else { sb.append(this.columns); } first = false; if (!first) sb.append(", "); sb.append("is_columnar:"); sb.append(this.is_columnar); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TRowSetStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowSetStandardScheme getScheme() { return new TRowSetStandardScheme(); } } private static class TRowSetStandardScheme extends org.apache.thrift.scheme.StandardScheme<TRowSet> { public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet 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: // ROW_DESC if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list72 = iprot.readListBegin(); struct.row_desc = new java.util.ArrayList<TColumnType>(_list72.size); @org.apache.thrift.annotation.Nullable TColumnType _elem73; for (int _i74 = 0; _i74 < _list72.size; ++_i74) { _elem73 = new TColumnType(); _elem73.read(iprot); struct.row_desc.add(_elem73); } iprot.readListEnd(); } struct.setRow_descIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // ROWS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list75 = iprot.readListBegin(); struct.rows = new java.util.ArrayList<TRow>(_list75.size); @org.apache.thrift.annotation.Nullable TRow _elem76; for (int _i77 = 0; _i77 < _list75.size; ++_i77) { _elem76 = new TRow(); _elem76.read(iprot); struct.rows.add(_elem76); } iprot.readListEnd(); } struct.setRowsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // COLUMNS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); struct.columns = new java.util.ArrayList<TColumn>(_list78.size); @org.apache.thrift.annotation.Nullable TColumn _elem79; for (int _i80 = 0; _i80 < _list78.size; ++_i80) { _elem79 = new TColumn(); _elem79.read(iprot); struct.columns.add(_elem79); } iprot.readListEnd(); } struct.setColumnsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // IS_COLUMNAR if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_columnar = iprot.readBool(); struct.setIs_columnarIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.row_desc != null) { oprot.writeFieldBegin(ROW_DESC_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.row_desc.size())); for (TColumnType _iter81 : struct.row_desc) { _iter81.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.rows != null) { oprot.writeFieldBegin(ROWS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); for (TRow _iter82 : struct.rows) { _iter82.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.columns != null) { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); for (TColumn _iter83 : struct.columns) { _iter83.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_COLUMNAR_FIELD_DESC); oprot.writeBool(struct.is_columnar); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TRowSetTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowSetTupleScheme getScheme() { return new TRowSetTupleScheme(); } } private static class TRowSetTupleScheme extends org.apache.thrift.scheme.TupleScheme<TRowSet> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetRow_desc()) { optionals.set(0); } if (struct.isSetRows()) { optionals.set(1); } if (struct.isSetColumns()) { optionals.set(2); } if (struct.isSetIs_columnar()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetRow_desc()) { { oprot.writeI32(struct.row_desc.size()); for (TColumnType _iter84 : struct.row_desc) { _iter84.write(oprot); } } } if (struct.isSetRows()) { { oprot.writeI32(struct.rows.size()); for (TRow _iter85 : struct.rows) { _iter85.write(oprot); } } } if (struct.isSetColumns()) { { oprot.writeI32(struct.columns.size()); for (TColumn _iter86 : struct.columns) { _iter86.write(oprot); } } } if (struct.isSetIs_columnar()) { oprot.writeBool(struct.is_columnar); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list87 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.row_desc = new java.util.ArrayList<TColumnType>(_list87.size); @org.apache.thrift.annotation.Nullable TColumnType _elem88; for (int _i89 = 0; _i89 < _list87.size; ++_i89) { _elem88 = new TColumnType(); _elem88.read(iprot); struct.row_desc.add(_elem88); } } struct.setRow_descIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list90 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.rows = new java.util.ArrayList<TRow>(_list90.size); @org.apache.thrift.annotation.Nullable TRow _elem91; for (int _i92 = 0; _i92 < _list90.size; ++_i92) { _elem91 = new TRow(); _elem91.read(iprot); struct.rows.add(_elem91); } } struct.setRowsIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list93 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.columns = new java.util.ArrayList<TColumn>(_list93.size); @org.apache.thrift.annotation.Nullable TColumn _elem94; for (int _i95 = 0; _i95 < _list93.size; ++_i95) { _elem94 = new TColumn(); _elem94.read(iprot); struct.columns.add(_elem94); } } struct.setColumnsIsSet(true); } if (incoming.get(3)) { struct.is_columnar = iprot.readBool(); struct.setIs_columnarIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TSerializedRows.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TSerializedRows implements org.apache.thrift.TBase<TSerializedRows, TSerializedRows._Fields>, java.io.Serializable, Cloneable, Comparable<TSerializedRows> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSerializedRows"); private static final org.apache.thrift.protocol.TField BUFFERS_FIELD_DESC = new org.apache.thrift.protocol.TField("buffers", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField BUFFER_LENGTHS_FIELD_DESC = new org.apache.thrift.protocol.TField("buffer_lengths", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.protocol.TField BUFFERS_TOTAL_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("buffers_total_size", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField TOTAL_COMPRESSION_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("total_compression_time_ms", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField DESCRIPTOR_FIELD_DESC = new org.apache.thrift.protocol.TField("descriptor", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final org.apache.thrift.protocol.TField TARGETS_FIELD_DESC = new org.apache.thrift.protocol.TField("targets", org.apache.thrift.protocol.TType.LIST, (short)6); private static final org.apache.thrift.protocol.TField TARGET_INIT_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("target_init_vals", org.apache.thrift.protocol.TType.LIST, (short)7); private static final org.apache.thrift.protocol.TField VARLEN_BUFFER_FIELD_DESC = new org.apache.thrift.protocol.TField("varlen_buffer", org.apache.thrift.protocol.TType.LIST, (short)8); private static final org.apache.thrift.protocol.TField COUNT_DISTINCT_SETS_FIELD_DESC = new org.apache.thrift.protocol.TField("count_distinct_sets", org.apache.thrift.protocol.TType.LIST, (short)9); private static final org.apache.thrift.protocol.TField EXPLANATION_FIELD_DESC = new org.apache.thrift.protocol.TField("explanation", org.apache.thrift.protocol.TType.STRING, (short)10); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSerializedRowsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSerializedRowsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List<java.nio.ByteBuffer> buffers; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> buffer_lengths; // required public long buffers_total_size; // required public int total_compression_time_ms; // required public @org.apache.thrift.annotation.Nullable TResultSetBufferDescriptor descriptor; // required public @org.apache.thrift.annotation.Nullable java.util.List<TTargetInfo> targets; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> target_init_vals; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.nio.ByteBuffer> varlen_buffer; // required public @org.apache.thrift.annotation.Nullable java.util.List<TCountDistinctSet> count_distinct_sets; // required public @org.apache.thrift.annotation.Nullable java.lang.String explanation; // 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 { BUFFERS((short)1, "buffers"), BUFFER_LENGTHS((short)2, "buffer_lengths"), BUFFERS_TOTAL_SIZE((short)3, "buffers_total_size"), TOTAL_COMPRESSION_TIME_MS((short)4, "total_compression_time_ms"), DESCRIPTOR((short)5, "descriptor"), TARGETS((short)6, "targets"), TARGET_INIT_VALS((short)7, "target_init_vals"), VARLEN_BUFFER((short)8, "varlen_buffer"), COUNT_DISTINCT_SETS((short)9, "count_distinct_sets"), EXPLANATION((short)10, "explanation"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // BUFFERS return BUFFERS; case 2: // BUFFER_LENGTHS return BUFFER_LENGTHS; case 3: // BUFFERS_TOTAL_SIZE return BUFFERS_TOTAL_SIZE; case 4: // TOTAL_COMPRESSION_TIME_MS return TOTAL_COMPRESSION_TIME_MS; case 5: // DESCRIPTOR return DESCRIPTOR; case 6: // TARGETS return TARGETS; case 7: // TARGET_INIT_VALS return TARGET_INIT_VALS; case 8: // VARLEN_BUFFER return VARLEN_BUFFER; case 9: // COUNT_DISTINCT_SETS return COUNT_DISTINCT_SETS; case 10: // EXPLANATION return EXPLANATION; 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 __BUFFERS_TOTAL_SIZE_ISSET_ID = 0; private static final int __TOTAL_COMPRESSION_TIME_MS_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.BUFFERS, new org.apache.thrift.meta_data.FieldMetaData("buffers", org.apache.thrift.TFieldRequirementType.DEFAULT, 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 , true)))); tmpMap.put(_Fields.BUFFER_LENGTHS, new org.apache.thrift.meta_data.FieldMetaData("buffer_lengths", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I64)))); tmpMap.put(_Fields.BUFFERS_TOTAL_SIZE, new org.apache.thrift.meta_data.FieldMetaData("buffers_total_size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TOTAL_COMPRESSION_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("total_compression_time_ms", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DESCRIPTOR, new org.apache.thrift.meta_data.FieldMetaData("descriptor", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TResultSetBufferDescriptor.class))); tmpMap.put(_Fields.TARGETS, new org.apache.thrift.meta_data.FieldMetaData("targets", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTargetInfo.class)))); tmpMap.put(_Fields.TARGET_INIT_VALS, new org.apache.thrift.meta_data.FieldMetaData("target_init_vals", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I64)))); tmpMap.put(_Fields.VARLEN_BUFFER, new org.apache.thrift.meta_data.FieldMetaData("varlen_buffer", org.apache.thrift.TFieldRequirementType.DEFAULT, 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 , true)))); tmpMap.put(_Fields.COUNT_DISTINCT_SETS, new org.apache.thrift.meta_data.FieldMetaData("count_distinct_sets", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCountDistinctSet.class)))); tmpMap.put(_Fields.EXPLANATION, new org.apache.thrift.meta_data.FieldMetaData("explanation", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TSerializedRows.class, metaDataMap); } public TSerializedRows() { } public TSerializedRows( java.util.List<java.nio.ByteBuffer> buffers, java.util.List<java.lang.Long> buffer_lengths, long buffers_total_size, int total_compression_time_ms, TResultSetBufferDescriptor descriptor, java.util.List<TTargetInfo> targets, java.util.List<java.lang.Long> target_init_vals, java.util.List<java.nio.ByteBuffer> varlen_buffer, java.util.List<TCountDistinctSet> count_distinct_sets, java.lang.String explanation) { this(); this.buffers = buffers; this.buffer_lengths = buffer_lengths; this.buffers_total_size = buffers_total_size; setBuffers_total_sizeIsSet(true); this.total_compression_time_ms = total_compression_time_ms; setTotal_compression_time_msIsSet(true); this.descriptor = descriptor; this.targets = targets; this.target_init_vals = target_init_vals; this.varlen_buffer = varlen_buffer; this.count_distinct_sets = count_distinct_sets; this.explanation = explanation; } /** * Performs a deep copy on <i>other</i>. */ public TSerializedRows(TSerializedRows other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetBuffers()) { java.util.List<java.nio.ByteBuffer> __this__buffers = new java.util.ArrayList<java.nio.ByteBuffer>(other.buffers); this.buffers = __this__buffers; } if (other.isSetBuffer_lengths()) { java.util.List<java.lang.Long> __this__buffer_lengths = new java.util.ArrayList<java.lang.Long>(other.buffer_lengths); this.buffer_lengths = __this__buffer_lengths; } this.buffers_total_size = other.buffers_total_size; this.total_compression_time_ms = other.total_compression_time_ms; if (other.isSetDescriptor()) { this.descriptor = new TResultSetBufferDescriptor(other.descriptor); } if (other.isSetTargets()) { java.util.List<TTargetInfo> __this__targets = new java.util.ArrayList<TTargetInfo>(other.targets.size()); for (TTargetInfo other_element : other.targets) { __this__targets.add(new TTargetInfo(other_element)); } this.targets = __this__targets; } if (other.isSetTarget_init_vals()) { java.util.List<java.lang.Long> __this__target_init_vals = new java.util.ArrayList<java.lang.Long>(other.target_init_vals); this.target_init_vals = __this__target_init_vals; } if (other.isSetVarlen_buffer()) { java.util.List<java.nio.ByteBuffer> __this__varlen_buffer = new java.util.ArrayList<java.nio.ByteBuffer>(other.varlen_buffer); this.varlen_buffer = __this__varlen_buffer; } if (other.isSetCount_distinct_sets()) { java.util.List<TCountDistinctSet> __this__count_distinct_sets = new java.util.ArrayList<TCountDistinctSet>(other.count_distinct_sets.size()); for (TCountDistinctSet other_element : other.count_distinct_sets) { __this__count_distinct_sets.add(new TCountDistinctSet(other_element)); } this.count_distinct_sets = __this__count_distinct_sets; } if (other.isSetExplanation()) { this.explanation = other.explanation; } } public TSerializedRows deepCopy() { return new TSerializedRows(this); } @Override public void clear() { this.buffers = null; this.buffer_lengths = null; setBuffers_total_sizeIsSet(false); this.buffers_total_size = 0; setTotal_compression_time_msIsSet(false); this.total_compression_time_ms = 0; this.descriptor = null; this.targets = null; this.target_init_vals = null; this.varlen_buffer = null; this.count_distinct_sets = null; this.explanation = null; } public int getBuffersSize() { return (this.buffers == null) ? 0 : this.buffers.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.nio.ByteBuffer> getBuffersIterator() { return (this.buffers == null) ? null : this.buffers.iterator(); } public void addToBuffers(java.nio.ByteBuffer elem) { if (this.buffers == null) { this.buffers = new java.util.ArrayList<java.nio.ByteBuffer>(); } this.buffers.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.nio.ByteBuffer> getBuffers() { return this.buffers; } public TSerializedRows setBuffers(@org.apache.thrift.annotation.Nullable java.util.List<java.nio.ByteBuffer> buffers) { this.buffers = buffers; return this; } public void unsetBuffers() { this.buffers = null; } /** Returns true if field buffers is set (has been assigned a value) and false otherwise */ public boolean isSetBuffers() { return this.buffers != null; } public void setBuffersIsSet(boolean value) { if (!value) { this.buffers = null; } } public int getBuffer_lengthsSize() { return (this.buffer_lengths == null) ? 0 : this.buffer_lengths.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Long> getBuffer_lengthsIterator() { return (this.buffer_lengths == null) ? null : this.buffer_lengths.iterator(); } public void addToBuffer_lengths(long elem) { if (this.buffer_lengths == null) { this.buffer_lengths = new java.util.ArrayList<java.lang.Long>(); } this.buffer_lengths.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Long> getBuffer_lengths() { return this.buffer_lengths; } public TSerializedRows setBuffer_lengths(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> buffer_lengths) { this.buffer_lengths = buffer_lengths; return this; } public void unsetBuffer_lengths() { this.buffer_lengths = null; } /** Returns true if field buffer_lengths is set (has been assigned a value) and false otherwise */ public boolean isSetBuffer_lengths() { return this.buffer_lengths != null; } public void setBuffer_lengthsIsSet(boolean value) { if (!value) { this.buffer_lengths = null; } } public long getBuffers_total_size() { return this.buffers_total_size; } public TSerializedRows setBuffers_total_size(long buffers_total_size) { this.buffers_total_size = buffers_total_size; setBuffers_total_sizeIsSet(true); return this; } public void unsetBuffers_total_size() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BUFFERS_TOTAL_SIZE_ISSET_ID); } /** Returns true if field buffers_total_size is set (has been assigned a value) and false otherwise */ public boolean isSetBuffers_total_size() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BUFFERS_TOTAL_SIZE_ISSET_ID); } public void setBuffers_total_sizeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BUFFERS_TOTAL_SIZE_ISSET_ID, value); } public int getTotal_compression_time_ms() { return this.total_compression_time_ms; } public TSerializedRows setTotal_compression_time_ms(int total_compression_time_ms) { this.total_compression_time_ms = total_compression_time_ms; setTotal_compression_time_msIsSet(true); return this; } public void unsetTotal_compression_time_ms() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TOTAL_COMPRESSION_TIME_MS_ISSET_ID); } /** Returns true if field total_compression_time_ms is set (has been assigned a value) and false otherwise */ public boolean isSetTotal_compression_time_ms() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TOTAL_COMPRESSION_TIME_MS_ISSET_ID); } public void setTotal_compression_time_msIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TOTAL_COMPRESSION_TIME_MS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public TResultSetBufferDescriptor getDescriptor() { return this.descriptor; } public TSerializedRows setDescriptor(@org.apache.thrift.annotation.Nullable TResultSetBufferDescriptor descriptor) { this.descriptor = descriptor; return this; } public void unsetDescriptor() { this.descriptor = null; } /** Returns true if field descriptor is set (has been assigned a value) and false otherwise */ public boolean isSetDescriptor() { return this.descriptor != null; } public void setDescriptorIsSet(boolean value) { if (!value) { this.descriptor = null; } } public int getTargetsSize() { return (this.targets == null) ? 0 : this.targets.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TTargetInfo> getTargetsIterator() { return (this.targets == null) ? null : this.targets.iterator(); } public void addToTargets(TTargetInfo elem) { if (this.targets == null) { this.targets = new java.util.ArrayList<TTargetInfo>(); } this.targets.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TTargetInfo> getTargets() { return this.targets; } public TSerializedRows setTargets(@org.apache.thrift.annotation.Nullable java.util.List<TTargetInfo> targets) { this.targets = targets; return this; } public void unsetTargets() { this.targets = null; } /** Returns true if field targets is set (has been assigned a value) and false otherwise */ public boolean isSetTargets() { return this.targets != null; } public void setTargetsIsSet(boolean value) { if (!value) { this.targets = null; } } public int getTarget_init_valsSize() { return (this.target_init_vals == null) ? 0 : this.target_init_vals.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.Long> getTarget_init_valsIterator() { return (this.target_init_vals == null) ? null : this.target_init_vals.iterator(); } public void addToTarget_init_vals(long elem) { if (this.target_init_vals == null) { this.target_init_vals = new java.util.ArrayList<java.lang.Long>(); } this.target_init_vals.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.Long> getTarget_init_vals() { return this.target_init_vals; } public TSerializedRows setTarget_init_vals(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> target_init_vals) { this.target_init_vals = target_init_vals; return this; } public void unsetTarget_init_vals() { this.target_init_vals = null; } /** Returns true if field target_init_vals is set (has been assigned a value) and false otherwise */ public boolean isSetTarget_init_vals() { return this.target_init_vals != null; } public void setTarget_init_valsIsSet(boolean value) { if (!value) { this.target_init_vals = null; } } public int getVarlen_bufferSize() { return (this.varlen_buffer == null) ? 0 : this.varlen_buffer.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.nio.ByteBuffer> getVarlen_bufferIterator() { return (this.varlen_buffer == null) ? null : this.varlen_buffer.iterator(); } public void addToVarlen_buffer(java.nio.ByteBuffer elem) { if (this.varlen_buffer == null) { this.varlen_buffer = new java.util.ArrayList<java.nio.ByteBuffer>(); } this.varlen_buffer.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.nio.ByteBuffer> getVarlen_buffer() { return this.varlen_buffer; } public TSerializedRows setVarlen_buffer(@org.apache.thrift.annotation.Nullable java.util.List<java.nio.ByteBuffer> varlen_buffer) { this.varlen_buffer = varlen_buffer; return this; } public void unsetVarlen_buffer() { this.varlen_buffer = null; } /** Returns true if field varlen_buffer is set (has been assigned a value) and false otherwise */ public boolean isSetVarlen_buffer() { return this.varlen_buffer != null; } public void setVarlen_bufferIsSet(boolean value) { if (!value) { this.varlen_buffer = null; } } public int getCount_distinct_setsSize() { return (this.count_distinct_sets == null) ? 0 : this.count_distinct_sets.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TCountDistinctSet> getCount_distinct_setsIterator() { return (this.count_distinct_sets == null) ? null : this.count_distinct_sets.iterator(); } public void addToCount_distinct_sets(TCountDistinctSet elem) { if (this.count_distinct_sets == null) { this.count_distinct_sets = new java.util.ArrayList<TCountDistinctSet>(); } this.count_distinct_sets.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TCountDistinctSet> getCount_distinct_sets() { return this.count_distinct_sets; } public TSerializedRows setCount_distinct_sets(@org.apache.thrift.annotation.Nullable java.util.List<TCountDistinctSet> count_distinct_sets) { this.count_distinct_sets = count_distinct_sets; return this; } public void unsetCount_distinct_sets() { this.count_distinct_sets = null; } /** Returns true if field count_distinct_sets is set (has been assigned a value) and false otherwise */ public boolean isSetCount_distinct_sets() { return this.count_distinct_sets != null; } public void setCount_distinct_setsIsSet(boolean value) { if (!value) { this.count_distinct_sets = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getExplanation() { return this.explanation; } public TSerializedRows setExplanation(@org.apache.thrift.annotation.Nullable java.lang.String explanation) { this.explanation = explanation; return this; } public void unsetExplanation() { this.explanation = null; } /** Returns true if field explanation is set (has been assigned a value) and false otherwise */ public boolean isSetExplanation() { return this.explanation != null; } public void setExplanationIsSet(boolean value) { if (!value) { this.explanation = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case BUFFERS: if (value == null) { unsetBuffers(); } else { setBuffers((java.util.List<java.nio.ByteBuffer>)value); } break; case BUFFER_LENGTHS: if (value == null) { unsetBuffer_lengths(); } else { setBuffer_lengths((java.util.List<java.lang.Long>)value); } break; case BUFFERS_TOTAL_SIZE: if (value == null) { unsetBuffers_total_size(); } else { setBuffers_total_size((java.lang.Long)value); } break; case TOTAL_COMPRESSION_TIME_MS: if (value == null) { unsetTotal_compression_time_ms(); } else { setTotal_compression_time_ms((java.lang.Integer)value); } break; case DESCRIPTOR: if (value == null) { unsetDescriptor(); } else { setDescriptor((TResultSetBufferDescriptor)value); } break; case TARGETS: if (value == null) { unsetTargets(); } else { setTargets((java.util.List<TTargetInfo>)value); } break; case TARGET_INIT_VALS: if (value == null) { unsetTarget_init_vals(); } else { setTarget_init_vals((java.util.List<java.lang.Long>)value); } break; case VARLEN_BUFFER: if (value == null) { unsetVarlen_buffer(); } else { setVarlen_buffer((java.util.List<java.nio.ByteBuffer>)value); } break; case COUNT_DISTINCT_SETS: if (value == null) { unsetCount_distinct_sets(); } else { setCount_distinct_sets((java.util.List<TCountDistinctSet>)value); } break; case EXPLANATION: if (value == null) { unsetExplanation(); } else { setExplanation((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case BUFFERS: return getBuffers(); case BUFFER_LENGTHS: return getBuffer_lengths(); case BUFFERS_TOTAL_SIZE: return getBuffers_total_size(); case TOTAL_COMPRESSION_TIME_MS: return getTotal_compression_time_ms(); case DESCRIPTOR: return getDescriptor(); case TARGETS: return getTargets(); case TARGET_INIT_VALS: return getTarget_init_vals(); case VARLEN_BUFFER: return getVarlen_buffer(); case COUNT_DISTINCT_SETS: return getCount_distinct_sets(); case EXPLANATION: return getExplanation(); } 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 BUFFERS: return isSetBuffers(); case BUFFER_LENGTHS: return isSetBuffer_lengths(); case BUFFERS_TOTAL_SIZE: return isSetBuffers_total_size(); case TOTAL_COMPRESSION_TIME_MS: return isSetTotal_compression_time_ms(); case DESCRIPTOR: return isSetDescriptor(); case TARGETS: return isSetTargets(); case TARGET_INIT_VALS: return isSetTarget_init_vals(); case VARLEN_BUFFER: return isSetVarlen_buffer(); case COUNT_DISTINCT_SETS: return isSetCount_distinct_sets(); case EXPLANATION: return isSetExplanation(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TSerializedRows) return this.equals((TSerializedRows)that); return false; } public boolean equals(TSerializedRows that) { if (that == null) return false; if (this == that) return true; boolean this_present_buffers = true && this.isSetBuffers(); boolean that_present_buffers = true && that.isSetBuffers(); if (this_present_buffers || that_present_buffers) { if (!(this_present_buffers && that_present_buffers)) return false; if (!this.buffers.equals(that.buffers)) return false; } boolean this_present_buffer_lengths = true && this.isSetBuffer_lengths(); boolean that_present_buffer_lengths = true && that.isSetBuffer_lengths(); if (this_present_buffer_lengths || that_present_buffer_lengths) { if (!(this_present_buffer_lengths && that_present_buffer_lengths)) return false; if (!this.buffer_lengths.equals(that.buffer_lengths)) return false; } boolean this_present_buffers_total_size = true; boolean that_present_buffers_total_size = true; if (this_present_buffers_total_size || that_present_buffers_total_size) { if (!(this_present_buffers_total_size && that_present_buffers_total_size)) return false; if (this.buffers_total_size != that.buffers_total_size) return false; } boolean this_present_total_compression_time_ms = true; boolean that_present_total_compression_time_ms = true; if (this_present_total_compression_time_ms || that_present_total_compression_time_ms) { if (!(this_present_total_compression_time_ms && that_present_total_compression_time_ms)) return false; if (this.total_compression_time_ms != that.total_compression_time_ms) return false; } boolean this_present_descriptor = true && this.isSetDescriptor(); boolean that_present_descriptor = true && that.isSetDescriptor(); if (this_present_descriptor || that_present_descriptor) { if (!(this_present_descriptor && that_present_descriptor)) return false; if (!this.descriptor.equals(that.descriptor)) return false; } boolean this_present_targets = true && this.isSetTargets(); boolean that_present_targets = true && that.isSetTargets(); if (this_present_targets || that_present_targets) { if (!(this_present_targets && that_present_targets)) return false; if (!this.targets.equals(that.targets)) return false; } boolean this_present_target_init_vals = true && this.isSetTarget_init_vals(); boolean that_present_target_init_vals = true && that.isSetTarget_init_vals(); if (this_present_target_init_vals || that_present_target_init_vals) { if (!(this_present_target_init_vals && that_present_target_init_vals)) return false; if (!this.target_init_vals.equals(that.target_init_vals)) return false; } boolean this_present_varlen_buffer = true && this.isSetVarlen_buffer(); boolean that_present_varlen_buffer = true && that.isSetVarlen_buffer(); if (this_present_varlen_buffer || that_present_varlen_buffer) { if (!(this_present_varlen_buffer && that_present_varlen_buffer)) return false; if (!this.varlen_buffer.equals(that.varlen_buffer)) return false; } boolean this_present_count_distinct_sets = true && this.isSetCount_distinct_sets(); boolean that_present_count_distinct_sets = true && that.isSetCount_distinct_sets(); if (this_present_count_distinct_sets || that_present_count_distinct_sets) { if (!(this_present_count_distinct_sets && that_present_count_distinct_sets)) return false; if (!this.count_distinct_sets.equals(that.count_distinct_sets)) return false; } boolean this_present_explanation = true && this.isSetExplanation(); boolean that_present_explanation = true && that.isSetExplanation(); if (this_present_explanation || that_present_explanation) { if (!(this_present_explanation && that_present_explanation)) return false; if (!this.explanation.equals(that.explanation)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetBuffers()) ? 131071 : 524287); if (isSetBuffers()) hashCode = hashCode * 8191 + buffers.hashCode(); hashCode = hashCode * 8191 + ((isSetBuffer_lengths()) ? 131071 : 524287); if (isSetBuffer_lengths()) hashCode = hashCode * 8191 + buffer_lengths.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(buffers_total_size); hashCode = hashCode * 8191 + total_compression_time_ms; hashCode = hashCode * 8191 + ((isSetDescriptor()) ? 131071 : 524287); if (isSetDescriptor()) hashCode = hashCode * 8191 + descriptor.hashCode(); hashCode = hashCode * 8191 + ((isSetTargets()) ? 131071 : 524287); if (isSetTargets()) hashCode = hashCode * 8191 + targets.hashCode(); hashCode = hashCode * 8191 + ((isSetTarget_init_vals()) ? 131071 : 524287); if (isSetTarget_init_vals()) hashCode = hashCode * 8191 + target_init_vals.hashCode(); hashCode = hashCode * 8191 + ((isSetVarlen_buffer()) ? 131071 : 524287); if (isSetVarlen_buffer()) hashCode = hashCode * 8191 + varlen_buffer.hashCode(); hashCode = hashCode * 8191 + ((isSetCount_distinct_sets()) ? 131071 : 524287); if (isSetCount_distinct_sets()) hashCode = hashCode * 8191 + count_distinct_sets.hashCode(); hashCode = hashCode * 8191 + ((isSetExplanation()) ? 131071 : 524287); if (isSetExplanation()) hashCode = hashCode * 8191 + explanation.hashCode(); return hashCode; } @Override public int compareTo(TSerializedRows other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetBuffers(), other.isSetBuffers()); if (lastComparison != 0) { return lastComparison; } if (isSetBuffers()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buffers, other.buffers); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetBuffer_lengths(), other.isSetBuffer_lengths()); if (lastComparison != 0) { return lastComparison; } if (isSetBuffer_lengths()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buffer_lengths, other.buffer_lengths); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetBuffers_total_size(), other.isSetBuffers_total_size()); if (lastComparison != 0) { return lastComparison; } if (isSetBuffers_total_size()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buffers_total_size, other.buffers_total_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTotal_compression_time_ms(), other.isSetTotal_compression_time_ms()); if (lastComparison != 0) { return lastComparison; } if (isSetTotal_compression_time_ms()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_compression_time_ms, other.total_compression_time_ms); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDescriptor(), other.isSetDescriptor()); if (lastComparison != 0) { return lastComparison; } if (isSetDescriptor()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.descriptor, other.descriptor); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTargets(), other.isSetTargets()); if (lastComparison != 0) { return lastComparison; } if (isSetTargets()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.targets, other.targets); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTarget_init_vals(), other.isSetTarget_init_vals()); if (lastComparison != 0) { return lastComparison; } if (isSetTarget_init_vals()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.target_init_vals, other.target_init_vals); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetVarlen_buffer(), other.isSetVarlen_buffer()); if (lastComparison != 0) { return lastComparison; } if (isSetVarlen_buffer()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.varlen_buffer, other.varlen_buffer); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCount_distinct_sets(), other.isSetCount_distinct_sets()); if (lastComparison != 0) { return lastComparison; } if (isSetCount_distinct_sets()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count_distinct_sets, other.count_distinct_sets); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExplanation(), other.isSetExplanation()); if (lastComparison != 0) { return lastComparison; } if (isSetExplanation()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.explanation, other.explanation); 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("TSerializedRows("); boolean first = true; sb.append("buffers:"); if (this.buffers == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.buffers, sb); } first = false; if (!first) sb.append(", "); sb.append("buffer_lengths:"); if (this.buffer_lengths == null) { sb.append("null"); } else { sb.append(this.buffer_lengths); } first = false; if (!first) sb.append(", "); sb.append("buffers_total_size:"); sb.append(this.buffers_total_size); first = false; if (!first) sb.append(", "); sb.append("total_compression_time_ms:"); sb.append(this.total_compression_time_ms); first = false; if (!first) sb.append(", "); sb.append("descriptor:"); if (this.descriptor == null) { sb.append("null"); } else { sb.append(this.descriptor); } first = false; if (!first) sb.append(", "); sb.append("targets:"); if (this.targets == null) { sb.append("null"); } else { sb.append(this.targets); } first = false; if (!first) sb.append(", "); sb.append("target_init_vals:"); if (this.target_init_vals == null) { sb.append("null"); } else { sb.append(this.target_init_vals); } first = false; if (!first) sb.append(", "); sb.append("varlen_buffer:"); if (this.varlen_buffer == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.varlen_buffer, sb); } first = false; if (!first) sb.append(", "); sb.append("count_distinct_sets:"); if (this.count_distinct_sets == null) { sb.append("null"); } else { sb.append(this.count_distinct_sets); } first = false; if (!first) sb.append(", "); sb.append("explanation:"); if (this.explanation == null) { sb.append("null"); } else { sb.append(this.explanation); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (descriptor != null) { descriptor.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 TSerializedRowsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSerializedRowsStandardScheme getScheme() { return new TSerializedRowsStandardScheme(); } } private static class TSerializedRowsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TSerializedRows> { public void read(org.apache.thrift.protocol.TProtocol iprot, TSerializedRows 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: // BUFFERS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list56 = iprot.readListBegin(); struct.buffers = new java.util.ArrayList<java.nio.ByteBuffer>(_list56.size); @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem57; for (int _i58 = 0; _i58 < _list56.size; ++_i58) { _elem57 = iprot.readBinary(); struct.buffers.add(_elem57); } iprot.readListEnd(); } struct.setBuffersIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // BUFFER_LENGTHS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list59 = iprot.readListBegin(); struct.buffer_lengths = new java.util.ArrayList<java.lang.Long>(_list59.size); long _elem60; for (int _i61 = 0; _i61 < _list59.size; ++_i61) { _elem60 = iprot.readI64(); struct.buffer_lengths.add(_elem60); } iprot.readListEnd(); } struct.setBuffer_lengthsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BUFFERS_TOTAL_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.buffers_total_size = iprot.readI64(); struct.setBuffers_total_sizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // TOTAL_COMPRESSION_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.total_compression_time_ms = iprot.readI32(); struct.setTotal_compression_time_msIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // DESCRIPTOR if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.descriptor = new TResultSetBufferDescriptor(); struct.descriptor.read(iprot); struct.setDescriptorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // TARGETS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); struct.targets = new java.util.ArrayList<TTargetInfo>(_list62.size); @org.apache.thrift.annotation.Nullable TTargetInfo _elem63; for (int _i64 = 0; _i64 < _list62.size; ++_i64) { _elem63 = new TTargetInfo(); _elem63.read(iprot); struct.targets.add(_elem63); } iprot.readListEnd(); } struct.setTargetsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // TARGET_INIT_VALS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list65 = iprot.readListBegin(); struct.target_init_vals = new java.util.ArrayList<java.lang.Long>(_list65.size); long _elem66; for (int _i67 = 0; _i67 < _list65.size; ++_i67) { _elem66 = iprot.readI64(); struct.target_init_vals.add(_elem66); } iprot.readListEnd(); } struct.setTarget_init_valsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // VARLEN_BUFFER if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list68 = iprot.readListBegin(); struct.varlen_buffer = new java.util.ArrayList<java.nio.ByteBuffer>(_list68.size); @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem69; for (int _i70 = 0; _i70 < _list68.size; ++_i70) { _elem69 = iprot.readBinary(); struct.varlen_buffer.add(_elem69); } iprot.readListEnd(); } struct.setVarlen_bufferIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // COUNT_DISTINCT_SETS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list71 = iprot.readListBegin(); struct.count_distinct_sets = new java.util.ArrayList<TCountDistinctSet>(_list71.size); @org.apache.thrift.annotation.Nullable TCountDistinctSet _elem72; for (int _i73 = 0; _i73 < _list71.size; ++_i73) { _elem72 = new TCountDistinctSet(); _elem72.read(iprot); struct.count_distinct_sets.add(_elem72); } iprot.readListEnd(); } struct.setCount_distinct_setsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // EXPLANATION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.explanation = iprot.readString(); struct.setExplanationIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TSerializedRows struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.buffers != null) { oprot.writeFieldBegin(BUFFERS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.buffers.size())); for (java.nio.ByteBuffer _iter74 : struct.buffers) { oprot.writeBinary(_iter74); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.buffer_lengths != null) { oprot.writeFieldBegin(BUFFER_LENGTHS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.buffer_lengths.size())); for (long _iter75 : struct.buffer_lengths) { oprot.writeI64(_iter75); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(BUFFERS_TOTAL_SIZE_FIELD_DESC); oprot.writeI64(struct.buffers_total_size); oprot.writeFieldEnd(); oprot.writeFieldBegin(TOTAL_COMPRESSION_TIME_MS_FIELD_DESC); oprot.writeI32(struct.total_compression_time_ms); oprot.writeFieldEnd(); if (struct.descriptor != null) { oprot.writeFieldBegin(DESCRIPTOR_FIELD_DESC); struct.descriptor.write(oprot); oprot.writeFieldEnd(); } if (struct.targets != null) { oprot.writeFieldBegin(TARGETS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.targets.size())); for (TTargetInfo _iter76 : struct.targets) { _iter76.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.target_init_vals != null) { oprot.writeFieldBegin(TARGET_INIT_VALS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.target_init_vals.size())); for (long _iter77 : struct.target_init_vals) { oprot.writeI64(_iter77); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.varlen_buffer != null) { oprot.writeFieldBegin(VARLEN_BUFFER_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.varlen_buffer.size())); for (java.nio.ByteBuffer _iter78 : struct.varlen_buffer) { oprot.writeBinary(_iter78); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.count_distinct_sets != null) { oprot.writeFieldBegin(COUNT_DISTINCT_SETS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.count_distinct_sets.size())); for (TCountDistinctSet _iter79 : struct.count_distinct_sets) { _iter79.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.explanation != null) { oprot.writeFieldBegin(EXPLANATION_FIELD_DESC); oprot.writeString(struct.explanation); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TSerializedRowsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSerializedRowsTupleScheme getScheme() { return new TSerializedRowsTupleScheme(); } } private static class TSerializedRowsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TSerializedRows> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSerializedRows struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetBuffers()) { optionals.set(0); } if (struct.isSetBuffer_lengths()) { optionals.set(1); } if (struct.isSetBuffers_total_size()) { optionals.set(2); } if (struct.isSetTotal_compression_time_ms()) { optionals.set(3); } if (struct.isSetDescriptor()) { optionals.set(4); } if (struct.isSetTargets()) { optionals.set(5); } if (struct.isSetTarget_init_vals()) { optionals.set(6); } if (struct.isSetVarlen_buffer()) { optionals.set(7); } if (struct.isSetCount_distinct_sets()) { optionals.set(8); } if (struct.isSetExplanation()) { optionals.set(9); } oprot.writeBitSet(optionals, 10); if (struct.isSetBuffers()) { { oprot.writeI32(struct.buffers.size()); for (java.nio.ByteBuffer _iter80 : struct.buffers) { oprot.writeBinary(_iter80); } } } if (struct.isSetBuffer_lengths()) { { oprot.writeI32(struct.buffer_lengths.size()); for (long _iter81 : struct.buffer_lengths) { oprot.writeI64(_iter81); } } } if (struct.isSetBuffers_total_size()) { oprot.writeI64(struct.buffers_total_size); } if (struct.isSetTotal_compression_time_ms()) { oprot.writeI32(struct.total_compression_time_ms); } if (struct.isSetDescriptor()) { struct.descriptor.write(oprot); } if (struct.isSetTargets()) { { oprot.writeI32(struct.targets.size()); for (TTargetInfo _iter82 : struct.targets) { _iter82.write(oprot); } } } if (struct.isSetTarget_init_vals()) { { oprot.writeI32(struct.target_init_vals.size()); for (long _iter83 : struct.target_init_vals) { oprot.writeI64(_iter83); } } } if (struct.isSetVarlen_buffer()) { { oprot.writeI32(struct.varlen_buffer.size()); for (java.nio.ByteBuffer _iter84 : struct.varlen_buffer) { oprot.writeBinary(_iter84); } } } if (struct.isSetCount_distinct_sets()) { { oprot.writeI32(struct.count_distinct_sets.size()); for (TCountDistinctSet _iter85 : struct.count_distinct_sets) { _iter85.write(oprot); } } } if (struct.isSetExplanation()) { oprot.writeString(struct.explanation); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSerializedRows struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(10); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); struct.buffers = new java.util.ArrayList<java.nio.ByteBuffer>(_list86.size); @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem87; for (int _i88 = 0; _i88 < _list86.size; ++_i88) { _elem87 = iprot.readBinary(); struct.buffers.add(_elem87); } } struct.setBuffersIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list89 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); struct.buffer_lengths = new java.util.ArrayList<java.lang.Long>(_list89.size); long _elem90; for (int _i91 = 0; _i91 < _list89.size; ++_i91) { _elem90 = iprot.readI64(); struct.buffer_lengths.add(_elem90); } } struct.setBuffer_lengthsIsSet(true); } if (incoming.get(2)) { struct.buffers_total_size = iprot.readI64(); struct.setBuffers_total_sizeIsSet(true); } if (incoming.get(3)) { struct.total_compression_time_ms = iprot.readI32(); struct.setTotal_compression_time_msIsSet(true); } if (incoming.get(4)) { struct.descriptor = new TResultSetBufferDescriptor(); struct.descriptor.read(iprot); struct.setDescriptorIsSet(true); } if (incoming.get(5)) { { org.apache.thrift.protocol.TList _list92 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.targets = new java.util.ArrayList<TTargetInfo>(_list92.size); @org.apache.thrift.annotation.Nullable TTargetInfo _elem93; for (int _i94 = 0; _i94 < _list92.size; ++_i94) { _elem93 = new TTargetInfo(); _elem93.read(iprot); struct.targets.add(_elem93); } } struct.setTargetsIsSet(true); } if (incoming.get(6)) { { org.apache.thrift.protocol.TList _list95 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64); struct.target_init_vals = new java.util.ArrayList<java.lang.Long>(_list95.size); long _elem96; for (int _i97 = 0; _i97 < _list95.size; ++_i97) { _elem96 = iprot.readI64(); struct.target_init_vals.add(_elem96); } } struct.setTarget_init_valsIsSet(true); } if (incoming.get(7)) { { org.apache.thrift.protocol.TList _list98 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); struct.varlen_buffer = new java.util.ArrayList<java.nio.ByteBuffer>(_list98.size); @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem99; for (int _i100 = 0; _i100 < _list98.size; ++_i100) { _elem99 = iprot.readBinary(); struct.varlen_buffer.add(_elem99); } } struct.setVarlen_bufferIsSet(true); } if (incoming.get(8)) { { org.apache.thrift.protocol.TList _list101 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.count_distinct_sets = new java.util.ArrayList<TCountDistinctSet>(_list101.size); @org.apache.thrift.annotation.Nullable TCountDistinctSet _elem102; for (int _i103 = 0; _i103 < _list101.size; ++_i103) { _elem102 = new TCountDistinctSet(); _elem102.read(iprot); struct.count_distinct_sets.add(_elem102); } } struct.setCount_distinct_setsIsSet(true); } if (incoming.get(9)) { struct.explanation = iprot.readString(); struct.setExplanationIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TServerPermissions.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TServerPermissions implements org.apache.thrift.TBase<TServerPermissions, TServerPermissions._Fields>, java.io.Serializable, Cloneable, Comparable<TServerPermissions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TServerPermissions"); private static final org.apache.thrift.protocol.TField CREATE__FIELD_DESC = new org.apache.thrift.protocol.TField("create_", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField DROP__FIELD_DESC = new org.apache.thrift.protocol.TField("drop_", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField ALTER__FIELD_DESC = new org.apache.thrift.protocol.TField("alter_", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField USAGE__FIELD_DESC = new org.apache.thrift.protocol.TField("usage_", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TServerPermissionsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TServerPermissionsTupleSchemeFactory(); public boolean create_; // required public boolean drop_; // required public boolean alter_; // required public boolean usage_; // 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 { CREATE_((short)1, "create_"), DROP_((short)2, "drop_"), ALTER_((short)3, "alter_"), USAGE_((short)4, "usage_"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // CREATE_ return CREATE_; case 2: // DROP_ return DROP_; case 3: // ALTER_ return ALTER_; case 4: // USAGE_ return USAGE_; 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 __CREATE__ISSET_ID = 0; private static final int __DROP__ISSET_ID = 1; private static final int __ALTER__ISSET_ID = 2; private static final int __USAGE__ISSET_ID = 3; 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.CREATE_, new org.apache.thrift.meta_data.FieldMetaData("create_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DROP_, new org.apache.thrift.meta_data.FieldMetaData("drop_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.ALTER_, new org.apache.thrift.meta_data.FieldMetaData("alter_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.USAGE_, new org.apache.thrift.meta_data.FieldMetaData("usage_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TServerPermissions.class, metaDataMap); } public TServerPermissions() { } public TServerPermissions( boolean create_, boolean drop_, boolean alter_, boolean usage_) { this(); this.create_ = create_; setCreate_IsSet(true); this.drop_ = drop_; setDrop_IsSet(true); this.alter_ = alter_; setAlter_IsSet(true); this.usage_ = usage_; setUsage_IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TServerPermissions(TServerPermissions other) { __isset_bitfield = other.__isset_bitfield; this.create_ = other.create_; this.drop_ = other.drop_; this.alter_ = other.alter_; this.usage_ = other.usage_; } public TServerPermissions deepCopy() { return new TServerPermissions(this); } @Override public void clear() { setCreate_IsSet(false); this.create_ = false; setDrop_IsSet(false); this.drop_ = false; setAlter_IsSet(false); this.alter_ = false; setUsage_IsSet(false); this.usage_ = false; } public boolean isCreate_() { return this.create_; } public TServerPermissions setCreate_(boolean create_) { this.create_ = create_; setCreate_IsSet(true); return this; } public void unsetCreate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATE__ISSET_ID); } /** Returns true if field create_ is set (has been assigned a value) and false otherwise */ public boolean isSetCreate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATE__ISSET_ID); } public void setCreate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATE__ISSET_ID, value); } public boolean isDrop_() { return this.drop_; } public TServerPermissions setDrop_(boolean drop_) { this.drop_ = drop_; setDrop_IsSet(true); return this; } public void unsetDrop_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DROP__ISSET_ID); } /** Returns true if field drop_ is set (has been assigned a value) and false otherwise */ public boolean isSetDrop_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DROP__ISSET_ID); } public void setDrop_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DROP__ISSET_ID, value); } public boolean isAlter_() { return this.alter_; } public TServerPermissions setAlter_(boolean alter_) { this.alter_ = alter_; setAlter_IsSet(true); return this; } public void unsetAlter_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ALTER__ISSET_ID); } /** Returns true if field alter_ is set (has been assigned a value) and false otherwise */ public boolean isSetAlter_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ALTER__ISSET_ID); } public void setAlter_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ALTER__ISSET_ID, value); } public boolean isUsage_() { return this.usage_; } public TServerPermissions setUsage_(boolean usage_) { this.usage_ = usage_; setUsage_IsSet(true); return this; } public void unsetUsage_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __USAGE__ISSET_ID); } /** Returns true if field usage_ is set (has been assigned a value) and false otherwise */ public boolean isSetUsage_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __USAGE__ISSET_ID); } public void setUsage_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __USAGE__ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case CREATE_: if (value == null) { unsetCreate_(); } else { setCreate_((java.lang.Boolean)value); } break; case DROP_: if (value == null) { unsetDrop_(); } else { setDrop_((java.lang.Boolean)value); } break; case ALTER_: if (value == null) { unsetAlter_(); } else { setAlter_((java.lang.Boolean)value); } break; case USAGE_: if (value == null) { unsetUsage_(); } else { setUsage_((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case CREATE_: return isCreate_(); case DROP_: return isDrop_(); case ALTER_: return isAlter_(); case USAGE_: return isUsage_(); } 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 CREATE_: return isSetCreate_(); case DROP_: return isSetDrop_(); case ALTER_: return isSetAlter_(); case USAGE_: return isSetUsage_(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TServerPermissions) return this.equals((TServerPermissions)that); return false; } public boolean equals(TServerPermissions that) { if (that == null) return false; if (this == that) return true; boolean this_present_create_ = true; boolean that_present_create_ = true; if (this_present_create_ || that_present_create_) { if (!(this_present_create_ && that_present_create_)) return false; if (this.create_ != that.create_) return false; } boolean this_present_drop_ = true; boolean that_present_drop_ = true; if (this_present_drop_ || that_present_drop_) { if (!(this_present_drop_ && that_present_drop_)) return false; if (this.drop_ != that.drop_) return false; } boolean this_present_alter_ = true; boolean that_present_alter_ = true; if (this_present_alter_ || that_present_alter_) { if (!(this_present_alter_ && that_present_alter_)) return false; if (this.alter_ != that.alter_) return false; } boolean this_present_usage_ = true; boolean that_present_usage_ = true; if (this_present_usage_ || that_present_usage_) { if (!(this_present_usage_ && that_present_usage_)) return false; if (this.usage_ != that.usage_) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((create_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((drop_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((alter_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((usage_) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TServerPermissions other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetCreate_(), other.isSetCreate_()); if (lastComparison != 0) { return lastComparison; } if (isSetCreate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.create_, other.create_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDrop_(), other.isSetDrop_()); if (lastComparison != 0) { return lastComparison; } if (isSetDrop_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.drop_, other.drop_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetAlter_(), other.isSetAlter_()); if (lastComparison != 0) { return lastComparison; } if (isSetAlter_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.alter_, other.alter_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetUsage_(), other.isSetUsage_()); if (lastComparison != 0) { return lastComparison; } if (isSetUsage_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage_, other.usage_); 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("TServerPermissions("); boolean first = true; sb.append("create_:"); sb.append(this.create_); first = false; if (!first) sb.append(", "); sb.append("drop_:"); sb.append(this.drop_); first = false; if (!first) sb.append(", "); sb.append("alter_:"); sb.append(this.alter_); first = false; if (!first) sb.append(", "); sb.append("usage_:"); sb.append(this.usage_); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TServerPermissionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TServerPermissionsStandardScheme getScheme() { return new TServerPermissionsStandardScheme(); } } private static class TServerPermissionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TServerPermissions> { public void read(org.apache.thrift.protocol.TProtocol iprot, TServerPermissions 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: // CREATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DROP_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.drop_ = iprot.readBool(); struct.setDrop_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // ALTER_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.alter_ = iprot.readBool(); struct.setAlter_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // USAGE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.usage_ = iprot.readBool(); struct.setUsage_IsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TServerPermissions struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CREATE__FIELD_DESC); oprot.writeBool(struct.create_); oprot.writeFieldEnd(); oprot.writeFieldBegin(DROP__FIELD_DESC); oprot.writeBool(struct.drop_); oprot.writeFieldEnd(); oprot.writeFieldBegin(ALTER__FIELD_DESC); oprot.writeBool(struct.alter_); oprot.writeFieldEnd(); oprot.writeFieldBegin(USAGE__FIELD_DESC); oprot.writeBool(struct.usage_); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TServerPermissionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TServerPermissionsTupleScheme getScheme() { return new TServerPermissionsTupleScheme(); } } private static class TServerPermissionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TServerPermissions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TServerPermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCreate_()) { optionals.set(0); } if (struct.isSetDrop_()) { optionals.set(1); } if (struct.isSetAlter_()) { optionals.set(2); } if (struct.isSetUsage_()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetCreate_()) { oprot.writeBool(struct.create_); } if (struct.isSetDrop_()) { oprot.writeBool(struct.drop_); } if (struct.isSetAlter_()) { oprot.writeBool(struct.alter_); } if (struct.isSetUsage_()) { oprot.writeBool(struct.usage_); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TServerPermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } if (incoming.get(1)) { struct.drop_ = iprot.readBool(); struct.setDrop_IsSet(true); } if (incoming.get(2)) { struct.alter_ = iprot.readBool(); struct.setAlter_IsSet(true); } if (incoming.get(3)) { struct.usage_ = iprot.readBool(); struct.setUsage_IsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TServerStatus.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TServerStatus implements org.apache.thrift.TBase<TServerStatus, TServerStatus._Fields>, java.io.Serializable, Cloneable, Comparable<TServerStatus> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TServerStatus"); private static final org.apache.thrift.protocol.TField READ_ONLY_FIELD_DESC = new org.apache.thrift.protocol.TField("read_only", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField RENDERING_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("rendering_enabled", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("start_time", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField EDITION_FIELD_DESC = new org.apache.thrift.protocol.TField("edition", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("host_name", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField POLY_RENDERING_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("poly_rendering_enabled", org.apache.thrift.protocol.TType.BOOL, (short)7); private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.I32, (short)8); private static final org.apache.thrift.protocol.TField RENDERER_STATUS_JSON_FIELD_DESC = new org.apache.thrift.protocol.TField("renderer_status_json", org.apache.thrift.protocol.TType.STRING, (short)9); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TServerStatusStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TServerStatusTupleSchemeFactory(); public boolean read_only; // required public @org.apache.thrift.annotation.Nullable java.lang.String version; // required public boolean rendering_enabled; // required public long start_time; // required public @org.apache.thrift.annotation.Nullable java.lang.String edition; // required public @org.apache.thrift.annotation.Nullable java.lang.String host_name; // required public boolean poly_rendering_enabled; // required /** * * @see TRole */ public @org.apache.thrift.annotation.Nullable TRole role; // required public @org.apache.thrift.annotation.Nullable java.lang.String renderer_status_json; // 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 { READ_ONLY((short)1, "read_only"), VERSION((short)2, "version"), RENDERING_ENABLED((short)3, "rendering_enabled"), START_TIME((short)4, "start_time"), EDITION((short)5, "edition"), HOST_NAME((short)6, "host_name"), POLY_RENDERING_ENABLED((short)7, "poly_rendering_enabled"), /** * * @see TRole */ ROLE((short)8, "role"), RENDERER_STATUS_JSON((short)9, "renderer_status_json"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // READ_ONLY return READ_ONLY; case 2: // VERSION return VERSION; case 3: // RENDERING_ENABLED return RENDERING_ENABLED; case 4: // START_TIME return START_TIME; case 5: // EDITION return EDITION; case 6: // HOST_NAME return HOST_NAME; case 7: // POLY_RENDERING_ENABLED return POLY_RENDERING_ENABLED; case 8: // ROLE return ROLE; case 9: // RENDERER_STATUS_JSON return RENDERER_STATUS_JSON; 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 __READ_ONLY_ISSET_ID = 0; private static final int __RENDERING_ENABLED_ISSET_ID = 1; private static final int __START_TIME_ISSET_ID = 2; private static final int __POLY_RENDERING_ENABLED_ISSET_ID = 3; 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.READ_ONLY, new org.apache.thrift.meta_data.FieldMetaData("read_only", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RENDERING_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("rendering_enabled", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("start_time", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.EDITION, new org.apache.thrift.meta_data.FieldMetaData("edition", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("host_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.POLY_RENDERING_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("poly_rendering_enabled", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TRole.class))); tmpMap.put(_Fields.RENDERER_STATUS_JSON, new org.apache.thrift.meta_data.FieldMetaData("renderer_status_json", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TServerStatus.class, metaDataMap); } public TServerStatus() { } public TServerStatus( boolean read_only, java.lang.String version, boolean rendering_enabled, long start_time, java.lang.String edition, java.lang.String host_name, boolean poly_rendering_enabled, TRole role, java.lang.String renderer_status_json) { this(); this.read_only = read_only; setRead_onlyIsSet(true); this.version = version; this.rendering_enabled = rendering_enabled; setRendering_enabledIsSet(true); this.start_time = start_time; setStart_timeIsSet(true); this.edition = edition; this.host_name = host_name; this.poly_rendering_enabled = poly_rendering_enabled; setPoly_rendering_enabledIsSet(true); this.role = role; this.renderer_status_json = renderer_status_json; } /** * Performs a deep copy on <i>other</i>. */ public TServerStatus(TServerStatus other) { __isset_bitfield = other.__isset_bitfield; this.read_only = other.read_only; if (other.isSetVersion()) { this.version = other.version; } this.rendering_enabled = other.rendering_enabled; this.start_time = other.start_time; if (other.isSetEdition()) { this.edition = other.edition; } if (other.isSetHost_name()) { this.host_name = other.host_name; } this.poly_rendering_enabled = other.poly_rendering_enabled; if (other.isSetRole()) { this.role = other.role; } if (other.isSetRenderer_status_json()) { this.renderer_status_json = other.renderer_status_json; } } public TServerStatus deepCopy() { return new TServerStatus(this); } @Override public void clear() { setRead_onlyIsSet(false); this.read_only = false; this.version = null; setRendering_enabledIsSet(false); this.rendering_enabled = false; setStart_timeIsSet(false); this.start_time = 0; this.edition = null; this.host_name = null; setPoly_rendering_enabledIsSet(false); this.poly_rendering_enabled = false; this.role = null; this.renderer_status_json = null; } public boolean isRead_only() { return this.read_only; } public TServerStatus setRead_only(boolean read_only) { this.read_only = read_only; setRead_onlyIsSet(true); return this; } public void unsetRead_only() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __READ_ONLY_ISSET_ID); } /** Returns true if field read_only is set (has been assigned a value) and false otherwise */ public boolean isSetRead_only() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __READ_ONLY_ISSET_ID); } public void setRead_onlyIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __READ_ONLY_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getVersion() { return this.version; } public TServerStatus setVersion(@org.apache.thrift.annotation.Nullable java.lang.String version) { this.version = version; return this; } public void unsetVersion() { this.version = null; } /** Returns true if field version is set (has been assigned a value) and false otherwise */ public boolean isSetVersion() { return this.version != null; } public void setVersionIsSet(boolean value) { if (!value) { this.version = null; } } public boolean isRendering_enabled() { return this.rendering_enabled; } public TServerStatus setRendering_enabled(boolean rendering_enabled) { this.rendering_enabled = rendering_enabled; setRendering_enabledIsSet(true); return this; } public void unsetRendering_enabled() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RENDERING_ENABLED_ISSET_ID); } /** Returns true if field rendering_enabled is set (has been assigned a value) and false otherwise */ public boolean isSetRendering_enabled() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RENDERING_ENABLED_ISSET_ID); } public void setRendering_enabledIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RENDERING_ENABLED_ISSET_ID, value); } public long getStart_time() { return this.start_time; } public TServerStatus setStart_time(long start_time) { this.start_time = start_time; setStart_timeIsSet(true); return this; } public void unsetStart_time() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_TIME_ISSET_ID); } /** Returns true if field start_time is set (has been assigned a value) and false otherwise */ public boolean isSetStart_time() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_TIME_ISSET_ID); } public void setStart_timeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_TIME_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getEdition() { return this.edition; } public TServerStatus setEdition(@org.apache.thrift.annotation.Nullable java.lang.String edition) { this.edition = edition; return this; } public void unsetEdition() { this.edition = null; } /** Returns true if field edition is set (has been assigned a value) and false otherwise */ public boolean isSetEdition() { return this.edition != null; } public void setEditionIsSet(boolean value) { if (!value) { this.edition = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getHost_name() { return this.host_name; } public TServerStatus setHost_name(@org.apache.thrift.annotation.Nullable java.lang.String host_name) { this.host_name = host_name; return this; } public void unsetHost_name() { this.host_name = null; } /** Returns true if field host_name is set (has been assigned a value) and false otherwise */ public boolean isSetHost_name() { return this.host_name != null; } public void setHost_nameIsSet(boolean value) { if (!value) { this.host_name = null; } } public boolean isPoly_rendering_enabled() { return this.poly_rendering_enabled; } public TServerStatus setPoly_rendering_enabled(boolean poly_rendering_enabled) { this.poly_rendering_enabled = poly_rendering_enabled; setPoly_rendering_enabledIsSet(true); return this; } public void unsetPoly_rendering_enabled() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __POLY_RENDERING_ENABLED_ISSET_ID); } /** Returns true if field poly_rendering_enabled is set (has been assigned a value) and false otherwise */ public boolean isSetPoly_rendering_enabled() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __POLY_RENDERING_ENABLED_ISSET_ID); } public void setPoly_rendering_enabledIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __POLY_RENDERING_ENABLED_ISSET_ID, value); } /** * * @see TRole */ @org.apache.thrift.annotation.Nullable public TRole getRole() { return this.role; } /** * * @see TRole */ public TServerStatus setRole(@org.apache.thrift.annotation.Nullable TRole role) { this.role = role; return this; } public void unsetRole() { this.role = null; } /** Returns true if field role is set (has been assigned a value) and false otherwise */ public boolean isSetRole() { return this.role != null; } public void setRoleIsSet(boolean value) { if (!value) { this.role = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getRenderer_status_json() { return this.renderer_status_json; } public TServerStatus setRenderer_status_json(@org.apache.thrift.annotation.Nullable java.lang.String renderer_status_json) { this.renderer_status_json = renderer_status_json; return this; } public void unsetRenderer_status_json() { this.renderer_status_json = null; } /** Returns true if field renderer_status_json is set (has been assigned a value) and false otherwise */ public boolean isSetRenderer_status_json() { return this.renderer_status_json != null; } public void setRenderer_status_jsonIsSet(boolean value) { if (!value) { this.renderer_status_json = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case READ_ONLY: if (value == null) { unsetRead_only(); } else { setRead_only((java.lang.Boolean)value); } break; case VERSION: if (value == null) { unsetVersion(); } else { setVersion((java.lang.String)value); } break; case RENDERING_ENABLED: if (value == null) { unsetRendering_enabled(); } else { setRendering_enabled((java.lang.Boolean)value); } break; case START_TIME: if (value == null) { unsetStart_time(); } else { setStart_time((java.lang.Long)value); } break; case EDITION: if (value == null) { unsetEdition(); } else { setEdition((java.lang.String)value); } break; case HOST_NAME: if (value == null) { unsetHost_name(); } else { setHost_name((java.lang.String)value); } break; case POLY_RENDERING_ENABLED: if (value == null) { unsetPoly_rendering_enabled(); } else { setPoly_rendering_enabled((java.lang.Boolean)value); } break; case ROLE: if (value == null) { unsetRole(); } else { setRole((TRole)value); } break; case RENDERER_STATUS_JSON: if (value == null) { unsetRenderer_status_json(); } else { setRenderer_status_json((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case READ_ONLY: return isRead_only(); case VERSION: return getVersion(); case RENDERING_ENABLED: return isRendering_enabled(); case START_TIME: return getStart_time(); case EDITION: return getEdition(); case HOST_NAME: return getHost_name(); case POLY_RENDERING_ENABLED: return isPoly_rendering_enabled(); case ROLE: return getRole(); case RENDERER_STATUS_JSON: return getRenderer_status_json(); } 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 READ_ONLY: return isSetRead_only(); case VERSION: return isSetVersion(); case RENDERING_ENABLED: return isSetRendering_enabled(); case START_TIME: return isSetStart_time(); case EDITION: return isSetEdition(); case HOST_NAME: return isSetHost_name(); case POLY_RENDERING_ENABLED: return isSetPoly_rendering_enabled(); case ROLE: return isSetRole(); case RENDERER_STATUS_JSON: return isSetRenderer_status_json(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TServerStatus) return this.equals((TServerStatus)that); return false; } public boolean equals(TServerStatus that) { if (that == null) return false; if (this == that) return true; boolean this_present_read_only = true; boolean that_present_read_only = true; if (this_present_read_only || that_present_read_only) { if (!(this_present_read_only && that_present_read_only)) return false; if (this.read_only != that.read_only) return false; } boolean this_present_version = true && this.isSetVersion(); boolean that_present_version = true && that.isSetVersion(); if (this_present_version || that_present_version) { if (!(this_present_version && that_present_version)) return false; if (!this.version.equals(that.version)) return false; } boolean this_present_rendering_enabled = true; boolean that_present_rendering_enabled = true; if (this_present_rendering_enabled || that_present_rendering_enabled) { if (!(this_present_rendering_enabled && that_present_rendering_enabled)) return false; if (this.rendering_enabled != that.rendering_enabled) return false; } boolean this_present_start_time = true; boolean that_present_start_time = true; if (this_present_start_time || that_present_start_time) { if (!(this_present_start_time && that_present_start_time)) return false; if (this.start_time != that.start_time) return false; } boolean this_present_edition = true && this.isSetEdition(); boolean that_present_edition = true && that.isSetEdition(); if (this_present_edition || that_present_edition) { if (!(this_present_edition && that_present_edition)) return false; if (!this.edition.equals(that.edition)) return false; } boolean this_present_host_name = true && this.isSetHost_name(); boolean that_present_host_name = true && that.isSetHost_name(); if (this_present_host_name || that_present_host_name) { if (!(this_present_host_name && that_present_host_name)) return false; if (!this.host_name.equals(that.host_name)) return false; } boolean this_present_poly_rendering_enabled = true; boolean that_present_poly_rendering_enabled = true; if (this_present_poly_rendering_enabled || that_present_poly_rendering_enabled) { if (!(this_present_poly_rendering_enabled && that_present_poly_rendering_enabled)) return false; if (this.poly_rendering_enabled != that.poly_rendering_enabled) return false; } boolean this_present_role = true && this.isSetRole(); boolean that_present_role = true && that.isSetRole(); if (this_present_role || that_present_role) { if (!(this_present_role && that_present_role)) return false; if (!this.role.equals(that.role)) return false; } boolean this_present_renderer_status_json = true && this.isSetRenderer_status_json(); boolean that_present_renderer_status_json = true && that.isSetRenderer_status_json(); if (this_present_renderer_status_json || that_present_renderer_status_json) { if (!(this_present_renderer_status_json && that_present_renderer_status_json)) return false; if (!this.renderer_status_json.equals(that.renderer_status_json)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((read_only) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetVersion()) ? 131071 : 524287); if (isSetVersion()) hashCode = hashCode * 8191 + version.hashCode(); hashCode = hashCode * 8191 + ((rendering_enabled) ? 131071 : 524287); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(start_time); hashCode = hashCode * 8191 + ((isSetEdition()) ? 131071 : 524287); if (isSetEdition()) hashCode = hashCode * 8191 + edition.hashCode(); hashCode = hashCode * 8191 + ((isSetHost_name()) ? 131071 : 524287); if (isSetHost_name()) hashCode = hashCode * 8191 + host_name.hashCode(); hashCode = hashCode * 8191 + ((poly_rendering_enabled) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetRole()) ? 131071 : 524287); if (isSetRole()) hashCode = hashCode * 8191 + role.getValue(); hashCode = hashCode * 8191 + ((isSetRenderer_status_json()) ? 131071 : 524287); if (isSetRenderer_status_json()) hashCode = hashCode * 8191 + renderer_status_json.hashCode(); return hashCode; } @Override public int compareTo(TServerStatus other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetRead_only(), other.isSetRead_only()); if (lastComparison != 0) { return lastComparison; } if (isSetRead_only()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.read_only, other.read_only); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetVersion(), other.isSetVersion()); if (lastComparison != 0) { return lastComparison; } if (isSetVersion()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRendering_enabled(), other.isSetRendering_enabled()); if (lastComparison != 0) { return lastComparison; } if (isSetRendering_enabled()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rendering_enabled, other.rendering_enabled); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetStart_time(), other.isSetStart_time()); if (lastComparison != 0) { return lastComparison; } if (isSetStart_time()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_time, other.start_time); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetEdition(), other.isSetEdition()); if (lastComparison != 0) { return lastComparison; } if (isSetEdition()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.edition, other.edition); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetHost_name(), other.isSetHost_name()); if (lastComparison != 0) { return lastComparison; } if (isSetHost_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host_name, other.host_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPoly_rendering_enabled(), other.isSetPoly_rendering_enabled()); if (lastComparison != 0) { return lastComparison; } if (isSetPoly_rendering_enabled()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.poly_rendering_enabled, other.poly_rendering_enabled); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRole(), other.isSetRole()); if (lastComparison != 0) { return lastComparison; } if (isSetRole()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRenderer_status_json(), other.isSetRenderer_status_json()); if (lastComparison != 0) { return lastComparison; } if (isSetRenderer_status_json()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.renderer_status_json, other.renderer_status_json); 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("TServerStatus("); boolean first = true; sb.append("read_only:"); sb.append(this.read_only); first = false; if (!first) sb.append(", "); sb.append("version:"); if (this.version == null) { sb.append("null"); } else { sb.append(this.version); } first = false; if (!first) sb.append(", "); sb.append("rendering_enabled:"); sb.append(this.rendering_enabled); first = false; if (!first) sb.append(", "); sb.append("start_time:"); sb.append(this.start_time); first = false; if (!first) sb.append(", "); sb.append("edition:"); if (this.edition == null) { sb.append("null"); } else { sb.append(this.edition); } first = false; if (!first) sb.append(", "); sb.append("host_name:"); if (this.host_name == null) { sb.append("null"); } else { sb.append(this.host_name); } first = false; if (!first) sb.append(", "); sb.append("poly_rendering_enabled:"); sb.append(this.poly_rendering_enabled); first = false; if (!first) sb.append(", "); sb.append("role:"); if (this.role == null) { sb.append("null"); } else { sb.append(this.role); } first = false; if (!first) sb.append(", "); sb.append("renderer_status_json:"); if (this.renderer_status_json == null) { sb.append("null"); } else { sb.append(this.renderer_status_json); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TServerStatusStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TServerStatusStandardScheme getScheme() { return new TServerStatusStandardScheme(); } } private static class TServerStatusStandardScheme extends org.apache.thrift.scheme.StandardScheme<TServerStatus> { public void read(org.apache.thrift.protocol.TProtocol iprot, TServerStatus 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: // READ_ONLY if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.read_only = iprot.readBool(); struct.setRead_onlyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // VERSION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.version = iprot.readString(); struct.setVersionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // RENDERING_ENABLED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.rendering_enabled = iprot.readBool(); struct.setRendering_enabledIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // START_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.start_time = iprot.readI64(); struct.setStart_timeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // EDITION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.edition = iprot.readString(); struct.setEditionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // HOST_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.host_name = iprot.readString(); struct.setHost_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // POLY_RENDERING_ENABLED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.poly_rendering_enabled = iprot.readBool(); struct.setPoly_rendering_enabledIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // ROLE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.role = ai.heavy.thrift.server.TRole.findByValue(iprot.readI32()); struct.setRoleIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // RENDERER_STATUS_JSON if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.renderer_status_json = iprot.readString(); struct.setRenderer_status_jsonIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TServerStatus struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(READ_ONLY_FIELD_DESC); oprot.writeBool(struct.read_only); oprot.writeFieldEnd(); if (struct.version != null) { oprot.writeFieldBegin(VERSION_FIELD_DESC); oprot.writeString(struct.version); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RENDERING_ENABLED_FIELD_DESC); oprot.writeBool(struct.rendering_enabled); oprot.writeFieldEnd(); oprot.writeFieldBegin(START_TIME_FIELD_DESC); oprot.writeI64(struct.start_time); oprot.writeFieldEnd(); if (struct.edition != null) { oprot.writeFieldBegin(EDITION_FIELD_DESC); oprot.writeString(struct.edition); oprot.writeFieldEnd(); } if (struct.host_name != null) { oprot.writeFieldBegin(HOST_NAME_FIELD_DESC); oprot.writeString(struct.host_name); oprot.writeFieldEnd(); } oprot.writeFieldBegin(POLY_RENDERING_ENABLED_FIELD_DESC); oprot.writeBool(struct.poly_rendering_enabled); oprot.writeFieldEnd(); if (struct.role != null) { oprot.writeFieldBegin(ROLE_FIELD_DESC); oprot.writeI32(struct.role.getValue()); oprot.writeFieldEnd(); } if (struct.renderer_status_json != null) { oprot.writeFieldBegin(RENDERER_STATUS_JSON_FIELD_DESC); oprot.writeString(struct.renderer_status_json); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TServerStatusTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TServerStatusTupleScheme getScheme() { return new TServerStatusTupleScheme(); } } private static class TServerStatusTupleScheme extends org.apache.thrift.scheme.TupleScheme<TServerStatus> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TServerStatus struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetRead_only()) { optionals.set(0); } if (struct.isSetVersion()) { optionals.set(1); } if (struct.isSetRendering_enabled()) { optionals.set(2); } if (struct.isSetStart_time()) { optionals.set(3); } if (struct.isSetEdition()) { optionals.set(4); } if (struct.isSetHost_name()) { optionals.set(5); } if (struct.isSetPoly_rendering_enabled()) { optionals.set(6); } if (struct.isSetRole()) { optionals.set(7); } if (struct.isSetRenderer_status_json()) { optionals.set(8); } oprot.writeBitSet(optionals, 9); if (struct.isSetRead_only()) { oprot.writeBool(struct.read_only); } if (struct.isSetVersion()) { oprot.writeString(struct.version); } if (struct.isSetRendering_enabled()) { oprot.writeBool(struct.rendering_enabled); } if (struct.isSetStart_time()) { oprot.writeI64(struct.start_time); } if (struct.isSetEdition()) { oprot.writeString(struct.edition); } if (struct.isSetHost_name()) { oprot.writeString(struct.host_name); } if (struct.isSetPoly_rendering_enabled()) { oprot.writeBool(struct.poly_rendering_enabled); } if (struct.isSetRole()) { oprot.writeI32(struct.role.getValue()); } if (struct.isSetRenderer_status_json()) { oprot.writeString(struct.renderer_status_json); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TServerStatus struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(9); if (incoming.get(0)) { struct.read_only = iprot.readBool(); struct.setRead_onlyIsSet(true); } if (incoming.get(1)) { struct.version = iprot.readString(); struct.setVersionIsSet(true); } if (incoming.get(2)) { struct.rendering_enabled = iprot.readBool(); struct.setRendering_enabledIsSet(true); } if (incoming.get(3)) { struct.start_time = iprot.readI64(); struct.setStart_timeIsSet(true); } if (incoming.get(4)) { struct.edition = iprot.readString(); struct.setEditionIsSet(true); } if (incoming.get(5)) { struct.host_name = iprot.readString(); struct.setHost_nameIsSet(true); } if (incoming.get(6)) { struct.poly_rendering_enabled = iprot.readBool(); struct.setPoly_rendering_enabledIsSet(true); } if (incoming.get(7)) { struct.role = ai.heavy.thrift.server.TRole.findByValue(iprot.readI32()); struct.setRoleIsSet(true); } if (incoming.get(8)) { struct.renderer_status_json = iprot.readString(); struct.setRenderer_status_jsonIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TSessionInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TSessionInfo implements org.apache.thrift.TBase<TSessionInfo, TSessionInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TSessionInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionInfo"); private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField DATABASE_FIELD_DESC = new org.apache.thrift.protocol.TField("database", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("start_time", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField IS_SUPER_FIELD_DESC = new org.apache.thrift.protocol.TField("is_super", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSessionInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSessionInfoTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String user; // required public @org.apache.thrift.annotation.Nullable java.lang.String database; // required public long start_time; // required public boolean is_super; // 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 { USER((short)1, "user"), DATABASE((short)2, "database"), START_TIME((short)3, "start_time"), IS_SUPER((short)4, "is_super"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // USER return USER; case 2: // DATABASE return DATABASE; case 3: // START_TIME return START_TIME; case 4: // IS_SUPER return IS_SUPER; 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 __START_TIME_ISSET_ID = 0; private static final int __IS_SUPER_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.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DATABASE, new org.apache.thrift.meta_data.FieldMetaData("database", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("start_time", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.IS_SUPER, new org.apache.thrift.meta_data.FieldMetaData("is_super", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionInfo.class, metaDataMap); } public TSessionInfo() { } public TSessionInfo( java.lang.String user, java.lang.String database, long start_time, boolean is_super) { this(); this.user = user; this.database = database; this.start_time = start_time; setStart_timeIsSet(true); this.is_super = is_super; setIs_superIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TSessionInfo(TSessionInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetUser()) { this.user = other.user; } if (other.isSetDatabase()) { this.database = other.database; } this.start_time = other.start_time; this.is_super = other.is_super; } public TSessionInfo deepCopy() { return new TSessionInfo(this); } @Override public void clear() { this.user = null; this.database = null; setStart_timeIsSet(false); this.start_time = 0; setIs_superIsSet(false); this.is_super = false; } @org.apache.thrift.annotation.Nullable public java.lang.String getUser() { return this.user; } public TSessionInfo setUser(@org.apache.thrift.annotation.Nullable java.lang.String user) { this.user = user; return this; } public void unsetUser() { this.user = null; } /** Returns true if field user is set (has been assigned a value) and false otherwise */ public boolean isSetUser() { return this.user != null; } public void setUserIsSet(boolean value) { if (!value) { this.user = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getDatabase() { return this.database; } public TSessionInfo setDatabase(@org.apache.thrift.annotation.Nullable java.lang.String database) { this.database = database; return this; } public void unsetDatabase() { this.database = null; } /** Returns true if field database is set (has been assigned a value) and false otherwise */ public boolean isSetDatabase() { return this.database != null; } public void setDatabaseIsSet(boolean value) { if (!value) { this.database = null; } } public long getStart_time() { return this.start_time; } public TSessionInfo setStart_time(long start_time) { this.start_time = start_time; setStart_timeIsSet(true); return this; } public void unsetStart_time() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_TIME_ISSET_ID); } /** Returns true if field start_time is set (has been assigned a value) and false otherwise */ public boolean isSetStart_time() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_TIME_ISSET_ID); } public void setStart_timeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_TIME_ISSET_ID, value); } public boolean isIs_super() { return this.is_super; } public TSessionInfo setIs_super(boolean is_super) { this.is_super = is_super; setIs_superIsSet(true); return this; } public void unsetIs_super() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_SUPER_ISSET_ID); } /** Returns true if field is_super is set (has been assigned a value) and false otherwise */ public boolean isSetIs_super() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_SUPER_ISSET_ID); } public void setIs_superIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_SUPER_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case USER: if (value == null) { unsetUser(); } else { setUser((java.lang.String)value); } break; case DATABASE: if (value == null) { unsetDatabase(); } else { setDatabase((java.lang.String)value); } break; case START_TIME: if (value == null) { unsetStart_time(); } else { setStart_time((java.lang.Long)value); } break; case IS_SUPER: if (value == null) { unsetIs_super(); } else { setIs_super((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case USER: return getUser(); case DATABASE: return getDatabase(); case START_TIME: return getStart_time(); case IS_SUPER: return isIs_super(); } 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 USER: return isSetUser(); case DATABASE: return isSetDatabase(); case START_TIME: return isSetStart_time(); case IS_SUPER: return isSetIs_super(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TSessionInfo) return this.equals((TSessionInfo)that); return false; } public boolean equals(TSessionInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_user = true && this.isSetUser(); boolean that_present_user = true && that.isSetUser(); if (this_present_user || that_present_user) { if (!(this_present_user && that_present_user)) return false; if (!this.user.equals(that.user)) return false; } boolean this_present_database = true && this.isSetDatabase(); boolean that_present_database = true && that.isSetDatabase(); if (this_present_database || that_present_database) { if (!(this_present_database && that_present_database)) return false; if (!this.database.equals(that.database)) return false; } boolean this_present_start_time = true; boolean that_present_start_time = true; if (this_present_start_time || that_present_start_time) { if (!(this_present_start_time && that_present_start_time)) return false; if (this.start_time != that.start_time) return false; } boolean this_present_is_super = true; boolean that_present_is_super = true; if (this_present_is_super || that_present_is_super) { if (!(this_present_is_super && that_present_is_super)) return false; if (this.is_super != that.is_super) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetUser()) ? 131071 : 524287); if (isSetUser()) hashCode = hashCode * 8191 + user.hashCode(); hashCode = hashCode * 8191 + ((isSetDatabase()) ? 131071 : 524287); if (isSetDatabase()) hashCode = hashCode * 8191 + database.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(start_time); hashCode = hashCode * 8191 + ((is_super) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TSessionInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetUser(), other.isSetUser()); if (lastComparison != 0) { return lastComparison; } if (isSetUser()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDatabase(), other.isSetDatabase()); if (lastComparison != 0) { return lastComparison; } if (isSetDatabase()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.database, other.database); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetStart_time(), other.isSetStart_time()); if (lastComparison != 0) { return lastComparison; } if (isSetStart_time()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_time, other.start_time); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_super(), other.isSetIs_super()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_super()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_super, other.is_super); 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("TSessionInfo("); boolean first = true; sb.append("user:"); if (this.user == null) { sb.append("null"); } else { sb.append(this.user); } first = false; if (!first) sb.append(", "); sb.append("database:"); if (this.database == null) { sb.append("null"); } else { sb.append(this.database); } first = false; if (!first) sb.append(", "); sb.append("start_time:"); sb.append(this.start_time); first = false; if (!first) sb.append(", "); sb.append("is_super:"); sb.append(this.is_super); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TSessionInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSessionInfoStandardScheme getScheme() { return new TSessionInfoStandardScheme(); } } private static class TSessionInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TSessionInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionInfo 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: // USER if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.user = iprot.readString(); struct.setUserIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DATABASE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.database = iprot.readString(); struct.setDatabaseIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // START_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.start_time = iprot.readI64(); struct.setStart_timeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // IS_SUPER if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_super = iprot.readBool(); struct.setIs_superIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TSessionInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.user != null) { oprot.writeFieldBegin(USER_FIELD_DESC); oprot.writeString(struct.user); oprot.writeFieldEnd(); } if (struct.database != null) { oprot.writeFieldBegin(DATABASE_FIELD_DESC); oprot.writeString(struct.database); oprot.writeFieldEnd(); } oprot.writeFieldBegin(START_TIME_FIELD_DESC); oprot.writeI64(struct.start_time); oprot.writeFieldEnd(); oprot.writeFieldBegin(IS_SUPER_FIELD_DESC); oprot.writeBool(struct.is_super); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TSessionInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSessionInfoTupleScheme getScheme() { return new TSessionInfoTupleScheme(); } } private static class TSessionInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TSessionInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSessionInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetUser()) { optionals.set(0); } if (struct.isSetDatabase()) { optionals.set(1); } if (struct.isSetStart_time()) { optionals.set(2); } if (struct.isSetIs_super()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetUser()) { oprot.writeString(struct.user); } if (struct.isSetDatabase()) { oprot.writeString(struct.database); } if (struct.isSetStart_time()) { oprot.writeI64(struct.start_time); } if (struct.isSetIs_super()) { oprot.writeBool(struct.is_super); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSessionInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.user = iprot.readString(); struct.setUserIsSet(true); } if (incoming.get(1)) { struct.database = iprot.readString(); struct.setDatabaseIsSet(true); } if (incoming.get(2)) { struct.start_time = iprot.readI64(); struct.setStart_timeIsSet(true); } if (incoming.get(3)) { struct.is_super = iprot.readBool(); struct.setIs_superIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TSlotSize.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TSlotSize implements org.apache.thrift.TBase<TSlotSize, TSlotSize._Fields>, java.io.Serializable, Cloneable, Comparable<TSlotSize> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSlotSize"); private static final org.apache.thrift.protocol.TField PADDED_FIELD_DESC = new org.apache.thrift.protocol.TField("padded", org.apache.thrift.protocol.TType.I16, (short)1); private static final org.apache.thrift.protocol.TField LOGICAL_FIELD_DESC = new org.apache.thrift.protocol.TField("logical", org.apache.thrift.protocol.TType.I16, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSlotSizeStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSlotSizeTupleSchemeFactory(); public short padded; // required public short logical; // 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 { PADDED((short)1, "padded"), LOGICAL((short)2, "logical"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // PADDED return PADDED; case 2: // LOGICAL return LOGICAL; 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 __PADDED_ISSET_ID = 0; private static final int __LOGICAL_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.PADDED, new org.apache.thrift.meta_data.FieldMetaData("padded", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.LOGICAL, new org.apache.thrift.meta_data.FieldMetaData("logical", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSlotSize.class, metaDataMap); } public TSlotSize() { } public TSlotSize( short padded, short logical) { this(); this.padded = padded; setPaddedIsSet(true); this.logical = logical; setLogicalIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TSlotSize(TSlotSize other) { __isset_bitfield = other.__isset_bitfield; this.padded = other.padded; this.logical = other.logical; } public TSlotSize deepCopy() { return new TSlotSize(this); } @Override public void clear() { setPaddedIsSet(false); this.padded = 0; setLogicalIsSet(false); this.logical = 0; } public short getPadded() { return this.padded; } public TSlotSize setPadded(short padded) { this.padded = padded; setPaddedIsSet(true); return this; } public void unsetPadded() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PADDED_ISSET_ID); } /** Returns true if field padded is set (has been assigned a value) and false otherwise */ public boolean isSetPadded() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PADDED_ISSET_ID); } public void setPaddedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PADDED_ISSET_ID, value); } public short getLogical() { return this.logical; } public TSlotSize setLogical(short logical) { this.logical = logical; setLogicalIsSet(true); return this; } public void unsetLogical() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LOGICAL_ISSET_ID); } /** Returns true if field logical is set (has been assigned a value) and false otherwise */ public boolean isSetLogical() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LOGICAL_ISSET_ID); } public void setLogicalIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LOGICAL_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case PADDED: if (value == null) { unsetPadded(); } else { setPadded((java.lang.Short)value); } break; case LOGICAL: if (value == null) { unsetLogical(); } else { setLogical((java.lang.Short)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case PADDED: return getPadded(); case LOGICAL: return getLogical(); } 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 PADDED: return isSetPadded(); case LOGICAL: return isSetLogical(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TSlotSize) return this.equals((TSlotSize)that); return false; } public boolean equals(TSlotSize that) { if (that == null) return false; if (this == that) return true; boolean this_present_padded = true; boolean that_present_padded = true; if (this_present_padded || that_present_padded) { if (!(this_present_padded && that_present_padded)) return false; if (this.padded != that.padded) return false; } boolean this_present_logical = true; boolean that_present_logical = true; if (this_present_logical || that_present_logical) { if (!(this_present_logical && that_present_logical)) return false; if (this.logical != that.logical) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + padded; hashCode = hashCode * 8191 + logical; return hashCode; } @Override public int compareTo(TSlotSize other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetPadded(), other.isSetPadded()); if (lastComparison != 0) { return lastComparison; } if (isSetPadded()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.padded, other.padded); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetLogical(), other.isSetLogical()); if (lastComparison != 0) { return lastComparison; } if (isSetLogical()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.logical, other.logical); 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("TSlotSize("); boolean first = true; sb.append("padded:"); sb.append(this.padded); first = false; if (!first) sb.append(", "); sb.append("logical:"); sb.append(this.logical); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TSlotSizeStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSlotSizeStandardScheme getScheme() { return new TSlotSizeStandardScheme(); } } private static class TSlotSizeStandardScheme extends org.apache.thrift.scheme.StandardScheme<TSlotSize> { public void read(org.apache.thrift.protocol.TProtocol iprot, TSlotSize 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: // PADDED if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.padded = iprot.readI16(); struct.setPaddedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // LOGICAL if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.logical = iprot.readI16(); struct.setLogicalIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TSlotSize struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(PADDED_FIELD_DESC); oprot.writeI16(struct.padded); oprot.writeFieldEnd(); oprot.writeFieldBegin(LOGICAL_FIELD_DESC); oprot.writeI16(struct.logical); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TSlotSizeTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSlotSizeTupleScheme getScheme() { return new TSlotSizeTupleScheme(); } } private static class TSlotSizeTupleScheme extends org.apache.thrift.scheme.TupleScheme<TSlotSize> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSlotSize struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetPadded()) { optionals.set(0); } if (struct.isSetLogical()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPadded()) { oprot.writeI16(struct.padded); } if (struct.isSetLogical()) { oprot.writeI16(struct.logical); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSlotSize struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.padded = iprot.readI16(); struct.setPaddedIsSet(true); } if (incoming.get(1)) { struct.logical = iprot.readI16(); struct.setLogicalIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TSourceType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TSourceType implements org.apache.thrift.TEnum { DELIMITED_FILE(0), GEO_FILE(1), PARQUET_FILE(2), RASTER_FILE(3), ODBC(4); private final int value; private TSourceType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TSourceType findByValue(int value) { switch (value) { case 0: return DELIMITED_FILE; case 1: return GEO_FILE; case 2: return PARQUET_FILE; case 3: return RASTER_FILE; case 4: return ODBC; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TStepResult.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TStepResult implements org.apache.thrift.TBase<TStepResult, TStepResult._Fields>, java.io.Serializable, Cloneable, Comparable<TStepResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStepResult"); private static final org.apache.thrift.protocol.TField SERIALIZED_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("serialized_rows", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EXECUTION_FINISHED_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_finished", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField MERGE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("merge_type", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.protocol.TField SHARDED_FIELD_DESC = new org.apache.thrift.protocol.TField("sharded", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField ROW_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("row_desc", org.apache.thrift.protocol.TType.LIST, (short)5); private static final org.apache.thrift.protocol.TField NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("node_id", org.apache.thrift.protocol.TType.I32, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStepResultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStepResultTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TSerializedRows serialized_rows; // required public boolean execution_finished; // required /** * * @see TMergeType */ public @org.apache.thrift.annotation.Nullable TMergeType merge_type; // required public boolean sharded; // required public @org.apache.thrift.annotation.Nullable java.util.List<TColumnType> row_desc; // required public int node_id; // 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 { SERIALIZED_ROWS((short)1, "serialized_rows"), EXECUTION_FINISHED((short)2, "execution_finished"), /** * * @see TMergeType */ MERGE_TYPE((short)3, "merge_type"), SHARDED((short)4, "sharded"), ROW_DESC((short)5, "row_desc"), NODE_ID((short)6, "node_id"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // SERIALIZED_ROWS return SERIALIZED_ROWS; case 2: // EXECUTION_FINISHED return EXECUTION_FINISHED; case 3: // MERGE_TYPE return MERGE_TYPE; case 4: // SHARDED return SHARDED; case 5: // ROW_DESC return ROW_DESC; case 6: // NODE_ID return NODE_ID; 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 __EXECUTION_FINISHED_ISSET_ID = 0; private static final int __SHARDED_ISSET_ID = 1; private static final int __NODE_ID_ISSET_ID = 2; 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.SERIALIZED_ROWS, new org.apache.thrift.meta_data.FieldMetaData("serialized_rows", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ai.heavy.thrift.server.TSerializedRows.class))); tmpMap.put(_Fields.EXECUTION_FINISHED, new org.apache.thrift.meta_data.FieldMetaData("execution_finished", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.MERGE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("merge_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TMergeType.class))); tmpMap.put(_Fields.SHARDED, new org.apache.thrift.meta_data.FieldMetaData("sharded", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.ROW_DESC, new org.apache.thrift.meta_data.FieldMetaData("row_desc", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST , "TRowDescriptor"))); tmpMap.put(_Fields.NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("node_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TStepResult.class, metaDataMap); } public TStepResult() { } public TStepResult( ai.heavy.thrift.server.TSerializedRows serialized_rows, boolean execution_finished, TMergeType merge_type, boolean sharded, java.util.List<TColumnType> row_desc, int node_id) { this(); this.serialized_rows = serialized_rows; this.execution_finished = execution_finished; setExecution_finishedIsSet(true); this.merge_type = merge_type; this.sharded = sharded; setShardedIsSet(true); this.row_desc = row_desc; this.node_id = node_id; setNode_idIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TStepResult(TStepResult other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetSerialized_rows()) { this.serialized_rows = new ai.heavy.thrift.server.TSerializedRows(other.serialized_rows); } this.execution_finished = other.execution_finished; if (other.isSetMerge_type()) { this.merge_type = other.merge_type; } this.sharded = other.sharded; if (other.isSetRow_desc()) { java.util.List<TColumnType> __this__row_desc = new java.util.ArrayList<TColumnType>(other.row_desc.size()); for (TColumnType other_element : other.row_desc) { __this__row_desc.add(new TColumnType(other_element)); } this.row_desc = __this__row_desc; } this.node_id = other.node_id; } public TStepResult deepCopy() { return new TStepResult(this); } @Override public void clear() { this.serialized_rows = null; setExecution_finishedIsSet(false); this.execution_finished = false; this.merge_type = null; setShardedIsSet(false); this.sharded = false; this.row_desc = null; setNode_idIsSet(false); this.node_id = 0; } @org.apache.thrift.annotation.Nullable public ai.heavy.thrift.server.TSerializedRows getSerialized_rows() { return this.serialized_rows; } public TStepResult setSerialized_rows(@org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TSerializedRows serialized_rows) { this.serialized_rows = serialized_rows; return this; } public void unsetSerialized_rows() { this.serialized_rows = null; } /** Returns true if field serialized_rows is set (has been assigned a value) and false otherwise */ public boolean isSetSerialized_rows() { return this.serialized_rows != null; } public void setSerialized_rowsIsSet(boolean value) { if (!value) { this.serialized_rows = null; } } public boolean isExecution_finished() { return this.execution_finished; } public TStepResult setExecution_finished(boolean execution_finished) { this.execution_finished = execution_finished; setExecution_finishedIsSet(true); return this; } public void unsetExecution_finished() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTION_FINISHED_ISSET_ID); } /** Returns true if field execution_finished is set (has been assigned a value) and false otherwise */ public boolean isSetExecution_finished() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTION_FINISHED_ISSET_ID); } public void setExecution_finishedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTION_FINISHED_ISSET_ID, value); } /** * * @see TMergeType */ @org.apache.thrift.annotation.Nullable public TMergeType getMerge_type() { return this.merge_type; } /** * * @see TMergeType */ public TStepResult setMerge_type(@org.apache.thrift.annotation.Nullable TMergeType merge_type) { this.merge_type = merge_type; return this; } public void unsetMerge_type() { this.merge_type = null; } /** Returns true if field merge_type is set (has been assigned a value) and false otherwise */ public boolean isSetMerge_type() { return this.merge_type != null; } public void setMerge_typeIsSet(boolean value) { if (!value) { this.merge_type = null; } } public boolean isSharded() { return this.sharded; } public TStepResult setSharded(boolean sharded) { this.sharded = sharded; setShardedIsSet(true); return this; } public void unsetSharded() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SHARDED_ISSET_ID); } /** Returns true if field sharded is set (has been assigned a value) and false otherwise */ public boolean isSetSharded() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SHARDED_ISSET_ID); } public void setShardedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SHARDED_ISSET_ID, value); } public int getRow_descSize() { return (this.row_desc == null) ? 0 : this.row_desc.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TColumnType> getRow_descIterator() { return (this.row_desc == null) ? null : this.row_desc.iterator(); } public void addToRow_desc(TColumnType elem) { if (this.row_desc == null) { this.row_desc = new java.util.ArrayList<TColumnType>(); } this.row_desc.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TColumnType> getRow_desc() { return this.row_desc; } public TStepResult setRow_desc(@org.apache.thrift.annotation.Nullable java.util.List<TColumnType> row_desc) { this.row_desc = row_desc; return this; } public void unsetRow_desc() { this.row_desc = null; } /** Returns true if field row_desc is set (has been assigned a value) and false otherwise */ public boolean isSetRow_desc() { return this.row_desc != null; } public void setRow_descIsSet(boolean value) { if (!value) { this.row_desc = null; } } public int getNode_id() { return this.node_id; } public TStepResult setNode_id(int node_id) { this.node_id = node_id; setNode_idIsSet(true); return this; } public void unsetNode_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NODE_ID_ISSET_ID); } /** Returns true if field node_id is set (has been assigned a value) and false otherwise */ public boolean isSetNode_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NODE_ID_ISSET_ID); } public void setNode_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NODE_ID_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SERIALIZED_ROWS: if (value == null) { unsetSerialized_rows(); } else { setSerialized_rows((ai.heavy.thrift.server.TSerializedRows)value); } break; case EXECUTION_FINISHED: if (value == null) { unsetExecution_finished(); } else { setExecution_finished((java.lang.Boolean)value); } break; case MERGE_TYPE: if (value == null) { unsetMerge_type(); } else { setMerge_type((TMergeType)value); } break; case SHARDED: if (value == null) { unsetSharded(); } else { setSharded((java.lang.Boolean)value); } break; case ROW_DESC: if (value == null) { unsetRow_desc(); } else { setRow_desc((java.util.List<TColumnType>)value); } break; case NODE_ID: if (value == null) { unsetNode_id(); } else { setNode_id((java.lang.Integer)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SERIALIZED_ROWS: return getSerialized_rows(); case EXECUTION_FINISHED: return isExecution_finished(); case MERGE_TYPE: return getMerge_type(); case SHARDED: return isSharded(); case ROW_DESC: return getRow_desc(); case NODE_ID: return getNode_id(); } 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 SERIALIZED_ROWS: return isSetSerialized_rows(); case EXECUTION_FINISHED: return isSetExecution_finished(); case MERGE_TYPE: return isSetMerge_type(); case SHARDED: return isSetSharded(); case ROW_DESC: return isSetRow_desc(); case NODE_ID: return isSetNode_id(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TStepResult) return this.equals((TStepResult)that); return false; } public boolean equals(TStepResult that) { if (that == null) return false; if (this == that) return true; boolean this_present_serialized_rows = true && this.isSetSerialized_rows(); boolean that_present_serialized_rows = true && that.isSetSerialized_rows(); if (this_present_serialized_rows || that_present_serialized_rows) { if (!(this_present_serialized_rows && that_present_serialized_rows)) return false; if (!this.serialized_rows.equals(that.serialized_rows)) return false; } boolean this_present_execution_finished = true; boolean that_present_execution_finished = true; if (this_present_execution_finished || that_present_execution_finished) { if (!(this_present_execution_finished && that_present_execution_finished)) return false; if (this.execution_finished != that.execution_finished) return false; } boolean this_present_merge_type = true && this.isSetMerge_type(); boolean that_present_merge_type = true && that.isSetMerge_type(); if (this_present_merge_type || that_present_merge_type) { if (!(this_present_merge_type && that_present_merge_type)) return false; if (!this.merge_type.equals(that.merge_type)) return false; } boolean this_present_sharded = true; boolean that_present_sharded = true; if (this_present_sharded || that_present_sharded) { if (!(this_present_sharded && that_present_sharded)) return false; if (this.sharded != that.sharded) return false; } boolean this_present_row_desc = true && this.isSetRow_desc(); boolean that_present_row_desc = true && that.isSetRow_desc(); if (this_present_row_desc || that_present_row_desc) { if (!(this_present_row_desc && that_present_row_desc)) return false; if (!this.row_desc.equals(that.row_desc)) return false; } boolean this_present_node_id = true; boolean that_present_node_id = true; if (this_present_node_id || that_present_node_id) { if (!(this_present_node_id && that_present_node_id)) return false; if (this.node_id != that.node_id) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetSerialized_rows()) ? 131071 : 524287); if (isSetSerialized_rows()) hashCode = hashCode * 8191 + serialized_rows.hashCode(); hashCode = hashCode * 8191 + ((execution_finished) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetMerge_type()) ? 131071 : 524287); if (isSetMerge_type()) hashCode = hashCode * 8191 + merge_type.getValue(); hashCode = hashCode * 8191 + ((sharded) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetRow_desc()) ? 131071 : 524287); if (isSetRow_desc()) hashCode = hashCode * 8191 + row_desc.hashCode(); hashCode = hashCode * 8191 + node_id; return hashCode; } @Override public int compareTo(TStepResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetSerialized_rows(), other.isSetSerialized_rows()); if (lastComparison != 0) { return lastComparison; } if (isSetSerialized_rows()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialized_rows, other.serialized_rows); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetExecution_finished(), other.isSetExecution_finished()); if (lastComparison != 0) { return lastComparison; } if (isSetExecution_finished()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_finished, other.execution_finished); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMerge_type(), other.isSetMerge_type()); if (lastComparison != 0) { return lastComparison; } if (isSetMerge_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merge_type, other.merge_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSharded(), other.isSetSharded()); if (lastComparison != 0) { return lastComparison; } if (isSetSharded()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sharded, other.sharded); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRow_desc(), other.isSetRow_desc()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_desc()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_desc, other.row_desc); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNode_id(), other.isSetNode_id()); if (lastComparison != 0) { return lastComparison; } if (isSetNode_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.node_id, other.node_id); 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("TStepResult("); boolean first = true; sb.append("serialized_rows:"); if (this.serialized_rows == null) { sb.append("null"); } else { sb.append(this.serialized_rows); } first = false; if (!first) sb.append(", "); sb.append("execution_finished:"); sb.append(this.execution_finished); first = false; if (!first) sb.append(", "); sb.append("merge_type:"); if (this.merge_type == null) { sb.append("null"); } else { sb.append(this.merge_type); } first = false; if (!first) sb.append(", "); sb.append("sharded:"); sb.append(this.sharded); first = false; if (!first) sb.append(", "); sb.append("row_desc:"); if (this.row_desc == null) { sb.append("null"); } else { sb.append(this.row_desc); } first = false; if (!first) sb.append(", "); sb.append("node_id:"); sb.append(this.node_id); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (serialized_rows != null) { serialized_rows.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 TStepResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStepResultStandardScheme getScheme() { return new TStepResultStandardScheme(); } } private static class TStepResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TStepResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, TStepResult 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: // SERIALIZED_ROWS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.serialized_rows = new ai.heavy.thrift.server.TSerializedRows(); struct.serialized_rows.read(iprot); struct.setSerialized_rowsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // EXECUTION_FINISHED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.execution_finished = iprot.readBool(); struct.setExecution_finishedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // MERGE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.merge_type = ai.heavy.thrift.server.TMergeType.findByValue(iprot.readI32()); struct.setMerge_typeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // SHARDED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.sharded = iprot.readBool(); struct.setShardedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // ROW_DESC if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); struct.row_desc = new java.util.ArrayList<TColumnType>(_list64.size); @org.apache.thrift.annotation.Nullable TColumnType _elem65; for (int _i66 = 0; _i66 < _list64.size; ++_i66) { _elem65 = new TColumnType(); _elem65.read(iprot); struct.row_desc.add(_elem65); } iprot.readListEnd(); } struct.setRow_descIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // NODE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.node_id = iprot.readI32(); struct.setNode_idIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TStepResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.serialized_rows != null) { oprot.writeFieldBegin(SERIALIZED_ROWS_FIELD_DESC); struct.serialized_rows.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(EXECUTION_FINISHED_FIELD_DESC); oprot.writeBool(struct.execution_finished); oprot.writeFieldEnd(); if (struct.merge_type != null) { oprot.writeFieldBegin(MERGE_TYPE_FIELD_DESC); oprot.writeI32(struct.merge_type.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(SHARDED_FIELD_DESC); oprot.writeBool(struct.sharded); oprot.writeFieldEnd(); if (struct.row_desc != null) { oprot.writeFieldBegin(ROW_DESC_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.row_desc.size())); for (TColumnType _iter67 : struct.row_desc) { _iter67.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(NODE_ID_FIELD_DESC); oprot.writeI32(struct.node_id); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TStepResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStepResultTupleScheme getScheme() { return new TStepResultTupleScheme(); } } private static class TStepResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TStepResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStepResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSerialized_rows()) { optionals.set(0); } if (struct.isSetExecution_finished()) { optionals.set(1); } if (struct.isSetMerge_type()) { optionals.set(2); } if (struct.isSetSharded()) { optionals.set(3); } if (struct.isSetRow_desc()) { optionals.set(4); } if (struct.isSetNode_id()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetSerialized_rows()) { struct.serialized_rows.write(oprot); } if (struct.isSetExecution_finished()) { oprot.writeBool(struct.execution_finished); } if (struct.isSetMerge_type()) { oprot.writeI32(struct.merge_type.getValue()); } if (struct.isSetSharded()) { oprot.writeBool(struct.sharded); } if (struct.isSetRow_desc()) { { oprot.writeI32(struct.row_desc.size()); for (TColumnType _iter68 : struct.row_desc) { _iter68.write(oprot); } } } if (struct.isSetNode_id()) { oprot.writeI32(struct.node_id); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStepResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.serialized_rows = new ai.heavy.thrift.server.TSerializedRows(); struct.serialized_rows.read(iprot); struct.setSerialized_rowsIsSet(true); } if (incoming.get(1)) { struct.execution_finished = iprot.readBool(); struct.setExecution_finishedIsSet(true); } if (incoming.get(2)) { struct.merge_type = ai.heavy.thrift.server.TMergeType.findByValue(iprot.readI32()); struct.setMerge_typeIsSet(true); } if (incoming.get(3)) { struct.sharded = iprot.readBool(); struct.setShardedIsSet(true); } if (incoming.get(4)) { { org.apache.thrift.protocol.TList _list69 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.row_desc = new java.util.ArrayList<TColumnType>(_list69.size); @org.apache.thrift.annotation.Nullable TColumnType _elem70; for (int _i71 = 0; _i71 < _list69.size; ++_i71) { _elem70 = new TColumnType(); _elem70.read(iprot); struct.row_desc.add(_elem70); } } struct.setRow_descIsSet(true); } if (incoming.get(5)) { struct.node_id = iprot.readI32(); struct.setNode_idIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TStringRow.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TStringRow implements org.apache.thrift.TBase<TStringRow, TStringRow._Fields>, java.io.Serializable, Cloneable, Comparable<TStringRow> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringRow"); private static final org.apache.thrift.protocol.TField COLS_FIELD_DESC = new org.apache.thrift.protocol.TField("cols", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringRowStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringRowTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List<TStringValue> cols; // 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 { COLS((short)1, "cols"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // COLS return COLS; 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 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.COLS, new org.apache.thrift.meta_data.FieldMetaData("cols", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringRow.class, metaDataMap); } public TStringRow() { } public TStringRow( java.util.List<TStringValue> cols) { this(); this.cols = cols; } /** * Performs a deep copy on <i>other</i>. */ public TStringRow(TStringRow other) { if (other.isSetCols()) { java.util.List<TStringValue> __this__cols = new java.util.ArrayList<TStringValue>(other.cols.size()); for (TStringValue other_element : other.cols) { __this__cols.add(new TStringValue(other_element)); } this.cols = __this__cols; } } public TStringRow deepCopy() { return new TStringRow(this); } @Override public void clear() { this.cols = null; } public int getColsSize() { return (this.cols == null) ? 0 : this.cols.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TStringValue> getColsIterator() { return (this.cols == null) ? null : this.cols.iterator(); } public void addToCols(TStringValue elem) { if (this.cols == null) { this.cols = new java.util.ArrayList<TStringValue>(); } this.cols.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TStringValue> getCols() { return this.cols; } public TStringRow setCols(@org.apache.thrift.annotation.Nullable java.util.List<TStringValue> cols) { this.cols = cols; return this; } public void unsetCols() { this.cols = null; } /** Returns true if field cols is set (has been assigned a value) and false otherwise */ public boolean isSetCols() { return this.cols != null; } public void setColsIsSet(boolean value) { if (!value) { this.cols = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case COLS: if (value == null) { unsetCols(); } else { setCols((java.util.List<TStringValue>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case COLS: return getCols(); } 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 COLS: return isSetCols(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TStringRow) return this.equals((TStringRow)that); return false; } public boolean equals(TStringRow that) { if (that == null) return false; if (this == that) return true; boolean this_present_cols = true && this.isSetCols(); boolean that_present_cols = true && that.isSetCols(); if (this_present_cols || that_present_cols) { if (!(this_present_cols && that_present_cols)) return false; if (!this.cols.equals(that.cols)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetCols()) ? 131071 : 524287); if (isSetCols()) hashCode = hashCode * 8191 + cols.hashCode(); return hashCode; } @Override public int compareTo(TStringRow other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetCols(), other.isSetCols()); if (lastComparison != 0) { return lastComparison; } if (isSetCols()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cols, other.cols); 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("TStringRow("); boolean first = true; sb.append("cols:"); if (this.cols == null) { sb.append("null"); } else { sb.append(this.cols); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { 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 TStringRowStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringRowStandardScheme getScheme() { return new TStringRowStandardScheme(); } } private static class TStringRowStandardScheme extends org.apache.thrift.scheme.StandardScheme<TStringRow> { public void read(org.apache.thrift.protocol.TProtocol iprot, TStringRow 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: // COLS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list56 = iprot.readListBegin(); struct.cols = new java.util.ArrayList<TStringValue>(_list56.size); @org.apache.thrift.annotation.Nullable TStringValue _elem57; for (int _i58 = 0; _i58 < _list56.size; ++_i58) { _elem57 = new TStringValue(); _elem57.read(iprot); struct.cols.add(_elem57); } iprot.readListEnd(); } struct.setColsIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TStringRow struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.cols != null) { oprot.writeFieldBegin(COLS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.cols.size())); for (TStringValue _iter59 : struct.cols) { _iter59.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TStringRowTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringRowTupleScheme getScheme() { return new TStringRowTupleScheme(); } } private static class TStringRowTupleScheme extends org.apache.thrift.scheme.TupleScheme<TStringRow> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStringRow struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCols()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetCols()) { { oprot.writeI32(struct.cols.size()); for (TStringValue _iter60 : struct.cols) { _iter60.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStringRow struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list61 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.cols = new java.util.ArrayList<TStringValue>(_list61.size); @org.apache.thrift.annotation.Nullable TStringValue _elem62; for (int _i63 = 0; _i63 < _list61.size; ++_i63) { _elem62 = new TStringValue(); _elem62.read(iprot); struct.cols.add(_elem62); } } struct.setColsIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TStringValue.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TStringValue implements org.apache.thrift.TBase<TStringValue, TStringValue._Fields>, java.io.Serializable, Cloneable, Comparable<TStringValue> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); private static final org.apache.thrift.protocol.TField STR_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("str_val", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField IS_NULL_FIELD_DESC = new org.apache.thrift.protocol.TField("is_null", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringValueStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringValueTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String str_val; // required public boolean is_null; // 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 { STR_VAL((short)1, "str_val"), IS_NULL((short)2, "is_null"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // STR_VAL return STR_VAL; case 2: // IS_NULL return IS_NULL; 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 __IS_NULL_ISSET_ID = 0; 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.STR_VAL, new org.apache.thrift.meta_data.FieldMetaData("str_val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_NULL, new org.apache.thrift.meta_data.FieldMetaData("is_null", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); } public TStringValue() { } public TStringValue( java.lang.String str_val, boolean is_null) { this(); this.str_val = str_val; this.is_null = is_null; setIs_nullIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TStringValue(TStringValue other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetStr_val()) { this.str_val = other.str_val; } this.is_null = other.is_null; } public TStringValue deepCopy() { return new TStringValue(this); } @Override public void clear() { this.str_val = null; setIs_nullIsSet(false); this.is_null = false; } @org.apache.thrift.annotation.Nullable public java.lang.String getStr_val() { return this.str_val; } public TStringValue setStr_val(@org.apache.thrift.annotation.Nullable java.lang.String str_val) { this.str_val = str_val; return this; } public void unsetStr_val() { this.str_val = null; } /** Returns true if field str_val is set (has been assigned a value) and false otherwise */ public boolean isSetStr_val() { return this.str_val != null; } public void setStr_valIsSet(boolean value) { if (!value) { this.str_val = null; } } public boolean isIs_null() { return this.is_null; } public TStringValue setIs_null(boolean is_null) { this.is_null = is_null; setIs_nullIsSet(true); return this; } public void unsetIs_null() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_NULL_ISSET_ID); } /** Returns true if field is_null is set (has been assigned a value) and false otherwise */ public boolean isSetIs_null() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_NULL_ISSET_ID); } public void setIs_nullIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_NULL_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STR_VAL: if (value == null) { unsetStr_val(); } else { setStr_val((java.lang.String)value); } break; case IS_NULL: if (value == null) { unsetIs_null(); } else { setIs_null((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STR_VAL: return getStr_val(); case IS_NULL: return isIs_null(); } 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 STR_VAL: return isSetStr_val(); case IS_NULL: return isSetIs_null(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TStringValue) return this.equals((TStringValue)that); return false; } public boolean equals(TStringValue that) { if (that == null) return false; if (this == that) return true; boolean this_present_str_val = true && this.isSetStr_val(); boolean that_present_str_val = true && that.isSetStr_val(); if (this_present_str_val || that_present_str_val) { if (!(this_present_str_val && that_present_str_val)) return false; if (!this.str_val.equals(that.str_val)) return false; } boolean this_present_is_null = true; boolean that_present_is_null = true; if (this_present_is_null || that_present_is_null) { if (!(this_present_is_null && that_present_is_null)) return false; if (this.is_null != that.is_null) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetStr_val()) ? 131071 : 524287); if (isSetStr_val()) hashCode = hashCode * 8191 + str_val.hashCode(); hashCode = hashCode * 8191 + ((is_null) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TStringValue other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetStr_val(), other.isSetStr_val()); if (lastComparison != 0) { return lastComparison; } if (isSetStr_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.str_val, other.str_val); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_null(), other.isSetIs_null()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_null()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_null, other.is_null); 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("TStringValue("); boolean first = true; sb.append("str_val:"); if (this.str_val == null) { sb.append("null"); } else { sb.append(this.str_val); } first = false; if (!first) sb.append(", "); sb.append("is_null:"); sb.append(this.is_null); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TStringValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringValueStandardScheme getScheme() { return new TStringValueStandardScheme(); } } private static class TStringValueStandardScheme extends org.apache.thrift.scheme.StandardScheme<TStringValue> { public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue 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: // STR_VAL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.str_val = iprot.readString(); struct.setStr_valIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IS_NULL if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_null = iprot.readBool(); struct.setIs_nullIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TStringValue struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.str_val != null) { oprot.writeFieldBegin(STR_VAL_FIELD_DESC); oprot.writeString(struct.str_val); oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_NULL_FIELD_DESC); oprot.writeBool(struct.is_null); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TStringValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringValueTupleScheme getScheme() { return new TStringValueTupleScheme(); } } private static class TStringValueTupleScheme extends org.apache.thrift.scheme.TupleScheme<TStringValue> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetStr_val()) { optionals.set(0); } if (struct.isSetIs_null()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetStr_val()) { oprot.writeString(struct.str_val); } if (struct.isSetIs_null()) { oprot.writeBool(struct.is_null); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.str_val = iprot.readString(); struct.setStr_valIsSet(true); } if (incoming.get(1)) { struct.is_null = iprot.readBool(); struct.setIs_nullIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableDetails.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTableDetails implements org.apache.thrift.TBase<TTableDetails, TTableDetails._Fields>, java.io.Serializable, Cloneable, Comparable<TTableDetails> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableDetails"); private static final org.apache.thrift.protocol.TField ROW_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("row_desc", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField FRAGMENT_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("fragment_size", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField PAGE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("page_size", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("max_rows", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField VIEW_SQL_FIELD_DESC = new org.apache.thrift.protocol.TField("view_sql", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField SHARD_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("shard_count", org.apache.thrift.protocol.TType.I64, (short)6); private static final org.apache.thrift.protocol.TField KEY_METAINFO_FIELD_DESC = new org.apache.thrift.protocol.TField("key_metainfo", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField IS_TEMPORARY_FIELD_DESC = new org.apache.thrift.protocol.TField("is_temporary", org.apache.thrift.protocol.TType.BOOL, (short)8); private static final org.apache.thrift.protocol.TField PARTITION_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("partition_detail", org.apache.thrift.protocol.TType.I32, (short)9); private static final org.apache.thrift.protocol.TField TABLE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("table_type", org.apache.thrift.protocol.TType.I32, (short)10); private static final org.apache.thrift.protocol.TField REFRESH_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("refresh_info", org.apache.thrift.protocol.TType.STRUCT, (short)11); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableDetailsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableDetailsTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List<TColumnType> row_desc; // required public long fragment_size; // required public long page_size; // required public long max_rows; // required public @org.apache.thrift.annotation.Nullable java.lang.String view_sql; // required public long shard_count; // required public @org.apache.thrift.annotation.Nullable java.lang.String key_metainfo; // required public boolean is_temporary; // required /** * * @see TPartitionDetail */ public @org.apache.thrift.annotation.Nullable TPartitionDetail partition_detail; // required /** * * @see TTableType */ public @org.apache.thrift.annotation.Nullable TTableType table_type; // required public @org.apache.thrift.annotation.Nullable TTableRefreshInfo refresh_info; // 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 { ROW_DESC((short)1, "row_desc"), FRAGMENT_SIZE((short)2, "fragment_size"), PAGE_SIZE((short)3, "page_size"), MAX_ROWS((short)4, "max_rows"), VIEW_SQL((short)5, "view_sql"), SHARD_COUNT((short)6, "shard_count"), KEY_METAINFO((short)7, "key_metainfo"), IS_TEMPORARY((short)8, "is_temporary"), /** * * @see TPartitionDetail */ PARTITION_DETAIL((short)9, "partition_detail"), /** * * @see TTableType */ TABLE_TYPE((short)10, "table_type"), REFRESH_INFO((short)11, "refresh_info"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // ROW_DESC return ROW_DESC; case 2: // FRAGMENT_SIZE return FRAGMENT_SIZE; case 3: // PAGE_SIZE return PAGE_SIZE; case 4: // MAX_ROWS return MAX_ROWS; case 5: // VIEW_SQL return VIEW_SQL; case 6: // SHARD_COUNT return SHARD_COUNT; case 7: // KEY_METAINFO return KEY_METAINFO; case 8: // IS_TEMPORARY return IS_TEMPORARY; case 9: // PARTITION_DETAIL return PARTITION_DETAIL; case 10: // TABLE_TYPE return TABLE_TYPE; case 11: // REFRESH_INFO return REFRESH_INFO; 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 __FRAGMENT_SIZE_ISSET_ID = 0; private static final int __PAGE_SIZE_ISSET_ID = 1; private static final int __MAX_ROWS_ISSET_ID = 2; private static final int __SHARD_COUNT_ISSET_ID = 3; private static final int __IS_TEMPORARY_ISSET_ID = 4; 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.ROW_DESC, new org.apache.thrift.meta_data.FieldMetaData("row_desc", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST , "TRowDescriptor"))); tmpMap.put(_Fields.FRAGMENT_SIZE, new org.apache.thrift.meta_data.FieldMetaData("fragment_size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.PAGE_SIZE, new org.apache.thrift.meta_data.FieldMetaData("page_size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("max_rows", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.VIEW_SQL, new org.apache.thrift.meta_data.FieldMetaData("view_sql", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.SHARD_COUNT, new org.apache.thrift.meta_data.FieldMetaData("shard_count", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.KEY_METAINFO, new org.apache.thrift.meta_data.FieldMetaData("key_metainfo", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_TEMPORARY, new org.apache.thrift.meta_data.FieldMetaData("is_temporary", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.PARTITION_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("partition_detail", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TPartitionDetail.class))); tmpMap.put(_Fields.TABLE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("table_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTableType.class))); tmpMap.put(_Fields.REFRESH_INFO, new org.apache.thrift.meta_data.FieldMetaData("refresh_info", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableRefreshInfo.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableDetails.class, metaDataMap); } public TTableDetails() { } public TTableDetails( java.util.List<TColumnType> row_desc, long fragment_size, long page_size, long max_rows, java.lang.String view_sql, long shard_count, java.lang.String key_metainfo, boolean is_temporary, TPartitionDetail partition_detail, TTableType table_type, TTableRefreshInfo refresh_info) { this(); this.row_desc = row_desc; this.fragment_size = fragment_size; setFragment_sizeIsSet(true); this.page_size = page_size; setPage_sizeIsSet(true); this.max_rows = max_rows; setMax_rowsIsSet(true); this.view_sql = view_sql; this.shard_count = shard_count; setShard_countIsSet(true); this.key_metainfo = key_metainfo; this.is_temporary = is_temporary; setIs_temporaryIsSet(true); this.partition_detail = partition_detail; this.table_type = table_type; this.refresh_info = refresh_info; } /** * Performs a deep copy on <i>other</i>. */ public TTableDetails(TTableDetails other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetRow_desc()) { java.util.List<TColumnType> __this__row_desc = new java.util.ArrayList<TColumnType>(other.row_desc.size()); for (TColumnType other_element : other.row_desc) { __this__row_desc.add(new TColumnType(other_element)); } this.row_desc = __this__row_desc; } this.fragment_size = other.fragment_size; this.page_size = other.page_size; this.max_rows = other.max_rows; if (other.isSetView_sql()) { this.view_sql = other.view_sql; } this.shard_count = other.shard_count; if (other.isSetKey_metainfo()) { this.key_metainfo = other.key_metainfo; } this.is_temporary = other.is_temporary; if (other.isSetPartition_detail()) { this.partition_detail = other.partition_detail; } if (other.isSetTable_type()) { this.table_type = other.table_type; } if (other.isSetRefresh_info()) { this.refresh_info = new TTableRefreshInfo(other.refresh_info); } } public TTableDetails deepCopy() { return new TTableDetails(this); } @Override public void clear() { this.row_desc = null; setFragment_sizeIsSet(false); this.fragment_size = 0; setPage_sizeIsSet(false); this.page_size = 0; setMax_rowsIsSet(false); this.max_rows = 0; this.view_sql = null; setShard_countIsSet(false); this.shard_count = 0; this.key_metainfo = null; setIs_temporaryIsSet(false); this.is_temporary = false; this.partition_detail = null; this.table_type = null; this.refresh_info = null; } public int getRow_descSize() { return (this.row_desc == null) ? 0 : this.row_desc.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<TColumnType> getRow_descIterator() { return (this.row_desc == null) ? null : this.row_desc.iterator(); } public void addToRow_desc(TColumnType elem) { if (this.row_desc == null) { this.row_desc = new java.util.ArrayList<TColumnType>(); } this.row_desc.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<TColumnType> getRow_desc() { return this.row_desc; } public TTableDetails setRow_desc(@org.apache.thrift.annotation.Nullable java.util.List<TColumnType> row_desc) { this.row_desc = row_desc; return this; } public void unsetRow_desc() { this.row_desc = null; } /** Returns true if field row_desc is set (has been assigned a value) and false otherwise */ public boolean isSetRow_desc() { return this.row_desc != null; } public void setRow_descIsSet(boolean value) { if (!value) { this.row_desc = null; } } public long getFragment_size() { return this.fragment_size; } public TTableDetails setFragment_size(long fragment_size) { this.fragment_size = fragment_size; setFragment_sizeIsSet(true); return this; } public void unsetFragment_size() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FRAGMENT_SIZE_ISSET_ID); } /** Returns true if field fragment_size is set (has been assigned a value) and false otherwise */ public boolean isSetFragment_size() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FRAGMENT_SIZE_ISSET_ID); } public void setFragment_sizeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FRAGMENT_SIZE_ISSET_ID, value); } public long getPage_size() { return this.page_size; } public TTableDetails setPage_size(long page_size) { this.page_size = page_size; setPage_sizeIsSet(true); return this; } public void unsetPage_size() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PAGE_SIZE_ISSET_ID); } /** Returns true if field page_size is set (has been assigned a value) and false otherwise */ public boolean isSetPage_size() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PAGE_SIZE_ISSET_ID); } public void setPage_sizeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PAGE_SIZE_ISSET_ID, value); } public long getMax_rows() { return this.max_rows; } public TTableDetails setMax_rows(long max_rows) { this.max_rows = max_rows; setMax_rowsIsSet(true); return this; } public void unsetMax_rows() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_ROWS_ISSET_ID); } /** Returns true if field max_rows is set (has been assigned a value) and false otherwise */ public boolean isSetMax_rows() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_ROWS_ISSET_ID); } public void setMax_rowsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_ROWS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getView_sql() { return this.view_sql; } public TTableDetails setView_sql(@org.apache.thrift.annotation.Nullable java.lang.String view_sql) { this.view_sql = view_sql; return this; } public void unsetView_sql() { this.view_sql = null; } /** Returns true if field view_sql is set (has been assigned a value) and false otherwise */ public boolean isSetView_sql() { return this.view_sql != null; } public void setView_sqlIsSet(boolean value) { if (!value) { this.view_sql = null; } } public long getShard_count() { return this.shard_count; } public TTableDetails setShard_count(long shard_count) { this.shard_count = shard_count; setShard_countIsSet(true); return this; } public void unsetShard_count() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SHARD_COUNT_ISSET_ID); } /** Returns true if field shard_count is set (has been assigned a value) and false otherwise */ public boolean isSetShard_count() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SHARD_COUNT_ISSET_ID); } public void setShard_countIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SHARD_COUNT_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getKey_metainfo() { return this.key_metainfo; } public TTableDetails setKey_metainfo(@org.apache.thrift.annotation.Nullable java.lang.String key_metainfo) { this.key_metainfo = key_metainfo; return this; } public void unsetKey_metainfo() { this.key_metainfo = null; } /** Returns true if field key_metainfo is set (has been assigned a value) and false otherwise */ public boolean isSetKey_metainfo() { return this.key_metainfo != null; } public void setKey_metainfoIsSet(boolean value) { if (!value) { this.key_metainfo = null; } } public boolean isIs_temporary() { return this.is_temporary; } public TTableDetails setIs_temporary(boolean is_temporary) { this.is_temporary = is_temporary; setIs_temporaryIsSet(true); return this; } public void unsetIs_temporary() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_TEMPORARY_ISSET_ID); } /** Returns true if field is_temporary is set (has been assigned a value) and false otherwise */ public boolean isSetIs_temporary() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_TEMPORARY_ISSET_ID); } public void setIs_temporaryIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_TEMPORARY_ISSET_ID, value); } /** * * @see TPartitionDetail */ @org.apache.thrift.annotation.Nullable public TPartitionDetail getPartition_detail() { return this.partition_detail; } /** * * @see TPartitionDetail */ public TTableDetails setPartition_detail(@org.apache.thrift.annotation.Nullable TPartitionDetail partition_detail) { this.partition_detail = partition_detail; return this; } public void unsetPartition_detail() { this.partition_detail = null; } /** Returns true if field partition_detail is set (has been assigned a value) and false otherwise */ public boolean isSetPartition_detail() { return this.partition_detail != null; } public void setPartition_detailIsSet(boolean value) { if (!value) { this.partition_detail = null; } } /** * * @see TTableType */ @org.apache.thrift.annotation.Nullable public TTableType getTable_type() { return this.table_type; } /** * * @see TTableType */ public TTableDetails setTable_type(@org.apache.thrift.annotation.Nullable TTableType table_type) { this.table_type = table_type; return this; } public void unsetTable_type() { this.table_type = null; } /** Returns true if field table_type is set (has been assigned a value) and false otherwise */ public boolean isSetTable_type() { return this.table_type != null; } public void setTable_typeIsSet(boolean value) { if (!value) { this.table_type = null; } } @org.apache.thrift.annotation.Nullable public TTableRefreshInfo getRefresh_info() { return this.refresh_info; } public TTableDetails setRefresh_info(@org.apache.thrift.annotation.Nullable TTableRefreshInfo refresh_info) { this.refresh_info = refresh_info; return this; } public void unsetRefresh_info() { this.refresh_info = null; } /** Returns true if field refresh_info is set (has been assigned a value) and false otherwise */ public boolean isSetRefresh_info() { return this.refresh_info != null; } public void setRefresh_infoIsSet(boolean value) { if (!value) { this.refresh_info = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ROW_DESC: if (value == null) { unsetRow_desc(); } else { setRow_desc((java.util.List<TColumnType>)value); } break; case FRAGMENT_SIZE: if (value == null) { unsetFragment_size(); } else { setFragment_size((java.lang.Long)value); } break; case PAGE_SIZE: if (value == null) { unsetPage_size(); } else { setPage_size((java.lang.Long)value); } break; case MAX_ROWS: if (value == null) { unsetMax_rows(); } else { setMax_rows((java.lang.Long)value); } break; case VIEW_SQL: if (value == null) { unsetView_sql(); } else { setView_sql((java.lang.String)value); } break; case SHARD_COUNT: if (value == null) { unsetShard_count(); } else { setShard_count((java.lang.Long)value); } break; case KEY_METAINFO: if (value == null) { unsetKey_metainfo(); } else { setKey_metainfo((java.lang.String)value); } break; case IS_TEMPORARY: if (value == null) { unsetIs_temporary(); } else { setIs_temporary((java.lang.Boolean)value); } break; case PARTITION_DETAIL: if (value == null) { unsetPartition_detail(); } else { setPartition_detail((TPartitionDetail)value); } break; case TABLE_TYPE: if (value == null) { unsetTable_type(); } else { setTable_type((TTableType)value); } break; case REFRESH_INFO: if (value == null) { unsetRefresh_info(); } else { setRefresh_info((TTableRefreshInfo)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ROW_DESC: return getRow_desc(); case FRAGMENT_SIZE: return getFragment_size(); case PAGE_SIZE: return getPage_size(); case MAX_ROWS: return getMax_rows(); case VIEW_SQL: return getView_sql(); case SHARD_COUNT: return getShard_count(); case KEY_METAINFO: return getKey_metainfo(); case IS_TEMPORARY: return isIs_temporary(); case PARTITION_DETAIL: return getPartition_detail(); case TABLE_TYPE: return getTable_type(); case REFRESH_INFO: return getRefresh_info(); } 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 ROW_DESC: return isSetRow_desc(); case FRAGMENT_SIZE: return isSetFragment_size(); case PAGE_SIZE: return isSetPage_size(); case MAX_ROWS: return isSetMax_rows(); case VIEW_SQL: return isSetView_sql(); case SHARD_COUNT: return isSetShard_count(); case KEY_METAINFO: return isSetKey_metainfo(); case IS_TEMPORARY: return isSetIs_temporary(); case PARTITION_DETAIL: return isSetPartition_detail(); case TABLE_TYPE: return isSetTable_type(); case REFRESH_INFO: return isSetRefresh_info(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTableDetails) return this.equals((TTableDetails)that); return false; } public boolean equals(TTableDetails that) { if (that == null) return false; if (this == that) return true; boolean this_present_row_desc = true && this.isSetRow_desc(); boolean that_present_row_desc = true && that.isSetRow_desc(); if (this_present_row_desc || that_present_row_desc) { if (!(this_present_row_desc && that_present_row_desc)) return false; if (!this.row_desc.equals(that.row_desc)) return false; } boolean this_present_fragment_size = true; boolean that_present_fragment_size = true; if (this_present_fragment_size || that_present_fragment_size) { if (!(this_present_fragment_size && that_present_fragment_size)) return false; if (this.fragment_size != that.fragment_size) return false; } boolean this_present_page_size = true; boolean that_present_page_size = true; if (this_present_page_size || that_present_page_size) { if (!(this_present_page_size && that_present_page_size)) return false; if (this.page_size != that.page_size) return false; } boolean this_present_max_rows = true; boolean that_present_max_rows = true; if (this_present_max_rows || that_present_max_rows) { if (!(this_present_max_rows && that_present_max_rows)) return false; if (this.max_rows != that.max_rows) return false; } boolean this_present_view_sql = true && this.isSetView_sql(); boolean that_present_view_sql = true && that.isSetView_sql(); if (this_present_view_sql || that_present_view_sql) { if (!(this_present_view_sql && that_present_view_sql)) return false; if (!this.view_sql.equals(that.view_sql)) return false; } boolean this_present_shard_count = true; boolean that_present_shard_count = true; if (this_present_shard_count || that_present_shard_count) { if (!(this_present_shard_count && that_present_shard_count)) return false; if (this.shard_count != that.shard_count) return false; } boolean this_present_key_metainfo = true && this.isSetKey_metainfo(); boolean that_present_key_metainfo = true && that.isSetKey_metainfo(); if (this_present_key_metainfo || that_present_key_metainfo) { if (!(this_present_key_metainfo && that_present_key_metainfo)) return false; if (!this.key_metainfo.equals(that.key_metainfo)) return false; } boolean this_present_is_temporary = true; boolean that_present_is_temporary = true; if (this_present_is_temporary || that_present_is_temporary) { if (!(this_present_is_temporary && that_present_is_temporary)) return false; if (this.is_temporary != that.is_temporary) return false; } boolean this_present_partition_detail = true && this.isSetPartition_detail(); boolean that_present_partition_detail = true && that.isSetPartition_detail(); if (this_present_partition_detail || that_present_partition_detail) { if (!(this_present_partition_detail && that_present_partition_detail)) return false; if (!this.partition_detail.equals(that.partition_detail)) return false; } boolean this_present_table_type = true && this.isSetTable_type(); boolean that_present_table_type = true && that.isSetTable_type(); if (this_present_table_type || that_present_table_type) { if (!(this_present_table_type && that_present_table_type)) return false; if (!this.table_type.equals(that.table_type)) return false; } boolean this_present_refresh_info = true && this.isSetRefresh_info(); boolean that_present_refresh_info = true && that.isSetRefresh_info(); if (this_present_refresh_info || that_present_refresh_info) { if (!(this_present_refresh_info && that_present_refresh_info)) return false; if (!this.refresh_info.equals(that.refresh_info)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetRow_desc()) ? 131071 : 524287); if (isSetRow_desc()) hashCode = hashCode * 8191 + row_desc.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(fragment_size); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(page_size); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_rows); hashCode = hashCode * 8191 + ((isSetView_sql()) ? 131071 : 524287); if (isSetView_sql()) hashCode = hashCode * 8191 + view_sql.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(shard_count); hashCode = hashCode * 8191 + ((isSetKey_metainfo()) ? 131071 : 524287); if (isSetKey_metainfo()) hashCode = hashCode * 8191 + key_metainfo.hashCode(); hashCode = hashCode * 8191 + ((is_temporary) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetPartition_detail()) ? 131071 : 524287); if (isSetPartition_detail()) hashCode = hashCode * 8191 + partition_detail.getValue(); hashCode = hashCode * 8191 + ((isSetTable_type()) ? 131071 : 524287); if (isSetTable_type()) hashCode = hashCode * 8191 + table_type.getValue(); hashCode = hashCode * 8191 + ((isSetRefresh_info()) ? 131071 : 524287); if (isSetRefresh_info()) hashCode = hashCode * 8191 + refresh_info.hashCode(); return hashCode; } @Override public int compareTo(TTableDetails other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetRow_desc(), other.isSetRow_desc()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_desc()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_desc, other.row_desc); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetFragment_size(), other.isSetFragment_size()); if (lastComparison != 0) { return lastComparison; } if (isSetFragment_size()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fragment_size, other.fragment_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPage_size(), other.isSetPage_size()); if (lastComparison != 0) { return lastComparison; } if (isSetPage_size()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.page_size, other.page_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMax_rows(), other.isSetMax_rows()); if (lastComparison != 0) { return lastComparison; } if (isSetMax_rows()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_rows, other.max_rows); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetView_sql(), other.isSetView_sql()); if (lastComparison != 0) { return lastComparison; } if (isSetView_sql()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.view_sql, other.view_sql); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetShard_count(), other.isSetShard_count()); if (lastComparison != 0) { return lastComparison; } if (isSetShard_count()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shard_count, other.shard_count); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetKey_metainfo(), other.isSetKey_metainfo()); if (lastComparison != 0) { return lastComparison; } if (isSetKey_metainfo()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key_metainfo, other.key_metainfo); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_temporary(), other.isSetIs_temporary()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_temporary()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_temporary, other.is_temporary); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPartition_detail(), other.isSetPartition_detail()); if (lastComparison != 0) { return lastComparison; } if (isSetPartition_detail()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partition_detail, other.partition_detail); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_type(), other.isSetTable_type()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_type, other.table_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetRefresh_info(), other.isSetRefresh_info()); if (lastComparison != 0) { return lastComparison; } if (isSetRefresh_info()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.refresh_info, other.refresh_info); 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("TTableDetails("); boolean first = true; sb.append("row_desc:"); if (this.row_desc == null) { sb.append("null"); } else { sb.append(this.row_desc); } first = false; if (!first) sb.append(", "); sb.append("fragment_size:"); sb.append(this.fragment_size); first = false; if (!first) sb.append(", "); sb.append("page_size:"); sb.append(this.page_size); first = false; if (!first) sb.append(", "); sb.append("max_rows:"); sb.append(this.max_rows); first = false; if (!first) sb.append(", "); sb.append("view_sql:"); if (this.view_sql == null) { sb.append("null"); } else { sb.append(this.view_sql); } first = false; if (!first) sb.append(", "); sb.append("shard_count:"); sb.append(this.shard_count); first = false; if (!first) sb.append(", "); sb.append("key_metainfo:"); if (this.key_metainfo == null) { sb.append("null"); } else { sb.append(this.key_metainfo); } first = false; if (!first) sb.append(", "); sb.append("is_temporary:"); sb.append(this.is_temporary); first = false; if (!first) sb.append(", "); sb.append("partition_detail:"); if (this.partition_detail == null) { sb.append("null"); } else { sb.append(this.partition_detail); } first = false; if (!first) sb.append(", "); sb.append("table_type:"); if (this.table_type == null) { sb.append("null"); } else { sb.append(this.table_type); } first = false; if (!first) sb.append(", "); sb.append("refresh_info:"); if (this.refresh_info == null) { sb.append("null"); } else { sb.append(this.refresh_info); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (refresh_info != null) { refresh_info.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 TTableDetailsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableDetailsStandardScheme getScheme() { return new TTableDetailsStandardScheme(); } } private static class TTableDetailsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTableDetails> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTableDetails 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: // ROW_DESC if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list160 = iprot.readListBegin(); struct.row_desc = new java.util.ArrayList<TColumnType>(_list160.size); @org.apache.thrift.annotation.Nullable TColumnType _elem161; for (int _i162 = 0; _i162 < _list160.size; ++_i162) { _elem161 = new TColumnType(); _elem161.read(iprot); struct.row_desc.add(_elem161); } iprot.readListEnd(); } struct.setRow_descIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // FRAGMENT_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.fragment_size = iprot.readI64(); struct.setFragment_sizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PAGE_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.page_size = iprot.readI64(); struct.setPage_sizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // MAX_ROWS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.max_rows = iprot.readI64(); struct.setMax_rowsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // VIEW_SQL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.view_sql = iprot.readString(); struct.setView_sqlIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // SHARD_COUNT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.shard_count = iprot.readI64(); struct.setShard_countIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // KEY_METAINFO if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.key_metainfo = iprot.readString(); struct.setKey_metainfoIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // IS_TEMPORARY if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_temporary = iprot.readBool(); struct.setIs_temporaryIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // PARTITION_DETAIL if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.partition_detail = ai.heavy.thrift.server.TPartitionDetail.findByValue(iprot.readI32()); struct.setPartition_detailIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // TABLE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.table_type = ai.heavy.thrift.server.TTableType.findByValue(iprot.readI32()); struct.setTable_typeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 11: // REFRESH_INFO if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.refresh_info = new TTableRefreshInfo(); struct.refresh_info.read(iprot); struct.setRefresh_infoIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTableDetails struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.row_desc != null) { oprot.writeFieldBegin(ROW_DESC_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.row_desc.size())); for (TColumnType _iter163 : struct.row_desc) { _iter163.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(FRAGMENT_SIZE_FIELD_DESC); oprot.writeI64(struct.fragment_size); oprot.writeFieldEnd(); oprot.writeFieldBegin(PAGE_SIZE_FIELD_DESC); oprot.writeI64(struct.page_size); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC); oprot.writeI64(struct.max_rows); oprot.writeFieldEnd(); if (struct.view_sql != null) { oprot.writeFieldBegin(VIEW_SQL_FIELD_DESC); oprot.writeString(struct.view_sql); oprot.writeFieldEnd(); } oprot.writeFieldBegin(SHARD_COUNT_FIELD_DESC); oprot.writeI64(struct.shard_count); oprot.writeFieldEnd(); if (struct.key_metainfo != null) { oprot.writeFieldBegin(KEY_METAINFO_FIELD_DESC); oprot.writeString(struct.key_metainfo); oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_TEMPORARY_FIELD_DESC); oprot.writeBool(struct.is_temporary); oprot.writeFieldEnd(); if (struct.partition_detail != null) { oprot.writeFieldBegin(PARTITION_DETAIL_FIELD_DESC); oprot.writeI32(struct.partition_detail.getValue()); oprot.writeFieldEnd(); } if (struct.table_type != null) { oprot.writeFieldBegin(TABLE_TYPE_FIELD_DESC); oprot.writeI32(struct.table_type.getValue()); oprot.writeFieldEnd(); } if (struct.refresh_info != null) { oprot.writeFieldBegin(REFRESH_INFO_FIELD_DESC); struct.refresh_info.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTableDetailsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableDetailsTupleScheme getScheme() { return new TTableDetailsTupleScheme(); } } private static class TTableDetailsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTableDetails> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableDetails struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetRow_desc()) { optionals.set(0); } if (struct.isSetFragment_size()) { optionals.set(1); } if (struct.isSetPage_size()) { optionals.set(2); } if (struct.isSetMax_rows()) { optionals.set(3); } if (struct.isSetView_sql()) { optionals.set(4); } if (struct.isSetShard_count()) { optionals.set(5); } if (struct.isSetKey_metainfo()) { optionals.set(6); } if (struct.isSetIs_temporary()) { optionals.set(7); } if (struct.isSetPartition_detail()) { optionals.set(8); } if (struct.isSetTable_type()) { optionals.set(9); } if (struct.isSetRefresh_info()) { optionals.set(10); } oprot.writeBitSet(optionals, 11); if (struct.isSetRow_desc()) { { oprot.writeI32(struct.row_desc.size()); for (TColumnType _iter164 : struct.row_desc) { _iter164.write(oprot); } } } if (struct.isSetFragment_size()) { oprot.writeI64(struct.fragment_size); } if (struct.isSetPage_size()) { oprot.writeI64(struct.page_size); } if (struct.isSetMax_rows()) { oprot.writeI64(struct.max_rows); } if (struct.isSetView_sql()) { oprot.writeString(struct.view_sql); } if (struct.isSetShard_count()) { oprot.writeI64(struct.shard_count); } if (struct.isSetKey_metainfo()) { oprot.writeString(struct.key_metainfo); } if (struct.isSetIs_temporary()) { oprot.writeBool(struct.is_temporary); } if (struct.isSetPartition_detail()) { oprot.writeI32(struct.partition_detail.getValue()); } if (struct.isSetTable_type()) { oprot.writeI32(struct.table_type.getValue()); } if (struct.isSetRefresh_info()) { struct.refresh_info.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableDetails struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list165 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.row_desc = new java.util.ArrayList<TColumnType>(_list165.size); @org.apache.thrift.annotation.Nullable TColumnType _elem166; for (int _i167 = 0; _i167 < _list165.size; ++_i167) { _elem166 = new TColumnType(); _elem166.read(iprot); struct.row_desc.add(_elem166); } } struct.setRow_descIsSet(true); } if (incoming.get(1)) { struct.fragment_size = iprot.readI64(); struct.setFragment_sizeIsSet(true); } if (incoming.get(2)) { struct.page_size = iprot.readI64(); struct.setPage_sizeIsSet(true); } if (incoming.get(3)) { struct.max_rows = iprot.readI64(); struct.setMax_rowsIsSet(true); } if (incoming.get(4)) { struct.view_sql = iprot.readString(); struct.setView_sqlIsSet(true); } if (incoming.get(5)) { struct.shard_count = iprot.readI64(); struct.setShard_countIsSet(true); } if (incoming.get(6)) { struct.key_metainfo = iprot.readString(); struct.setKey_metainfoIsSet(true); } if (incoming.get(7)) { struct.is_temporary = iprot.readBool(); struct.setIs_temporaryIsSet(true); } if (incoming.get(8)) { struct.partition_detail = ai.heavy.thrift.server.TPartitionDetail.findByValue(iprot.readI32()); struct.setPartition_detailIsSet(true); } if (incoming.get(9)) { struct.table_type = ai.heavy.thrift.server.TTableType.findByValue(iprot.readI32()); struct.setTable_typeIsSet(true); } if (incoming.get(10)) { struct.refresh_info = new TTableRefreshInfo(); struct.refresh_info.read(iprot); struct.setRefresh_infoIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableEpochInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTableEpochInfo implements org.apache.thrift.TBase<TTableEpochInfo, TTableEpochInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TTableEpochInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableEpochInfo"); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("table_id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField TABLE_EPOCH_FIELD_DESC = new org.apache.thrift.protocol.TField("table_epoch", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField LEAF_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("leaf_index", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableEpochInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableEpochInfoTupleSchemeFactory(); public int table_id; // required public int table_epoch; // required public int leaf_index; // 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 { TABLE_ID((short)1, "table_id"), TABLE_EPOCH((short)2, "table_epoch"), LEAF_INDEX((short)3, "leaf_index"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // TABLE_ID return TABLE_ID; case 2: // TABLE_EPOCH return TABLE_EPOCH; case 3: // LEAF_INDEX return LEAF_INDEX; 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 __TABLE_ID_ISSET_ID = 0; private static final int __TABLE_EPOCH_ISSET_ID = 1; private static final int __LEAF_INDEX_ISSET_ID = 2; 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.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("table_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.TABLE_EPOCH, new org.apache.thrift.meta_data.FieldMetaData("table_epoch", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.LEAF_INDEX, new org.apache.thrift.meta_data.FieldMetaData("leaf_index", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TTableEpochInfo.class, metaDataMap); } public TTableEpochInfo() { } public TTableEpochInfo( int table_id, int table_epoch, int leaf_index) { this(); this.table_id = table_id; setTable_idIsSet(true); this.table_epoch = table_epoch; setTable_epochIsSet(true); this.leaf_index = leaf_index; setLeaf_indexIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TTableEpochInfo(TTableEpochInfo other) { __isset_bitfield = other.__isset_bitfield; this.table_id = other.table_id; this.table_epoch = other.table_epoch; this.leaf_index = other.leaf_index; } public TTableEpochInfo deepCopy() { return new TTableEpochInfo(this); } @Override public void clear() { setTable_idIsSet(false); this.table_id = 0; setTable_epochIsSet(false); this.table_epoch = 0; setLeaf_indexIsSet(false); this.leaf_index = 0; } public int getTable_id() { return this.table_id; } public TTableEpochInfo setTable_id(int table_id) { this.table_id = table_id; setTable_idIsSet(true); return this; } public void unsetTable_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } /** Returns true if field table_id is set (has been assigned a value) and false otherwise */ public boolean isSetTable_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } public void setTable_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLE_ID_ISSET_ID, value); } public int getTable_epoch() { return this.table_epoch; } public TTableEpochInfo setTable_epoch(int table_epoch) { this.table_epoch = table_epoch; setTable_epochIsSet(true); return this; } public void unsetTable_epoch() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLE_EPOCH_ISSET_ID); } /** Returns true if field table_epoch is set (has been assigned a value) and false otherwise */ public boolean isSetTable_epoch() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLE_EPOCH_ISSET_ID); } public void setTable_epochIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLE_EPOCH_ISSET_ID, value); } public int getLeaf_index() { return this.leaf_index; } public TTableEpochInfo setLeaf_index(int leaf_index) { this.leaf_index = leaf_index; setLeaf_indexIsSet(true); return this; } public void unsetLeaf_index() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LEAF_INDEX_ISSET_ID); } /** Returns true if field leaf_index is set (has been assigned a value) and false otherwise */ public boolean isSetLeaf_index() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LEAF_INDEX_ISSET_ID); } public void setLeaf_indexIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LEAF_INDEX_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TABLE_ID: if (value == null) { unsetTable_id(); } else { setTable_id((java.lang.Integer)value); } break; case TABLE_EPOCH: if (value == null) { unsetTable_epoch(); } else { setTable_epoch((java.lang.Integer)value); } break; case LEAF_INDEX: if (value == null) { unsetLeaf_index(); } else { setLeaf_index((java.lang.Integer)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TABLE_ID: return getTable_id(); case TABLE_EPOCH: return getTable_epoch(); case LEAF_INDEX: return getLeaf_index(); } 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 TABLE_ID: return isSetTable_id(); case TABLE_EPOCH: return isSetTable_epoch(); case LEAF_INDEX: return isSetLeaf_index(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTableEpochInfo) return this.equals((TTableEpochInfo)that); return false; } public boolean equals(TTableEpochInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_table_id = true; boolean that_present_table_id = true; if (this_present_table_id || that_present_table_id) { if (!(this_present_table_id && that_present_table_id)) return false; if (this.table_id != that.table_id) return false; } boolean this_present_table_epoch = true; boolean that_present_table_epoch = true; if (this_present_table_epoch || that_present_table_epoch) { if (!(this_present_table_epoch && that_present_table_epoch)) return false; if (this.table_epoch != that.table_epoch) return false; } boolean this_present_leaf_index = true; boolean that_present_leaf_index = true; if (this_present_leaf_index || that_present_leaf_index) { if (!(this_present_leaf_index && that_present_leaf_index)) return false; if (this.leaf_index != that.leaf_index) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + table_id; hashCode = hashCode * 8191 + table_epoch; hashCode = hashCode * 8191 + leaf_index; return hashCode; } @Override public int compareTo(TTableEpochInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetTable_id(), other.isSetTable_id()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_id, other.table_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_epoch(), other.isSetTable_epoch()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_epoch()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_epoch, other.table_epoch); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetLeaf_index(), other.isSetLeaf_index()); if (lastComparison != 0) { return lastComparison; } if (isSetLeaf_index()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leaf_index, other.leaf_index); 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("TTableEpochInfo("); boolean first = true; sb.append("table_id:"); sb.append(this.table_id); first = false; if (!first) sb.append(", "); sb.append("table_epoch:"); sb.append(this.table_epoch); first = false; if (!first) sb.append(", "); sb.append("leaf_index:"); sb.append(this.leaf_index); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TTableEpochInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableEpochInfoStandardScheme getScheme() { return new TTableEpochInfoStandardScheme(); } } private static class TTableEpochInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTableEpochInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTableEpochInfo 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: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TABLE_EPOCH if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.table_epoch = iprot.readI32(); struct.setTable_epochIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // LEAF_INDEX if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.leaf_index = iprot.readI32(); struct.setLeaf_indexIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTableEpochInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); oprot.writeI32(struct.table_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(TABLE_EPOCH_FIELD_DESC); oprot.writeI32(struct.table_epoch); oprot.writeFieldEnd(); oprot.writeFieldBegin(LEAF_INDEX_FIELD_DESC); oprot.writeI32(struct.leaf_index); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTableEpochInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableEpochInfoTupleScheme getScheme() { return new TTableEpochInfoTupleScheme(); } } private static class TTableEpochInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTableEpochInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableEpochInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetTable_id()) { optionals.set(0); } if (struct.isSetTable_epoch()) { optionals.set(1); } if (struct.isSetLeaf_index()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetTable_id()) { oprot.writeI32(struct.table_id); } if (struct.isSetTable_epoch()) { oprot.writeI32(struct.table_epoch); } if (struct.isSetLeaf_index()) { oprot.writeI32(struct.leaf_index); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableEpochInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } if (incoming.get(1)) { struct.table_epoch = iprot.readI32(); struct.setTable_epochIsSet(true); } if (incoming.get(2)) { struct.leaf_index = iprot.readI32(); struct.setLeaf_indexIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableGeneration.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTableGeneration implements org.apache.thrift.TBase<TTableGeneration, TTableGeneration._Fields>, java.io.Serializable, Cloneable, Comparable<TTableGeneration> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableGeneration"); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("table_id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField TUPLE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("tuple_count", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField START_ROWID_FIELD_DESC = new org.apache.thrift.protocol.TField("start_rowid", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableGenerationStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableGenerationTupleSchemeFactory(); public int table_id; // required public long tuple_count; // required public long start_rowid; // 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 { TABLE_ID((short)1, "table_id"), TUPLE_COUNT((short)2, "tuple_count"), START_ROWID((short)3, "start_rowid"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // TABLE_ID return TABLE_ID; case 2: // TUPLE_COUNT return TUPLE_COUNT; case 3: // START_ROWID return START_ROWID; 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 __TABLE_ID_ISSET_ID = 0; private static final int __TUPLE_COUNT_ISSET_ID = 1; private static final int __START_ROWID_ISSET_ID = 2; 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.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("table_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.TUPLE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("tuple_count", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.START_ROWID, new org.apache.thrift.meta_data.FieldMetaData("start_rowid", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableGeneration.class, metaDataMap); } public TTableGeneration() { } public TTableGeneration( int table_id, long tuple_count, long start_rowid) { this(); this.table_id = table_id; setTable_idIsSet(true); this.tuple_count = tuple_count; setTuple_countIsSet(true); this.start_rowid = start_rowid; setStart_rowidIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TTableGeneration(TTableGeneration other) { __isset_bitfield = other.__isset_bitfield; this.table_id = other.table_id; this.tuple_count = other.tuple_count; this.start_rowid = other.start_rowid; } public TTableGeneration deepCopy() { return new TTableGeneration(this); } @Override public void clear() { setTable_idIsSet(false); this.table_id = 0; setTuple_countIsSet(false); this.tuple_count = 0; setStart_rowidIsSet(false); this.start_rowid = 0; } public int getTable_id() { return this.table_id; } public TTableGeneration setTable_id(int table_id) { this.table_id = table_id; setTable_idIsSet(true); return this; } public void unsetTable_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } /** Returns true if field table_id is set (has been assigned a value) and false otherwise */ public boolean isSetTable_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } public void setTable_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLE_ID_ISSET_ID, value); } public long getTuple_count() { return this.tuple_count; } public TTableGeneration setTuple_count(long tuple_count) { this.tuple_count = tuple_count; setTuple_countIsSet(true); return this; } public void unsetTuple_count() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TUPLE_COUNT_ISSET_ID); } /** Returns true if field tuple_count is set (has been assigned a value) and false otherwise */ public boolean isSetTuple_count() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TUPLE_COUNT_ISSET_ID); } public void setTuple_countIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TUPLE_COUNT_ISSET_ID, value); } public long getStart_rowid() { return this.start_rowid; } public TTableGeneration setStart_rowid(long start_rowid) { this.start_rowid = start_rowid; setStart_rowidIsSet(true); return this; } public void unsetStart_rowid() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_ROWID_ISSET_ID); } /** Returns true if field start_rowid is set (has been assigned a value) and false otherwise */ public boolean isSetStart_rowid() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_ROWID_ISSET_ID); } public void setStart_rowidIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_ROWID_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TABLE_ID: if (value == null) { unsetTable_id(); } else { setTable_id((java.lang.Integer)value); } break; case TUPLE_COUNT: if (value == null) { unsetTuple_count(); } else { setTuple_count((java.lang.Long)value); } break; case START_ROWID: if (value == null) { unsetStart_rowid(); } else { setStart_rowid((java.lang.Long)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TABLE_ID: return getTable_id(); case TUPLE_COUNT: return getTuple_count(); case START_ROWID: return getStart_rowid(); } 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 TABLE_ID: return isSetTable_id(); case TUPLE_COUNT: return isSetTuple_count(); case START_ROWID: return isSetStart_rowid(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTableGeneration) return this.equals((TTableGeneration)that); return false; } public boolean equals(TTableGeneration that) { if (that == null) return false; if (this == that) return true; boolean this_present_table_id = true; boolean that_present_table_id = true; if (this_present_table_id || that_present_table_id) { if (!(this_present_table_id && that_present_table_id)) return false; if (this.table_id != that.table_id) return false; } boolean this_present_tuple_count = true; boolean that_present_tuple_count = true; if (this_present_tuple_count || that_present_tuple_count) { if (!(this_present_tuple_count && that_present_tuple_count)) return false; if (this.tuple_count != that.tuple_count) return false; } boolean this_present_start_rowid = true; boolean that_present_start_rowid = true; if (this_present_start_rowid || that_present_start_rowid) { if (!(this_present_start_rowid && that_present_start_rowid)) return false; if (this.start_rowid != that.start_rowid) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + table_id; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(tuple_count); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(start_rowid); return hashCode; } @Override public int compareTo(TTableGeneration other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetTable_id(), other.isSetTable_id()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_id, other.table_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTuple_count(), other.isSetTuple_count()); if (lastComparison != 0) { return lastComparison; } if (isSetTuple_count()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tuple_count, other.tuple_count); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetStart_rowid(), other.isSetStart_rowid()); if (lastComparison != 0) { return lastComparison; } if (isSetStart_rowid()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_rowid, other.start_rowid); 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("TTableGeneration("); boolean first = true; sb.append("table_id:"); sb.append(this.table_id); first = false; if (!first) sb.append(", "); sb.append("tuple_count:"); sb.append(this.tuple_count); first = false; if (!first) sb.append(", "); sb.append("start_rowid:"); sb.append(this.start_rowid); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TTableGenerationStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableGenerationStandardScheme getScheme() { return new TTableGenerationStandardScheme(); } } private static class TTableGenerationStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTableGeneration> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTableGeneration 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: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TUPLE_COUNT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.tuple_count = iprot.readI64(); struct.setTuple_countIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // START_ROWID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.start_rowid = iprot.readI64(); struct.setStart_rowidIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTableGeneration struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); oprot.writeI32(struct.table_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(TUPLE_COUNT_FIELD_DESC); oprot.writeI64(struct.tuple_count); oprot.writeFieldEnd(); oprot.writeFieldBegin(START_ROWID_FIELD_DESC); oprot.writeI64(struct.start_rowid); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTableGenerationTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableGenerationTupleScheme getScheme() { return new TTableGenerationTupleScheme(); } } private static class TTableGenerationTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTableGeneration> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableGeneration struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetTable_id()) { optionals.set(0); } if (struct.isSetTuple_count()) { optionals.set(1); } if (struct.isSetStart_rowid()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetTable_id()) { oprot.writeI32(struct.table_id); } if (struct.isSetTuple_count()) { oprot.writeI64(struct.tuple_count); } if (struct.isSetStart_rowid()) { oprot.writeI64(struct.start_rowid); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableGeneration struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.table_id = iprot.readI32(); struct.setTable_idIsSet(true); } if (incoming.get(1)) { struct.tuple_count = iprot.readI64(); struct.setTuple_countIsSet(true); } if (incoming.get(2)) { struct.start_rowid = iprot.readI64(); struct.setStart_rowidIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableMeta.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTableMeta implements org.apache.thrift.TBase<TTableMeta, TTableMeta._Fields>, java.io.Serializable, Cloneable, Comparable<TTableMeta> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableMeta"); private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("table_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField NUM_COLS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_cols", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField IS_VIEW_FIELD_DESC = new org.apache.thrift.protocol.TField("is_view", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField IS_REPLICATED_FIELD_DESC = new org.apache.thrift.protocol.TField("is_replicated", org.apache.thrift.protocol.TType.BOOL, (short)5); private static final org.apache.thrift.protocol.TField SHARD_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("shard_count", org.apache.thrift.protocol.TType.I64, (short)6); private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("max_rows", org.apache.thrift.protocol.TType.I64, (short)7); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("table_id", org.apache.thrift.protocol.TType.I64, (short)8); private static final org.apache.thrift.protocol.TField MAX_TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("max_table_id", org.apache.thrift.protocol.TType.I64, (short)9); private static final org.apache.thrift.protocol.TField COL_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("col_types", org.apache.thrift.protocol.TType.LIST, (short)10); private static final org.apache.thrift.protocol.TField COL_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("col_names", org.apache.thrift.protocol.TType.LIST, (short)11); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableMetaStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableMetaTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.lang.String table_name; // required public long num_cols; // required public boolean is_view; // required public boolean is_replicated; // required public long shard_count; // required public long max_rows; // required public long table_id; // required public long max_table_id; // required public @org.apache.thrift.annotation.Nullable java.util.List<ai.heavy.thrift.server.TTypeInfo> col_types; // required public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> col_names; // 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 { TABLE_NAME((short)1, "table_name"), NUM_COLS((short)2, "num_cols"), IS_VIEW((short)4, "is_view"), IS_REPLICATED((short)5, "is_replicated"), SHARD_COUNT((short)6, "shard_count"), MAX_ROWS((short)7, "max_rows"), TABLE_ID((short)8, "table_id"), MAX_TABLE_ID((short)9, "max_table_id"), COL_TYPES((short)10, "col_types"), COL_NAMES((short)11, "col_names"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // TABLE_NAME return TABLE_NAME; case 2: // NUM_COLS return NUM_COLS; case 4: // IS_VIEW return IS_VIEW; case 5: // IS_REPLICATED return IS_REPLICATED; case 6: // SHARD_COUNT return SHARD_COUNT; case 7: // MAX_ROWS return MAX_ROWS; case 8: // TABLE_ID return TABLE_ID; case 9: // MAX_TABLE_ID return MAX_TABLE_ID; case 10: // COL_TYPES return COL_TYPES; case 11: // COL_NAMES return COL_NAMES; 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 __NUM_COLS_ISSET_ID = 0; private static final int __IS_VIEW_ISSET_ID = 1; private static final int __IS_REPLICATED_ISSET_ID = 2; private static final int __SHARD_COUNT_ISSET_ID = 3; private static final int __MAX_ROWS_ISSET_ID = 4; private static final int __TABLE_ID_ISSET_ID = 5; private static final int __MAX_TABLE_ID_ISSET_ID = 6; 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.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("table_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.NUM_COLS, new org.apache.thrift.meta_data.FieldMetaData("num_cols", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.IS_VIEW, new org.apache.thrift.meta_data.FieldMetaData("is_view", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.IS_REPLICATED, new org.apache.thrift.meta_data.FieldMetaData("is_replicated", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.SHARD_COUNT, new org.apache.thrift.meta_data.FieldMetaData("shard_count", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("max_rows", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("table_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.MAX_TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("max_table_id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.COL_TYPES, new org.apache.thrift.meta_data.FieldMetaData("col_types", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ai.heavy.thrift.server.TTypeInfo.class)))); tmpMap.put(_Fields.COL_NAMES, new org.apache.thrift.meta_data.FieldMetaData("col_names", org.apache.thrift.TFieldRequirementType.DEFAULT, 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)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableMeta.class, metaDataMap); } public TTableMeta() { } public TTableMeta( java.lang.String table_name, long num_cols, boolean is_view, boolean is_replicated, long shard_count, long max_rows, long table_id, long max_table_id, java.util.List<ai.heavy.thrift.server.TTypeInfo> col_types, java.util.List<java.lang.String> col_names) { this(); this.table_name = table_name; this.num_cols = num_cols; setNum_colsIsSet(true); this.is_view = is_view; setIs_viewIsSet(true); this.is_replicated = is_replicated; setIs_replicatedIsSet(true); this.shard_count = shard_count; setShard_countIsSet(true); this.max_rows = max_rows; setMax_rowsIsSet(true); this.table_id = table_id; setTable_idIsSet(true); this.max_table_id = max_table_id; setMax_table_idIsSet(true); this.col_types = col_types; this.col_names = col_names; } /** * Performs a deep copy on <i>other</i>. */ public TTableMeta(TTableMeta other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetTable_name()) { this.table_name = other.table_name; } this.num_cols = other.num_cols; this.is_view = other.is_view; this.is_replicated = other.is_replicated; this.shard_count = other.shard_count; this.max_rows = other.max_rows; this.table_id = other.table_id; this.max_table_id = other.max_table_id; if (other.isSetCol_types()) { java.util.List<ai.heavy.thrift.server.TTypeInfo> __this__col_types = new java.util.ArrayList<ai.heavy.thrift.server.TTypeInfo>(other.col_types.size()); for (ai.heavy.thrift.server.TTypeInfo other_element : other.col_types) { __this__col_types.add(new ai.heavy.thrift.server.TTypeInfo(other_element)); } this.col_types = __this__col_types; } if (other.isSetCol_names()) { java.util.List<java.lang.String> __this__col_names = new java.util.ArrayList<java.lang.String>(other.col_names); this.col_names = __this__col_names; } } public TTableMeta deepCopy() { return new TTableMeta(this); } @Override public void clear() { this.table_name = null; setNum_colsIsSet(false); this.num_cols = 0; setIs_viewIsSet(false); this.is_view = false; setIs_replicatedIsSet(false); this.is_replicated = false; setShard_countIsSet(false); this.shard_count = 0; setMax_rowsIsSet(false); this.max_rows = 0; setTable_idIsSet(false); this.table_id = 0; setMax_table_idIsSet(false); this.max_table_id = 0; this.col_types = null; this.col_names = null; } @org.apache.thrift.annotation.Nullable public java.lang.String getTable_name() { return this.table_name; } public TTableMeta setTable_name(@org.apache.thrift.annotation.Nullable java.lang.String table_name) { this.table_name = table_name; return this; } public void unsetTable_name() { this.table_name = null; } /** Returns true if field table_name is set (has been assigned a value) and false otherwise */ public boolean isSetTable_name() { return this.table_name != null; } public void setTable_nameIsSet(boolean value) { if (!value) { this.table_name = null; } } public long getNum_cols() { return this.num_cols; } public TTableMeta setNum_cols(long num_cols) { this.num_cols = num_cols; setNum_colsIsSet(true); return this; } public void unsetNum_cols() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_COLS_ISSET_ID); } /** Returns true if field num_cols is set (has been assigned a value) and false otherwise */ public boolean isSetNum_cols() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_COLS_ISSET_ID); } public void setNum_colsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_COLS_ISSET_ID, value); } public boolean isIs_view() { return this.is_view; } public TTableMeta setIs_view(boolean is_view) { this.is_view = is_view; setIs_viewIsSet(true); return this; } public void unsetIs_view() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_VIEW_ISSET_ID); } /** Returns true if field is_view is set (has been assigned a value) and false otherwise */ public boolean isSetIs_view() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_VIEW_ISSET_ID); } public void setIs_viewIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_VIEW_ISSET_ID, value); } public boolean isIs_replicated() { return this.is_replicated; } public TTableMeta setIs_replicated(boolean is_replicated) { this.is_replicated = is_replicated; setIs_replicatedIsSet(true); return this; } public void unsetIs_replicated() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_REPLICATED_ISSET_ID); } /** Returns true if field is_replicated is set (has been assigned a value) and false otherwise */ public boolean isSetIs_replicated() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_REPLICATED_ISSET_ID); } public void setIs_replicatedIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_REPLICATED_ISSET_ID, value); } public long getShard_count() { return this.shard_count; } public TTableMeta setShard_count(long shard_count) { this.shard_count = shard_count; setShard_countIsSet(true); return this; } public void unsetShard_count() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SHARD_COUNT_ISSET_ID); } /** Returns true if field shard_count is set (has been assigned a value) and false otherwise */ public boolean isSetShard_count() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SHARD_COUNT_ISSET_ID); } public void setShard_countIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SHARD_COUNT_ISSET_ID, value); } public long getMax_rows() { return this.max_rows; } public TTableMeta setMax_rows(long max_rows) { this.max_rows = max_rows; setMax_rowsIsSet(true); return this; } public void unsetMax_rows() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_ROWS_ISSET_ID); } /** Returns true if field max_rows is set (has been assigned a value) and false otherwise */ public boolean isSetMax_rows() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_ROWS_ISSET_ID); } public void setMax_rowsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_ROWS_ISSET_ID, value); } public long getTable_id() { return this.table_id; } public TTableMeta setTable_id(long table_id) { this.table_id = table_id; setTable_idIsSet(true); return this; } public void unsetTable_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } /** Returns true if field table_id is set (has been assigned a value) and false otherwise */ public boolean isSetTable_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLE_ID_ISSET_ID); } public void setTable_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLE_ID_ISSET_ID, value); } public long getMax_table_id() { return this.max_table_id; } public TTableMeta setMax_table_id(long max_table_id) { this.max_table_id = max_table_id; setMax_table_idIsSet(true); return this; } public void unsetMax_table_id() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_TABLE_ID_ISSET_ID); } /** Returns true if field max_table_id is set (has been assigned a value) and false otherwise */ public boolean isSetMax_table_id() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_TABLE_ID_ISSET_ID); } public void setMax_table_idIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_TABLE_ID_ISSET_ID, value); } public int getCol_typesSize() { return (this.col_types == null) ? 0 : this.col_types.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<ai.heavy.thrift.server.TTypeInfo> getCol_typesIterator() { return (this.col_types == null) ? null : this.col_types.iterator(); } public void addToCol_types(ai.heavy.thrift.server.TTypeInfo elem) { if (this.col_types == null) { this.col_types = new java.util.ArrayList<ai.heavy.thrift.server.TTypeInfo>(); } this.col_types.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<ai.heavy.thrift.server.TTypeInfo> getCol_types() { return this.col_types; } public TTableMeta setCol_types(@org.apache.thrift.annotation.Nullable java.util.List<ai.heavy.thrift.server.TTypeInfo> col_types) { this.col_types = col_types; return this; } public void unsetCol_types() { this.col_types = null; } /** Returns true if field col_types is set (has been assigned a value) and false otherwise */ public boolean isSetCol_types() { return this.col_types != null; } public void setCol_typesIsSet(boolean value) { if (!value) { this.col_types = null; } } public int getCol_namesSize() { return (this.col_names == null) ? 0 : this.col_names.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<java.lang.String> getCol_namesIterator() { return (this.col_names == null) ? null : this.col_names.iterator(); } public void addToCol_names(java.lang.String elem) { if (this.col_names == null) { this.col_names = new java.util.ArrayList<java.lang.String>(); } this.col_names.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<java.lang.String> getCol_names() { return this.col_names; } public TTableMeta setCol_names(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> col_names) { this.col_names = col_names; return this; } public void unsetCol_names() { this.col_names = null; } /** Returns true if field col_names is set (has been assigned a value) and false otherwise */ public boolean isSetCol_names() { return this.col_names != null; } public void setCol_namesIsSet(boolean value) { if (!value) { this.col_names = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TABLE_NAME: if (value == null) { unsetTable_name(); } else { setTable_name((java.lang.String)value); } break; case NUM_COLS: if (value == null) { unsetNum_cols(); } else { setNum_cols((java.lang.Long)value); } break; case IS_VIEW: if (value == null) { unsetIs_view(); } else { setIs_view((java.lang.Boolean)value); } break; case IS_REPLICATED: if (value == null) { unsetIs_replicated(); } else { setIs_replicated((java.lang.Boolean)value); } break; case SHARD_COUNT: if (value == null) { unsetShard_count(); } else { setShard_count((java.lang.Long)value); } break; case MAX_ROWS: if (value == null) { unsetMax_rows(); } else { setMax_rows((java.lang.Long)value); } break; case TABLE_ID: if (value == null) { unsetTable_id(); } else { setTable_id((java.lang.Long)value); } break; case MAX_TABLE_ID: if (value == null) { unsetMax_table_id(); } else { setMax_table_id((java.lang.Long)value); } break; case COL_TYPES: if (value == null) { unsetCol_types(); } else { setCol_types((java.util.List<ai.heavy.thrift.server.TTypeInfo>)value); } break; case COL_NAMES: if (value == null) { unsetCol_names(); } else { setCol_names((java.util.List<java.lang.String>)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TABLE_NAME: return getTable_name(); case NUM_COLS: return getNum_cols(); case IS_VIEW: return isIs_view(); case IS_REPLICATED: return isIs_replicated(); case SHARD_COUNT: return getShard_count(); case MAX_ROWS: return getMax_rows(); case TABLE_ID: return getTable_id(); case MAX_TABLE_ID: return getMax_table_id(); case COL_TYPES: return getCol_types(); case COL_NAMES: return getCol_names(); } 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 TABLE_NAME: return isSetTable_name(); case NUM_COLS: return isSetNum_cols(); case IS_VIEW: return isSetIs_view(); case IS_REPLICATED: return isSetIs_replicated(); case SHARD_COUNT: return isSetShard_count(); case MAX_ROWS: return isSetMax_rows(); case TABLE_ID: return isSetTable_id(); case MAX_TABLE_ID: return isSetMax_table_id(); case COL_TYPES: return isSetCol_types(); case COL_NAMES: return isSetCol_names(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTableMeta) return this.equals((TTableMeta)that); return false; } public boolean equals(TTableMeta that) { if (that == null) return false; if (this == that) return true; boolean this_present_table_name = true && this.isSetTable_name(); boolean that_present_table_name = true && that.isSetTable_name(); if (this_present_table_name || that_present_table_name) { if (!(this_present_table_name && that_present_table_name)) return false; if (!this.table_name.equals(that.table_name)) return false; } boolean this_present_num_cols = true; boolean that_present_num_cols = true; if (this_present_num_cols || that_present_num_cols) { if (!(this_present_num_cols && that_present_num_cols)) return false; if (this.num_cols != that.num_cols) return false; } boolean this_present_is_view = true; boolean that_present_is_view = true; if (this_present_is_view || that_present_is_view) { if (!(this_present_is_view && that_present_is_view)) return false; if (this.is_view != that.is_view) return false; } boolean this_present_is_replicated = true; boolean that_present_is_replicated = true; if (this_present_is_replicated || that_present_is_replicated) { if (!(this_present_is_replicated && that_present_is_replicated)) return false; if (this.is_replicated != that.is_replicated) return false; } boolean this_present_shard_count = true; boolean that_present_shard_count = true; if (this_present_shard_count || that_present_shard_count) { if (!(this_present_shard_count && that_present_shard_count)) return false; if (this.shard_count != that.shard_count) return false; } boolean this_present_max_rows = true; boolean that_present_max_rows = true; if (this_present_max_rows || that_present_max_rows) { if (!(this_present_max_rows && that_present_max_rows)) return false; if (this.max_rows != that.max_rows) return false; } boolean this_present_table_id = true; boolean that_present_table_id = true; if (this_present_table_id || that_present_table_id) { if (!(this_present_table_id && that_present_table_id)) return false; if (this.table_id != that.table_id) return false; } boolean this_present_max_table_id = true; boolean that_present_max_table_id = true; if (this_present_max_table_id || that_present_max_table_id) { if (!(this_present_max_table_id && that_present_max_table_id)) return false; if (this.max_table_id != that.max_table_id) return false; } boolean this_present_col_types = true && this.isSetCol_types(); boolean that_present_col_types = true && that.isSetCol_types(); if (this_present_col_types || that_present_col_types) { if (!(this_present_col_types && that_present_col_types)) return false; if (!this.col_types.equals(that.col_types)) return false; } boolean this_present_col_names = true && this.isSetCol_names(); boolean that_present_col_names = true && that.isSetCol_names(); if (this_present_col_names || that_present_col_names) { if (!(this_present_col_names && that_present_col_names)) return false; if (!this.col_names.equals(that.col_names)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetTable_name()) ? 131071 : 524287); if (isSetTable_name()) hashCode = hashCode * 8191 + table_name.hashCode(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(num_cols); hashCode = hashCode * 8191 + ((is_view) ? 131071 : 524287); hashCode = hashCode * 8191 + ((is_replicated) ? 131071 : 524287); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(shard_count); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_rows); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(table_id); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_table_id); hashCode = hashCode * 8191 + ((isSetCol_types()) ? 131071 : 524287); if (isSetCol_types()) hashCode = hashCode * 8191 + col_types.hashCode(); hashCode = hashCode * 8191 + ((isSetCol_names()) ? 131071 : 524287); if (isSetCol_names()) hashCode = hashCode * 8191 + col_names.hashCode(); return hashCode; } @Override public int compareTo(TTableMeta other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetTable_name(), other.isSetTable_name()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_name, other.table_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNum_cols(), other.isSetNum_cols()); if (lastComparison != 0) { return lastComparison; } if (isSetNum_cols()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_cols, other.num_cols); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_view(), other.isSetIs_view()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_view()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_view, other.is_view); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_replicated(), other.isSetIs_replicated()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_replicated()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_replicated, other.is_replicated); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetShard_count(), other.isSetShard_count()); if (lastComparison != 0) { return lastComparison; } if (isSetShard_count()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shard_count, other.shard_count); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMax_rows(), other.isSetMax_rows()); if (lastComparison != 0) { return lastComparison; } if (isSetMax_rows()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_rows, other.max_rows); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTable_id(), other.isSetTable_id()); if (lastComparison != 0) { return lastComparison; } if (isSetTable_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_id, other.table_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetMax_table_id(), other.isSetMax_table_id()); if (lastComparison != 0) { return lastComparison; } if (isSetMax_table_id()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_table_id, other.max_table_id); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCol_types(), other.isSetCol_types()); if (lastComparison != 0) { return lastComparison; } if (isSetCol_types()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.col_types, other.col_types); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetCol_names(), other.isSetCol_names()); if (lastComparison != 0) { return lastComparison; } if (isSetCol_names()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.col_names, other.col_names); 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("TTableMeta("); boolean first = true; sb.append("table_name:"); if (this.table_name == null) { sb.append("null"); } else { sb.append(this.table_name); } first = false; if (!first) sb.append(", "); sb.append("num_cols:"); sb.append(this.num_cols); first = false; if (!first) sb.append(", "); sb.append("is_view:"); sb.append(this.is_view); first = false; if (!first) sb.append(", "); sb.append("is_replicated:"); sb.append(this.is_replicated); first = false; if (!first) sb.append(", "); sb.append("shard_count:"); sb.append(this.shard_count); first = false; if (!first) sb.append(", "); sb.append("max_rows:"); sb.append(this.max_rows); first = false; if (!first) sb.append(", "); sb.append("table_id:"); sb.append(this.table_id); first = false; if (!first) sb.append(", "); sb.append("max_table_id:"); sb.append(this.max_table_id); first = false; if (!first) sb.append(", "); sb.append("col_types:"); if (this.col_types == null) { sb.append("null"); } else { sb.append(this.col_types); } first = false; if (!first) sb.append(", "); sb.append("col_names:"); if (this.col_names == null) { sb.append("null"); } else { sb.append(this.col_names); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TTableMetaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableMetaStandardScheme getScheme() { return new TTableMetaStandardScheme(); } } private static class TTableMetaStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTableMeta> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTableMeta 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: // TABLE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.table_name = iprot.readString(); struct.setTable_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NUM_COLS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.num_cols = iprot.readI64(); struct.setNum_colsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // IS_VIEW if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_view = iprot.readBool(); struct.setIs_viewIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // IS_REPLICATED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_replicated = iprot.readBool(); struct.setIs_replicatedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // SHARD_COUNT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.shard_count = iprot.readI64(); struct.setShard_countIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // MAX_ROWS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.max_rows = iprot.readI64(); struct.setMax_rowsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.table_id = iprot.readI64(); struct.setTable_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // MAX_TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.max_table_id = iprot.readI64(); struct.setMax_table_idIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // COL_TYPES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list144 = iprot.readListBegin(); struct.col_types = new java.util.ArrayList<ai.heavy.thrift.server.TTypeInfo>(_list144.size); @org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TTypeInfo _elem145; for (int _i146 = 0; _i146 < _list144.size; ++_i146) { _elem145 = new ai.heavy.thrift.server.TTypeInfo(); _elem145.read(iprot); struct.col_types.add(_elem145); } iprot.readListEnd(); } struct.setCol_typesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 11: // COL_NAMES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list147 = iprot.readListBegin(); struct.col_names = new java.util.ArrayList<java.lang.String>(_list147.size); @org.apache.thrift.annotation.Nullable java.lang.String _elem148; for (int _i149 = 0; _i149 < _list147.size; ++_i149) { _elem148 = iprot.readString(); struct.col_names.add(_elem148); } iprot.readListEnd(); } struct.setCol_namesIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTableMeta struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.table_name != null) { oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); oprot.writeString(struct.table_name); oprot.writeFieldEnd(); } oprot.writeFieldBegin(NUM_COLS_FIELD_DESC); oprot.writeI64(struct.num_cols); oprot.writeFieldEnd(); oprot.writeFieldBegin(IS_VIEW_FIELD_DESC); oprot.writeBool(struct.is_view); oprot.writeFieldEnd(); oprot.writeFieldBegin(IS_REPLICATED_FIELD_DESC); oprot.writeBool(struct.is_replicated); oprot.writeFieldEnd(); oprot.writeFieldBegin(SHARD_COUNT_FIELD_DESC); oprot.writeI64(struct.shard_count); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC); oprot.writeI64(struct.max_rows); oprot.writeFieldEnd(); oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); oprot.writeI64(struct.table_id); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAX_TABLE_ID_FIELD_DESC); oprot.writeI64(struct.max_table_id); oprot.writeFieldEnd(); if (struct.col_types != null) { oprot.writeFieldBegin(COL_TYPES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.col_types.size())); for (ai.heavy.thrift.server.TTypeInfo _iter150 : struct.col_types) { _iter150.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.col_names != null) { oprot.writeFieldBegin(COL_NAMES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.col_names.size())); for (java.lang.String _iter151 : struct.col_names) { oprot.writeString(_iter151); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTableMetaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableMetaTupleScheme getScheme() { return new TTableMetaTupleScheme(); } } private static class TTableMetaTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTableMeta> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableMeta struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetTable_name()) { optionals.set(0); } if (struct.isSetNum_cols()) { optionals.set(1); } if (struct.isSetIs_view()) { optionals.set(2); } if (struct.isSetIs_replicated()) { optionals.set(3); } if (struct.isSetShard_count()) { optionals.set(4); } if (struct.isSetMax_rows()) { optionals.set(5); } if (struct.isSetTable_id()) { optionals.set(6); } if (struct.isSetMax_table_id()) { optionals.set(7); } if (struct.isSetCol_types()) { optionals.set(8); } if (struct.isSetCol_names()) { optionals.set(9); } oprot.writeBitSet(optionals, 10); if (struct.isSetTable_name()) { oprot.writeString(struct.table_name); } if (struct.isSetNum_cols()) { oprot.writeI64(struct.num_cols); } if (struct.isSetIs_view()) { oprot.writeBool(struct.is_view); } if (struct.isSetIs_replicated()) { oprot.writeBool(struct.is_replicated); } if (struct.isSetShard_count()) { oprot.writeI64(struct.shard_count); } if (struct.isSetMax_rows()) { oprot.writeI64(struct.max_rows); } if (struct.isSetTable_id()) { oprot.writeI64(struct.table_id); } if (struct.isSetMax_table_id()) { oprot.writeI64(struct.max_table_id); } if (struct.isSetCol_types()) { { oprot.writeI32(struct.col_types.size()); for (ai.heavy.thrift.server.TTypeInfo _iter152 : struct.col_types) { _iter152.write(oprot); } } } if (struct.isSetCol_names()) { { oprot.writeI32(struct.col_names.size()); for (java.lang.String _iter153 : struct.col_names) { oprot.writeString(_iter153); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableMeta struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(10); if (incoming.get(0)) { struct.table_name = iprot.readString(); struct.setTable_nameIsSet(true); } if (incoming.get(1)) { struct.num_cols = iprot.readI64(); struct.setNum_colsIsSet(true); } if (incoming.get(2)) { struct.is_view = iprot.readBool(); struct.setIs_viewIsSet(true); } if (incoming.get(3)) { struct.is_replicated = iprot.readBool(); struct.setIs_replicatedIsSet(true); } if (incoming.get(4)) { struct.shard_count = iprot.readI64(); struct.setShard_countIsSet(true); } if (incoming.get(5)) { struct.max_rows = iprot.readI64(); struct.setMax_rowsIsSet(true); } if (incoming.get(6)) { struct.table_id = iprot.readI64(); struct.setTable_idIsSet(true); } if (incoming.get(7)) { struct.max_table_id = iprot.readI64(); struct.setMax_table_idIsSet(true); } if (incoming.get(8)) { { org.apache.thrift.protocol.TList _list154 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.col_types = new java.util.ArrayList<ai.heavy.thrift.server.TTypeInfo>(_list154.size); @org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TTypeInfo _elem155; for (int _i156 = 0; _i156 < _list154.size; ++_i156) { _elem155 = new ai.heavy.thrift.server.TTypeInfo(); _elem155.read(iprot); struct.col_types.add(_elem155); } } struct.setCol_typesIsSet(true); } if (incoming.get(9)) { { org.apache.thrift.protocol.TList _list157 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); struct.col_names = new java.util.ArrayList<java.lang.String>(_list157.size); @org.apache.thrift.annotation.Nullable java.lang.String _elem158; for (int _i159 = 0; _i159 < _list157.size; ++_i159) { _elem158 = iprot.readString(); struct.col_names.add(_elem158); } } struct.setCol_namesIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTablePermissions.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTablePermissions implements org.apache.thrift.TBase<TTablePermissions, TTablePermissions._Fields>, java.io.Serializable, Cloneable, Comparable<TTablePermissions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTablePermissions"); private static final org.apache.thrift.protocol.TField CREATE__FIELD_DESC = new org.apache.thrift.protocol.TField("create_", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField DROP__FIELD_DESC = new org.apache.thrift.protocol.TField("drop_", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField SELECT__FIELD_DESC = new org.apache.thrift.protocol.TField("select_", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField INSERT__FIELD_DESC = new org.apache.thrift.protocol.TField("insert_", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField UPDATE__FIELD_DESC = new org.apache.thrift.protocol.TField("update_", org.apache.thrift.protocol.TType.BOOL, (short)5); private static final org.apache.thrift.protocol.TField DELETE__FIELD_DESC = new org.apache.thrift.protocol.TField("delete_", org.apache.thrift.protocol.TType.BOOL, (short)6); private static final org.apache.thrift.protocol.TField TRUNCATE__FIELD_DESC = new org.apache.thrift.protocol.TField("truncate_", org.apache.thrift.protocol.TType.BOOL, (short)7); private static final org.apache.thrift.protocol.TField ALTER__FIELD_DESC = new org.apache.thrift.protocol.TField("alter_", org.apache.thrift.protocol.TType.BOOL, (short)8); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTablePermissionsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTablePermissionsTupleSchemeFactory(); public boolean create_; // required public boolean drop_; // required public boolean select_; // required public boolean insert_; // required public boolean update_; // required public boolean delete_; // required public boolean truncate_; // required public boolean alter_; // 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 { CREATE_((short)1, "create_"), DROP_((short)2, "drop_"), SELECT_((short)3, "select_"), INSERT_((short)4, "insert_"), UPDATE_((short)5, "update_"), DELETE_((short)6, "delete_"), TRUNCATE_((short)7, "truncate_"), ALTER_((short)8, "alter_"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // CREATE_ return CREATE_; case 2: // DROP_ return DROP_; case 3: // SELECT_ return SELECT_; case 4: // INSERT_ return INSERT_; case 5: // UPDATE_ return UPDATE_; case 6: // DELETE_ return DELETE_; case 7: // TRUNCATE_ return TRUNCATE_; case 8: // ALTER_ return ALTER_; 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 __CREATE__ISSET_ID = 0; private static final int __DROP__ISSET_ID = 1; private static final int __SELECT__ISSET_ID = 2; private static final int __INSERT__ISSET_ID = 3; private static final int __UPDATE__ISSET_ID = 4; private static final int __DELETE__ISSET_ID = 5; private static final int __TRUNCATE__ISSET_ID = 6; private static final int __ALTER__ISSET_ID = 7; 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.CREATE_, new org.apache.thrift.meta_data.FieldMetaData("create_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DROP_, new org.apache.thrift.meta_data.FieldMetaData("drop_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.SELECT_, new org.apache.thrift.meta_data.FieldMetaData("select_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.INSERT_, new org.apache.thrift.meta_data.FieldMetaData("insert_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.UPDATE_, new org.apache.thrift.meta_data.FieldMetaData("update_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DELETE_, new org.apache.thrift.meta_data.FieldMetaData("delete_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.TRUNCATE_, new org.apache.thrift.meta_data.FieldMetaData("truncate_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.ALTER_, new org.apache.thrift.meta_data.FieldMetaData("alter_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTablePermissions.class, metaDataMap); } public TTablePermissions() { } public TTablePermissions( boolean create_, boolean drop_, boolean select_, boolean insert_, boolean update_, boolean delete_, boolean truncate_, boolean alter_) { this(); this.create_ = create_; setCreate_IsSet(true); this.drop_ = drop_; setDrop_IsSet(true); this.select_ = select_; setSelect_IsSet(true); this.insert_ = insert_; setInsert_IsSet(true); this.update_ = update_; setUpdate_IsSet(true); this.delete_ = delete_; setDelete_IsSet(true); this.truncate_ = truncate_; setTruncate_IsSet(true); this.alter_ = alter_; setAlter_IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TTablePermissions(TTablePermissions other) { __isset_bitfield = other.__isset_bitfield; this.create_ = other.create_; this.drop_ = other.drop_; this.select_ = other.select_; this.insert_ = other.insert_; this.update_ = other.update_; this.delete_ = other.delete_; this.truncate_ = other.truncate_; this.alter_ = other.alter_; } public TTablePermissions deepCopy() { return new TTablePermissions(this); } @Override public void clear() { setCreate_IsSet(false); this.create_ = false; setDrop_IsSet(false); this.drop_ = false; setSelect_IsSet(false); this.select_ = false; setInsert_IsSet(false); this.insert_ = false; setUpdate_IsSet(false); this.update_ = false; setDelete_IsSet(false); this.delete_ = false; setTruncate_IsSet(false); this.truncate_ = false; setAlter_IsSet(false); this.alter_ = false; } public boolean isCreate_() { return this.create_; } public TTablePermissions setCreate_(boolean create_) { this.create_ = create_; setCreate_IsSet(true); return this; } public void unsetCreate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATE__ISSET_ID); } /** Returns true if field create_ is set (has been assigned a value) and false otherwise */ public boolean isSetCreate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATE__ISSET_ID); } public void setCreate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATE__ISSET_ID, value); } public boolean isDrop_() { return this.drop_; } public TTablePermissions setDrop_(boolean drop_) { this.drop_ = drop_; setDrop_IsSet(true); return this; } public void unsetDrop_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DROP__ISSET_ID); } /** Returns true if field drop_ is set (has been assigned a value) and false otherwise */ public boolean isSetDrop_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DROP__ISSET_ID); } public void setDrop_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DROP__ISSET_ID, value); } public boolean isSelect_() { return this.select_; } public TTablePermissions setSelect_(boolean select_) { this.select_ = select_; setSelect_IsSet(true); return this; } public void unsetSelect_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SELECT__ISSET_ID); } /** Returns true if field select_ is set (has been assigned a value) and false otherwise */ public boolean isSetSelect_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SELECT__ISSET_ID); } public void setSelect_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SELECT__ISSET_ID, value); } public boolean isInsert_() { return this.insert_; } public TTablePermissions setInsert_(boolean insert_) { this.insert_ = insert_; setInsert_IsSet(true); return this; } public void unsetInsert_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INSERT__ISSET_ID); } /** Returns true if field insert_ is set (has been assigned a value) and false otherwise */ public boolean isSetInsert_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INSERT__ISSET_ID); } public void setInsert_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INSERT__ISSET_ID, value); } public boolean isUpdate_() { return this.update_; } public TTablePermissions setUpdate_(boolean update_) { this.update_ = update_; setUpdate_IsSet(true); return this; } public void unsetUpdate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATE__ISSET_ID); } /** Returns true if field update_ is set (has been assigned a value) and false otherwise */ public boolean isSetUpdate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATE__ISSET_ID); } public void setUpdate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATE__ISSET_ID, value); } public boolean isDelete_() { return this.delete_; } public TTablePermissions setDelete_(boolean delete_) { this.delete_ = delete_; setDelete_IsSet(true); return this; } public void unsetDelete_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DELETE__ISSET_ID); } /** Returns true if field delete_ is set (has been assigned a value) and false otherwise */ public boolean isSetDelete_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DELETE__ISSET_ID); } public void setDelete_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DELETE__ISSET_ID, value); } public boolean isTruncate_() { return this.truncate_; } public TTablePermissions setTruncate_(boolean truncate_) { this.truncate_ = truncate_; setTruncate_IsSet(true); return this; } public void unsetTruncate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRUNCATE__ISSET_ID); } /** Returns true if field truncate_ is set (has been assigned a value) and false otherwise */ public boolean isSetTruncate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRUNCATE__ISSET_ID); } public void setTruncate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRUNCATE__ISSET_ID, value); } public boolean isAlter_() { return this.alter_; } public TTablePermissions setAlter_(boolean alter_) { this.alter_ = alter_; setAlter_IsSet(true); return this; } public void unsetAlter_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ALTER__ISSET_ID); } /** Returns true if field alter_ is set (has been assigned a value) and false otherwise */ public boolean isSetAlter_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ALTER__ISSET_ID); } public void setAlter_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ALTER__ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case CREATE_: if (value == null) { unsetCreate_(); } else { setCreate_((java.lang.Boolean)value); } break; case DROP_: if (value == null) { unsetDrop_(); } else { setDrop_((java.lang.Boolean)value); } break; case SELECT_: if (value == null) { unsetSelect_(); } else { setSelect_((java.lang.Boolean)value); } break; case INSERT_: if (value == null) { unsetInsert_(); } else { setInsert_((java.lang.Boolean)value); } break; case UPDATE_: if (value == null) { unsetUpdate_(); } else { setUpdate_((java.lang.Boolean)value); } break; case DELETE_: if (value == null) { unsetDelete_(); } else { setDelete_((java.lang.Boolean)value); } break; case TRUNCATE_: if (value == null) { unsetTruncate_(); } else { setTruncate_((java.lang.Boolean)value); } break; case ALTER_: if (value == null) { unsetAlter_(); } else { setAlter_((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case CREATE_: return isCreate_(); case DROP_: return isDrop_(); case SELECT_: return isSelect_(); case INSERT_: return isInsert_(); case UPDATE_: return isUpdate_(); case DELETE_: return isDelete_(); case TRUNCATE_: return isTruncate_(); case ALTER_: return isAlter_(); } 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 CREATE_: return isSetCreate_(); case DROP_: return isSetDrop_(); case SELECT_: return isSetSelect_(); case INSERT_: return isSetInsert_(); case UPDATE_: return isSetUpdate_(); case DELETE_: return isSetDelete_(); case TRUNCATE_: return isSetTruncate_(); case ALTER_: return isSetAlter_(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTablePermissions) return this.equals((TTablePermissions)that); return false; } public boolean equals(TTablePermissions that) { if (that == null) return false; if (this == that) return true; boolean this_present_create_ = true; boolean that_present_create_ = true; if (this_present_create_ || that_present_create_) { if (!(this_present_create_ && that_present_create_)) return false; if (this.create_ != that.create_) return false; } boolean this_present_drop_ = true; boolean that_present_drop_ = true; if (this_present_drop_ || that_present_drop_) { if (!(this_present_drop_ && that_present_drop_)) return false; if (this.drop_ != that.drop_) return false; } boolean this_present_select_ = true; boolean that_present_select_ = true; if (this_present_select_ || that_present_select_) { if (!(this_present_select_ && that_present_select_)) return false; if (this.select_ != that.select_) return false; } boolean this_present_insert_ = true; boolean that_present_insert_ = true; if (this_present_insert_ || that_present_insert_) { if (!(this_present_insert_ && that_present_insert_)) return false; if (this.insert_ != that.insert_) return false; } boolean this_present_update_ = true; boolean that_present_update_ = true; if (this_present_update_ || that_present_update_) { if (!(this_present_update_ && that_present_update_)) return false; if (this.update_ != that.update_) return false; } boolean this_present_delete_ = true; boolean that_present_delete_ = true; if (this_present_delete_ || that_present_delete_) { if (!(this_present_delete_ && that_present_delete_)) return false; if (this.delete_ != that.delete_) return false; } boolean this_present_truncate_ = true; boolean that_present_truncate_ = true; if (this_present_truncate_ || that_present_truncate_) { if (!(this_present_truncate_ && that_present_truncate_)) return false; if (this.truncate_ != that.truncate_) return false; } boolean this_present_alter_ = true; boolean that_present_alter_ = true; if (this_present_alter_ || that_present_alter_) { if (!(this_present_alter_ && that_present_alter_)) return false; if (this.alter_ != that.alter_) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((create_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((drop_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((select_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((insert_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((update_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((delete_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((truncate_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((alter_) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TTablePermissions other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetCreate_(), other.isSetCreate_()); if (lastComparison != 0) { return lastComparison; } if (isSetCreate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.create_, other.create_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDrop_(), other.isSetDrop_()); if (lastComparison != 0) { return lastComparison; } if (isSetDrop_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.drop_, other.drop_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSelect_(), other.isSetSelect_()); if (lastComparison != 0) { return lastComparison; } if (isSetSelect_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.select_, other.select_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetInsert_(), other.isSetInsert_()); if (lastComparison != 0) { return lastComparison; } if (isSetInsert_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.insert_, other.insert_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetUpdate_(), other.isSetUpdate_()); if (lastComparison != 0) { return lastComparison; } if (isSetUpdate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.update_, other.update_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDelete_(), other.isSetDelete_()); if (lastComparison != 0) { return lastComparison; } if (isSetDelete_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delete_, other.delete_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTruncate_(), other.isSetTruncate_()); if (lastComparison != 0) { return lastComparison; } if (isSetTruncate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.truncate_, other.truncate_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetAlter_(), other.isSetAlter_()); if (lastComparison != 0) { return lastComparison; } if (isSetAlter_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.alter_, other.alter_); 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("TTablePermissions("); boolean first = true; sb.append("create_:"); sb.append(this.create_); first = false; if (!first) sb.append(", "); sb.append("drop_:"); sb.append(this.drop_); first = false; if (!first) sb.append(", "); sb.append("select_:"); sb.append(this.select_); first = false; if (!first) sb.append(", "); sb.append("insert_:"); sb.append(this.insert_); first = false; if (!first) sb.append(", "); sb.append("update_:"); sb.append(this.update_); first = false; if (!first) sb.append(", "); sb.append("delete_:"); sb.append(this.delete_); first = false; if (!first) sb.append(", "); sb.append("truncate_:"); sb.append(this.truncate_); first = false; if (!first) sb.append(", "); sb.append("alter_:"); sb.append(this.alter_); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TTablePermissionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTablePermissionsStandardScheme getScheme() { return new TTablePermissionsStandardScheme(); } } private static class TTablePermissionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTablePermissions> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTablePermissions 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: // CREATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DROP_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.drop_ = iprot.readBool(); struct.setDrop_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // SELECT_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.select_ = iprot.readBool(); struct.setSelect_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // INSERT_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.insert_ = iprot.readBool(); struct.setInsert_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // UPDATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.update_ = iprot.readBool(); struct.setUpdate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // DELETE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // TRUNCATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.truncate_ = iprot.readBool(); struct.setTruncate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // ALTER_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.alter_ = iprot.readBool(); struct.setAlter_IsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTablePermissions struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CREATE__FIELD_DESC); oprot.writeBool(struct.create_); oprot.writeFieldEnd(); oprot.writeFieldBegin(DROP__FIELD_DESC); oprot.writeBool(struct.drop_); oprot.writeFieldEnd(); oprot.writeFieldBegin(SELECT__FIELD_DESC); oprot.writeBool(struct.select_); oprot.writeFieldEnd(); oprot.writeFieldBegin(INSERT__FIELD_DESC); oprot.writeBool(struct.insert_); oprot.writeFieldEnd(); oprot.writeFieldBegin(UPDATE__FIELD_DESC); oprot.writeBool(struct.update_); oprot.writeFieldEnd(); oprot.writeFieldBegin(DELETE__FIELD_DESC); oprot.writeBool(struct.delete_); oprot.writeFieldEnd(); oprot.writeFieldBegin(TRUNCATE__FIELD_DESC); oprot.writeBool(struct.truncate_); oprot.writeFieldEnd(); oprot.writeFieldBegin(ALTER__FIELD_DESC); oprot.writeBool(struct.alter_); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTablePermissionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTablePermissionsTupleScheme getScheme() { return new TTablePermissionsTupleScheme(); } } private static class TTablePermissionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTablePermissions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTablePermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCreate_()) { optionals.set(0); } if (struct.isSetDrop_()) { optionals.set(1); } if (struct.isSetSelect_()) { optionals.set(2); } if (struct.isSetInsert_()) { optionals.set(3); } if (struct.isSetUpdate_()) { optionals.set(4); } if (struct.isSetDelete_()) { optionals.set(5); } if (struct.isSetTruncate_()) { optionals.set(6); } if (struct.isSetAlter_()) { optionals.set(7); } oprot.writeBitSet(optionals, 8); if (struct.isSetCreate_()) { oprot.writeBool(struct.create_); } if (struct.isSetDrop_()) { oprot.writeBool(struct.drop_); } if (struct.isSetSelect_()) { oprot.writeBool(struct.select_); } if (struct.isSetInsert_()) { oprot.writeBool(struct.insert_); } if (struct.isSetUpdate_()) { oprot.writeBool(struct.update_); } if (struct.isSetDelete_()) { oprot.writeBool(struct.delete_); } if (struct.isSetTruncate_()) { oprot.writeBool(struct.truncate_); } if (struct.isSetAlter_()) { oprot.writeBool(struct.alter_); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTablePermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } if (incoming.get(1)) { struct.drop_ = iprot.readBool(); struct.setDrop_IsSet(true); } if (incoming.get(2)) { struct.select_ = iprot.readBool(); struct.setSelect_IsSet(true); } if (incoming.get(3)) { struct.insert_ = iprot.readBool(); struct.setInsert_IsSet(true); } if (incoming.get(4)) { struct.update_ = iprot.readBool(); struct.setUpdate_IsSet(true); } if (incoming.get(5)) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(true); } if (incoming.get(6)) { struct.truncate_ = iprot.readBool(); struct.setTruncate_IsSet(true); } if (incoming.get(7)) { struct.alter_ = iprot.readBool(); struct.setAlter_IsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableRefreshInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTableRefreshInfo implements org.apache.thrift.TBase<TTableRefreshInfo, TTableRefreshInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TTableRefreshInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableRefreshInfo"); private static final org.apache.thrift.protocol.TField UPDATE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("update_type", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField TIMING_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("timing_type", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField START_DATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("start_date_time", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField INTERVAL_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("interval_type", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField INTERVAL_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("interval_count", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField LAST_REFRESH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("last_refresh_time", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField NEXT_REFRESH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("next_refresh_time", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableRefreshInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableRefreshInfoTupleSchemeFactory(); /** * * @see TTableRefreshUpdateType */ public @org.apache.thrift.annotation.Nullable TTableRefreshUpdateType update_type; // required /** * * @see TTableRefreshTimingType */ public @org.apache.thrift.annotation.Nullable TTableRefreshTimingType timing_type; // required public @org.apache.thrift.annotation.Nullable java.lang.String start_date_time; // required /** * * @see TTableRefreshIntervalType */ public @org.apache.thrift.annotation.Nullable TTableRefreshIntervalType interval_type; // required public long interval_count; // required public @org.apache.thrift.annotation.Nullable java.lang.String last_refresh_time; // required public @org.apache.thrift.annotation.Nullable java.lang.String next_refresh_time; // 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 { /** * * @see TTableRefreshUpdateType */ UPDATE_TYPE((short)1, "update_type"), /** * * @see TTableRefreshTimingType */ TIMING_TYPE((short)2, "timing_type"), START_DATE_TIME((short)3, "start_date_time"), /** * * @see TTableRefreshIntervalType */ INTERVAL_TYPE((short)4, "interval_type"), INTERVAL_COUNT((short)5, "interval_count"), LAST_REFRESH_TIME((short)6, "last_refresh_time"), NEXT_REFRESH_TIME((short)7, "next_refresh_time"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // UPDATE_TYPE return UPDATE_TYPE; case 2: // TIMING_TYPE return TIMING_TYPE; case 3: // START_DATE_TIME return START_DATE_TIME; case 4: // INTERVAL_TYPE return INTERVAL_TYPE; case 5: // INTERVAL_COUNT return INTERVAL_COUNT; case 6: // LAST_REFRESH_TIME return LAST_REFRESH_TIME; case 7: // NEXT_REFRESH_TIME return NEXT_REFRESH_TIME; 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 __INTERVAL_COUNT_ISSET_ID = 0; 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.UPDATE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("update_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTableRefreshUpdateType.class))); tmpMap.put(_Fields.TIMING_TYPE, new org.apache.thrift.meta_data.FieldMetaData("timing_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTableRefreshTimingType.class))); tmpMap.put(_Fields.START_DATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("start_date_time", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.INTERVAL_TYPE, new org.apache.thrift.meta_data.FieldMetaData("interval_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTableRefreshIntervalType.class))); tmpMap.put(_Fields.INTERVAL_COUNT, new org.apache.thrift.meta_data.FieldMetaData("interval_count", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.LAST_REFRESH_TIME, new org.apache.thrift.meta_data.FieldMetaData("last_refresh_time", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.NEXT_REFRESH_TIME, new org.apache.thrift.meta_data.FieldMetaData("next_refresh_time", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(TTableRefreshInfo.class, metaDataMap); } public TTableRefreshInfo() { } public TTableRefreshInfo( TTableRefreshUpdateType update_type, TTableRefreshTimingType timing_type, java.lang.String start_date_time, TTableRefreshIntervalType interval_type, long interval_count, java.lang.String last_refresh_time, java.lang.String next_refresh_time) { this(); this.update_type = update_type; this.timing_type = timing_type; this.start_date_time = start_date_time; this.interval_type = interval_type; this.interval_count = interval_count; setInterval_countIsSet(true); this.last_refresh_time = last_refresh_time; this.next_refresh_time = next_refresh_time; } /** * Performs a deep copy on <i>other</i>. */ public TTableRefreshInfo(TTableRefreshInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetUpdate_type()) { this.update_type = other.update_type; } if (other.isSetTiming_type()) { this.timing_type = other.timing_type; } if (other.isSetStart_date_time()) { this.start_date_time = other.start_date_time; } if (other.isSetInterval_type()) { this.interval_type = other.interval_type; } this.interval_count = other.interval_count; if (other.isSetLast_refresh_time()) { this.last_refresh_time = other.last_refresh_time; } if (other.isSetNext_refresh_time()) { this.next_refresh_time = other.next_refresh_time; } } public TTableRefreshInfo deepCopy() { return new TTableRefreshInfo(this); } @Override public void clear() { this.update_type = null; this.timing_type = null; this.start_date_time = null; this.interval_type = null; setInterval_countIsSet(false); this.interval_count = 0; this.last_refresh_time = null; this.next_refresh_time = null; } /** * * @see TTableRefreshUpdateType */ @org.apache.thrift.annotation.Nullable public TTableRefreshUpdateType getUpdate_type() { return this.update_type; } /** * * @see TTableRefreshUpdateType */ public TTableRefreshInfo setUpdate_type(@org.apache.thrift.annotation.Nullable TTableRefreshUpdateType update_type) { this.update_type = update_type; return this; } public void unsetUpdate_type() { this.update_type = null; } /** Returns true if field update_type is set (has been assigned a value) and false otherwise */ public boolean isSetUpdate_type() { return this.update_type != null; } public void setUpdate_typeIsSet(boolean value) { if (!value) { this.update_type = null; } } /** * * @see TTableRefreshTimingType */ @org.apache.thrift.annotation.Nullable public TTableRefreshTimingType getTiming_type() { return this.timing_type; } /** * * @see TTableRefreshTimingType */ public TTableRefreshInfo setTiming_type(@org.apache.thrift.annotation.Nullable TTableRefreshTimingType timing_type) { this.timing_type = timing_type; return this; } public void unsetTiming_type() { this.timing_type = null; } /** Returns true if field timing_type is set (has been assigned a value) and false otherwise */ public boolean isSetTiming_type() { return this.timing_type != null; } public void setTiming_typeIsSet(boolean value) { if (!value) { this.timing_type = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getStart_date_time() { return this.start_date_time; } public TTableRefreshInfo setStart_date_time(@org.apache.thrift.annotation.Nullable java.lang.String start_date_time) { this.start_date_time = start_date_time; return this; } public void unsetStart_date_time() { this.start_date_time = null; } /** Returns true if field start_date_time is set (has been assigned a value) and false otherwise */ public boolean isSetStart_date_time() { return this.start_date_time != null; } public void setStart_date_timeIsSet(boolean value) { if (!value) { this.start_date_time = null; } } /** * * @see TTableRefreshIntervalType */ @org.apache.thrift.annotation.Nullable public TTableRefreshIntervalType getInterval_type() { return this.interval_type; } /** * * @see TTableRefreshIntervalType */ public TTableRefreshInfo setInterval_type(@org.apache.thrift.annotation.Nullable TTableRefreshIntervalType interval_type) { this.interval_type = interval_type; return this; } public void unsetInterval_type() { this.interval_type = null; } /** Returns true if field interval_type is set (has been assigned a value) and false otherwise */ public boolean isSetInterval_type() { return this.interval_type != null; } public void setInterval_typeIsSet(boolean value) { if (!value) { this.interval_type = null; } } public long getInterval_count() { return this.interval_count; } public TTableRefreshInfo setInterval_count(long interval_count) { this.interval_count = interval_count; setInterval_countIsSet(true); return this; } public void unsetInterval_count() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INTERVAL_COUNT_ISSET_ID); } /** Returns true if field interval_count is set (has been assigned a value) and false otherwise */ public boolean isSetInterval_count() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INTERVAL_COUNT_ISSET_ID); } public void setInterval_countIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INTERVAL_COUNT_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getLast_refresh_time() { return this.last_refresh_time; } public TTableRefreshInfo setLast_refresh_time(@org.apache.thrift.annotation.Nullable java.lang.String last_refresh_time) { this.last_refresh_time = last_refresh_time; return this; } public void unsetLast_refresh_time() { this.last_refresh_time = null; } /** Returns true if field last_refresh_time is set (has been assigned a value) and false otherwise */ public boolean isSetLast_refresh_time() { return this.last_refresh_time != null; } public void setLast_refresh_timeIsSet(boolean value) { if (!value) { this.last_refresh_time = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getNext_refresh_time() { return this.next_refresh_time; } public TTableRefreshInfo setNext_refresh_time(@org.apache.thrift.annotation.Nullable java.lang.String next_refresh_time) { this.next_refresh_time = next_refresh_time; return this; } public void unsetNext_refresh_time() { this.next_refresh_time = null; } /** Returns true if field next_refresh_time is set (has been assigned a value) and false otherwise */ public boolean isSetNext_refresh_time() { return this.next_refresh_time != null; } public void setNext_refresh_timeIsSet(boolean value) { if (!value) { this.next_refresh_time = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case UPDATE_TYPE: if (value == null) { unsetUpdate_type(); } else { setUpdate_type((TTableRefreshUpdateType)value); } break; case TIMING_TYPE: if (value == null) { unsetTiming_type(); } else { setTiming_type((TTableRefreshTimingType)value); } break; case START_DATE_TIME: if (value == null) { unsetStart_date_time(); } else { setStart_date_time((java.lang.String)value); } break; case INTERVAL_TYPE: if (value == null) { unsetInterval_type(); } else { setInterval_type((TTableRefreshIntervalType)value); } break; case INTERVAL_COUNT: if (value == null) { unsetInterval_count(); } else { setInterval_count((java.lang.Long)value); } break; case LAST_REFRESH_TIME: if (value == null) { unsetLast_refresh_time(); } else { setLast_refresh_time((java.lang.String)value); } break; case NEXT_REFRESH_TIME: if (value == null) { unsetNext_refresh_time(); } else { setNext_refresh_time((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case UPDATE_TYPE: return getUpdate_type(); case TIMING_TYPE: return getTiming_type(); case START_DATE_TIME: return getStart_date_time(); case INTERVAL_TYPE: return getInterval_type(); case INTERVAL_COUNT: return getInterval_count(); case LAST_REFRESH_TIME: return getLast_refresh_time(); case NEXT_REFRESH_TIME: return getNext_refresh_time(); } 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 UPDATE_TYPE: return isSetUpdate_type(); case TIMING_TYPE: return isSetTiming_type(); case START_DATE_TIME: return isSetStart_date_time(); case INTERVAL_TYPE: return isSetInterval_type(); case INTERVAL_COUNT: return isSetInterval_count(); case LAST_REFRESH_TIME: return isSetLast_refresh_time(); case NEXT_REFRESH_TIME: return isSetNext_refresh_time(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTableRefreshInfo) return this.equals((TTableRefreshInfo)that); return false; } public boolean equals(TTableRefreshInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_update_type = true && this.isSetUpdate_type(); boolean that_present_update_type = true && that.isSetUpdate_type(); if (this_present_update_type || that_present_update_type) { if (!(this_present_update_type && that_present_update_type)) return false; if (!this.update_type.equals(that.update_type)) return false; } boolean this_present_timing_type = true && this.isSetTiming_type(); boolean that_present_timing_type = true && that.isSetTiming_type(); if (this_present_timing_type || that_present_timing_type) { if (!(this_present_timing_type && that_present_timing_type)) return false; if (!this.timing_type.equals(that.timing_type)) return false; } boolean this_present_start_date_time = true && this.isSetStart_date_time(); boolean that_present_start_date_time = true && that.isSetStart_date_time(); if (this_present_start_date_time || that_present_start_date_time) { if (!(this_present_start_date_time && that_present_start_date_time)) return false; if (!this.start_date_time.equals(that.start_date_time)) return false; } boolean this_present_interval_type = true && this.isSetInterval_type(); boolean that_present_interval_type = true && that.isSetInterval_type(); if (this_present_interval_type || that_present_interval_type) { if (!(this_present_interval_type && that_present_interval_type)) return false; if (!this.interval_type.equals(that.interval_type)) return false; } boolean this_present_interval_count = true; boolean that_present_interval_count = true; if (this_present_interval_count || that_present_interval_count) { if (!(this_present_interval_count && that_present_interval_count)) return false; if (this.interval_count != that.interval_count) return false; } boolean this_present_last_refresh_time = true && this.isSetLast_refresh_time(); boolean that_present_last_refresh_time = true && that.isSetLast_refresh_time(); if (this_present_last_refresh_time || that_present_last_refresh_time) { if (!(this_present_last_refresh_time && that_present_last_refresh_time)) return false; if (!this.last_refresh_time.equals(that.last_refresh_time)) return false; } boolean this_present_next_refresh_time = true && this.isSetNext_refresh_time(); boolean that_present_next_refresh_time = true && that.isSetNext_refresh_time(); if (this_present_next_refresh_time || that_present_next_refresh_time) { if (!(this_present_next_refresh_time && that_present_next_refresh_time)) return false; if (!this.next_refresh_time.equals(that.next_refresh_time)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetUpdate_type()) ? 131071 : 524287); if (isSetUpdate_type()) hashCode = hashCode * 8191 + update_type.getValue(); hashCode = hashCode * 8191 + ((isSetTiming_type()) ? 131071 : 524287); if (isSetTiming_type()) hashCode = hashCode * 8191 + timing_type.getValue(); hashCode = hashCode * 8191 + ((isSetStart_date_time()) ? 131071 : 524287); if (isSetStart_date_time()) hashCode = hashCode * 8191 + start_date_time.hashCode(); hashCode = hashCode * 8191 + ((isSetInterval_type()) ? 131071 : 524287); if (isSetInterval_type()) hashCode = hashCode * 8191 + interval_type.getValue(); hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(interval_count); hashCode = hashCode * 8191 + ((isSetLast_refresh_time()) ? 131071 : 524287); if (isSetLast_refresh_time()) hashCode = hashCode * 8191 + last_refresh_time.hashCode(); hashCode = hashCode * 8191 + ((isSetNext_refresh_time()) ? 131071 : 524287); if (isSetNext_refresh_time()) hashCode = hashCode * 8191 + next_refresh_time.hashCode(); return hashCode; } @Override public int compareTo(TTableRefreshInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetUpdate_type(), other.isSetUpdate_type()); if (lastComparison != 0) { return lastComparison; } if (isSetUpdate_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.update_type, other.update_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetTiming_type(), other.isSetTiming_type()); if (lastComparison != 0) { return lastComparison; } if (isSetTiming_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timing_type, other.timing_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetStart_date_time(), other.isSetStart_date_time()); if (lastComparison != 0) { return lastComparison; } if (isSetStart_date_time()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_date_time, other.start_date_time); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetInterval_type(), other.isSetInterval_type()); if (lastComparison != 0) { return lastComparison; } if (isSetInterval_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.interval_type, other.interval_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetInterval_count(), other.isSetInterval_count()); if (lastComparison != 0) { return lastComparison; } if (isSetInterval_count()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.interval_count, other.interval_count); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetLast_refresh_time(), other.isSetLast_refresh_time()); if (lastComparison != 0) { return lastComparison; } if (isSetLast_refresh_time()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.last_refresh_time, other.last_refresh_time); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNext_refresh_time(), other.isSetNext_refresh_time()); if (lastComparison != 0) { return lastComparison; } if (isSetNext_refresh_time()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.next_refresh_time, other.next_refresh_time); 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("TTableRefreshInfo("); boolean first = true; sb.append("update_type:"); if (this.update_type == null) { sb.append("null"); } else { sb.append(this.update_type); } first = false; if (!first) sb.append(", "); sb.append("timing_type:"); if (this.timing_type == null) { sb.append("null"); } else { sb.append(this.timing_type); } first = false; if (!first) sb.append(", "); sb.append("start_date_time:"); if (this.start_date_time == null) { sb.append("null"); } else { sb.append(this.start_date_time); } first = false; if (!first) sb.append(", "); sb.append("interval_type:"); if (this.interval_type == null) { sb.append("null"); } else { sb.append(this.interval_type); } first = false; if (!first) sb.append(", "); sb.append("interval_count:"); sb.append(this.interval_count); first = false; if (!first) sb.append(", "); sb.append("last_refresh_time:"); if (this.last_refresh_time == null) { sb.append("null"); } else { sb.append(this.last_refresh_time); } first = false; if (!first) sb.append(", "); sb.append("next_refresh_time:"); if (this.next_refresh_time == null) { sb.append("null"); } else { sb.append(this.next_refresh_time); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TTableRefreshInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableRefreshInfoStandardScheme getScheme() { return new TTableRefreshInfoStandardScheme(); } } private static class TTableRefreshInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTableRefreshInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTableRefreshInfo 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: // UPDATE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.update_type = ai.heavy.thrift.server.TTableRefreshUpdateType.findByValue(iprot.readI32()); struct.setUpdate_typeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TIMING_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.timing_type = ai.heavy.thrift.server.TTableRefreshTimingType.findByValue(iprot.readI32()); struct.setTiming_typeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // START_DATE_TIME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.start_date_time = iprot.readString(); struct.setStart_date_timeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // INTERVAL_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.interval_type = ai.heavy.thrift.server.TTableRefreshIntervalType.findByValue(iprot.readI32()); struct.setInterval_typeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // INTERVAL_COUNT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.interval_count = iprot.readI64(); struct.setInterval_countIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // LAST_REFRESH_TIME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.last_refresh_time = iprot.readString(); struct.setLast_refresh_timeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // NEXT_REFRESH_TIME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.next_refresh_time = iprot.readString(); struct.setNext_refresh_timeIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTableRefreshInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.update_type != null) { oprot.writeFieldBegin(UPDATE_TYPE_FIELD_DESC); oprot.writeI32(struct.update_type.getValue()); oprot.writeFieldEnd(); } if (struct.timing_type != null) { oprot.writeFieldBegin(TIMING_TYPE_FIELD_DESC); oprot.writeI32(struct.timing_type.getValue()); oprot.writeFieldEnd(); } if (struct.start_date_time != null) { oprot.writeFieldBegin(START_DATE_TIME_FIELD_DESC); oprot.writeString(struct.start_date_time); oprot.writeFieldEnd(); } if (struct.interval_type != null) { oprot.writeFieldBegin(INTERVAL_TYPE_FIELD_DESC); oprot.writeI32(struct.interval_type.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(INTERVAL_COUNT_FIELD_DESC); oprot.writeI64(struct.interval_count); oprot.writeFieldEnd(); if (struct.last_refresh_time != null) { oprot.writeFieldBegin(LAST_REFRESH_TIME_FIELD_DESC); oprot.writeString(struct.last_refresh_time); oprot.writeFieldEnd(); } if (struct.next_refresh_time != null) { oprot.writeFieldBegin(NEXT_REFRESH_TIME_FIELD_DESC); oprot.writeString(struct.next_refresh_time); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTableRefreshInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableRefreshInfoTupleScheme getScheme() { return new TTableRefreshInfoTupleScheme(); } } private static class TTableRefreshInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTableRefreshInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableRefreshInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetUpdate_type()) { optionals.set(0); } if (struct.isSetTiming_type()) { optionals.set(1); } if (struct.isSetStart_date_time()) { optionals.set(2); } if (struct.isSetInterval_type()) { optionals.set(3); } if (struct.isSetInterval_count()) { optionals.set(4); } if (struct.isSetLast_refresh_time()) { optionals.set(5); } if (struct.isSetNext_refresh_time()) { optionals.set(6); } oprot.writeBitSet(optionals, 7); if (struct.isSetUpdate_type()) { oprot.writeI32(struct.update_type.getValue()); } if (struct.isSetTiming_type()) { oprot.writeI32(struct.timing_type.getValue()); } if (struct.isSetStart_date_time()) { oprot.writeString(struct.start_date_time); } if (struct.isSetInterval_type()) { oprot.writeI32(struct.interval_type.getValue()); } if (struct.isSetInterval_count()) { oprot.writeI64(struct.interval_count); } if (struct.isSetLast_refresh_time()) { oprot.writeString(struct.last_refresh_time); } if (struct.isSetNext_refresh_time()) { oprot.writeString(struct.next_refresh_time); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableRefreshInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.update_type = ai.heavy.thrift.server.TTableRefreshUpdateType.findByValue(iprot.readI32()); struct.setUpdate_typeIsSet(true); } if (incoming.get(1)) { struct.timing_type = ai.heavy.thrift.server.TTableRefreshTimingType.findByValue(iprot.readI32()); struct.setTiming_typeIsSet(true); } if (incoming.get(2)) { struct.start_date_time = iprot.readString(); struct.setStart_date_timeIsSet(true); } if (incoming.get(3)) { struct.interval_type = ai.heavy.thrift.server.TTableRefreshIntervalType.findByValue(iprot.readI32()); struct.setInterval_typeIsSet(true); } if (incoming.get(4)) { struct.interval_count = iprot.readI64(); struct.setInterval_countIsSet(true); } if (incoming.get(5)) { struct.last_refresh_time = iprot.readString(); struct.setLast_refresh_timeIsSet(true); } if (incoming.get(6)) { struct.next_refresh_time = iprot.readString(); struct.setNext_refresh_timeIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableRefreshIntervalType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TTableRefreshIntervalType implements org.apache.thrift.TEnum { NONE(0), HOUR(1), DAY(2); private final int value; private TTableRefreshIntervalType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TTableRefreshIntervalType findByValue(int value) { switch (value) { case 0: return NONE; case 1: return HOUR; case 2: return DAY; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableRefreshTimingType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TTableRefreshTimingType implements org.apache.thrift.TEnum { MANUAL(0), SCHEDULED(1); private final int value; private TTableRefreshTimingType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TTableRefreshTimingType findByValue(int value) { switch (value) { case 0: return MANUAL; case 1: return SCHEDULED; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableRefreshUpdateType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TTableRefreshUpdateType implements org.apache.thrift.TEnum { ALL(0), APPEND(1); private final int value; private TTableRefreshUpdateType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TTableRefreshUpdateType findByValue(int value) { switch (value) { case 0: return ALL; case 1: return APPEND; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTableType.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; public enum TTableType implements org.apache.thrift.TEnum { DEFAULT(0), TEMPORARY(1), FOREIGN(2), VIEW(3); private final int value; private TTableType(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ @org.apache.thrift.annotation.Nullable public static TTableType findByValue(int value) { switch (value) { case 0: return DEFAULT; case 1: return TEMPORARY; case 2: return FOREIGN; case 3: return VIEW; default: return null; } } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTargetInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTargetInfo implements org.apache.thrift.TBase<TTargetInfo, TTargetInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TTargetInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTargetInfo"); private static final org.apache.thrift.protocol.TField IS_AGG_FIELD_DESC = new org.apache.thrift.protocol.TField("is_agg", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField KIND_FIELD_DESC = new org.apache.thrift.protocol.TField("kind", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField ARG_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("arg_type", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField SKIP_NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("skip_nulls", org.apache.thrift.protocol.TType.BOOL, (short)5); private static final org.apache.thrift.protocol.TField IS_DISTINCT_FIELD_DESC = new org.apache.thrift.protocol.TField("is_distinct", org.apache.thrift.protocol.TType.BOOL, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTargetInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTargetInfoTupleSchemeFactory(); public boolean is_agg; // required /** * * @see TAggKind */ public @org.apache.thrift.annotation.Nullable TAggKind kind; // required public @org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TTypeInfo type; // required public @org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TTypeInfo arg_type; // required public boolean skip_nulls; // required public boolean is_distinct; // 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 { IS_AGG((short)1, "is_agg"), /** * * @see TAggKind */ KIND((short)2, "kind"), TYPE((short)3, "type"), ARG_TYPE((short)4, "arg_type"), SKIP_NULLS((short)5, "skip_nulls"), IS_DISTINCT((short)6, "is_distinct"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // IS_AGG return IS_AGG; case 2: // KIND return KIND; case 3: // TYPE return TYPE; case 4: // ARG_TYPE return ARG_TYPE; case 5: // SKIP_NULLS return SKIP_NULLS; case 6: // IS_DISTINCT return IS_DISTINCT; 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 __IS_AGG_ISSET_ID = 0; private static final int __SKIP_NULLS_ISSET_ID = 1; private static final int __IS_DISTINCT_ISSET_ID = 2; 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.IS_AGG, new org.apache.thrift.meta_data.FieldMetaData("is_agg", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.KIND, new org.apache.thrift.meta_data.FieldMetaData("kind", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TAggKind.class))); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ai.heavy.thrift.server.TTypeInfo.class))); tmpMap.put(_Fields.ARG_TYPE, new org.apache.thrift.meta_data.FieldMetaData("arg_type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ai.heavy.thrift.server.TTypeInfo.class))); tmpMap.put(_Fields.SKIP_NULLS, new org.apache.thrift.meta_data.FieldMetaData("skip_nulls", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.IS_DISTINCT, new org.apache.thrift.meta_data.FieldMetaData("is_distinct", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTargetInfo.class, metaDataMap); } public TTargetInfo() { } public TTargetInfo( boolean is_agg, TAggKind kind, ai.heavy.thrift.server.TTypeInfo type, ai.heavy.thrift.server.TTypeInfo arg_type, boolean skip_nulls, boolean is_distinct) { this(); this.is_agg = is_agg; setIs_aggIsSet(true); this.kind = kind; this.type = type; this.arg_type = arg_type; this.skip_nulls = skip_nulls; setSkip_nullsIsSet(true); this.is_distinct = is_distinct; setIs_distinctIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TTargetInfo(TTargetInfo other) { __isset_bitfield = other.__isset_bitfield; this.is_agg = other.is_agg; if (other.isSetKind()) { this.kind = other.kind; } if (other.isSetType()) { this.type = new ai.heavy.thrift.server.TTypeInfo(other.type); } if (other.isSetArg_type()) { this.arg_type = new ai.heavy.thrift.server.TTypeInfo(other.arg_type); } this.skip_nulls = other.skip_nulls; this.is_distinct = other.is_distinct; } public TTargetInfo deepCopy() { return new TTargetInfo(this); } @Override public void clear() { setIs_aggIsSet(false); this.is_agg = false; this.kind = null; this.type = null; this.arg_type = null; setSkip_nullsIsSet(false); this.skip_nulls = false; setIs_distinctIsSet(false); this.is_distinct = false; } public boolean isIs_agg() { return this.is_agg; } public TTargetInfo setIs_agg(boolean is_agg) { this.is_agg = is_agg; setIs_aggIsSet(true); return this; } public void unsetIs_agg() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_AGG_ISSET_ID); } /** Returns true if field is_agg is set (has been assigned a value) and false otherwise */ public boolean isSetIs_agg() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_AGG_ISSET_ID); } public void setIs_aggIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_AGG_ISSET_ID, value); } /** * * @see TAggKind */ @org.apache.thrift.annotation.Nullable public TAggKind getKind() { return this.kind; } /** * * @see TAggKind */ public TTargetInfo setKind(@org.apache.thrift.annotation.Nullable TAggKind kind) { this.kind = kind; return this; } public void unsetKind() { this.kind = null; } /** Returns true if field kind is set (has been assigned a value) and false otherwise */ public boolean isSetKind() { return this.kind != null; } public void setKindIsSet(boolean value) { if (!value) { this.kind = null; } } @org.apache.thrift.annotation.Nullable public ai.heavy.thrift.server.TTypeInfo getType() { return this.type; } public TTargetInfo setType(@org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TTypeInfo type) { this.type = type; return this; } public void unsetType() { this.type = null; } /** Returns true if field type is set (has been assigned a value) and false otherwise */ public boolean isSetType() { return this.type != null; } public void setTypeIsSet(boolean value) { if (!value) { this.type = null; } } @org.apache.thrift.annotation.Nullable public ai.heavy.thrift.server.TTypeInfo getArg_type() { return this.arg_type; } public TTargetInfo setArg_type(@org.apache.thrift.annotation.Nullable ai.heavy.thrift.server.TTypeInfo arg_type) { this.arg_type = arg_type; return this; } public void unsetArg_type() { this.arg_type = null; } /** Returns true if field arg_type is set (has been assigned a value) and false otherwise */ public boolean isSetArg_type() { return this.arg_type != null; } public void setArg_typeIsSet(boolean value) { if (!value) { this.arg_type = null; } } public boolean isSkip_nulls() { return this.skip_nulls; } public TTargetInfo setSkip_nulls(boolean skip_nulls) { this.skip_nulls = skip_nulls; setSkip_nullsIsSet(true); return this; } public void unsetSkip_nulls() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SKIP_NULLS_ISSET_ID); } /** Returns true if field skip_nulls is set (has been assigned a value) and false otherwise */ public boolean isSetSkip_nulls() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SKIP_NULLS_ISSET_ID); } public void setSkip_nullsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SKIP_NULLS_ISSET_ID, value); } public boolean isIs_distinct() { return this.is_distinct; } public TTargetInfo setIs_distinct(boolean is_distinct) { this.is_distinct = is_distinct; setIs_distinctIsSet(true); return this; } public void unsetIs_distinct() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_DISTINCT_ISSET_ID); } /** Returns true if field is_distinct is set (has been assigned a value) and false otherwise */ public boolean isSetIs_distinct() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_DISTINCT_ISSET_ID); } public void setIs_distinctIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_DISTINCT_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case IS_AGG: if (value == null) { unsetIs_agg(); } else { setIs_agg((java.lang.Boolean)value); } break; case KIND: if (value == null) { unsetKind(); } else { setKind((TAggKind)value); } break; case TYPE: if (value == null) { unsetType(); } else { setType((ai.heavy.thrift.server.TTypeInfo)value); } break; case ARG_TYPE: if (value == null) { unsetArg_type(); } else { setArg_type((ai.heavy.thrift.server.TTypeInfo)value); } break; case SKIP_NULLS: if (value == null) { unsetSkip_nulls(); } else { setSkip_nulls((java.lang.Boolean)value); } break; case IS_DISTINCT: if (value == null) { unsetIs_distinct(); } else { setIs_distinct((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case IS_AGG: return isIs_agg(); case KIND: return getKind(); case TYPE: return getType(); case ARG_TYPE: return getArg_type(); case SKIP_NULLS: return isSkip_nulls(); case IS_DISTINCT: return isIs_distinct(); } 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 IS_AGG: return isSetIs_agg(); case KIND: return isSetKind(); case TYPE: return isSetType(); case ARG_TYPE: return isSetArg_type(); case SKIP_NULLS: return isSetSkip_nulls(); case IS_DISTINCT: return isSetIs_distinct(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTargetInfo) return this.equals((TTargetInfo)that); return false; } public boolean equals(TTargetInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_is_agg = true; boolean that_present_is_agg = true; if (this_present_is_agg || that_present_is_agg) { if (!(this_present_is_agg && that_present_is_agg)) return false; if (this.is_agg != that.is_agg) return false; } boolean this_present_kind = true && this.isSetKind(); boolean that_present_kind = true && that.isSetKind(); if (this_present_kind || that_present_kind) { if (!(this_present_kind && that_present_kind)) return false; if (!this.kind.equals(that.kind)) return false; } boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } boolean this_present_arg_type = true && this.isSetArg_type(); boolean that_present_arg_type = true && that.isSetArg_type(); if (this_present_arg_type || that_present_arg_type) { if (!(this_present_arg_type && that_present_arg_type)) return false; if (!this.arg_type.equals(that.arg_type)) return false; } boolean this_present_skip_nulls = true; boolean that_present_skip_nulls = true; if (this_present_skip_nulls || that_present_skip_nulls) { if (!(this_present_skip_nulls && that_present_skip_nulls)) return false; if (this.skip_nulls != that.skip_nulls) return false; } boolean this_present_is_distinct = true; boolean that_present_is_distinct = true; if (this_present_is_distinct || that_present_is_distinct) { if (!(this_present_is_distinct && that_present_is_distinct)) return false; if (this.is_distinct != that.is_distinct) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((is_agg) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetKind()) ? 131071 : 524287); if (isSetKind()) hashCode = hashCode * 8191 + kind.getValue(); hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); if (isSetType()) hashCode = hashCode * 8191 + type.hashCode(); hashCode = hashCode * 8191 + ((isSetArg_type()) ? 131071 : 524287); if (isSetArg_type()) hashCode = hashCode * 8191 + arg_type.hashCode(); hashCode = hashCode * 8191 + ((skip_nulls) ? 131071 : 524287); hashCode = hashCode * 8191 + ((is_distinct) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TTargetInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetIs_agg(), other.isSetIs_agg()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_agg()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_agg, other.is_agg); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetKind(), other.isSetKind()); if (lastComparison != 0) { return lastComparison; } if (isSetKind()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.kind, other.kind); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType()); if (lastComparison != 0) { return lastComparison; } if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetArg_type(), other.isSetArg_type()); if (lastComparison != 0) { return lastComparison; } if (isSetArg_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg_type, other.arg_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSkip_nulls(), other.isSetSkip_nulls()); if (lastComparison != 0) { return lastComparison; } if (isSetSkip_nulls()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.skip_nulls, other.skip_nulls); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_distinct(), other.isSetIs_distinct()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_distinct()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_distinct, other.is_distinct); 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("TTargetInfo("); boolean first = true; sb.append("is_agg:"); sb.append(this.is_agg); first = false; if (!first) sb.append(", "); sb.append("kind:"); if (this.kind == null) { sb.append("null"); } else { sb.append(this.kind); } first = false; if (!first) sb.append(", "); sb.append("type:"); if (this.type == null) { sb.append("null"); } else { sb.append(this.type); } first = false; if (!first) sb.append(", "); sb.append("arg_type:"); if (this.arg_type == null) { sb.append("null"); } else { sb.append(this.arg_type); } first = false; if (!first) sb.append(", "); sb.append("skip_nulls:"); sb.append(this.skip_nulls); first = false; if (!first) sb.append(", "); sb.append("is_distinct:"); sb.append(this.is_distinct); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (type != null) { type.validate(); } if (arg_type != null) { arg_type.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 TTargetInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTargetInfoStandardScheme getScheme() { return new TTargetInfoStandardScheme(); } } private static class TTargetInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTargetInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTargetInfo 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: // IS_AGG if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_agg = iprot.readBool(); struct.setIs_aggIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KIND if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.kind = ai.heavy.thrift.server.TAggKind.findByValue(iprot.readI32()); struct.setKindIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.type = new ai.heavy.thrift.server.TTypeInfo(); struct.type.read(iprot); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // ARG_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.arg_type = new ai.heavy.thrift.server.TTypeInfo(); struct.arg_type.read(iprot); struct.setArg_typeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // SKIP_NULLS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.skip_nulls = iprot.readBool(); struct.setSkip_nullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // IS_DISTINCT if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_distinct = iprot.readBool(); struct.setIs_distinctIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTargetInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(IS_AGG_FIELD_DESC); oprot.writeBool(struct.is_agg); oprot.writeFieldEnd(); if (struct.kind != null) { oprot.writeFieldBegin(KIND_FIELD_DESC); oprot.writeI32(struct.kind.getValue()); oprot.writeFieldEnd(); } if (struct.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); struct.type.write(oprot); oprot.writeFieldEnd(); } if (struct.arg_type != null) { oprot.writeFieldBegin(ARG_TYPE_FIELD_DESC); struct.arg_type.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(SKIP_NULLS_FIELD_DESC); oprot.writeBool(struct.skip_nulls); oprot.writeFieldEnd(); oprot.writeFieldBegin(IS_DISTINCT_FIELD_DESC); oprot.writeBool(struct.is_distinct); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTargetInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTargetInfoTupleScheme getScheme() { return new TTargetInfoTupleScheme(); } } private static class TTargetInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTargetInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTargetInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetIs_agg()) { optionals.set(0); } if (struct.isSetKind()) { optionals.set(1); } if (struct.isSetType()) { optionals.set(2); } if (struct.isSetArg_type()) { optionals.set(3); } if (struct.isSetSkip_nulls()) { optionals.set(4); } if (struct.isSetIs_distinct()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetIs_agg()) { oprot.writeBool(struct.is_agg); } if (struct.isSetKind()) { oprot.writeI32(struct.kind.getValue()); } if (struct.isSetType()) { struct.type.write(oprot); } if (struct.isSetArg_type()) { struct.arg_type.write(oprot); } if (struct.isSetSkip_nulls()) { oprot.writeBool(struct.skip_nulls); } if (struct.isSetIs_distinct()) { oprot.writeBool(struct.is_distinct); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTargetInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.is_agg = iprot.readBool(); struct.setIs_aggIsSet(true); } if (incoming.get(1)) { struct.kind = ai.heavy.thrift.server.TAggKind.findByValue(iprot.readI32()); struct.setKindIsSet(true); } if (incoming.get(2)) { struct.type = new ai.heavy.thrift.server.TTypeInfo(); struct.type.read(iprot); struct.setTypeIsSet(true); } if (incoming.get(3)) { struct.arg_type = new ai.heavy.thrift.server.TTypeInfo(); struct.arg_type.read(iprot); struct.setArg_typeIsSet(true); } if (incoming.get(4)) { struct.skip_nulls = iprot.readBool(); struct.setSkip_nullsIsSet(true); } if (incoming.get(5)) { struct.is_distinct = iprot.readBool(); struct.setIs_distinctIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TTypeInfo.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TTypeInfo implements org.apache.thrift.TBase<TTypeInfo, TTypeInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TTypeInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeInfo"); private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField ENCODING_FIELD_DESC = new org.apache.thrift.protocol.TField("encoding", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField NULLABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("nullable", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField IS_ARRAY_FIELD_DESC = new org.apache.thrift.protocol.TField("is_array", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField PRECISION_FIELD_DESC = new org.apache.thrift.protocol.TField("precision", org.apache.thrift.protocol.TType.I32, (short)5); private static final org.apache.thrift.protocol.TField SCALE_FIELD_DESC = new org.apache.thrift.protocol.TField("scale", org.apache.thrift.protocol.TType.I32, (short)6); private static final org.apache.thrift.protocol.TField COMP_PARAM_FIELD_DESC = new org.apache.thrift.protocol.TField("comp_param", org.apache.thrift.protocol.TType.I32, (short)7); private static final org.apache.thrift.protocol.TField SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("size", org.apache.thrift.protocol.TType.I32, (short)8); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeInfoStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeInfoTupleSchemeFactory(); /** * * @see TDatumType */ public @org.apache.thrift.annotation.Nullable TDatumType type; // required /** * * @see TEncodingType */ public @org.apache.thrift.annotation.Nullable TEncodingType encoding; // required public boolean nullable; // required public boolean is_array; // required public int precision; // required public int scale; // required public int comp_param; // required public int size; // 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 { /** * * @see TDatumType */ TYPE((short)1, "type"), /** * * @see TEncodingType */ ENCODING((short)4, "encoding"), NULLABLE((short)2, "nullable"), IS_ARRAY((short)3, "is_array"), PRECISION((short)5, "precision"), SCALE((short)6, "scale"), COMP_PARAM((short)7, "comp_param"), SIZE((short)8, "size"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // TYPE return TYPE; case 4: // ENCODING return ENCODING; case 2: // NULLABLE return NULLABLE; case 3: // IS_ARRAY return IS_ARRAY; case 5: // PRECISION return PRECISION; case 6: // SCALE return SCALE; case 7: // COMP_PARAM return COMP_PARAM; case 8: // SIZE return SIZE; 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 __NULLABLE_ISSET_ID = 0; private static final int __IS_ARRAY_ISSET_ID = 1; private static final int __PRECISION_ISSET_ID = 2; private static final int __SCALE_ISSET_ID = 3; private static final int __COMP_PARAM_ISSET_ID = 4; private static final int __SIZE_ISSET_ID = 5; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.SIZE}; 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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDatumType.class))); tmpMap.put(_Fields.ENCODING, new org.apache.thrift.meta_data.FieldMetaData("encoding", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TEncodingType.class))); tmpMap.put(_Fields.NULLABLE, new org.apache.thrift.meta_data.FieldMetaData("nullable", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.IS_ARRAY, new org.apache.thrift.meta_data.FieldMetaData("is_array", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.PRECISION, new org.apache.thrift.meta_data.FieldMetaData("precision", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SCALE, new org.apache.thrift.meta_data.FieldMetaData("scale", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.COMP_PARAM, new org.apache.thrift.meta_data.FieldMetaData("comp_param", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SIZE, new org.apache.thrift.meta_data.FieldMetaData("size", org.apache.thrift.TFieldRequirementType.OPTIONAL, 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(TTypeInfo.class, metaDataMap); } public TTypeInfo() { this.size = -1; } public TTypeInfo( TDatumType type, TEncodingType encoding, boolean nullable, boolean is_array, int precision, int scale, int comp_param) { this(); this.type = type; this.encoding = encoding; this.nullable = nullable; setNullableIsSet(true); this.is_array = is_array; setIs_arrayIsSet(true); this.precision = precision; setPrecisionIsSet(true); this.scale = scale; setScaleIsSet(true); this.comp_param = comp_param; setComp_paramIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TTypeInfo(TTypeInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetType()) { this.type = other.type; } if (other.isSetEncoding()) { this.encoding = other.encoding; } this.nullable = other.nullable; this.is_array = other.is_array; this.precision = other.precision; this.scale = other.scale; this.comp_param = other.comp_param; this.size = other.size; } public TTypeInfo deepCopy() { return new TTypeInfo(this); } @Override public void clear() { this.type = null; this.encoding = null; setNullableIsSet(false); this.nullable = false; setIs_arrayIsSet(false); this.is_array = false; setPrecisionIsSet(false); this.precision = 0; setScaleIsSet(false); this.scale = 0; setComp_paramIsSet(false); this.comp_param = 0; this.size = -1; } /** * * @see TDatumType */ @org.apache.thrift.annotation.Nullable public TDatumType getType() { return this.type; } /** * * @see TDatumType */ public TTypeInfo setType(@org.apache.thrift.annotation.Nullable TDatumType type) { this.type = type; return this; } public void unsetType() { this.type = null; } /** Returns true if field type is set (has been assigned a value) and false otherwise */ public boolean isSetType() { return this.type != null; } public void setTypeIsSet(boolean value) { if (!value) { this.type = null; } } /** * * @see TEncodingType */ @org.apache.thrift.annotation.Nullable public TEncodingType getEncoding() { return this.encoding; } /** * * @see TEncodingType */ public TTypeInfo setEncoding(@org.apache.thrift.annotation.Nullable TEncodingType encoding) { this.encoding = encoding; return this; } public void unsetEncoding() { this.encoding = null; } /** Returns true if field encoding is set (has been assigned a value) and false otherwise */ public boolean isSetEncoding() { return this.encoding != null; } public void setEncodingIsSet(boolean value) { if (!value) { this.encoding = null; } } public boolean isNullable() { return this.nullable; } public TTypeInfo setNullable(boolean nullable) { this.nullable = nullable; setNullableIsSet(true); return this; } public void unsetNullable() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NULLABLE_ISSET_ID); } /** Returns true if field nullable is set (has been assigned a value) and false otherwise */ public boolean isSetNullable() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NULLABLE_ISSET_ID); } public void setNullableIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NULLABLE_ISSET_ID, value); } public boolean isIs_array() { return this.is_array; } public TTypeInfo setIs_array(boolean is_array) { this.is_array = is_array; setIs_arrayIsSet(true); return this; } public void unsetIs_array() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_ARRAY_ISSET_ID); } /** Returns true if field is_array is set (has been assigned a value) and false otherwise */ public boolean isSetIs_array() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_ARRAY_ISSET_ID); } public void setIs_arrayIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_ARRAY_ISSET_ID, value); } public int getPrecision() { return this.precision; } public TTypeInfo setPrecision(int precision) { this.precision = precision; setPrecisionIsSet(true); return this; } public void unsetPrecision() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PRECISION_ISSET_ID); } /** Returns true if field precision is set (has been assigned a value) and false otherwise */ public boolean isSetPrecision() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PRECISION_ISSET_ID); } public void setPrecisionIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PRECISION_ISSET_ID, value); } public int getScale() { return this.scale; } public TTypeInfo setScale(int scale) { this.scale = scale; setScaleIsSet(true); return this; } public void unsetScale() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCALE_ISSET_ID); } /** Returns true if field scale is set (has been assigned a value) and false otherwise */ public boolean isSetScale() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCALE_ISSET_ID); } public void setScaleIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCALE_ISSET_ID, value); } public int getComp_param() { return this.comp_param; } public TTypeInfo setComp_param(int comp_param) { this.comp_param = comp_param; setComp_paramIsSet(true); return this; } public void unsetComp_param() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COMP_PARAM_ISSET_ID); } /** Returns true if field comp_param is set (has been assigned a value) and false otherwise */ public boolean isSetComp_param() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMP_PARAM_ISSET_ID); } public void setComp_paramIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COMP_PARAM_ISSET_ID, value); } public int getSize() { return this.size; } public TTypeInfo setSize(int size) { this.size = size; setSizeIsSet(true); return this; } public void unsetSize() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SIZE_ISSET_ID); } /** Returns true if field size is set (has been assigned a value) and false otherwise */ public boolean isSetSize() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SIZE_ISSET_ID); } public void setSizeIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SIZE_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TYPE: if (value == null) { unsetType(); } else { setType((TDatumType)value); } break; case ENCODING: if (value == null) { unsetEncoding(); } else { setEncoding((TEncodingType)value); } break; case NULLABLE: if (value == null) { unsetNullable(); } else { setNullable((java.lang.Boolean)value); } break; case IS_ARRAY: if (value == null) { unsetIs_array(); } else { setIs_array((java.lang.Boolean)value); } break; case PRECISION: if (value == null) { unsetPrecision(); } else { setPrecision((java.lang.Integer)value); } break; case SCALE: if (value == null) { unsetScale(); } else { setScale((java.lang.Integer)value); } break; case COMP_PARAM: if (value == null) { unsetComp_param(); } else { setComp_param((java.lang.Integer)value); } break; case SIZE: if (value == null) { unsetSize(); } else { setSize((java.lang.Integer)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case ENCODING: return getEncoding(); case NULLABLE: return isNullable(); case IS_ARRAY: return isIs_array(); case PRECISION: return getPrecision(); case SCALE: return getScale(); case COMP_PARAM: return getComp_param(); case SIZE: return getSize(); } 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 TYPE: return isSetType(); case ENCODING: return isSetEncoding(); case NULLABLE: return isSetNullable(); case IS_ARRAY: return isSetIs_array(); case PRECISION: return isSetPrecision(); case SCALE: return isSetScale(); case COMP_PARAM: return isSetComp_param(); case SIZE: return isSetSize(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TTypeInfo) return this.equals((TTypeInfo)that); return false; } public boolean equals(TTypeInfo that) { if (that == null) return false; if (this == that) return true; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } boolean this_present_encoding = true && this.isSetEncoding(); boolean that_present_encoding = true && that.isSetEncoding(); if (this_present_encoding || that_present_encoding) { if (!(this_present_encoding && that_present_encoding)) return false; if (!this.encoding.equals(that.encoding)) return false; } boolean this_present_nullable = true; boolean that_present_nullable = true; if (this_present_nullable || that_present_nullable) { if (!(this_present_nullable && that_present_nullable)) return false; if (this.nullable != that.nullable) return false; } boolean this_present_is_array = true; boolean that_present_is_array = true; if (this_present_is_array || that_present_is_array) { if (!(this_present_is_array && that_present_is_array)) return false; if (this.is_array != that.is_array) return false; } boolean this_present_precision = true; boolean that_present_precision = true; if (this_present_precision || that_present_precision) { if (!(this_present_precision && that_present_precision)) return false; if (this.precision != that.precision) return false; } boolean this_present_scale = true; boolean that_present_scale = true; if (this_present_scale || that_present_scale) { if (!(this_present_scale && that_present_scale)) return false; if (this.scale != that.scale) return false; } boolean this_present_comp_param = true; boolean that_present_comp_param = true; if (this_present_comp_param || that_present_comp_param) { if (!(this_present_comp_param && that_present_comp_param)) return false; if (this.comp_param != that.comp_param) return false; } boolean this_present_size = true && this.isSetSize(); boolean that_present_size = true && that.isSetSize(); if (this_present_size || that_present_size) { if (!(this_present_size && that_present_size)) return false; if (this.size != that.size) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); if (isSetType()) hashCode = hashCode * 8191 + type.getValue(); hashCode = hashCode * 8191 + ((isSetEncoding()) ? 131071 : 524287); if (isSetEncoding()) hashCode = hashCode * 8191 + encoding.getValue(); hashCode = hashCode * 8191 + ((nullable) ? 131071 : 524287); hashCode = hashCode * 8191 + ((is_array) ? 131071 : 524287); hashCode = hashCode * 8191 + precision; hashCode = hashCode * 8191 + scale; hashCode = hashCode * 8191 + comp_param; hashCode = hashCode * 8191 + ((isSetSize()) ? 131071 : 524287); if (isSetSize()) hashCode = hashCode * 8191 + size; return hashCode; } @Override public int compareTo(TTypeInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType()); if (lastComparison != 0) { return lastComparison; } if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetEncoding(), other.isSetEncoding()); if (lastComparison != 0) { return lastComparison; } if (isSetEncoding()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encoding, other.encoding); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetNullable(), other.isSetNullable()); if (lastComparison != 0) { return lastComparison; } if (isSetNullable()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nullable, other.nullable); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_array(), other.isSetIs_array()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_array()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_array, other.is_array); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetPrecision(), other.isSetPrecision()); if (lastComparison != 0) { return lastComparison; } if (isSetPrecision()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.precision, other.precision); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetScale(), other.isSetScale()); if (lastComparison != 0) { return lastComparison; } if (isSetScale()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scale, other.scale); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetComp_param(), other.isSetComp_param()); if (lastComparison != 0) { return lastComparison; } if (isSetComp_param()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comp_param, other.comp_param); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSize(), other.isSetSize()); if (lastComparison != 0) { return lastComparison; } if (isSetSize()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, other.size); 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("TTypeInfo("); boolean first = true; sb.append("type:"); if (this.type == null) { sb.append("null"); } else { sb.append(this.type); } first = false; if (!first) sb.append(", "); sb.append("encoding:"); if (this.encoding == null) { sb.append("null"); } else { sb.append(this.encoding); } first = false; if (!first) sb.append(", "); sb.append("nullable:"); sb.append(this.nullable); first = false; if (!first) sb.append(", "); sb.append("is_array:"); sb.append(this.is_array); first = false; if (!first) sb.append(", "); sb.append("precision:"); sb.append(this.precision); first = false; if (!first) sb.append(", "); sb.append("scale:"); sb.append(this.scale); first = false; if (!first) sb.append(", "); sb.append("comp_param:"); sb.append(this.comp_param); first = false; if (isSetSize()) { if (!first) sb.append(", "); sb.append("size:"); sb.append(this.size); first = false; } sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TTypeInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTypeInfoStandardScheme getScheme() { return new TTypeInfoStandardScheme(); } } private static class TTypeInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTypeInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeInfo 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: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = ai.heavy.thrift.server.TDatumType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // ENCODING if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.encoding = ai.heavy.thrift.server.TEncodingType.findByValue(iprot.readI32()); struct.setEncodingIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NULLABLE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.nullable = iprot.readBool(); struct.setNullableIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // IS_ARRAY if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_array = iprot.readBool(); struct.setIs_arrayIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // PRECISION if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.precision = iprot.readI32(); struct.setPrecisionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // SCALE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.scale = iprot.readI32(); struct.setScaleIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // COMP_PARAM if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.comp_param = iprot.readI32(); struct.setComp_paramIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.size = iprot.readI32(); struct.setSizeIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeI32(struct.type.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(NULLABLE_FIELD_DESC); oprot.writeBool(struct.nullable); oprot.writeFieldEnd(); oprot.writeFieldBegin(IS_ARRAY_FIELD_DESC); oprot.writeBool(struct.is_array); oprot.writeFieldEnd(); if (struct.encoding != null) { oprot.writeFieldBegin(ENCODING_FIELD_DESC); oprot.writeI32(struct.encoding.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(PRECISION_FIELD_DESC); oprot.writeI32(struct.precision); oprot.writeFieldEnd(); oprot.writeFieldBegin(SCALE_FIELD_DESC); oprot.writeI32(struct.scale); oprot.writeFieldEnd(); oprot.writeFieldBegin(COMP_PARAM_FIELD_DESC); oprot.writeI32(struct.comp_param); oprot.writeFieldEnd(); if (struct.isSetSize()) { oprot.writeFieldBegin(SIZE_FIELD_DESC); oprot.writeI32(struct.size); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TTypeInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTypeInfoTupleScheme getScheme() { return new TTypeInfoTupleScheme(); } } private static class TTypeInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTypeInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTypeInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetType()) { optionals.set(0); } if (struct.isSetEncoding()) { optionals.set(1); } if (struct.isSetNullable()) { optionals.set(2); } if (struct.isSetIs_array()) { optionals.set(3); } if (struct.isSetPrecision()) { optionals.set(4); } if (struct.isSetScale()) { optionals.set(5); } if (struct.isSetComp_param()) { optionals.set(6); } if (struct.isSetSize()) { optionals.set(7); } oprot.writeBitSet(optionals, 8); if (struct.isSetType()) { oprot.writeI32(struct.type.getValue()); } if (struct.isSetEncoding()) { oprot.writeI32(struct.encoding.getValue()); } if (struct.isSetNullable()) { oprot.writeBool(struct.nullable); } if (struct.isSetIs_array()) { oprot.writeBool(struct.is_array); } if (struct.isSetPrecision()) { oprot.writeI32(struct.precision); } if (struct.isSetScale()) { oprot.writeI32(struct.scale); } if (struct.isSetComp_param()) { oprot.writeI32(struct.comp_param); } if (struct.isSetSize()) { oprot.writeI32(struct.size); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTypeInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.type = ai.heavy.thrift.server.TDatumType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } if (incoming.get(1)) { struct.encoding = ai.heavy.thrift.server.TEncodingType.findByValue(iprot.readI32()); struct.setEncodingIsSet(true); } if (incoming.get(2)) { struct.nullable = iprot.readBool(); struct.setNullableIsSet(true); } if (incoming.get(3)) { struct.is_array = iprot.readBool(); struct.setIs_arrayIsSet(true); } if (incoming.get(4)) { struct.precision = iprot.readI32(); struct.setPrecisionIsSet(true); } if (incoming.get(5)) { struct.scale = iprot.readI32(); struct.setScaleIsSet(true); } if (incoming.get(6)) { struct.comp_param = iprot.readI32(); struct.setComp_paramIsSet(true); } if (incoming.get(7)) { struct.size = iprot.readI32(); struct.setSizeIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TVarLen.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TVarLen implements org.apache.thrift.TBase<TVarLen, TVarLen._Fields>, java.io.Serializable, Cloneable, Comparable<TVarLen> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TVarLen"); private static final org.apache.thrift.protocol.TField PAYLOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("payload", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField IS_NULL_FIELD_DESC = new org.apache.thrift.protocol.TField("is_null", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TVarLenStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TVarLenTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer payload; // required public boolean is_null; // 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 { PAYLOAD((short)1, "payload"), IS_NULL((short)2, "is_null"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // PAYLOAD return PAYLOAD; case 2: // IS_NULL return IS_NULL; 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 __IS_NULL_ISSET_ID = 0; 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.PAYLOAD, new org.apache.thrift.meta_data.FieldMetaData("payload", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.IS_NULL, new org.apache.thrift.meta_data.FieldMetaData("is_null", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TVarLen.class, metaDataMap); } public TVarLen() { } public TVarLen( java.nio.ByteBuffer payload, boolean is_null) { this(); this.payload = org.apache.thrift.TBaseHelper.copyBinary(payload); this.is_null = is_null; setIs_nullIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TVarLen(TVarLen other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPayload()) { this.payload = org.apache.thrift.TBaseHelper.copyBinary(other.payload); } this.is_null = other.is_null; } public TVarLen deepCopy() { return new TVarLen(this); } @Override public void clear() { this.payload = null; setIs_nullIsSet(false); this.is_null = false; } public byte[] getPayload() { setPayload(org.apache.thrift.TBaseHelper.rightSize(payload)); return payload == null ? null : payload.array(); } public java.nio.ByteBuffer bufferForPayload() { return org.apache.thrift.TBaseHelper.copyBinary(payload); } public TVarLen setPayload(byte[] payload) { this.payload = payload == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(payload.clone()); return this; } public TVarLen setPayload(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer payload) { this.payload = org.apache.thrift.TBaseHelper.copyBinary(payload); return this; } public void unsetPayload() { this.payload = null; } /** Returns true if field payload is set (has been assigned a value) and false otherwise */ public boolean isSetPayload() { return this.payload != null; } public void setPayloadIsSet(boolean value) { if (!value) { this.payload = null; } } public boolean isIs_null() { return this.is_null; } public TVarLen setIs_null(boolean is_null) { this.is_null = is_null; setIs_nullIsSet(true); return this; } public void unsetIs_null() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __IS_NULL_ISSET_ID); } /** Returns true if field is_null is set (has been assigned a value) and false otherwise */ public boolean isSetIs_null() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __IS_NULL_ISSET_ID); } public void setIs_nullIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __IS_NULL_ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case PAYLOAD: if (value == null) { unsetPayload(); } else { if (value instanceof byte[]) { setPayload((byte[])value); } else { setPayload((java.nio.ByteBuffer)value); } } break; case IS_NULL: if (value == null) { unsetIs_null(); } else { setIs_null((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case PAYLOAD: return getPayload(); case IS_NULL: return isIs_null(); } 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 PAYLOAD: return isSetPayload(); case IS_NULL: return isSetIs_null(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TVarLen) return this.equals((TVarLen)that); return false; } public boolean equals(TVarLen that) { if (that == null) return false; if (this == that) return true; boolean this_present_payload = true && this.isSetPayload(); boolean that_present_payload = true && that.isSetPayload(); if (this_present_payload || that_present_payload) { if (!(this_present_payload && that_present_payload)) return false; if (!this.payload.equals(that.payload)) return false; } boolean this_present_is_null = true; boolean that_present_is_null = true; if (this_present_is_null || that_present_is_null) { if (!(this_present_is_null && that_present_is_null)) return false; if (this.is_null != that.is_null) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetPayload()) ? 131071 : 524287); if (isSetPayload()) hashCode = hashCode * 8191 + payload.hashCode(); hashCode = hashCode * 8191 + ((is_null) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TVarLen other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetPayload(), other.isSetPayload()); if (lastComparison != 0) { return lastComparison; } if (isSetPayload()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payload, other.payload); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetIs_null(), other.isSetIs_null()); if (lastComparison != 0) { return lastComparison; } if (isSetIs_null()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_null, other.is_null); 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("TVarLen("); boolean first = true; sb.append("payload:"); if (this.payload == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.payload, sb); } first = false; if (!first) sb.append(", "); sb.append("is_null:"); sb.append(this.is_null); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TVarLenStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TVarLenStandardScheme getScheme() { return new TVarLenStandardScheme(); } } private static class TVarLenStandardScheme extends org.apache.thrift.scheme.StandardScheme<TVarLen> { public void read(org.apache.thrift.protocol.TProtocol iprot, TVarLen 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: // PAYLOAD if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.payload = iprot.readBinary(); struct.setPayloadIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IS_NULL if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.is_null = iprot.readBool(); struct.setIs_nullIsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TVarLen struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.payload != null) { oprot.writeFieldBegin(PAYLOAD_FIELD_DESC); oprot.writeBinary(struct.payload); oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_NULL_FIELD_DESC); oprot.writeBool(struct.is_null); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TVarLenTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TVarLenTupleScheme getScheme() { return new TVarLenTupleScheme(); } } private static class TVarLenTupleScheme extends org.apache.thrift.scheme.TupleScheme<TVarLen> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TVarLen struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetPayload()) { optionals.set(0); } if (struct.isSetIs_null()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPayload()) { oprot.writeBinary(struct.payload); } if (struct.isSetIs_null()) { oprot.writeBool(struct.is_null); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TVarLen struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.payload = iprot.readBinary(); struct.setPayloadIsSet(true); } if (incoming.get(1)) { struct.is_null = iprot.readBool(); struct.setIs_nullIsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift
java-sources/ai/heavy/heavyai-jdbc/6.1.0/ai/heavy/thrift/server/TViewPermissions.java
/** * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ai.heavy.thrift.server; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TViewPermissions implements org.apache.thrift.TBase<TViewPermissions, TViewPermissions._Fields>, java.io.Serializable, Cloneable, Comparable<TViewPermissions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TViewPermissions"); private static final org.apache.thrift.protocol.TField CREATE__FIELD_DESC = new org.apache.thrift.protocol.TField("create_", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField DROP__FIELD_DESC = new org.apache.thrift.protocol.TField("drop_", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField SELECT__FIELD_DESC = new org.apache.thrift.protocol.TField("select_", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField INSERT__FIELD_DESC = new org.apache.thrift.protocol.TField("insert_", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField UPDATE__FIELD_DESC = new org.apache.thrift.protocol.TField("update_", org.apache.thrift.protocol.TType.BOOL, (short)5); private static final org.apache.thrift.protocol.TField DELETE__FIELD_DESC = new org.apache.thrift.protocol.TField("delete_", org.apache.thrift.protocol.TType.BOOL, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TViewPermissionsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TViewPermissionsTupleSchemeFactory(); public boolean create_; // required public boolean drop_; // required public boolean select_; // required public boolean insert_; // required public boolean update_; // required public boolean delete_; // 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 { CREATE_((short)1, "create_"), DROP_((short)2, "drop_"), SELECT_((short)3, "select_"), INSERT_((short)4, "insert_"), UPDATE_((short)5, "update_"), DELETE_((short)6, "delete_"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); 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: // CREATE_ return CREATE_; case 2: // DROP_ return DROP_; case 3: // SELECT_ return SELECT_; case 4: // INSERT_ return INSERT_; case 5: // UPDATE_ return UPDATE_; case 6: // DELETE_ return DELETE_; 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 __CREATE__ISSET_ID = 0; private static final int __DROP__ISSET_ID = 1; private static final int __SELECT__ISSET_ID = 2; private static final int __INSERT__ISSET_ID = 3; private static final int __UPDATE__ISSET_ID = 4; private static final int __DELETE__ISSET_ID = 5; 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.CREATE_, new org.apache.thrift.meta_data.FieldMetaData("create_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DROP_, new org.apache.thrift.meta_data.FieldMetaData("drop_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.SELECT_, new org.apache.thrift.meta_data.FieldMetaData("select_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.INSERT_, new org.apache.thrift.meta_data.FieldMetaData("insert_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.UPDATE_, new org.apache.thrift.meta_data.FieldMetaData("update_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DELETE_, new org.apache.thrift.meta_data.FieldMetaData("delete_", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TViewPermissions.class, metaDataMap); } public TViewPermissions() { } public TViewPermissions( boolean create_, boolean drop_, boolean select_, boolean insert_, boolean update_, boolean delete_) { this(); this.create_ = create_; setCreate_IsSet(true); this.drop_ = drop_; setDrop_IsSet(true); this.select_ = select_; setSelect_IsSet(true); this.insert_ = insert_; setInsert_IsSet(true); this.update_ = update_; setUpdate_IsSet(true); this.delete_ = delete_; setDelete_IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TViewPermissions(TViewPermissions other) { __isset_bitfield = other.__isset_bitfield; this.create_ = other.create_; this.drop_ = other.drop_; this.select_ = other.select_; this.insert_ = other.insert_; this.update_ = other.update_; this.delete_ = other.delete_; } public TViewPermissions deepCopy() { return new TViewPermissions(this); } @Override public void clear() { setCreate_IsSet(false); this.create_ = false; setDrop_IsSet(false); this.drop_ = false; setSelect_IsSet(false); this.select_ = false; setInsert_IsSet(false); this.insert_ = false; setUpdate_IsSet(false); this.update_ = false; setDelete_IsSet(false); this.delete_ = false; } public boolean isCreate_() { return this.create_; } public TViewPermissions setCreate_(boolean create_) { this.create_ = create_; setCreate_IsSet(true); return this; } public void unsetCreate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATE__ISSET_ID); } /** Returns true if field create_ is set (has been assigned a value) and false otherwise */ public boolean isSetCreate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATE__ISSET_ID); } public void setCreate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATE__ISSET_ID, value); } public boolean isDrop_() { return this.drop_; } public TViewPermissions setDrop_(boolean drop_) { this.drop_ = drop_; setDrop_IsSet(true); return this; } public void unsetDrop_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DROP__ISSET_ID); } /** Returns true if field drop_ is set (has been assigned a value) and false otherwise */ public boolean isSetDrop_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DROP__ISSET_ID); } public void setDrop_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DROP__ISSET_ID, value); } public boolean isSelect_() { return this.select_; } public TViewPermissions setSelect_(boolean select_) { this.select_ = select_; setSelect_IsSet(true); return this; } public void unsetSelect_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SELECT__ISSET_ID); } /** Returns true if field select_ is set (has been assigned a value) and false otherwise */ public boolean isSetSelect_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SELECT__ISSET_ID); } public void setSelect_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SELECT__ISSET_ID, value); } public boolean isInsert_() { return this.insert_; } public TViewPermissions setInsert_(boolean insert_) { this.insert_ = insert_; setInsert_IsSet(true); return this; } public void unsetInsert_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INSERT__ISSET_ID); } /** Returns true if field insert_ is set (has been assigned a value) and false otherwise */ public boolean isSetInsert_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INSERT__ISSET_ID); } public void setInsert_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INSERT__ISSET_ID, value); } public boolean isUpdate_() { return this.update_; } public TViewPermissions setUpdate_(boolean update_) { this.update_ = update_; setUpdate_IsSet(true); return this; } public void unsetUpdate_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATE__ISSET_ID); } /** Returns true if field update_ is set (has been assigned a value) and false otherwise */ public boolean isSetUpdate_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATE__ISSET_ID); } public void setUpdate_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATE__ISSET_ID, value); } public boolean isDelete_() { return this.delete_; } public TViewPermissions setDelete_(boolean delete_) { this.delete_ = delete_; setDelete_IsSet(true); return this; } public void unsetDelete_() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DELETE__ISSET_ID); } /** Returns true if field delete_ is set (has been assigned a value) and false otherwise */ public boolean isSetDelete_() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DELETE__ISSET_ID); } public void setDelete_IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DELETE__ISSET_ID, value); } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case CREATE_: if (value == null) { unsetCreate_(); } else { setCreate_((java.lang.Boolean)value); } break; case DROP_: if (value == null) { unsetDrop_(); } else { setDrop_((java.lang.Boolean)value); } break; case SELECT_: if (value == null) { unsetSelect_(); } else { setSelect_((java.lang.Boolean)value); } break; case INSERT_: if (value == null) { unsetInsert_(); } else { setInsert_((java.lang.Boolean)value); } break; case UPDATE_: if (value == null) { unsetUpdate_(); } else { setUpdate_((java.lang.Boolean)value); } break; case DELETE_: if (value == null) { unsetDelete_(); } else { setDelete_((java.lang.Boolean)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case CREATE_: return isCreate_(); case DROP_: return isDrop_(); case SELECT_: return isSelect_(); case INSERT_: return isInsert_(); case UPDATE_: return isUpdate_(); case DELETE_: return isDelete_(); } 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 CREATE_: return isSetCreate_(); case DROP_: return isSetDrop_(); case SELECT_: return isSetSelect_(); case INSERT_: return isSetInsert_(); case UPDATE_: return isSetUpdate_(); case DELETE_: return isSetDelete_(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof TViewPermissions) return this.equals((TViewPermissions)that); return false; } public boolean equals(TViewPermissions that) { if (that == null) return false; if (this == that) return true; boolean this_present_create_ = true; boolean that_present_create_ = true; if (this_present_create_ || that_present_create_) { if (!(this_present_create_ && that_present_create_)) return false; if (this.create_ != that.create_) return false; } boolean this_present_drop_ = true; boolean that_present_drop_ = true; if (this_present_drop_ || that_present_drop_) { if (!(this_present_drop_ && that_present_drop_)) return false; if (this.drop_ != that.drop_) return false; } boolean this_present_select_ = true; boolean that_present_select_ = true; if (this_present_select_ || that_present_select_) { if (!(this_present_select_ && that_present_select_)) return false; if (this.select_ != that.select_) return false; } boolean this_present_insert_ = true; boolean that_present_insert_ = true; if (this_present_insert_ || that_present_insert_) { if (!(this_present_insert_ && that_present_insert_)) return false; if (this.insert_ != that.insert_) return false; } boolean this_present_update_ = true; boolean that_present_update_ = true; if (this_present_update_ || that_present_update_) { if (!(this_present_update_ && that_present_update_)) return false; if (this.update_ != that.update_) return false; } boolean this_present_delete_ = true; boolean that_present_delete_ = true; if (this_present_delete_ || that_present_delete_) { if (!(this_present_delete_ && that_present_delete_)) return false; if (this.delete_ != that.delete_) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((create_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((drop_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((select_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((insert_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((update_) ? 131071 : 524287); hashCode = hashCode * 8191 + ((delete_) ? 131071 : 524287); return hashCode; } @Override public int compareTo(TViewPermissions other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetCreate_(), other.isSetCreate_()); if (lastComparison != 0) { return lastComparison; } if (isSetCreate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.create_, other.create_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDrop_(), other.isSetDrop_()); if (lastComparison != 0) { return lastComparison; } if (isSetDrop_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.drop_, other.drop_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetSelect_(), other.isSetSelect_()); if (lastComparison != 0) { return lastComparison; } if (isSetSelect_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.select_, other.select_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetInsert_(), other.isSetInsert_()); if (lastComparison != 0) { return lastComparison; } if (isSetInsert_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.insert_, other.insert_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetUpdate_(), other.isSetUpdate_()); if (lastComparison != 0) { return lastComparison; } if (isSetUpdate_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.update_, other.update_); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDelete_(), other.isSetDelete_()); if (lastComparison != 0) { return lastComparison; } if (isSetDelete_()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delete_, other.delete_); 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("TViewPermissions("); boolean first = true; sb.append("create_:"); sb.append(this.create_); first = false; if (!first) sb.append(", "); sb.append("drop_:"); sb.append(this.drop_); first = false; if (!first) sb.append(", "); sb.append("select_:"); sb.append(this.select_); first = false; if (!first) sb.append(", "); sb.append("insert_:"); sb.append(this.insert_); first = false; if (!first) sb.append(", "); sb.append("update_:"); sb.append(this.update_); first = false; if (!first) sb.append(", "); sb.append("delete_:"); sb.append(this.delete_); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 TViewPermissionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TViewPermissionsStandardScheme getScheme() { return new TViewPermissionsStandardScheme(); } } private static class TViewPermissionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TViewPermissions> { public void read(org.apache.thrift.protocol.TProtocol iprot, TViewPermissions 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: // CREATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DROP_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.drop_ = iprot.readBool(); struct.setDrop_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // SELECT_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.select_ = iprot.readBool(); struct.setSelect_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // INSERT_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.insert_ = iprot.readBool(); struct.setInsert_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // UPDATE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.update_ = iprot.readBool(); struct.setUpdate_IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // DELETE_ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(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 struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TViewPermissions struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CREATE__FIELD_DESC); oprot.writeBool(struct.create_); oprot.writeFieldEnd(); oprot.writeFieldBegin(DROP__FIELD_DESC); oprot.writeBool(struct.drop_); oprot.writeFieldEnd(); oprot.writeFieldBegin(SELECT__FIELD_DESC); oprot.writeBool(struct.select_); oprot.writeFieldEnd(); oprot.writeFieldBegin(INSERT__FIELD_DESC); oprot.writeBool(struct.insert_); oprot.writeFieldEnd(); oprot.writeFieldBegin(UPDATE__FIELD_DESC); oprot.writeBool(struct.update_); oprot.writeFieldEnd(); oprot.writeFieldBegin(DELETE__FIELD_DESC); oprot.writeBool(struct.delete_); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TViewPermissionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TViewPermissionsTupleScheme getScheme() { return new TViewPermissionsTupleScheme(); } } private static class TViewPermissionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TViewPermissions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TViewPermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCreate_()) { optionals.set(0); } if (struct.isSetDrop_()) { optionals.set(1); } if (struct.isSetSelect_()) { optionals.set(2); } if (struct.isSetInsert_()) { optionals.set(3); } if (struct.isSetUpdate_()) { optionals.set(4); } if (struct.isSetDelete_()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetCreate_()) { oprot.writeBool(struct.create_); } if (struct.isSetDrop_()) { oprot.writeBool(struct.drop_); } if (struct.isSetSelect_()) { oprot.writeBool(struct.select_); } if (struct.isSetInsert_()) { oprot.writeBool(struct.insert_); } if (struct.isSetUpdate_()) { oprot.writeBool(struct.update_); } if (struct.isSetDelete_()) { oprot.writeBool(struct.delete_); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TViewPermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.create_ = iprot.readBool(); struct.setCreate_IsSet(true); } if (incoming.get(1)) { struct.drop_ = iprot.readBool(); struct.setDrop_IsSet(true); } if (incoming.get(2)) { struct.select_ = iprot.readBool(); struct.setSelect_IsSet(true); } if (incoming.get(3)) { struct.insert_ = iprot.readBool(); struct.setInsert_IsSet(true); } if (incoming.get(4)) { struct.update_ = iprot.readBool(); struct.setUpdate_IsSet(true); } if (incoming.get(5)) { struct.delete_ = iprot.readBool(); struct.setDelete_IsSet(true); } } } private static <S extends org.apache.thrift.scheme.IScheme> 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(); } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/BeanContainer.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado; import ai.houyi.dorado.rest.util.ClassLoaderUtils; /** * bean容器 * * @author weiping wang * */ public interface BeanContainer { BeanContainer DEFAULT = new BeanContainer() { @SuppressWarnings("unchecked") @Override public <T> T getBean(Class<T> beanType) { if (beanType.isInterface()) return null; return (T) ClassLoaderUtils.newInstance(beanType); } @Override public <T> T getBean(String name) { return null; } }; <T> T getBean(Class<T> beanType); <T> T getBean(String name); }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/Dorado.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado; import java.net.URL; import ai.houyi.dorado.rest.server.DoradoServerBuilder; import ai.houyi.dorado.rest.util.ClassLoaderUtils; /** * * @author wangwp */ public final class Dorado { public static volatile ClassLoader classLoader; public static volatile boolean springInitialized; public static volatile BeanContainer beanContainer; public static volatile DoradoServerBuilder serverConfig; public static volatile Class<?> mainClass; public static volatile boolean isEnableSwagger; public static volatile boolean isEnableSpring; public static volatile boolean isEnableProtobuf; public static volatile boolean isEnableSwaggerUi; static { classLoader = Thread.currentThread().getContextClassLoader(); beanContainer = BeanContainer.DEFAULT; try { Class.forName("com.google.protobuf.Message"); isEnableProtobuf = true; } catch (Throwable ex) { // ignore this ex } try { Class.forName("org.springframework.context.ApplicationContext"); isEnableSpring = true; } catch (Throwable ex) { // ignore this ex } try { Class.forName("mobi.f2time.dorado.swagger.controller.SwaggerV2Controller"); isEnableSwagger = true; } catch (Throwable ex) { // ignore this ex } try { URL url = ClassLoaderUtils.getURL("META-INF/webjars/swagger-ui"); isEnableSwaggerUi = url!=null; }catch(Throwable ex) { //ignore this ex } } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/exception/DoradoException.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.exception; /** * * @author wangwp */ @SuppressWarnings("serial") public class DoradoException extends RuntimeException { public DoradoException() { super(); } public DoradoException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } public DoradoException(String message, Throwable cause) { super(message, cause); } public DoradoException(String message) { super(message); } public DoradoException(Throwable cause) { super(cause); } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/exception/package-info.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ /** * * @author wangwp */ package ai.houyi.dorado.exception;
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty/ext/CaseIgnoringComparator.java
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.netty.ext; import java.io.Serializable; import java.util.Comparator; final class CaseIgnoringComparator implements Comparator<CharSequence>, Serializable { private static final long serialVersionUID = 4582133183775373862L; static final CaseIgnoringComparator INSTANCE = new CaseIgnoringComparator(); private CaseIgnoringComparator() { } @Override public int compare(CharSequence o1, CharSequence o2) { int o1Length = o1.length(); int o2Length = o2.length(); int min = Math.min(o1Length, o2Length); for (int i = 0; i < min; i++) { char c1 = o1.charAt(i); char c2 = o2.charAt(i); if (c1 != c2) { c1 = Character.toUpperCase(c1); c2 = Character.toUpperCase(c2); if (c1 != c2) { c1 = Character.toLowerCase(c1); c2 = Character.toLowerCase(c2); if (c1 != c2) { return c1 - c2; } } } } return o1Length - o2Length; } private Object readResolve() { return INSTANCE; } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty/ext/HttpPostBodyUtil.java
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.netty.ext; import io.netty.buffer.ByteBuf; /** * Shared Static object between HttpMessageDecoder, HttpPostRequestDecoder and HttpPostRequestEncoder */ final class HttpPostBodyUtil { public static final int chunkSize = 8096; /** * Default Content-Type in binary form */ public static final String DEFAULT_BINARY_CONTENT_TYPE = "application/octet-stream"; /** * Default Content-Type in Text form */ public static final String DEFAULT_TEXT_CONTENT_TYPE = "text/plain"; /** * Allowed mechanism for multipart * mechanism := "7bit" / "8bit" / "binary" Not allowed: "quoted-printable" / "base64" */ public enum TransferEncodingMechanism { /** * Default encoding */ BIT7("7bit"), /** * Short lines but not in ASCII - no encoding */ BIT8("8bit"), /** * Could be long text not in ASCII - no encoding */ BINARY("binary"); private final String value; TransferEncodingMechanism(String value) { this.value = value; } public String value() { return value; } @Override public String toString() { return value; } } private HttpPostBodyUtil() { } /** * This class intends to decrease the CPU in seeking ahead some bytes in * HttpPostRequestDecoder */ static class SeekAheadOptimize { byte[] bytes; int readerIndex; int pos; int origPos; int limit; ByteBuf buffer; /** * @param buffer buffer with a backing byte array */ SeekAheadOptimize(ByteBuf buffer) { if (!buffer.hasArray()) { throw new IllegalArgumentException("buffer hasn't backing byte array"); } this.buffer = buffer; bytes = buffer.array(); readerIndex = buffer.readerIndex(); origPos = pos = buffer.arrayOffset() + readerIndex; limit = buffer.arrayOffset() + buffer.writerIndex(); } /** * * @param minus this value will be used as (currentPos - minus) to set * the current readerIndex in the buffer. */ void setReadPosition(int minus) { pos -= minus; readerIndex = getReadPosition(pos); buffer.readerIndex(readerIndex); } /** * * @param index raw index of the array (pos in general) * @return the value equivalent of raw index to be used in readerIndex(value) */ int getReadPosition(int index) { return index - origPos + readerIndex; } } /** * Find the first non whitespace * @return the rank of the first non whitespace */ static int findNonWhitespace(String sb, int offset) { int result; for (result = offset; result < sb.length(); result ++) { if (!Character.isWhitespace(sb.charAt(result))) { break; } } return result; } /** * Find the end of String * @return the rank of the end of string */ static int findEndOfString(String sb) { int result; for (result = sb.length(); result > 0; result --) { if (!Character.isWhitespace(sb.charAt(result - 1))) { break; } } return result; } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty/ext/HttpPostMultipartRequestDecoder.java
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.netty.ext; import static io.netty.buffer.Unpooled.buffer; import static io.netty.util.internal.ObjectUtil.checkNotNull; import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.UnsupportedCharsetException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.TreeMap; import ai.houyi.dorado.netty.ext.HttpPostBodyUtil.SeekAheadOptimize; import ai.houyi.dorado.netty.ext.HttpPostBodyUtil.TransferEncodingMechanism; import ai.houyi.dorado.netty.ext.HttpPostRequestDecoder.EndOfDataDecoderException; import ai.houyi.dorado.netty.ext.HttpPostRequestDecoder.ErrorDataDecoderException; import ai.houyi.dorado.netty.ext.HttpPostRequestDecoder.MultiPartStatus; import ai.houyi.dorado.netty.ext.HttpPostRequestDecoder.NotEnoughDataDecoderException; import io.netty.buffer.ByteBuf; import io.netty.handler.codec.http.HttpConstants; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaderValues; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.LastHttpContent; import io.netty.handler.codec.http.QueryStringDecoder; import io.netty.handler.codec.http.multipart.Attribute; import io.netty.handler.codec.http.multipart.DefaultHttpDataFactory; import io.netty.handler.codec.http.multipart.FileUpload; import io.netty.handler.codec.http.multipart.HttpData; import io.netty.handler.codec.http.multipart.HttpDataFactory; import io.netty.handler.codec.http.multipart.InterfaceHttpData; import io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoder; import io.netty.util.CharsetUtil; import io.netty.util.internal.InternalThreadLocalMap; import io.netty.util.internal.StringUtil; /** * This decoder will decode Body and can handle POST BODY. * * You <strong>MUST</strong> call {@link #destroy()} after completion to release * all resources. * */ public class HttpPostMultipartRequestDecoder implements InterfaceHttpPostRequestDecoder { /** * Factory used to create InterfaceHttpData */ private final HttpDataFactory factory; /** * Request to decode */ private final HttpRequest request; /** * Default charset to use */ private Charset charset; /** * Does the last chunk already received */ private boolean isLastChunk; /** * HttpDatas from Body */ private final List<InterfaceHttpData> bodyListHttpData = new ArrayList<InterfaceHttpData>(); /** * HttpDatas as Map from Body */ private final Map<String, List<InterfaceHttpData>> bodyMapHttpData = new TreeMap<String, List<InterfaceHttpData>>( CaseIgnoringComparator.INSTANCE); /** * The current channelBuffer */ private ByteBuf undecodedChunk; /** * Body HttpDatas current position */ private int bodyListHttpDataRank; /** * If multipart, this is the boundary for the global multipart */ private String multipartDataBoundary; /** * If multipart, there could be internal multiparts (mixed) to the global * multipart. Only one level is allowed. */ private String multipartMixedBoundary; /** * Current getStatus */ private MultiPartStatus currentStatus = MultiPartStatus.NOTSTARTED; /** * Used in Multipart */ private Map<CharSequence, Attribute> currentFieldAttributes; /** * The current FileUpload that is currently in decode process */ private FileUpload currentFileUpload; /** * The current Attribute that is currently in decode process */ private Attribute currentAttribute; private boolean destroyed; private int discardThreshold = HttpPostRequestDecoder.DEFAULT_DISCARD_THRESHOLD; /** * * @param request the request to decode * @throws NullPointerException for request * @throws ErrorDataDecoderException if the default charset was wrong when * decoding or other errors */ public HttpPostMultipartRequestDecoder(HttpRequest request) { this(new DefaultHttpDataFactory(DefaultHttpDataFactory.MINSIZE), request, HttpConstants.DEFAULT_CHARSET); } /** * * @param factory the factory used to create InterfaceHttpData * @param request the request to decode * @throws NullPointerException for request or factory * @throws ErrorDataDecoderException if the default charset was wrong when * decoding or other errors */ public HttpPostMultipartRequestDecoder(HttpDataFactory factory, HttpRequest request) { this(factory, request, HttpConstants.DEFAULT_CHARSET); } /** * * @param factory the factory used to create InterfaceHttpData * @param request the request to decode * @param charset the charset to use as default * @throws NullPointerException for request or charset or factory * @throws ErrorDataDecoderException if the default charset was wrong when * decoding or other errors */ public HttpPostMultipartRequestDecoder(HttpDataFactory factory, HttpRequest request, Charset charset) { this.request = checkNotNull(request, "request"); this.charset = checkNotNull(charset, "charset"); this.factory = checkNotNull(factory, "factory"); // Fill default values setMultipart(this.request.headers().get(HttpHeaderNames.CONTENT_TYPE)); if (request instanceof HttpContent) { // Offer automatically if the given request is als type of HttpContent // See #1089 offer((HttpContent) request); } else { undecodedChunk = buffer(); parseBody(); } } /** * Set from the request ContentType the multipartDataBoundary and the possible * charset. */ private void setMultipart(String contentType) { String[] dataBoundary = HttpPostRequestDecoder.getMultipartDataBoundary(contentType); if (dataBoundary != null) { multipartDataBoundary = dataBoundary[0]; if (dataBoundary.length > 1 && dataBoundary[1] != null) { charset = Charset.forName(dataBoundary[1]); } } else { multipartDataBoundary = null; } currentStatus = MultiPartStatus.HEADERDELIMITER; } private void checkDestroyed() { if (destroyed) { throw new IllegalStateException( HttpPostMultipartRequestDecoder.class.getSimpleName() + " was destroyed already"); } } /** * True if this request is a Multipart request * * @return True if this request is a Multipart request */ @Override public boolean isMultipart() { checkDestroyed(); return true; } /** * Set the amount of bytes after which read bytes in the buffer should be * discarded. Setting this lower gives lower memory usage but with the overhead * of more memory copies. Use {@code 0} to disable it. */ @Override public void setDiscardThreshold(int discardThreshold) { this.discardThreshold = checkPositiveOrZero(discardThreshold, "discardThreshold"); } /** * Return the threshold in bytes after which read data in the buffer should be * discarded. */ @Override public int getDiscardThreshold() { return discardThreshold; } /** * This getMethod returns a List of all HttpDatas from body.<br> * * If chunked, all chunks must have been offered using offer() getMethod. If * not, NotEnoughDataDecoderException will be raised. * * @return the list of HttpDatas from Body part for POST getMethod * @throws NotEnoughDataDecoderException Need more chunks */ @Override public List<InterfaceHttpData> getBodyHttpDatas() { checkDestroyed(); if (!isLastChunk) { throw new NotEnoughDataDecoderException(); } return bodyListHttpData; } /** * This getMethod returns a List of all HttpDatas with the given name from * body.<br> * * If chunked, all chunks must have been offered using offer() getMethod. If * not, NotEnoughDataDecoderException will be raised. * * @return All Body HttpDatas with the given name (ignore case) * @throws NotEnoughDataDecoderException need more chunks */ @Override public List<InterfaceHttpData> getBodyHttpDatas(String name) { checkDestroyed(); if (!isLastChunk) { throw new NotEnoughDataDecoderException(); } return bodyMapHttpData.get(name); } /** * This getMethod returns the first InterfaceHttpData with the given name from * body.<br> * * If chunked, all chunks must have been offered using offer() getMethod. If * not, NotEnoughDataDecoderException will be raised. * * @return The first Body InterfaceHttpData with the given name (ignore case) * @throws NotEnoughDataDecoderException need more chunks */ @Override public InterfaceHttpData getBodyHttpData(String name) { checkDestroyed(); if (!isLastChunk) { throw new NotEnoughDataDecoderException(); } List<InterfaceHttpData> list = bodyMapHttpData.get(name); if (list != null) { return list.get(0); } return null; } /** * Initialized the internals from a new chunk * * @param content the new received chunk * @throws ErrorDataDecoderException if there is a problem with the charset * decoding or other errors */ @Override public HttpPostMultipartRequestDecoder offer(HttpContent content) { checkDestroyed(); // Maybe we should better not copy here for performance reasons but this will // need // more care by the caller to release the content in a correct manner later // So maybe something to optimize on a later stage ByteBuf buf = content.content(); if (undecodedChunk == null) { undecodedChunk = buf.copy(); } else { undecodedChunk.writeBytes(buf); } if (content instanceof LastHttpContent) { isLastChunk = true; } parseBody(); if (undecodedChunk != null && undecodedChunk.writerIndex() > discardThreshold) { undecodedChunk.discardReadBytes(); } return this; } /** * True if at current getStatus, there is an available decoded InterfaceHttpData * from the Body. * * This getMethod works for chunked and not chunked request. * * @return True if at current getStatus, there is a decoded InterfaceHttpData * @throws EndOfDataDecoderException No more data will be available */ @Override public boolean hasNext() { checkDestroyed(); if (currentStatus == MultiPartStatus.EPILOGUE) { // OK except if end of list if (bodyListHttpDataRank >= bodyListHttpData.size()) { throw new EndOfDataDecoderException(); } } return !bodyListHttpData.isEmpty() && bodyListHttpDataRank < bodyListHttpData.size(); } /** * Returns the next available InterfaceHttpData or null if, at the time it is * called, there is no more available InterfaceHttpData. A subsequent call to * offer(httpChunk) could enable more data. * * Be sure to call {@link InterfaceHttpData#release()} after you are done with * processing to make sure to not leak any resources * * @return the next available InterfaceHttpData or null if none * @throws EndOfDataDecoderException No more data will be available */ @Override public InterfaceHttpData next() { checkDestroyed(); if (hasNext()) { return bodyListHttpData.get(bodyListHttpDataRank++); } return null; } @Override public InterfaceHttpData currentPartialHttpData() { if (currentFileUpload != null) { return currentFileUpload; } else { return currentAttribute; } } /** * This getMethod will parse as much as possible data and fill the list and map * * @throws ErrorDataDecoderException if there is a problem with the charset * decoding or other errors */ private void parseBody() { if (currentStatus == MultiPartStatus.PREEPILOGUE || currentStatus == MultiPartStatus.EPILOGUE) { if (isLastChunk) { currentStatus = MultiPartStatus.EPILOGUE; } return; } parseBodyMultipart(); } /** * Utility function to add a new decoded data */ protected void addHttpData(InterfaceHttpData data) { if (data == null) { return; } List<InterfaceHttpData> datas = bodyMapHttpData.get(data.getName()); if (datas == null) { datas = new ArrayList<InterfaceHttpData>(1); bodyMapHttpData.put(data.getName(), datas); } datas.add(data); bodyListHttpData.add(data); } /** * Parse the Body for multipart * * @throws ErrorDataDecoderException if there is a problem with the charset * decoding or other errors */ private void parseBodyMultipart() { if (undecodedChunk == null || undecodedChunk.readableBytes() == 0) { // nothing to decode return; } InterfaceHttpData data = decodeMultipart(currentStatus); while (data != null) { addHttpData(data); if (currentStatus == MultiPartStatus.PREEPILOGUE || currentStatus == MultiPartStatus.EPILOGUE) { break; } data = decodeMultipart(currentStatus); } } /** * Decode a multipart request by pieces<br> * <br> * NOTSTARTED PREAMBLE (<br> * (HEADERDELIMITER DISPOSITION (FIELD | FILEUPLOAD))*<br> * (HEADERDELIMITER DISPOSITION MIXEDPREAMBLE<br> * (MIXEDDELIMITER MIXEDDISPOSITION MIXEDFILEUPLOAD)+<br> * MIXEDCLOSEDELIMITER)*<br> * CLOSEDELIMITER)+ EPILOGUE<br> * * Inspired from HttpMessageDecoder * * @return the next decoded InterfaceHttpData or null if none until now. * @throws ErrorDataDecoderException if an error occurs */ private InterfaceHttpData decodeMultipart(MultiPartStatus state) { switch (state) { case NOTSTARTED: throw new ErrorDataDecoderException("Should not be called with the current getStatus"); case PREAMBLE: // Content-type: multipart/form-data, boundary=AaB03x throw new ErrorDataDecoderException("Should not be called with the current getStatus"); case HEADERDELIMITER: { // --AaB03x or --AaB03x-- return findMultipartDelimiter(multipartDataBoundary, MultiPartStatus.DISPOSITION, MultiPartStatus.PREEPILOGUE); } case DISPOSITION: { // content-disposition: form-data; name="field1" // content-disposition: form-data; name="pics"; filename="file1.txt" // and other immediate values like // Content-type: image/gif // Content-Type: text/plain // Content-Type: text/plain; charset=ISO-8859-1 // Content-Transfer-Encoding: binary // The following line implies a change of mode (mixed mode) // Content-type: multipart/mixed, boundary=BbC04y return findMultipartDisposition(); } case FIELD: { // Now get value according to Content-Type and Charset Charset localCharset = null; Attribute charsetAttribute = currentFieldAttributes.get(HttpHeaderValues.CHARSET); if (charsetAttribute != null) { try { localCharset = Charset.forName(charsetAttribute.getValue()); } catch (IOException e) { throw new ErrorDataDecoderException(e); } catch (UnsupportedCharsetException e) { throw new ErrorDataDecoderException(e); } } Attribute nameAttribute = currentFieldAttributes.get(HttpHeaderValues.NAME); if (currentAttribute == null) { Attribute lengthAttribute = currentFieldAttributes.get(HttpHeaderNames.CONTENT_LENGTH); long size; try { size = lengthAttribute != null ? Long.parseLong(lengthAttribute.getValue()) : 0L; } catch (IOException e) { throw new ErrorDataDecoderException(e); } catch (NumberFormatException ignored) { size = 0; } try { if (size > 0) { currentAttribute = factory.createAttribute(request, cleanString(nameAttribute.getValue()), size); } else { currentAttribute = factory.createAttribute(request, cleanString(nameAttribute.getValue())); } } catch (NullPointerException e) { throw new ErrorDataDecoderException(e); } catch (IllegalArgumentException e) { throw new ErrorDataDecoderException(e); } catch (IOException e) { throw new ErrorDataDecoderException(e); } if (localCharset != null) { currentAttribute.setCharset(localCharset); } } // load data if (!loadDataMultipart(undecodedChunk, multipartDataBoundary, currentAttribute)) { // Delimiter is not found. Need more chunks. return null; } Attribute finalAttribute = currentAttribute; currentAttribute = null; currentFieldAttributes = null; // ready to load the next one currentStatus = MultiPartStatus.HEADERDELIMITER; return finalAttribute; } case FILEUPLOAD: { // eventually restart from existing FileUpload return getFileUpload(multipartDataBoundary); } case MIXEDDELIMITER: { // --AaB03x or --AaB03x-- // Note that currentFieldAttributes exists return findMultipartDelimiter(multipartMixedBoundary, MultiPartStatus.MIXEDDISPOSITION, MultiPartStatus.HEADERDELIMITER); } case MIXEDDISPOSITION: { return findMultipartDisposition(); } case MIXEDFILEUPLOAD: { // eventually restart from existing FileUpload return getFileUpload(multipartMixedBoundary); } case PREEPILOGUE: return null; case EPILOGUE: return null; default: throw new ErrorDataDecoderException("Shouldn't reach here."); } } /** * Skip control Characters * * @throws NotEnoughDataDecoderException */ private static void skipControlCharacters(ByteBuf undecodedChunk) { if (!undecodedChunk.hasArray()) { try { skipControlCharactersStandard(undecodedChunk); } catch (IndexOutOfBoundsException e1) { throw new NotEnoughDataDecoderException(e1); } return; } SeekAheadOptimize sao = new SeekAheadOptimize(undecodedChunk); while (sao.pos < sao.limit) { char c = (char) (sao.bytes[sao.pos++] & 0xFF); if (!Character.isISOControl(c) && !Character.isWhitespace(c)) { sao.setReadPosition(1); return; } } throw new NotEnoughDataDecoderException("Access out of bounds"); } private static void skipControlCharactersStandard(ByteBuf undecodedChunk) { for (;;) { char c = (char) undecodedChunk.readUnsignedByte(); if (!Character.isISOControl(c) && !Character.isWhitespace(c)) { undecodedChunk.readerIndex(undecodedChunk.readerIndex() - 1); break; } } } /** * Find the next Multipart Delimiter * * @param delimiter delimiter to find * @param dispositionStatus the next getStatus if the delimiter is a start * @param closeDelimiterStatus the next getStatus if the delimiter is a close * delimiter * @return the next InterfaceHttpData if any * @throws ErrorDataDecoderException */ private InterfaceHttpData findMultipartDelimiter(String delimiter, MultiPartStatus dispositionStatus, MultiPartStatus closeDelimiterStatus) { // --AaB03x or --AaB03x-- int readerIndex = undecodedChunk.readerIndex(); try { skipControlCharacters(undecodedChunk); } catch (NotEnoughDataDecoderException ignored) { undecodedChunk.readerIndex(readerIndex); return null; } skipOneLine(); String newline; try { newline = readDelimiter(undecodedChunk, delimiter); } catch (NotEnoughDataDecoderException ignored) { undecodedChunk.readerIndex(readerIndex); return null; } if (newline.equals(delimiter)) { currentStatus = dispositionStatus; return decodeMultipart(dispositionStatus); } if (newline.equals(delimiter + "--")) { // CLOSEDELIMITER or MIXED CLOSEDELIMITER found currentStatus = closeDelimiterStatus; if (currentStatus == MultiPartStatus.HEADERDELIMITER) { // MIXEDCLOSEDELIMITER // end of the Mixed part currentFieldAttributes = null; return decodeMultipart(MultiPartStatus.HEADERDELIMITER); } return null; } undecodedChunk.readerIndex(readerIndex); throw new ErrorDataDecoderException("No Multipart delimiter found"); } /** * Find the next Disposition * * @return the next InterfaceHttpData if any * @throws ErrorDataDecoderException */ private InterfaceHttpData findMultipartDisposition() { int readerIndex = undecodedChunk.readerIndex(); if (currentStatus == MultiPartStatus.DISPOSITION) { currentFieldAttributes = new TreeMap<CharSequence, Attribute>(CaseIgnoringComparator.INSTANCE); } // read many lines until empty line with newline found! Store all data while (!skipOneLine()) { String newline; try { skipControlCharacters(undecodedChunk); newline = readLine(undecodedChunk, charset); } catch (NotEnoughDataDecoderException ignored) { undecodedChunk.readerIndex(readerIndex); return null; } String[] contents = splitMultipartHeader(newline); if (HttpHeaderNames.CONTENT_DISPOSITION.contentEqualsIgnoreCase(contents[0])) { boolean checkSecondArg; if (currentStatus == MultiPartStatus.DISPOSITION) { checkSecondArg = HttpHeaderValues.FORM_DATA.contentEqualsIgnoreCase(contents[1]); } else { checkSecondArg = HttpHeaderValues.ATTACHMENT.contentEqualsIgnoreCase(contents[1]) || HttpHeaderValues.FILE.contentEqualsIgnoreCase(contents[1]); } if (checkSecondArg) { // read next values and store them in the map as Attribute for (int i = 2; i < contents.length; i++) { String[] values = contents[i].split("=", 2); Attribute attribute; try { attribute = getContentDispositionAttribute(values); } catch (NullPointerException e) { throw new ErrorDataDecoderException(e); } catch (IllegalArgumentException e) { throw new ErrorDataDecoderException(e); } currentFieldAttributes.put(attribute.getName(), attribute); } } } else if (HttpHeaderNames.CONTENT_TRANSFER_ENCODING.contentEqualsIgnoreCase(contents[0])) { Attribute attribute; try { attribute = factory.createAttribute(request, HttpHeaderNames.CONTENT_TRANSFER_ENCODING.toString(), cleanString(contents[1])); } catch (NullPointerException e) { throw new ErrorDataDecoderException(e); } catch (IllegalArgumentException e) { throw new ErrorDataDecoderException(e); } currentFieldAttributes.put(HttpHeaderNames.CONTENT_TRANSFER_ENCODING, attribute); } else if (HttpHeaderNames.CONTENT_LENGTH.contentEqualsIgnoreCase(contents[0])) { Attribute attribute; try { attribute = factory.createAttribute(request, HttpHeaderNames.CONTENT_LENGTH.toString(), cleanString(contents[1])); } catch (NullPointerException e) { throw new ErrorDataDecoderException(e); } catch (IllegalArgumentException e) { throw new ErrorDataDecoderException(e); } currentFieldAttributes.put(HttpHeaderNames.CONTENT_LENGTH, attribute); } else if (HttpHeaderNames.CONTENT_TYPE.contentEqualsIgnoreCase(contents[0])) { // Take care of possible "multipart/mixed" if (HttpHeaderValues.MULTIPART_MIXED.contentEqualsIgnoreCase(contents[1])) { if (currentStatus == MultiPartStatus.DISPOSITION) { String values = StringUtil.substringAfter(contents[2], '='); multipartMixedBoundary = "--" + values; currentStatus = MultiPartStatus.MIXEDDELIMITER; return decodeMultipart(MultiPartStatus.MIXEDDELIMITER); } else { throw new ErrorDataDecoderException("Mixed Multipart found in a previous Mixed Multipart"); } } else { for (int i = 1; i < contents.length; i++) { final String charsetHeader = HttpHeaderValues.CHARSET.toString(); if (contents[i].regionMatches(true, 0, charsetHeader, 0, charsetHeader.length())) { String values = StringUtil.substringAfter(contents[i], '='); Attribute attribute; try { attribute = factory.createAttribute(request, charsetHeader, cleanString(values)); } catch (NullPointerException e) { throw new ErrorDataDecoderException(e); } catch (IllegalArgumentException e) { throw new ErrorDataDecoderException(e); } currentFieldAttributes.put(HttpHeaderValues.CHARSET, attribute); } else { Attribute attribute; try { attribute = factory.createAttribute(request, cleanString(contents[0]), contents[i]); } catch (NullPointerException e) { throw new ErrorDataDecoderException(e); } catch (IllegalArgumentException e) { throw new ErrorDataDecoderException(e); } currentFieldAttributes.put(attribute.getName(), attribute); } } } } else { throw new ErrorDataDecoderException("Unknown Params: " + newline); } } // Is it a FileUpload Attribute filenameAttribute = currentFieldAttributes.get(HttpHeaderValues.FILENAME); if (currentStatus == MultiPartStatus.DISPOSITION) { if (filenameAttribute != null) { // FileUpload currentStatus = MultiPartStatus.FILEUPLOAD; // do not change the buffer position return decodeMultipart(MultiPartStatus.FILEUPLOAD); } else { // Field currentStatus = MultiPartStatus.FIELD; // do not change the buffer position return decodeMultipart(MultiPartStatus.FIELD); } } else { if (filenameAttribute != null) { // FileUpload currentStatus = MultiPartStatus.MIXEDFILEUPLOAD; // do not change the buffer position return decodeMultipart(MultiPartStatus.MIXEDFILEUPLOAD); } else { // Field is not supported in MIXED mode throw new ErrorDataDecoderException("Filename not found"); } } } private static final String FILENAME_ENCODED = HttpHeaderValues.FILENAME.toString() + '*'; private Attribute getContentDispositionAttribute(String... values) { String name = cleanString(values[0]); String value = values[1]; // Filename can be token, quoted or encoded. See // https://tools.ietf.org/html/rfc5987 if (HttpHeaderValues.FILENAME.contentEquals(name)) { // Value is quoted or token. Strip if quoted: int last = value.length() - 1; if (last > 0 && value.charAt(0) == HttpConstants.DOUBLE_QUOTE && value.charAt(last) == HttpConstants.DOUBLE_QUOTE) { value = value.substring(1, last); } } else if (FILENAME_ENCODED.equals(name)) { try { name = HttpHeaderValues.FILENAME.toString(); String[] split = value.split("'", 3); value = QueryStringDecoder.decodeComponent(split[2], Charset.forName(split[0])); } catch (ArrayIndexOutOfBoundsException e) { throw new ErrorDataDecoderException(e); } catch (UnsupportedCharsetException e) { throw new ErrorDataDecoderException(e); } } else { // otherwise we need to clean the value value = cleanString(value); } return factory.createAttribute(request, name, value); } /** * Get the FileUpload (new one or current one) * * @param delimiter the delimiter to use * @return the InterfaceHttpData if any * @throws ErrorDataDecoderException */ protected InterfaceHttpData getFileUpload(String delimiter) { // eventually restart from existing FileUpload // Now get value according to Content-Type and Charset Attribute encoding = currentFieldAttributes.get(HttpHeaderNames.CONTENT_TRANSFER_ENCODING); Charset localCharset = charset; // Default TransferEncodingMechanism mechanism = TransferEncodingMechanism.BIT7; if (encoding != null) { String code; try { code = encoding.getValue().toLowerCase(); } catch (IOException e) { throw new ErrorDataDecoderException(e); } if (code.equals(HttpPostBodyUtil.TransferEncodingMechanism.BIT7.value())) { localCharset = CharsetUtil.US_ASCII; } else if (code.equals(HttpPostBodyUtil.TransferEncodingMechanism.BIT8.value())) { localCharset = CharsetUtil.ISO_8859_1; mechanism = TransferEncodingMechanism.BIT8; } else if (code.equals(HttpPostBodyUtil.TransferEncodingMechanism.BINARY.value())) { // no real charset, so let the default mechanism = TransferEncodingMechanism.BINARY; } else { throw new ErrorDataDecoderException("TransferEncoding Unknown: " + code); } } Attribute charsetAttribute = currentFieldAttributes.get(HttpHeaderValues.CHARSET); if (charsetAttribute != null) { try { localCharset = Charset.forName(charsetAttribute.getValue()); } catch (IOException e) { throw new ErrorDataDecoderException(e); } catch (UnsupportedCharsetException e) { throw new ErrorDataDecoderException(e); } } if (currentFileUpload == null) { Attribute filenameAttribute = currentFieldAttributes.get(HttpHeaderValues.FILENAME); Attribute nameAttribute = currentFieldAttributes.get(HttpHeaderValues.NAME); Attribute contentTypeAttribute = currentFieldAttributes.get(HttpHeaderNames.CONTENT_TYPE); Attribute lengthAttribute = currentFieldAttributes.get(HttpHeaderNames.CONTENT_LENGTH); long size; try { size = lengthAttribute != null ? Long.parseLong(lengthAttribute.getValue()) : 0L; } catch (IOException e) { throw new ErrorDataDecoderException(e); } catch (NumberFormatException ignored) { size = 0; } try { String contentType; if (contentTypeAttribute != null) { contentType = contentTypeAttribute.getValue(); } else { contentType = HttpPostBodyUtil.DEFAULT_BINARY_CONTENT_TYPE; } currentFileUpload = factory.createFileUpload(request, cleanString(nameAttribute.getValue()), cleanString(filenameAttribute.getValue()), contentType, mechanism.value(), localCharset, size); } catch (NullPointerException e) { throw new ErrorDataDecoderException(e); } catch (IllegalArgumentException e) { throw new ErrorDataDecoderException(e); } catch (IOException e) { throw new ErrorDataDecoderException(e); } } // load data as much as possible if (!loadDataMultipart(undecodedChunk, delimiter, currentFileUpload)) { // Delimiter is not found. Need more chunks. return null; } if (currentFileUpload.isCompleted()) { // ready to load the next one if (currentStatus == MultiPartStatus.FILEUPLOAD) { currentStatus = MultiPartStatus.HEADERDELIMITER; currentFieldAttributes = null; } else { currentStatus = MultiPartStatus.MIXEDDELIMITER; cleanMixedAttributes(); } FileUpload fileUpload = currentFileUpload; currentFileUpload = null; return fileUpload; } // do not change the buffer position // since some can be already saved into FileUpload // So do not change the currentStatus return null; } /** * Destroy the {@link HttpPostMultipartRequestDecoder} and release all it * resources. After this method was called it is not possible to operate on it * anymore. */ @Override public void destroy() { checkDestroyed(); cleanFiles(); destroyed = true; if (undecodedChunk != null && undecodedChunk.refCnt() > 0) { undecodedChunk.release(); undecodedChunk = null; } // release all data which was not yet pulled for (int i = bodyListHttpDataRank; i < bodyListHttpData.size(); i++) { InterfaceHttpData data = bodyListHttpData.get(i); if (data.refCnt() > 0) data.release(); } } /** * Clean all HttpDatas (on Disk) for the current request. */ @Override public void cleanFiles() { checkDestroyed(); factory.cleanRequestHttpData(request); } /** * Remove the given FileUpload from the list of FileUploads to clean */ @Override public void removeHttpDataFromClean(InterfaceHttpData data) { checkDestroyed(); factory.removeHttpDataFromClean(request, data); } /** * Remove all Attributes that should be cleaned between two FileUpload in Mixed * mode */ private void cleanMixedAttributes() { currentFieldAttributes.remove(HttpHeaderValues.CHARSET); currentFieldAttributes.remove(HttpHeaderNames.CONTENT_LENGTH); currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TRANSFER_ENCODING); currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TYPE); currentFieldAttributes.remove(HttpHeaderValues.FILENAME); } /** * Read one line up to the CRLF or LF * * @return the String from one line * @throws NotEnoughDataDecoderException Need more chunks and reset the * {@code readerIndex} to the previous * value */ private static String readLineStandard(ByteBuf undecodedChunk, Charset charset) { int readerIndex = undecodedChunk.readerIndex(); try { ByteBuf line = buffer(64); while (undecodedChunk.isReadable()) { byte nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.CR) { // check but do not changed readerIndex nextByte = undecodedChunk.getByte(undecodedChunk.readerIndex()); if (nextByte == HttpConstants.LF) { // force read undecodedChunk.readByte(); return line.toString(charset); } else { // Write CR (not followed by LF) line.writeByte(HttpConstants.CR); } } else if (nextByte == HttpConstants.LF) { return line.toString(charset); } else { line.writeByte(nextByte); } } } catch (IndexOutOfBoundsException e) { undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(e); } undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } /** * Read one line up to the CRLF or LF * * @return the String from one line * @throws NotEnoughDataDecoderException Need more chunks and reset the * {@code readerIndex} to the previous * value */ private static String readLine(ByteBuf undecodedChunk, Charset charset) { if (!undecodedChunk.hasArray()) { return readLineStandard(undecodedChunk, charset); } SeekAheadOptimize sao = new SeekAheadOptimize(undecodedChunk); int readerIndex = undecodedChunk.readerIndex(); try { ByteBuf line = buffer(64); while (sao.pos < sao.limit) { byte nextByte = sao.bytes[sao.pos++]; if (nextByte == HttpConstants.CR) { if (sao.pos < sao.limit) { nextByte = sao.bytes[sao.pos++]; if (nextByte == HttpConstants.LF) { sao.setReadPosition(0); return line.toString(charset); } else { // Write CR (not followed by LF) sao.pos--; line.writeByte(HttpConstants.CR); } } else { line.writeByte(nextByte); } } else if (nextByte == HttpConstants.LF) { sao.setReadPosition(0); return line.toString(charset); } else { line.writeByte(nextByte); } } } catch (IndexOutOfBoundsException e) { undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(e); } undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } /** * Read one line up to --delimiter or --delimiter-- and if existing the CRLF or * LF Read one line up to --delimiter or --delimiter-- and if existing the CRLF * or LF. Note that CRLF or LF are mandatory for opening delimiter (--delimiter) * but not for closing delimiter (--delimiter--) since some clients does not * include CRLF in this case. * * @param delimiter of the form --string, such that '--' is already included * @return the String from one line as the delimiter searched (opening or * closing) * @throws NotEnoughDataDecoderException Need more chunks and reset the * {@code readerIndex} to the previous * value */ private static String readDelimiterStandard(ByteBuf undecodedChunk, String delimiter) { int readerIndex = undecodedChunk.readerIndex(); try { StringBuilder sb = new StringBuilder(64); int delimiterPos = 0; int len = delimiter.length(); while (undecodedChunk.isReadable() && delimiterPos < len) { byte nextByte = undecodedChunk.readByte(); if (nextByte == delimiter.charAt(delimiterPos)) { delimiterPos++; sb.append((char) nextByte); } else { // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } // Now check if either opening delimiter or closing delimiter if (undecodedChunk.isReadable()) { byte nextByte = undecodedChunk.readByte(); // first check for opening delimiter if (nextByte == HttpConstants.CR) { nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.LF) { return sb.toString(); } else { // error since CR must be followed by LF // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } else if (nextByte == HttpConstants.LF) { return sb.toString(); } else if (nextByte == '-') { sb.append('-'); // second check for closing delimiter nextByte = undecodedChunk.readByte(); if (nextByte == '-') { sb.append('-'); // now try to find if CRLF or LF there if (undecodedChunk.isReadable()) { nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.CR) { nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.LF) { return sb.toString(); } else { // error CR without LF // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } else if (nextByte == HttpConstants.LF) { return sb.toString(); } else { // No CRLF but ok however (Adobe Flash uploader) // minus 1 since we read one char ahead but // should not undecodedChunk.readerIndex(undecodedChunk.readerIndex() - 1); return sb.toString(); } } // FIXME what do we do here? // either considering it is fine, either waiting for // more data to come? // lets try considering it is fine... return sb.toString(); } // only one '-' => not enough // whatever now => error since incomplete } } } catch (IndexOutOfBoundsException e) { undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(e); } undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } /** * Read one line up to --delimiter or --delimiter-- and if existing the CRLF or * LF. Note that CRLF or LF are mandatory for opening delimiter (--delimiter) * but not for closing delimiter (--delimiter--) since some clients does not * include CRLF in this case. * * @param delimiter of the form --string, such that '--' is already included * @return the String from one line as the delimiter searched (opening or * closing) * @throws NotEnoughDataDecoderException Need more chunks and reset the * readerInder to the previous value */ private static String readDelimiter(ByteBuf undecodedChunk, String delimiter) { if (!undecodedChunk.hasArray()) { return readDelimiterStandard(undecodedChunk, delimiter); } SeekAheadOptimize sao = new SeekAheadOptimize(undecodedChunk); int readerIndex = undecodedChunk.readerIndex(); int delimiterPos = 0; int len = delimiter.length(); try { StringBuilder sb = new StringBuilder(64); // check conformity with delimiter while (sao.pos < sao.limit && delimiterPos < len) { byte nextByte = sao.bytes[sao.pos++]; if (nextByte == delimiter.charAt(delimiterPos)) { delimiterPos++; sb.append((char) nextByte); } else { // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } // Now check if either opening delimiter or closing delimiter if (sao.pos < sao.limit) { byte nextByte = sao.bytes[sao.pos++]; if (nextByte == HttpConstants.CR) { // first check for opening delimiter if (sao.pos < sao.limit) { nextByte = sao.bytes[sao.pos++]; if (nextByte == HttpConstants.LF) { sao.setReadPosition(0); return sb.toString(); } else { // error CR without LF // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } else { // error since CR must be followed by LF // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } else if (nextByte == HttpConstants.LF) { // same first check for opening delimiter where LF used with // no CR sao.setReadPosition(0); return sb.toString(); } else if (nextByte == '-') { sb.append('-'); // second check for closing delimiter if (sao.pos < sao.limit) { nextByte = sao.bytes[sao.pos++]; if (nextByte == '-') { sb.append('-'); // now try to find if CRLF or LF there if (sao.pos < sao.limit) { nextByte = sao.bytes[sao.pos++]; if (nextByte == HttpConstants.CR) { if (sao.pos < sao.limit) { nextByte = sao.bytes[sao.pos++]; if (nextByte == HttpConstants.LF) { sao.setReadPosition(0); return sb.toString(); } else { // error CR without LF // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } else { // error CR without LF // delimiter not found so break here ! undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } } else if (nextByte == HttpConstants.LF) { sao.setReadPosition(0); return sb.toString(); } else { // No CRLF but ok however (Adobe Flash // uploader) // minus 1 since we read one char ahead but // should not sao.setReadPosition(1); return sb.toString(); } } // FIXME what do we do here? // either considering it is fine, either waiting for // more data to come? // lets try considering it is fine... sao.setReadPosition(0); return sb.toString(); } // whatever now => error since incomplete // only one '-' => not enough or whatever not enough // element } } } } catch (IndexOutOfBoundsException e) { undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(e); } undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); } /** * Load the field value or file data from a Multipart request * * @return {@code true} if the last chunk is loaded (boundary delimiter found), * {@code false} if need more chunks * @throws ErrorDataDecoderException */ private static boolean loadDataMultipartStandard(ByteBuf undecodedChunk, String delimiter, HttpData httpData) { final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; int lastPosition = startReaderIndex; byte prevByte = HttpConstants.LF; boolean delimiterFound = false; while (undecodedChunk.isReadable()) { final byte nextByte = undecodedChunk.readByte(); // Check the delimiter if (prevByte == HttpConstants.LF && nextByte == delimiter.codePointAt(index)) { index++; if (delimeterLength == index) { delimiterFound = true; break; } continue; } lastPosition = undecodedChunk.readerIndex(); if (nextByte == HttpConstants.LF) { index = 0; lastPosition -= (prevByte == HttpConstants.CR) ? 2 : 1; } prevByte = nextByte; } if (prevByte == HttpConstants.CR) { lastPosition--; } ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e); } undecodedChunk.readerIndex(lastPosition); return delimiterFound; } /** * Load the field value from a Multipart request * * @return {@code true} if the last chunk is loaded (boundary delimiter found), * {@code false} if need more chunks * @throws ErrorDataDecoderException */ private static boolean loadDataMultipart(ByteBuf undecodedChunk, String delimiter, HttpData httpData) { if (!undecodedChunk.hasArray()) { return loadDataMultipartStandard(undecodedChunk, delimiter, httpData); } final SeekAheadOptimize sao = new SeekAheadOptimize(undecodedChunk); final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; int lastRealPos = sao.pos; byte prevByte = HttpConstants.LF; boolean delimiterFound = false; while (sao.pos < sao.limit) { final byte nextByte = sao.bytes[sao.pos++]; // Check the delimiter if (prevByte == HttpConstants.LF && nextByte == delimiter.codePointAt(index)) { index++; if (delimeterLength == index) { delimiterFound = true; break; } continue; } lastRealPos = sao.pos; if (nextByte == HttpConstants.LF) { index = 0; lastRealPos -= (prevByte == HttpConstants.CR) ? 2 : 1; } prevByte = nextByte; } if (prevByte == HttpConstants.CR) { lastRealPos--; } final int lastPosition = sao.getReadPosition(lastRealPos); final ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e); } undecodedChunk.readerIndex(lastPosition); return delimiterFound; } /** * Clean the String from any unallowed character * * @return the cleaned String */ private static String cleanString(String field) { int size = field.length(); StringBuilder sb = new StringBuilder(size); for (int i = 0; i < size; i++) { char nextChar = field.charAt(i); switch (nextChar) { case HttpConstants.COLON: case HttpConstants.COMMA: case HttpConstants.EQUALS: case HttpConstants.SEMICOLON: case HttpConstants.HT: sb.append(HttpConstants.SP_CHAR); break; case HttpConstants.DOUBLE_QUOTE: // nothing added, just removes it break; default: sb.append(nextChar); break; } } return sb.toString().trim(); } /** * Skip one empty line * * @return True if one empty line was skipped */ private boolean skipOneLine() { if (!undecodedChunk.isReadable()) { return false; } byte nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.CR) { if (!undecodedChunk.isReadable()) { undecodedChunk.readerIndex(undecodedChunk.readerIndex() - 1); return false; } nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.LF) { return true; } undecodedChunk.readerIndex(undecodedChunk.readerIndex() - 2); return false; } if (nextByte == HttpConstants.LF) { return true; } undecodedChunk.readerIndex(undecodedChunk.readerIndex() - 1); return false; } /** * Split one header in Multipart * * @return an array of String where rank 0 is the name of the header, follows by * several values that were separated by ';' or ',' */ private static String[] splitMultipartHeader(String sb) { ArrayList<String> headers = new ArrayList<String>(1); int nameStart; int nameEnd; int colonEnd; int valueStart; int valueEnd; nameStart = HttpPostBodyUtil.findNonWhitespace(sb, 0); for (nameEnd = nameStart; nameEnd < sb.length(); nameEnd++) { char ch = sb.charAt(nameEnd); if (ch == ':' || Character.isWhitespace(ch)) { break; } } for (colonEnd = nameEnd; colonEnd < sb.length(); colonEnd++) { if (sb.charAt(colonEnd) == ':') { colonEnd++; break; } } valueStart = HttpPostBodyUtil.findNonWhitespace(sb, colonEnd); valueEnd = HttpPostBodyUtil.findEndOfString(sb); headers.add(sb.substring(nameStart, nameEnd)); String svalue = (valueStart >= valueEnd) ? StringUtil.EMPTY_STRING : sb.substring(valueStart, valueEnd); String[] values; if (svalue.indexOf(';') >= 0) { values = splitMultipartHeaderValues(svalue); } else { values = svalue.split(","); } for (String value : values) { headers.add(value.trim()); } String[] array = new String[headers.size()]; for (int i = 0; i < headers.size(); i++) { array[i] = headers.get(i); } return array; } /** * Split one header value in Multipart * * @return an array of String where values that were separated by ';' or ',' */ private static String[] splitMultipartHeaderValues(String svalue) { List<String> values = InternalThreadLocalMap.get().arrayList(1); boolean inQuote = false; boolean escapeNext = false; int start = 0; for (int i = 0; i < svalue.length(); i++) { char c = svalue.charAt(i); if (inQuote) { if (escapeNext) { escapeNext = false; } else { if (c == '\\') { escapeNext = true; } else if (c == '"') { inQuote = false; } } } else { if (c == '"') { inQuote = true; } else if (c == ';') { values.add(svalue.substring(start, i)); start = i + 1; } } } values.add(svalue.substring(start)); return values.toArray(new String[0]); } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty/ext/HttpPostRequestDecoder.java
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.netty.ext; import java.nio.charset.Charset; import java.util.List; import io.netty.handler.codec.DecoderException; import io.netty.handler.codec.http.HttpConstants; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaderValues; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.multipart.DefaultHttpDataFactory; import io.netty.handler.codec.http.multipart.HttpDataFactory; import io.netty.handler.codec.http.multipart.HttpPostStandardRequestDecoder; import io.netty.handler.codec.http.multipart.InterfaceHttpData; import io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoder; import io.netty.util.internal.StringUtil; /** * This decoder will decode Body and can handle POST BODY. * * You <strong>MUST</strong> call {@link #destroy()} after completion to release all resources. * */ public class HttpPostRequestDecoder implements InterfaceHttpPostRequestDecoder { static final int DEFAULT_DISCARD_THRESHOLD = 10 * 1024 * 1024; private final InterfaceHttpPostRequestDecoder decoder; /** * * @param request * the request to decode * @throws NullPointerException * for request * @throws ErrorDataDecoderException * if the default charset was wrong when decoding or other * errors */ public HttpPostRequestDecoder(HttpRequest request) { this(new DefaultHttpDataFactory(DefaultHttpDataFactory.MINSIZE), request, HttpConstants.DEFAULT_CHARSET); } /** * * @param factory * the factory used to create InterfaceHttpData * @param request * the request to decode * @throws NullPointerException * for request or factory * @throws ErrorDataDecoderException * if the default charset was wrong when decoding or other * errors */ public HttpPostRequestDecoder(HttpDataFactory factory, HttpRequest request) { this(factory, request, HttpConstants.DEFAULT_CHARSET); } /** * * @param factory * the factory used to create InterfaceHttpData * @param request * the request to decode * @param charset * the charset to use as default * @throws NullPointerException * for request or charset or factory * @throws ErrorDataDecoderException * if the default charset was wrong when decoding or other * errors */ public HttpPostRequestDecoder(HttpDataFactory factory, HttpRequest request, Charset charset) { if (factory == null) { throw new NullPointerException("factory"); } if (request == null) { throw new NullPointerException("request"); } if (charset == null) { throw new NullPointerException("charset"); } // Fill default values if (isMultipart(request)) { decoder = new HttpPostMultipartRequestDecoder(factory, request, charset); } else { decoder = new HttpPostStandardRequestDecoder(factory, request, charset); } } /** * states follow NOTSTARTED PREAMBLE ( (HEADERDELIMITER DISPOSITION (FIELD | * FILEUPLOAD))* (HEADERDELIMITER DISPOSITION MIXEDPREAMBLE (MIXEDDELIMITER * MIXEDDISPOSITION MIXEDFILEUPLOAD)+ MIXEDCLOSEDELIMITER)* CLOSEDELIMITER)+ * EPILOGUE * * First getStatus is: NOSTARTED * * Content-type: multipart/form-data, boundary=AaB03x => PREAMBLE in Header * * --AaB03x => HEADERDELIMITER content-disposition: form-data; name="field1" * => DISPOSITION * * Joe Blow => FIELD --AaB03x => HEADERDELIMITER content-disposition: * form-data; name="pics" => DISPOSITION Content-type: multipart/mixed, * boundary=BbC04y * * --BbC04y => MIXEDDELIMITER Content-disposition: attachment; * filename="file1.txt" => MIXEDDISPOSITION Content-Type: text/plain * * ... contents of file1.txt ... => MIXEDFILEUPLOAD --BbC04y => * MIXEDDELIMITER Content-disposition: file; filename="file2.gif" => * MIXEDDISPOSITION Content-type: image/gif Content-Transfer-Encoding: * binary * * ...contents of file2.gif... => MIXEDFILEUPLOAD --BbC04y-- => * MIXEDCLOSEDELIMITER --AaB03x-- => CLOSEDELIMITER * * Once CLOSEDELIMITER is found, last getStatus is EPILOGUE */ protected enum MultiPartStatus { NOTSTARTED, PREAMBLE, HEADERDELIMITER, DISPOSITION, FIELD, FILEUPLOAD, MIXEDPREAMBLE, MIXEDDELIMITER, MIXEDDISPOSITION, MIXEDFILEUPLOAD, MIXEDCLOSEDELIMITER, CLOSEDELIMITER, PREEPILOGUE, EPILOGUE } /** * Check if the given request is a multipart request * @return True if the request is a Multipart request */ public static boolean isMultipart(HttpRequest request) { if (request.headers().contains(HttpHeaderNames.CONTENT_TYPE)) { return getMultipartDataBoundary(request.headers().get(HttpHeaderNames.CONTENT_TYPE)) != null; } else { return false; } } /** * Check from the request ContentType if this request is a Multipart request. * @return an array of String if multipartDataBoundary exists with the multipartDataBoundary * as first element, charset if any as second (missing if not set), else null */ protected static String[] getMultipartDataBoundary(String contentType) { // Check if Post using "multipart/form-data; boundary=--89421926422648 [; charset=xxx]" String[] headerContentType = splitHeaderContentType(contentType); final String multiPartHeader = HttpHeaderValues.MULTIPART_FORM_DATA.toString(); if (headerContentType[0].regionMatches(true, 0, multiPartHeader, 0 , multiPartHeader.length())) { int mrank; int crank; final String boundaryHeader = HttpHeaderValues.BOUNDARY.toString(); if (headerContentType[1].regionMatches(true, 0, boundaryHeader, 0, boundaryHeader.length())) { mrank = 1; crank = 2; } else if (headerContentType[2].regionMatches(true, 0, boundaryHeader, 0, boundaryHeader.length())) { mrank = 2; crank = 1; } else { return null; } String boundary = StringUtil.substringAfter(headerContentType[mrank], '='); if (boundary == null) { throw new ErrorDataDecoderException("Needs a boundary value"); } if (boundary.charAt(0) == '"') { String bound = boundary.trim(); int index = bound.length() - 1; if (bound.charAt(index) == '"') { boundary = bound.substring(1, index); } } final String charsetHeader = HttpHeaderValues.CHARSET.toString(); if (headerContentType[crank].regionMatches(true, 0, charsetHeader, 0, charsetHeader.length())) { String charset = StringUtil.substringAfter(headerContentType[crank], '='); if (charset != null) { return new String[] {"--" + boundary, charset}; } } return new String[] {"--" + boundary}; } return null; } @Override public boolean isMultipart() { return decoder.isMultipart(); } @Override public void setDiscardThreshold(int discardThreshold) { decoder.setDiscardThreshold(discardThreshold); } @Override public int getDiscardThreshold() { return decoder.getDiscardThreshold(); } @Override public List<InterfaceHttpData> getBodyHttpDatas() { return decoder.getBodyHttpDatas(); } @Override public List<InterfaceHttpData> getBodyHttpDatas(String name) { return decoder.getBodyHttpDatas(name); } @Override public InterfaceHttpData getBodyHttpData(String name) { return decoder.getBodyHttpData(name); } @Override public InterfaceHttpPostRequestDecoder offer(HttpContent content) { return decoder.offer(content); } @Override public boolean hasNext() { return decoder.hasNext(); } @Override public InterfaceHttpData next() { return decoder.next(); } @Override public InterfaceHttpData currentPartialHttpData() { return decoder.currentPartialHttpData(); } @Override public void destroy() { decoder.destroy(); } @Override public void cleanFiles() { decoder.cleanFiles(); } @Override public void removeHttpDataFromClean(InterfaceHttpData data) { decoder.removeHttpDataFromClean(data); } /** * Split the very first line (Content-Type value) in 3 Strings * * @return the array of 3 Strings */ private static String[] splitHeaderContentType(String sb) { int aStart; int aEnd; int bStart; int bEnd; int cStart; int cEnd; aStart = HttpPostBodyUtil.findNonWhitespace(sb, 0); aEnd = sb.indexOf(';'); if (aEnd == -1) { return new String[] { sb, "", "" }; } bStart = HttpPostBodyUtil.findNonWhitespace(sb, aEnd + 1); if (sb.charAt(aEnd - 1) == ' ') { aEnd--; } bEnd = sb.indexOf(';', bStart); if (bEnd == -1) { bEnd = HttpPostBodyUtil.findEndOfString(sb); return new String[] { sb.substring(aStart, aEnd), sb.substring(bStart, bEnd), "" }; } cStart = HttpPostBodyUtil.findNonWhitespace(sb, bEnd + 1); if (sb.charAt(bEnd - 1) == ' ') { bEnd--; } cEnd = HttpPostBodyUtil.findEndOfString(sb); return new String[] { sb.substring(aStart, aEnd), sb.substring(bStart, bEnd), sb.substring(cStart, cEnd) }; } /** * Exception when try reading data from request in chunked format, and not * enough data are available (need more chunks) */ public static class NotEnoughDataDecoderException extends DecoderException { private static final long serialVersionUID = -7846841864603865638L; public NotEnoughDataDecoderException() { } public NotEnoughDataDecoderException(String msg) { super(msg); } public NotEnoughDataDecoderException(Throwable cause) { super(cause); } public NotEnoughDataDecoderException(String msg, Throwable cause) { super(msg, cause); } } /** * Exception when the body is fully decoded, even if there is still data */ public static class EndOfDataDecoderException extends DecoderException { private static final long serialVersionUID = 1336267941020800769L; } /** * Exception when an error occurs while decoding */ public static class ErrorDataDecoderException extends DecoderException { private static final long serialVersionUID = 5020247425493164465L; public ErrorDataDecoderException() { } public ErrorDataDecoderException(String msg) { super(msg); } public ErrorDataDecoderException(Throwable cause) { super(cause); } public ErrorDataDecoderException(String msg, Throwable cause) { super(msg, cause); } } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/netty/ext/package-info.java
/* * Copyright 2017 The OpenAds Project * * The OpenAds Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ /** * @author weiping wang * */ package ai.houyi.dorado.netty.ext;
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/DefaultParameterNameResolver.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import ai.houyi.dorado.rest.annotation.HeaderParam; import ai.houyi.dorado.rest.annotation.PathVariable; import ai.houyi.dorado.rest.annotation.RequestParam; import ai.houyi.dorado.rest.util.StringUtils; /** * 根据方法参数注解获得方法参数名 * * @author wangwp */ public class DefaultParameterNameResolver implements ParameterNameResolver { private ParameterNameResolver parameterNameResolver; public DefaultParameterNameResolver() { this.parameterNameResolver = new LocalVariableTableParameterNameResolver(); } @Override public String[] getParameterNames(Method method) { if (method.getParameterCount() == 0) return new String[] {}; String[] parameterNames = parameterNameResolver.getParameterNames(method); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); Annotation parameterAnnotation = null; for (int i = 0; i < parameterNames.length; i++) { if (parameterAnnotations[i].length == 0) { continue; } parameterAnnotation = parameterAnnotations[i][0]; String parameterNameByAnnotation = getParameterNameByAnnotation(parameterAnnotation); parameterNames[i] = StringUtils.defaultString(parameterNameByAnnotation, parameterNames[i]); } return parameterNames; } private String getParameterNameByAnnotation(Annotation annotation) { Class<?> annotationType = annotation.annotationType(); if (annotationType == RequestParam.class) { return ((RequestParam) annotation).value(); } else if (annotationType == HeaderParam.class) { return ((HeaderParam) annotation).value(); } else if (annotationType == PathVariable.class) { return ((PathVariable) annotation).value(); } return null; } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/Jdk8ParameterNameResolver.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.lang.reflect.Method; import java.lang.reflect.Parameter; /** * * @author wangwp */ public class Jdk8ParameterNameResolver implements ParameterNameResolver { @Override public String[] getParameterNames(Method method) { Parameter[] methodParameters = method.getParameters(); String[] parameterNames = new String[methodParameters.length]; for (int i = 0; i < parameterNames.length; i++) { parameterNames[i] = methodParameters[i].getName(); } return parameterNames; } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/LocalVariableTableParameterNameResolver.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import ai.houyi.dorado.exception.DoradoException; /** * 利用asm从类的局部变量表中获取方法参数名 * * @author wangwp */ public class LocalVariableTableParameterNameResolver implements ParameterNameResolver { @Override public String[] getParameterNames(Method method) { final String methodName = method.getName(); final Class<?>[] parameterTypes = method.getParameterTypes(); final String[] parameterNames = new String[parameterTypes.length]; if (parameterTypes == null || parameterTypes.length == 0) { return null; } boolean isStatic = Modifier.isStatic(method.getModifiers()); final Type[] types = new Type[parameterTypes.length]; final int[] lvtSlotIndex = new int[types.length]; int nextIndex = (isStatic ? 0 : 1); for (int i = 0; i < types.length; i++) { types[i] = Type.getType(parameterTypes[i]); lvtSlotIndex[i] = nextIndex; if (types[i] == Type.LONG_TYPE || types[i] == Type.DOUBLE_TYPE) { nextIndex += 2; } else { nextIndex++; } } try { ClassReader classReader = new ClassReader(method.getDeclaringClass().getName()); classReader.accept(new ClassVisitor(Opcodes.ASM6) { @Override public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { Type[] argumentTypes = Type.getArgumentTypes(descriptor); if (!methodName.equals(name) || !Arrays.equals(argumentTypes, types)) { return super.visitMethod(access, name, descriptor, signature, exceptions); } return new MethodVisitor(Opcodes.ASM6) { @Override public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) { for (int i = 0; i < lvtSlotIndex.length; i++) { if (lvtSlotIndex[i] == index) { parameterNames[i] = name; } } } }; } }, 0); } catch (Exception ex) { String errorMsg = String.format("Get method parameter names error, method: %s", method.getName()); throw new DoradoException(errorMsg, ex); } return parameterNames; } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/MediaType.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.util.Collections; import java.util.Comparator; import java.util.LinkedHashMap; import java.util.Map; import java.util.TreeMap; import ai.houyi.dorado.rest.util.StringUtils; /** * copy from javax.ws.rs.core.MediaType * * @author wangwp */ public class MediaType { private String type; private String subtype; private Map<String, String> parameters; public static final String CHARSET_PARAMETER = "charset"; public static final String MEDIA_TYPE_WILDCARD = "*"; // Common media type constants public final static String WILDCARD = "*/*"; public final static MediaType WILDCARD_TYPE = new MediaType(); /** * A {@code String} constant representing "{@value #APPLICATION_XML}" media * type. */ public final static String APPLICATION_XML = "application/xml"; /** * A {@link MediaType} constant representing "{@value #APPLICATION_XML}" media * type. */ public final static MediaType APPLICATION_XML_TYPE = new MediaType("application", "xml"); /** * A {@code String} constant representing "{@value #APPLICATION_ATOM_XML}" media * type. */ public final static String APPLICATION_ATOM_XML = "application/atom+xml"; /** * A {@link MediaType} constant representing "{@value #APPLICATION_ATOM_XML}" * media type. */ public final static MediaType APPLICATION_ATOM_XML_TYPE = new MediaType("application", "atom+xml"); /** * A {@code String} constant representing "{@value #APPLICATION_XHTML_XML}" * media type. */ public final static String APPLICATION_XHTML_XML = "application/xhtml+xml"; /** * A {@link MediaType} constant representing "{@value #APPLICATION_XHTML_XML}" * media type. */ public final static MediaType APPLICATION_XHTML_XML_TYPE = new MediaType("application", "xhtml+xml"); /** * A {@code String} constant representing "{@value #APPLICATION_SVG_XML}" media * type. */ public final static String APPLICATION_SVG_XML = "application/svg+xml"; /** * A {@link MediaType} constant representing "{@value #APPLICATION_SVG_XML}" * media type. */ public final static MediaType APPLICATION_SVG_XML_TYPE = new MediaType("application", "svg+xml"); /** * A {@code String} constant representing "{@value #APPLICATION_JSON}" media * type. */ public final static String APPLICATION_JSON = "application/json"; /** * A {@link MediaType} constant representing "{@value #APPLICATION_JSON}" media * type. */ public final static MediaType APPLICATION_JSON_TYPE = new MediaType("application", "json"); /** * A {@code String} constant representing * "{@value #APPLICATION_FORM_URLENCODED}" media type. */ public final static String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded"; /** * A {@link MediaType} constant representing * "{@value #APPLICATION_FORM_URLENCODED}" media type. */ public final static MediaType APPLICATION_FORM_URLENCODED_TYPE = new MediaType("application", "x-www-form-urlencoded"); /** * A {@code String} constant representing "{@value #MULTIPART_FORM_DATA}" media * type. */ public final static String MULTIPART_FORM_DATA = "multipart/form-data"; /** * A {@link MediaType} constant representing "{@value #MULTIPART_FORM_DATA}" * media type. */ public final static MediaType MULTIPART_FORM_DATA_TYPE = new MediaType("multipart", "form-data"); /** * A {@code String} constant representing "{@value #APPLICATION_OCTET_STREAM}" * media type. */ public final static String APPLICATION_OCTET_STREAM = "application/octet-stream"; /** * A {@link MediaType} constant representing * "{@value #APPLICATION_OCTET_STREAM}" media type. */ public final static MediaType APPLICATION_OCTET_STREAM_TYPE = new MediaType("application", "octet-stream"); /** * A {@code String} constant representing "{@value #TEXT_PLAIN}" media type. */ public final static String TEXT_PLAIN = "text/plain"; /** * A {@link MediaType} constant representing "{@value #TEXT_PLAIN}" media type. */ public final static MediaType TEXT_PLAIN_TYPE = new MediaType("text", "plain"); /** * A {@code String} constant representing "{@value #TEXT_XML}" media type. */ public final static String TEXT_XML = "text/xml"; /** * A {@link MediaType} constant representing "{@value #TEXT_XML}" media type. */ public final static MediaType TEXT_XML_TYPE = new MediaType("text", "xml"); /** * A {@code String} constant representing "{@value #TEXT_HTML}" media type. */ public final static String TEXT_HTML = "text/html"; /** * A {@link MediaType} constant representing "{@value #TEXT_HTML}" media type. */ public final static MediaType TEXT_HTML_TYPE = new MediaType("text", "html"); public final static String APPLICATION_PROTOBUF = "application/x-protobuf"; public final static MediaType APPLICATION_PROTOBUF_TYPE = new MediaType("application", "x-protobuf"); public static final MediaType TEXT_JAVASCRIPT = new MediaType("text", "javascript"); public static final MediaType TEXT_CSS = new MediaType("text", "css");; private static TreeMap<String, String> createParametersMap(Map<String, String> initialValues) { final TreeMap<String, String> map = new TreeMap<String, String>(new Comparator<String>() { @Override public int compare(String o1, String o2) { return o1.compareToIgnoreCase(o2); } }); if (initialValues != null) { for (Map.Entry<String, String> e : initialValues.entrySet()) { map.put(e.getKey().toLowerCase(), e.getValue()); } } return map; } /** * Creates a new instance of {@code MediaType} with the supplied type, subtype * and parameters. * * @param type * the primary type, {@code null} is equivalent to * {@link #MEDIA_TYPE_WILDCARD}. * @param subtype * the subtype, {@code null} is equivalent to * {@link #MEDIA_TYPE_WILDCARD}. * @param parameters * a map of media type parameters, {@code null} is the same as an * empty map. */ public MediaType(String type, String subtype, Map<String, String> parameters) { this(type, subtype, null, createParametersMap(parameters)); } /** * Creates a new instance of {@code MediaType} with the supplied type and * subtype. * * @param type * the primary type, {@code null} is equivalent to * {@link #MEDIA_TYPE_WILDCARD} * @param subtype * the subtype, {@code null} is equivalent to * {@link #MEDIA_TYPE_WILDCARD} */ public MediaType(String type, String subtype) { this(type, subtype, null, null); } /** * Creates a new instance of {@code MediaType} with the supplied type, subtype * and "{@value #CHARSET_PARAMETER}" parameter. * * @param type * the primary type, {@code null} is equivalent to * {@link #MEDIA_TYPE_WILDCARD} * @param subtype * the subtype, {@code null} is equivalent to * {@link #MEDIA_TYPE_WILDCARD} * @param charset * the "{@value #CHARSET_PARAMETER}" parameter value. If {@code null} * or empty the "{@value #CHARSET_PARAMETER}" parameter will not be * set. */ public MediaType(String type, String subtype, String charset) { this(type, subtype, charset, null); } /** * Creates a new instance of {@code MediaType}, both type and subtype are * wildcards. Consider using the constant {@link #WILDCARD_TYPE} instead. */ public MediaType() { this(MEDIA_TYPE_WILDCARD, MEDIA_TYPE_WILDCARD, null, null); } private MediaType(String type, String subtype, String charset, Map<String, String> parameterMap) { this.type = type == null ? MEDIA_TYPE_WILDCARD : type; this.subtype = subtype == null ? MEDIA_TYPE_WILDCARD : subtype; if (parameterMap == null) { parameterMap = new TreeMap<String, String>(new Comparator<String>() { @Override public int compare(String o1, String o2) { return o1.compareToIgnoreCase(o2); } }); } if (charset != null && !charset.isEmpty()) { parameterMap.put(CHARSET_PARAMETER, charset); } this.parameters = Collections.unmodifiableMap(parameterMap); } /** * Getter for primary type. * * @return value of primary type. */ public String getType() { return this.type; } /** * Checks if the primary type is a wildcard. * * @return true if the primary type is a wildcard. */ public boolean isWildcardType() { return this.getType().equals(MEDIA_TYPE_WILDCARD); } /** * Getter for subtype. * * @return value of subtype. */ public String getSubtype() { return this.subtype; } /** * Checks if the subtype is a wildcard. * * @return true if the subtype is a wildcard. */ public boolean isWildcardSubtype() { return this.getSubtype().equals(MEDIA_TYPE_WILDCARD); } /** * Getter for a read-only parameter map. Keys are case-insensitive. * * @return an immutable map of parameters. */ public Map<String, String> getParameters() { return parameters; } /** * Create a new {@code MediaType} instance with the same type, subtype and * parameters copied from the original instance and the supplied * "{@value #CHARSET_PARAMETER}" parameter. * * @param charset * the "{@value #CHARSET_PARAMETER}" parameter value. If {@code null} * or empty the "{@value #CHARSET_PARAMETER}" parameter will not be * set or updated. * @return copy of the current {@code MediaType} instance with the * "{@value #CHARSET_PARAMETER}" parameter set to the supplied value. * @since 2.0 */ public MediaType withCharset(String charset) { return new MediaType(this.type, this.subtype, charset, createParametersMap(this.parameters)); } /** * Check if this media type is compatible with another media type. E.g. image/* * is compatible with image/jpeg, image/png, etc. Media type parameters are * ignored. The function is commutative. * * @param other * the media type to compare with. * @return true if the types are compatible, false otherwise. */ public boolean isCompatible(MediaType other) { return other != null && // return false if other is null, else (type.equals(MEDIA_TYPE_WILDCARD) || other.type.equals(MEDIA_TYPE_WILDCARD) || // both are wildcard // types, or (type.equalsIgnoreCase(other.type) && (subtype.equals(MEDIA_TYPE_WILDCARD) || other.subtype.equals(MEDIA_TYPE_WILDCARD))) || // same types, wildcard sub-types, or (type.equalsIgnoreCase(other.type) && this.subtype.equalsIgnoreCase(other.subtype))); // same // types // & // sub-types } public static MediaType valueOf(String mediaType) { if (StringUtils.isBlank(mediaType)) { return null; } String[] parts = mediaType.split(";"); String fullType = parts[0].trim(); if (WILDCARD.equals(fullType)) { fullType = "*/*"; } int subIndex = fullType.indexOf('/'); if (subIndex == -1) { throw new IllegalArgumentException("\"" + mediaType + "\" does not contain '/'"); } if (subIndex == fullType.length() - 1) { throw new IllegalArgumentException("\"" + mediaType + "\" does not contain subtype after '/'"); } String type = fullType.substring(0, subIndex); String subtype = fullType.substring(subIndex + 1, fullType.length()); if (MEDIA_TYPE_WILDCARD.equals(type) && !MEDIA_TYPE_WILDCARD.equals(subtype)) { throw new IllegalArgumentException("A wildcard type is legal only in '*/*' (all media types)."); } Map<String, String> parameters = null; if (parts.length > 1) { parameters = new LinkedHashMap<String, String>(parts.length - 1); for (int i = 1; i < parts.length; i++) { String parameter = parts[i]; int eqIndex = parameter.indexOf('='); if (eqIndex != -1) { String attribute = parameter.substring(0, eqIndex); String value = parameter.substring(eqIndex + 1, parameter.length()); parameters.put(attribute, value); } } } return new MediaType(type, subtype, parameters); } @Override public boolean equals(Object obj) { if (!(obj instanceof MediaType)) { return false; } MediaType other = (MediaType) obj; return (this.type.equalsIgnoreCase(other.type) && this.subtype.equalsIgnoreCase(other.subtype)); } @Override public int hashCode() { return (this.type.toLowerCase() + this.subtype.toLowerCase()).hashCode(); } public String toString() { String contentType = String.format("%s/%s", this.type, this.subtype); String charset = this.parameters.get(CHARSET_PARAMETER); if (charset != null) { return String.format("%s; charset=%s", contentType, charset); } return contentType; } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/MessageBodyConverter.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.io.InputStream; import java.lang.reflect.Type; import com.alibaba.fastjson.JSONObject; import com.google.protobuf.Message; import ai.houyi.dorado.exception.DoradoException; import ai.houyi.dorado.rest.util.IOUtils; import ai.houyi.dorado.rest.util.SerializeUtils; import io.netty.util.CharsetUtil; /** * * @author wangwp */ public interface MessageBodyConverter<T> { byte[] writeMessageBody(T t); T readMessageBody(InputStream in, Type clazz); MessageBodyConverter<? extends Object> JSON = new MessageBodyConverter<Object>() { @Override public byte[] writeMessageBody(Object t) { if (t.getClass() == String.class) { return ((String) t).getBytes(CharsetUtil.UTF_8); } else if (t.getClass() == byte[].class) { return (byte[]) t; } return com.alibaba.fastjson.JSON.toJSONBytes(t); } @Override public Object readMessageBody(InputStream in, Type type) { return JSONObject.parseObject(IOUtils.toString(in, CharsetUtil.UTF_8.name()), type); } }; @SuppressWarnings("rawtypes") MessageBodyConverter TEXT_WILDCARD = new MessageBodyConverter<Object>() { @Override public byte[] writeMessageBody(Object t) { return t.toString().getBytes(CharsetUtil.UTF_8); } @Override public Object readMessageBody(InputStream in, Type type) { return IOUtils.toString(in, CharsetUtil.UTF_8.name()); } }; @SuppressWarnings("rawtypes") MessageBodyConverter PROTOBUF = new MessageBodyConverter<Message>() { @Override public byte[] writeMessageBody(Message t) { return t.toByteArray(); } @Override public Message readMessageBody(InputStream in, Type type) { try { return (Message) ObjectSerializer.PROTOBUF.deserialize(in, type); } catch (Throwable ex) { throw new DoradoException(ex); } } }; @SuppressWarnings("rawtypes") MessageBodyConverter DEFAULT = new MessageBodyConverter<Object>() { @Override public byte[] writeMessageBody(Object t) { return SerializeUtils.serialize(t); } @Override public Object readMessageBody(InputStream in, Type type) { return SerializeUtils.deserialize(in, type); } }; }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/MessageBodyConverters.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.util.Map; import java.util.ServiceLoader; import java.util.concurrent.ConcurrentHashMap; import ai.houyi.dorado.rest.annotation.Produce; import ai.houyi.dorado.rest.util.StringUtils; /** * * @author wangwp */ public class MessageBodyConverters { @SuppressWarnings("rawtypes") private static Map<MediaType, MessageBodyConverter> messageBodyConverterHolder = new ConcurrentHashMap<>(); static { messageBodyConverterHolder.put(MediaType.TEXT_HTML_TYPE, MessageBodyConverter.TEXT_WILDCARD); messageBodyConverterHolder.put(MediaType.TEXT_JAVASCRIPT, MessageBodyConverter.TEXT_WILDCARD); messageBodyConverterHolder.put(MediaType.TEXT_CSS, MessageBodyConverter.TEXT_WILDCARD); messageBodyConverterHolder.put(MediaType.TEXT_PLAIN_TYPE, MessageBodyConverter.TEXT_WILDCARD); messageBodyConverterHolder.put(MediaType.APPLICATION_JSON_TYPE, MessageBodyConverter.JSON); messageBodyConverterHolder.put(MediaType.APPLICATION_PROTOBUF_TYPE, MessageBodyConverter.PROTOBUF); messageBodyConverterHolder.put(MediaType.APPLICATION_OCTET_STREAM_TYPE, MessageBodyConverter.DEFAULT); messageBodyConverterHolder.put(MediaType.WILDCARD_TYPE, MessageBodyConverter.DEFAULT); @SuppressWarnings("rawtypes") ServiceLoader<MessageBodyConverter> extMessageBodyConverters = ServiceLoader.load(MessageBodyConverter.class); extMessageBodyConverters.forEach(converter -> { Produce produce = converter.getClass().getAnnotation(Produce.class); if (produce != null && !StringUtils.isBlank(produce.value())) messageBodyConverterHolder.put(MediaType.valueOf(produce.value()), converter); }); } @SuppressWarnings("rawtypes") public static MessageBodyConverter getMessageBodyConverter(MediaType mediaType) { MessageBodyConverter messageBodyConverter = messageBodyConverterHolder.get(mediaType); return messageBodyConverter == null ? MessageBodyConverter.DEFAULT : messageBodyConverter; } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/ObjectSerializer.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Type; import com.alibaba.fastjson.JSONObject; import com.google.protobuf.Message; import ai.houyi.dorado.rest.util.IOUtils; import ai.houyi.dorado.rest.util.ProtobufMessageDescriptors; import ai.houyi.dorado.rest.util.TypeUtils; import io.netty.util.CharsetUtil; /** * * @author wangwp */ public interface ObjectSerializer { byte[] serialize(Object t); Object deserialize(InputStream in, Type type); ObjectSerializer JSON = new ObjectSerializer() { @Override public byte[] serialize(Object t) { return com.alibaba.fastjson.JSON.toJSONString(t).getBytes(CharsetUtil.UTF_8); } @Override public Object deserialize(InputStream in, Type type) { String text = IOUtils.toString(in, CharsetUtil.UTF_8.name()); return JSONObject.parseObject(text, type); } }; ObjectSerializer PROTOBUF = new ObjectSerializer() { @Override public byte[] serialize(Object t) { Message message = (Message) t; return message.toByteArray(); } @SuppressWarnings("rawtypes") @Override public Object deserialize(InputStream in, Type type) { return ProtobufMessageDescriptors.newMessageForType(in, (Class) type); } }; ObjectSerializer DEFAULT = new ObjectSerializer() { @Override public byte[] serialize(Object t) { if(t instanceof byte[]) { return (byte[])t; } if(t instanceof InputStream) { return IOUtils.readBytes((InputStream) t); } if (TypeUtils.isProtobufMessage(t.getClass())) { return ((Message) t).toByteArray(); } return com.alibaba.fastjson.JSON.toJSONBytes(t); } @Override public Object deserialize(InputStream in, Type type) { try { if (TypeUtils.isProtobufMessage(type)) { return ProtobufMessageDescriptors.newMessageForType(in, (Class<?>) type); } return JSONObject.parseObject(in, type); } catch (IOException ex) { // ignore exception } return null; } }; }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/ParameterNameResolver.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.lang.reflect.Method; /** * * @author wangwp */ public interface ParameterNameResolver { String[] getParameterNames(Method method); ParameterNameResolver DEFAULT = new DefaultParameterNameResolver(); ParameterNameResolver JDK8 = new Jdk8ParameterNameResolver(); ParameterNameResolver LOCAL_VARIABLE_TABLE = new LocalVariableTableParameterNameResolver(); }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/ParameterValueResolver.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.io.InputStream; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import ai.houyi.dorado.rest.http.Cookie; import ai.houyi.dorado.rest.http.HttpRequest; import ai.houyi.dorado.rest.http.HttpResponse; import ai.houyi.dorado.rest.util.MediaTypeUtils; import ai.houyi.dorado.rest.util.MethodDescriptor; import ai.houyi.dorado.rest.util.TypeConverter; import ai.houyi.dorado.rest.util.TypeConverters; import ai.houyi.dorado.rest.util.TypeUtils; import ai.houyi.dorado.rest.util.MethodDescriptor.MethodParameter; /** * * @author wangwp */ public interface ParameterValueResolver { Object resolveParameterValue(HttpRequest request, HttpResponse response, MethodDescriptor desc, MethodParameter methodParameter, String pathVariable); @SuppressWarnings("unchecked") ParameterValueResolver REQUEST_PARAM = (req, resp, methodDesc, methodParam, pathVariable) -> TypeConverters .resolveConverter(methodParam.getType()).convert(req.getParameter(methodParam.getName())); @SuppressWarnings("unchecked") ParameterValueResolver HEADER_PARAM = (req, resp, methodDesc, methodParam, pathVariable) -> TypeConverters .resolveConverter(methodParam.getType()).convert(req.getHeader(methodParam.getName())); @SuppressWarnings("unchecked") ParameterValueResolver PATH_PARAM = (req, resp, methodDesc, methodParam, pathVariable) -> TypeConverters .resolveConverter(methodParam.getType()).convert(pathVariable); ParameterValueResolver HTTP_REQUEST = (req, resp, methodDesc, methodParam, pathVariable) -> TypeConverter.DUMMY .convert(req); ParameterValueResolver HTTP_RESPONSE = (req, resp, methodDesc, methodParam, pathVariable) -> TypeConverter.DUMMY .convert(resp); @SuppressWarnings("unchecked") ParameterValueResolver COOKIE_PARAM = (req, resp, methodDesc, methodParam, pathVariable) -> { Cookie[] cookies = req.getCookies(); for (Cookie cookie : cookies) { if (methodParam.getName().equalsIgnoreCase(cookie.name())) { return TypeConverters.resolveConverter(methodParam.getType()).convert(cookie.value()); } } Class<?> parameterType = methodParam.getType(); return parameterType.isPrimitive() ? TypeUtils.primitiveDefault(parameterType) : null; }; @SuppressWarnings({ "rawtypes" }) ParameterValueResolver REQUEST_BODY = (req, resp, methodDesc, methodParam, pathVariable) -> { Class<?> parameterType = methodParam.getType(); InputStream payload = req.getInputStream(); MessageBodyConverter converter = MessageBodyConverters .getMessageBodyConverter(MediaTypeUtils.defaultForType(parameterType, methodDesc.consume())); Type parameterizedType = methodParam.getParameterizedType(); return converter.readMessageBody(payload, parameterizedType); }; ParameterValueResolver ALL = new ParameterValueResolver() { List<ParameterValueResolver> resolverList = new ArrayList<>(); { resolverList.add(REQUEST_PARAM); resolverList.add(PATH_PARAM); resolverList.add(HEADER_PARAM); } @Override public Object resolveParameterValue(HttpRequest request, HttpResponse response, MethodDescriptor desc, MethodParameter methodParameter, String pathVariable) { Class<?> parameterType = methodParameter.getType(); // 如果没有注解指定参数从何处获取的话,默认按照RequestParam->PathVariable->HeaderParam获取,如果全部没有则返回null for (ParameterValueResolver valueResolver : resolverList) { Object parameterValue = valueResolver.resolveParameterValue(request, response, desc, methodParameter, pathVariable); if (parameterValue != null) return parameterValue; } // 如果方法参数是基本类型则必须给定默认值 if (parameterType.isPrimitive()) { return TypeUtils.primitiveDefault(parameterType); } if (TypeUtils.isWrapper(parameterType)) { return null; } // 如果方法只有一个参数且不是基础类型以及wrapper类型的话尝试利用requestBody转换器 if (methodParameter.getMethodParameterCount() == 1) { return REQUEST_BODY.resolveParameterValue(request, response, desc, methodParameter, pathVariable); } // 如果从请求参数、路径参数、请求头部参数都无法获取到且非基本类型的话尝试从请求体中获取 return null; } }; ParameterValueResolver MULTIPARTFILE = (req, resp, methodDesc, methodParam, pathVariable) -> { Class<?> parameterType = methodParam.getType(); if (parameterType.isArray()) { return req.getFiles(); } return req.getFile(); }; }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/ParameterValueResolvers.java
/* * Copyright 2017 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import ai.houyi.dorado.rest.annotation.HeaderParam; import ai.houyi.dorado.rest.annotation.PathVariable; import ai.houyi.dorado.rest.annotation.RequestBody; import ai.houyi.dorado.rest.annotation.RequestParam; import ai.houyi.dorado.rest.http.HttpRequest; import ai.houyi.dorado.rest.http.HttpResponse; import ai.houyi.dorado.rest.http.MultipartFile; /** * * @author wangwp */ public class ParameterValueResolvers { private static Map<Class<?>, ParameterValueResolver> parameterValueResolverHolder = new ConcurrentHashMap<>(); static { parameterValueResolverHolder.put(RequestParam.class, ParameterValueResolver.REQUEST_PARAM); parameterValueResolverHolder.put(HeaderParam.class, ParameterValueResolver.HEADER_PARAM); parameterValueResolverHolder.put(PathVariable.class, ParameterValueResolver.PATH_PARAM); parameterValueResolverHolder.put(HttpRequest.class, ParameterValueResolver.HTTP_REQUEST); parameterValueResolverHolder.put(HttpResponse.class, ParameterValueResolver.HTTP_RESPONSE); parameterValueResolverHolder.put(RequestBody.class, ParameterValueResolver.REQUEST_BODY); parameterValueResolverHolder.put(MultipartFile.class, ParameterValueResolver.MULTIPARTFILE); } public static ParameterValueResolver getParameterValueResolver(Class<?> parameterAnnotationType) { if (parameterAnnotationType == null) { return ParameterValueResolver.ALL; } ParameterValueResolver parameterValueResolver = parameterValueResolverHolder.get(parameterAnnotationType); if (parameterValueResolver == null) { return ParameterValueResolver.ALL; } return parameterValueResolverHolder.get(parameterAnnotationType); } }
0
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado
java-sources/ai/houyi/dorado-core/0.0.51/ai/houyi/dorado/rest/ResourceRegister.java
/* * Copyright 2012 The OpenDSP Project * * The OpenDSP Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package ai.houyi.dorado.rest; /** * @author weiping wang * */ public interface ResourceRegister { void register(); }