All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.iotdb.service.rpc.thrift.TSFetchResultsResp Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.iotdb.service.rpc.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2023-04-20")
public class TSFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSFetchResultsResp");

  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
  private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)2);
  private static final org.apache.thrift.protocol.TField IS_ALIGN_FIELD_DESC = new org.apache.thrift.protocol.TField("isAlign", org.apache.thrift.protocol.TType.BOOL, (short)3);
  private static final org.apache.thrift.protocol.TField QUERY_DATA_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("queryDataSet", org.apache.thrift.protocol.TType.STRUCT, (short)4);
  private static final org.apache.thrift.protocol.TField NON_ALIGN_QUERY_DATA_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("nonAlignQueryDataSet", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField QUERY_RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("queryResult", org.apache.thrift.protocol.TType.LIST, (short)6);
  private static final org.apache.thrift.protocol.TField MORE_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("moreData", org.apache.thrift.protocol.TType.BOOL, (short)7);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSFetchResultsRespStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSFetchResultsRespTupleSchemeFactory();

  public @org.apache.thrift.annotation.Nullable org.apache.iotdb.common.rpc.thrift.TSStatus status; // required
  public boolean hasResultSet; // required
  public boolean isAlign; // required
  public @org.apache.thrift.annotation.Nullable TSQueryDataSet queryDataSet; // optional
  public @org.apache.thrift.annotation.Nullable TSQueryNonAlignDataSet nonAlignQueryDataSet; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List queryResult; // optional
  public boolean moreData; // 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 {
    STATUS((short)1, "status"),
    HAS_RESULT_SET((short)2, "hasResultSet"),
    IS_ALIGN((short)3, "isAlign"),
    QUERY_DATA_SET((short)4, "queryDataSet"),
    NON_ALIGN_QUERY_DATA_SET((short)5, "nonAlignQueryDataSet"),
    QUERY_RESULT((short)6, "queryResult"),
    MORE_DATA((short)7, "moreData");

    private static final java.util.Map byName = new java.util.HashMap();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // STATUS
          return STATUS;
        case 2: // HAS_RESULT_SET
          return HAS_RESULT_SET;
        case 3: // IS_ALIGN
          return IS_ALIGN;
        case 4: // QUERY_DATA_SET
          return QUERY_DATA_SET;
        case 5: // NON_ALIGN_QUERY_DATA_SET
          return NON_ALIGN_QUERY_DATA_SET;
        case 6: // QUERY_RESULT
          return QUERY_RESULT;
        case 7: // MORE_DATA
          return MORE_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 __HASRESULTSET_ISSET_ID = 0;
  private static final int __ISALIGN_ISSET_ID = 1;
  private static final int __MOREDATA_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.QUERY_DATA_SET,_Fields.NON_ALIGN_QUERY_DATA_SET,_Fields.QUERY_RESULT,_Fields.MORE_DATA};
  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.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.iotdb.common.rpc.thrift.TSStatus.class)));
    tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.IS_ALIGN, new org.apache.thrift.meta_data.FieldMetaData("isAlign", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.QUERY_DATA_SET, new org.apache.thrift.meta_data.FieldMetaData("queryDataSet", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSQueryDataSet.class)));
    tmpMap.put(_Fields.NON_ALIGN_QUERY_DATA_SET, new org.apache.thrift.meta_data.FieldMetaData("nonAlignQueryDataSet", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSQueryNonAlignDataSet.class)));
    tmpMap.put(_Fields.QUERY_RESULT, new org.apache.thrift.meta_data.FieldMetaData("queryResult", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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.MORE_DATA, new org.apache.thrift.meta_data.FieldMetaData("moreData", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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(TSFetchResultsResp.class, metaDataMap);
  }

  public TSFetchResultsResp() {
  }

  public TSFetchResultsResp(
    org.apache.iotdb.common.rpc.thrift.TSStatus status,
    boolean hasResultSet,
    boolean isAlign)
  {
    this();
    this.status = status;
    this.hasResultSet = hasResultSet;
    setHasResultSetIsSet(true);
    this.isAlign = isAlign;
    setIsAlignIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public TSFetchResultsResp(TSFetchResultsResp other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetStatus()) {
      this.status = new org.apache.iotdb.common.rpc.thrift.TSStatus(other.status);
    }
    this.hasResultSet = other.hasResultSet;
    this.isAlign = other.isAlign;
    if (other.isSetQueryDataSet()) {
      this.queryDataSet = new TSQueryDataSet(other.queryDataSet);
    }
    if (other.isSetNonAlignQueryDataSet()) {
      this.nonAlignQueryDataSet = new TSQueryNonAlignDataSet(other.nonAlignQueryDataSet);
    }
    if (other.isSetQueryResult()) {
      java.util.List __this__queryResult = new java.util.ArrayList(other.queryResult);
      this.queryResult = __this__queryResult;
    }
    this.moreData = other.moreData;
  }

  public TSFetchResultsResp deepCopy() {
    return new TSFetchResultsResp(this);
  }

  @Override
  public void clear() {
    this.status = null;
    setHasResultSetIsSet(false);
    this.hasResultSet = false;
    setIsAlignIsSet(false);
    this.isAlign = false;
    this.queryDataSet = null;
    this.nonAlignQueryDataSet = null;
    this.queryResult = null;
    setMoreDataIsSet(false);
    this.moreData = false;
  }

  @org.apache.thrift.annotation.Nullable
  public org.apache.iotdb.common.rpc.thrift.TSStatus getStatus() {
    return this.status;
  }

  public TSFetchResultsResp setStatus(@org.apache.thrift.annotation.Nullable org.apache.iotdb.common.rpc.thrift.TSStatus status) {
    this.status = status;
    return this;
  }

  public void unsetStatus() {
    this.status = null;
  }

  /** Returns true if field status is set (has been assigned a value) and false otherwise */
  public boolean isSetStatus() {
    return this.status != null;
  }

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

  public boolean isHasResultSet() {
    return this.hasResultSet;
  }

  public TSFetchResultsResp setHasResultSet(boolean hasResultSet) {
    this.hasResultSet = hasResultSet;
    setHasResultSetIsSet(true);
    return this;
  }

  public void unsetHasResultSet() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID);
  }

  /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */
  public boolean isSetHasResultSet() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID);
  }

  public void setHasResultSetIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value);
  }

  public boolean isIsAlign() {
    return this.isAlign;
  }

  public TSFetchResultsResp setIsAlign(boolean isAlign) {
    this.isAlign = isAlign;
    setIsAlignIsSet(true);
    return this;
  }

  public void unsetIsAlign() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ISALIGN_ISSET_ID);
  }

  /** Returns true if field isAlign is set (has been assigned a value) and false otherwise */
  public boolean isSetIsAlign() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ISALIGN_ISSET_ID);
  }

  public void setIsAlignIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ISALIGN_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public TSQueryDataSet getQueryDataSet() {
    return this.queryDataSet;
  }

  public TSFetchResultsResp setQueryDataSet(@org.apache.thrift.annotation.Nullable TSQueryDataSet queryDataSet) {
    this.queryDataSet = queryDataSet;
    return this;
  }

  public void unsetQueryDataSet() {
    this.queryDataSet = null;
  }

  /** Returns true if field queryDataSet is set (has been assigned a value) and false otherwise */
  public boolean isSetQueryDataSet() {
    return this.queryDataSet != null;
  }

  public void setQueryDataSetIsSet(boolean value) {
    if (!value) {
      this.queryDataSet = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TSQueryNonAlignDataSet getNonAlignQueryDataSet() {
    return this.nonAlignQueryDataSet;
  }

  public TSFetchResultsResp setNonAlignQueryDataSet(@org.apache.thrift.annotation.Nullable TSQueryNonAlignDataSet nonAlignQueryDataSet) {
    this.nonAlignQueryDataSet = nonAlignQueryDataSet;
    return this;
  }

  public void unsetNonAlignQueryDataSet() {
    this.nonAlignQueryDataSet = null;
  }

  /** Returns true if field nonAlignQueryDataSet is set (has been assigned a value) and false otherwise */
  public boolean isSetNonAlignQueryDataSet() {
    return this.nonAlignQueryDataSet != null;
  }

  public void setNonAlignQueryDataSetIsSet(boolean value) {
    if (!value) {
      this.nonAlignQueryDataSet = null;
    }
  }

  public int getQueryResultSize() {
    return (this.queryResult == null) ? 0 : this.queryResult.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator getQueryResultIterator() {
    return (this.queryResult == null) ? null : this.queryResult.iterator();
  }

  public void addToQueryResult(java.nio.ByteBuffer elem) {
    if (this.queryResult == null) {
      this.queryResult = new java.util.ArrayList();
    }
    this.queryResult.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List getQueryResult() {
    return this.queryResult;
  }

  public TSFetchResultsResp setQueryResult(@org.apache.thrift.annotation.Nullable java.util.List queryResult) {
    this.queryResult = queryResult;
    return this;
  }

  public void unsetQueryResult() {
    this.queryResult = null;
  }

  /** Returns true if field queryResult is set (has been assigned a value) and false otherwise */
  public boolean isSetQueryResult() {
    return this.queryResult != null;
  }

  public void setQueryResultIsSet(boolean value) {
    if (!value) {
      this.queryResult = null;
    }
  }

  public boolean isMoreData() {
    return this.moreData;
  }

  public TSFetchResultsResp setMoreData(boolean moreData) {
    this.moreData = moreData;
    setMoreDataIsSet(true);
    return this;
  }

  public void unsetMoreData() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MOREDATA_ISSET_ID);
  }

  /** Returns true if field moreData is set (has been assigned a value) and false otherwise */
  public boolean isSetMoreData() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MOREDATA_ISSET_ID);
  }

  public void setMoreDataIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MOREDATA_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((org.apache.iotdb.common.rpc.thrift.TSStatus)value);
      }
      break;

    case HAS_RESULT_SET:
      if (value == null) {
        unsetHasResultSet();
      } else {
        setHasResultSet((java.lang.Boolean)value);
      }
      break;

    case IS_ALIGN:
      if (value == null) {
        unsetIsAlign();
      } else {
        setIsAlign((java.lang.Boolean)value);
      }
      break;

    case QUERY_DATA_SET:
      if (value == null) {
        unsetQueryDataSet();
      } else {
        setQueryDataSet((TSQueryDataSet)value);
      }
      break;

    case NON_ALIGN_QUERY_DATA_SET:
      if (value == null) {
        unsetNonAlignQueryDataSet();
      } else {
        setNonAlignQueryDataSet((TSQueryNonAlignDataSet)value);
      }
      break;

    case QUERY_RESULT:
      if (value == null) {
        unsetQueryResult();
      } else {
        setQueryResult((java.util.List)value);
      }
      break;

    case MORE_DATA:
      if (value == null) {
        unsetMoreData();
      } else {
        setMoreData((java.lang.Boolean)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case STATUS:
      return getStatus();

    case HAS_RESULT_SET:
      return isHasResultSet();

    case IS_ALIGN:
      return isIsAlign();

    case QUERY_DATA_SET:
      return getQueryDataSet();

    case NON_ALIGN_QUERY_DATA_SET:
      return getNonAlignQueryDataSet();

    case QUERY_RESULT:
      return getQueryResult();

    case MORE_DATA:
      return isMoreData();

    }
    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 STATUS:
      return isSetStatus();
    case HAS_RESULT_SET:
      return isSetHasResultSet();
    case IS_ALIGN:
      return isSetIsAlign();
    case QUERY_DATA_SET:
      return isSetQueryDataSet();
    case NON_ALIGN_QUERY_DATA_SET:
      return isSetNonAlignQueryDataSet();
    case QUERY_RESULT:
      return isSetQueryResult();
    case MORE_DATA:
      return isSetMoreData();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TSFetchResultsResp)
      return this.equals((TSFetchResultsResp)that);
    return false;
  }

  public boolean equals(TSFetchResultsResp that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_hasResultSet = true;
    boolean that_present_hasResultSet = true;
    if (this_present_hasResultSet || that_present_hasResultSet) {
      if (!(this_present_hasResultSet && that_present_hasResultSet))
        return false;
      if (this.hasResultSet != that.hasResultSet)
        return false;
    }

    boolean this_present_isAlign = true;
    boolean that_present_isAlign = true;
    if (this_present_isAlign || that_present_isAlign) {
      if (!(this_present_isAlign && that_present_isAlign))
        return false;
      if (this.isAlign != that.isAlign)
        return false;
    }

    boolean this_present_queryDataSet = true && this.isSetQueryDataSet();
    boolean that_present_queryDataSet = true && that.isSetQueryDataSet();
    if (this_present_queryDataSet || that_present_queryDataSet) {
      if (!(this_present_queryDataSet && that_present_queryDataSet))
        return false;
      if (!this.queryDataSet.equals(that.queryDataSet))
        return false;
    }

    boolean this_present_nonAlignQueryDataSet = true && this.isSetNonAlignQueryDataSet();
    boolean that_present_nonAlignQueryDataSet = true && that.isSetNonAlignQueryDataSet();
    if (this_present_nonAlignQueryDataSet || that_present_nonAlignQueryDataSet) {
      if (!(this_present_nonAlignQueryDataSet && that_present_nonAlignQueryDataSet))
        return false;
      if (!this.nonAlignQueryDataSet.equals(that.nonAlignQueryDataSet))
        return false;
    }

    boolean this_present_queryResult = true && this.isSetQueryResult();
    boolean that_present_queryResult = true && that.isSetQueryResult();
    if (this_present_queryResult || that_present_queryResult) {
      if (!(this_present_queryResult && that_present_queryResult))
        return false;
      if (!this.queryResult.equals(that.queryResult))
        return false;
    }

    boolean this_present_moreData = true && this.isSetMoreData();
    boolean that_present_moreData = true && that.isSetMoreData();
    if (this_present_moreData || that_present_moreData) {
      if (!(this_present_moreData && that_present_moreData))
        return false;
      if (this.moreData != that.moreData)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287);
    if (isSetStatus())
      hashCode = hashCode * 8191 + status.hashCode();

    hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isAlign) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetQueryDataSet()) ? 131071 : 524287);
    if (isSetQueryDataSet())
      hashCode = hashCode * 8191 + queryDataSet.hashCode();

    hashCode = hashCode * 8191 + ((isSetNonAlignQueryDataSet()) ? 131071 : 524287);
    if (isSetNonAlignQueryDataSet())
      hashCode = hashCode * 8191 + nonAlignQueryDataSet.hashCode();

    hashCode = hashCode * 8191 + ((isSetQueryResult()) ? 131071 : 524287);
    if (isSetQueryResult())
      hashCode = hashCode * 8191 + queryResult.hashCode();

    hashCode = hashCode * 8191 + ((isSetMoreData()) ? 131071 : 524287);
    if (isSetMoreData())
      hashCode = hashCode * 8191 + ((moreData) ? 131071 : 524287);

    return hashCode;
  }

  @Override
  public int compareTo(TSFetchResultsResp other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetStatus(), other.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetHasResultSet(), other.isSetHasResultSet());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHasResultSet()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetIsAlign(), other.isSetIsAlign());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIsAlign()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isAlign, other.isAlign);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryDataSet(), other.isSetQueryDataSet());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryDataSet()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryDataSet, other.queryDataSet);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetNonAlignQueryDataSet(), other.isSetNonAlignQueryDataSet());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNonAlignQueryDataSet()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nonAlignQueryDataSet, other.nonAlignQueryDataSet);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryResult(), other.isSetQueryResult());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryResult()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryResult, other.queryResult);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMoreData(), other.isSetMoreData());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMoreData()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.moreData, other.moreData);
      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("TSFetchResultsResp(");
    boolean first = true;

    sb.append("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("hasResultSet:");
    sb.append(this.hasResultSet);
    first = false;
    if (!first) sb.append(", ");
    sb.append("isAlign:");
    sb.append(this.isAlign);
    first = false;
    if (isSetQueryDataSet()) {
      if (!first) sb.append(", ");
      sb.append("queryDataSet:");
      if (this.queryDataSet == null) {
        sb.append("null");
      } else {
        sb.append(this.queryDataSet);
      }
      first = false;
    }
    if (isSetNonAlignQueryDataSet()) {
      if (!first) sb.append(", ");
      sb.append("nonAlignQueryDataSet:");
      if (this.nonAlignQueryDataSet == null) {
        sb.append("null");
      } else {
        sb.append(this.nonAlignQueryDataSet);
      }
      first = false;
    }
    if (isSetQueryResult()) {
      if (!first) sb.append(", ");
      sb.append("queryResult:");
      if (this.queryResult == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.queryResult, sb);
      }
      first = false;
    }
    if (isSetMoreData()) {
      if (!first) sb.append(", ");
      sb.append("moreData:");
      sb.append(this.moreData);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (status == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'hasResultSet' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'isAlign' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
    if (status != null) {
      status.validate();
    }
    if (queryDataSet != null) {
      queryDataSet.validate();
    }
    if (nonAlignQueryDataSet != null) {
      nonAlignQueryDataSet.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 TSFetchResultsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TSFetchResultsRespStandardScheme getScheme() {
      return new TSFetchResultsRespStandardScheme();
    }
  }

  private static class TSFetchResultsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TSFetchResultsResp 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: // STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.status = new org.apache.iotdb.common.rpc.thrift.TSStatus();
              struct.status.read(iprot);
              struct.setStatusIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // HAS_RESULT_SET
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.hasResultSet = iprot.readBool();
              struct.setHasResultSetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // IS_ALIGN
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.isAlign = iprot.readBool();
              struct.setIsAlignIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // QUERY_DATA_SET
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.queryDataSet = new TSQueryDataSet();
              struct.queryDataSet.read(iprot);
              struct.setQueryDataSetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // NON_ALIGN_QUERY_DATA_SET
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.nonAlignQueryDataSet = new TSQueryNonAlignDataSet();
              struct.nonAlignQueryDataSet.read(iprot);
              struct.setNonAlignQueryDataSetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // QUERY_RESULT
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list126 = iprot.readListBegin();
                struct.queryResult = new java.util.ArrayList(_list126.size);
                @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem127;
                for (int _i128 = 0; _i128 < _list126.size; ++_i128)
                {
                  _elem127 = iprot.readBinary();
                  struct.queryResult.add(_elem127);
                }
                iprot.readListEnd();
              }
              struct.setQueryResultIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // MORE_DATA
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.moreData = iprot.readBool();
              struct.setMoreDataIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetHasResultSet()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetIsAlign()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'isAlign' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TSFetchResultsResp struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        struct.status.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC);
      oprot.writeBool(struct.hasResultSet);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_ALIGN_FIELD_DESC);
      oprot.writeBool(struct.isAlign);
      oprot.writeFieldEnd();
      if (struct.queryDataSet != null) {
        if (struct.isSetQueryDataSet()) {
          oprot.writeFieldBegin(QUERY_DATA_SET_FIELD_DESC);
          struct.queryDataSet.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.nonAlignQueryDataSet != null) {
        if (struct.isSetNonAlignQueryDataSet()) {
          oprot.writeFieldBegin(NON_ALIGN_QUERY_DATA_SET_FIELD_DESC);
          struct.nonAlignQueryDataSet.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.queryResult != null) {
        if (struct.isSetQueryResult()) {
          oprot.writeFieldBegin(QUERY_RESULT_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.queryResult.size()));
            for (java.nio.ByteBuffer _iter129 : struct.queryResult)
            {
              oprot.writeBinary(_iter129);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetMoreData()) {
        oprot.writeFieldBegin(MORE_DATA_FIELD_DESC);
        oprot.writeBool(struct.moreData);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TSFetchResultsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TSFetchResultsRespTupleScheme getScheme() {
      return new TSFetchResultsRespTupleScheme();
    }
  }

  private static class TSFetchResultsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TSFetchResultsResp struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.status.write(oprot);
      oprot.writeBool(struct.hasResultSet);
      oprot.writeBool(struct.isAlign);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetQueryDataSet()) {
        optionals.set(0);
      }
      if (struct.isSetNonAlignQueryDataSet()) {
        optionals.set(1);
      }
      if (struct.isSetQueryResult()) {
        optionals.set(2);
      }
      if (struct.isSetMoreData()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetQueryDataSet()) {
        struct.queryDataSet.write(oprot);
      }
      if (struct.isSetNonAlignQueryDataSet()) {
        struct.nonAlignQueryDataSet.write(oprot);
      }
      if (struct.isSetQueryResult()) {
        {
          oprot.writeI32(struct.queryResult.size());
          for (java.nio.ByteBuffer _iter130 : struct.queryResult)
          {
            oprot.writeBinary(_iter130);
          }
        }
      }
      if (struct.isSetMoreData()) {
        oprot.writeBool(struct.moreData);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TSFetchResultsResp struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.status = new org.apache.iotdb.common.rpc.thrift.TSStatus();
      struct.status.read(iprot);
      struct.setStatusIsSet(true);
      struct.hasResultSet = iprot.readBool();
      struct.setHasResultSetIsSet(true);
      struct.isAlign = iprot.readBool();
      struct.setIsAlignIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.queryDataSet = new TSQueryDataSet();
        struct.queryDataSet.read(iprot);
        struct.setQueryDataSetIsSet(true);
      }
      if (incoming.get(1)) {
        struct.nonAlignQueryDataSet = new TSQueryNonAlignDataSet();
        struct.nonAlignQueryDataSet.read(iprot);
        struct.setNonAlignQueryDataSetIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list131 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
          struct.queryResult = new java.util.ArrayList(_list131.size);
          @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem132;
          for (int _i133 = 0; _i133 < _list131.size; ++_i133)
          {
            _elem132 = iprot.readBinary();
            struct.queryResult.add(_elem132);
          }
        }
        struct.setQueryResultIsSet(true);
      }
      if (incoming.get(3)) {
        struct.moreData = iprot.readBool();
        struct.setMoreDataIsSet(true);
      }
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy