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

org.apache.iotdb.mpp.rpc.thrift.TFetchWindowBatchResp 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.mpp.rpc.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2024-09-12")
public class TFetchWindowBatchResp 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("TFetchWindowBatchResp");

  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 QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField COLUMN_NAME_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("columnNameList", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField COLUMN_TYPE_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("columnTypeList", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField COLUMN_NAME_INDEX_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("columnNameIndexMap", org.apache.thrift.protocol.TType.MAP, (short)5);
  private static final org.apache.thrift.protocol.TField WINDOW_DATASET_FIELD_DESC = new org.apache.thrift.protocol.TField("windowDataset", org.apache.thrift.protocol.TType.LIST, (short)6);
  private static final org.apache.thrift.protocol.TField HAS_MORE_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMoreData", org.apache.thrift.protocol.TType.BOOL, (short)7);

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

  public @org.apache.thrift.annotation.Nullable org.apache.iotdb.common.rpc.thrift.TSStatus status; // required
  public long queryId; // required
  public @org.apache.thrift.annotation.Nullable java.util.List columnNameList; // required
  public @org.apache.thrift.annotation.Nullable java.util.List columnTypeList; // required
  public @org.apache.thrift.annotation.Nullable java.util.Map columnNameIndexMap; // required
  public @org.apache.thrift.annotation.Nullable java.util.List> windowDataset; // required
  public boolean hasMoreData; // 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 {
    STATUS((short)1, "status"),
    QUERY_ID((short)2, "queryId"),
    COLUMN_NAME_LIST((short)3, "columnNameList"),
    COLUMN_TYPE_LIST((short)4, "columnTypeList"),
    COLUMN_NAME_INDEX_MAP((short)5, "columnNameIndexMap"),
    WINDOW_DATASET((short)6, "windowDataset"),
    HAS_MORE_DATA((short)7, "hasMoreData");

    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: // QUERY_ID
          return QUERY_ID;
        case 3: // COLUMN_NAME_LIST
          return COLUMN_NAME_LIST;
        case 4: // COLUMN_TYPE_LIST
          return COLUMN_TYPE_LIST;
        case 5: // COLUMN_NAME_INDEX_MAP
          return COLUMN_NAME_INDEX_MAP;
        case 6: // WINDOW_DATASET
          return WINDOW_DATASET;
        case 7: // HAS_MORE_DATA
          return HAS_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 __QUERYID_ISSET_ID = 0;
  private static final int __HASMOREDATA_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.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.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.COLUMN_NAME_LIST, new org.apache.thrift.meta_data.FieldMetaData("columnNameList", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.COLUMN_TYPE_LIST, new org.apache.thrift.meta_data.FieldMetaData("columnTypeList", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.COLUMN_NAME_INDEX_MAP, new org.apache.thrift.meta_data.FieldMetaData("columnNameIndexMap", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
    tmpMap.put(_Fields.WINDOW_DATASET, new org.apache.thrift.meta_data.FieldMetaData("windowDataset", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            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.HAS_MORE_DATA, new org.apache.thrift.meta_data.FieldMetaData("hasMoreData", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        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(TFetchWindowBatchResp.class, metaDataMap);
  }

  public TFetchWindowBatchResp() {
  }

  public TFetchWindowBatchResp(
    org.apache.iotdb.common.rpc.thrift.TSStatus status,
    long queryId,
    java.util.List columnNameList,
    java.util.List columnTypeList,
    java.util.Map columnNameIndexMap,
    java.util.List> windowDataset,
    boolean hasMoreData)
  {
    this();
    this.status = status;
    this.queryId = queryId;
    setQueryIdIsSet(true);
    this.columnNameList = columnNameList;
    this.columnTypeList = columnTypeList;
    this.columnNameIndexMap = columnNameIndexMap;
    this.windowDataset = windowDataset;
    this.hasMoreData = hasMoreData;
    setHasMoreDataIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public TFetchWindowBatchResp(TFetchWindowBatchResp other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetStatus()) {
      this.status = new org.apache.iotdb.common.rpc.thrift.TSStatus(other.status);
    }
    this.queryId = other.queryId;
    if (other.isSetColumnNameList()) {
      java.util.List __this__columnNameList = new java.util.ArrayList(other.columnNameList);
      this.columnNameList = __this__columnNameList;
    }
    if (other.isSetColumnTypeList()) {
      java.util.List __this__columnTypeList = new java.util.ArrayList(other.columnTypeList);
      this.columnTypeList = __this__columnTypeList;
    }
    if (other.isSetColumnNameIndexMap()) {
      java.util.Map __this__columnNameIndexMap = new java.util.HashMap(other.columnNameIndexMap);
      this.columnNameIndexMap = __this__columnNameIndexMap;
    }
    if (other.isSetWindowDataset()) {
      java.util.List> __this__windowDataset = new java.util.ArrayList>(other.windowDataset.size());
      for (java.util.List other_element : other.windowDataset) {
        java.util.List __this__windowDataset_copy = new java.util.ArrayList(other_element);
        __this__windowDataset.add(__this__windowDataset_copy);
      }
      this.windowDataset = __this__windowDataset;
    }
    this.hasMoreData = other.hasMoreData;
  }

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

  @Override
  public void clear() {
    this.status = null;
    setQueryIdIsSet(false);
    this.queryId = 0;
    this.columnNameList = null;
    this.columnTypeList = null;
    this.columnNameIndexMap = null;
    this.windowDataset = null;
    setHasMoreDataIsSet(false);
    this.hasMoreData = false;
  }

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

  public TFetchWindowBatchResp 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 long getQueryId() {
    return this.queryId;
  }

  public TFetchWindowBatchResp setQueryId(long queryId) {
    this.queryId = queryId;
    setQueryIdIsSet(true);
    return this;
  }

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

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

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

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

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

  public void addToColumnNameList(java.lang.String elem) {
    if (this.columnNameList == null) {
      this.columnNameList = new java.util.ArrayList();
    }
    this.columnNameList.add(elem);
  }

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

  public TFetchWindowBatchResp setColumnNameList(@org.apache.thrift.annotation.Nullable java.util.List columnNameList) {
    this.columnNameList = columnNameList;
    return this;
  }

  public void unsetColumnNameList() {
    this.columnNameList = null;
  }

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

  public void setColumnNameListIsSet(boolean value) {
    if (!value) {
      this.columnNameList = null;
    }
  }

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

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

  public void addToColumnTypeList(java.lang.String elem) {
    if (this.columnTypeList == null) {
      this.columnTypeList = new java.util.ArrayList();
    }
    this.columnTypeList.add(elem);
  }

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

  public TFetchWindowBatchResp setColumnTypeList(@org.apache.thrift.annotation.Nullable java.util.List columnTypeList) {
    this.columnTypeList = columnTypeList;
    return this;
  }

  public void unsetColumnTypeList() {
    this.columnTypeList = null;
  }

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

  public void setColumnTypeListIsSet(boolean value) {
    if (!value) {
      this.columnTypeList = null;
    }
  }

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

  public void putToColumnNameIndexMap(java.lang.String key, int val) {
    if (this.columnNameIndexMap == null) {
      this.columnNameIndexMap = new java.util.HashMap();
    }
    this.columnNameIndexMap.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map getColumnNameIndexMap() {
    return this.columnNameIndexMap;
  }

  public TFetchWindowBatchResp setColumnNameIndexMap(@org.apache.thrift.annotation.Nullable java.util.Map columnNameIndexMap) {
    this.columnNameIndexMap = columnNameIndexMap;
    return this;
  }

  public void unsetColumnNameIndexMap() {
    this.columnNameIndexMap = null;
  }

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

  public void setColumnNameIndexMapIsSet(boolean value) {
    if (!value) {
      this.columnNameIndexMap = null;
    }
  }

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

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

  public void addToWindowDataset(java.util.List elem) {
    if (this.windowDataset == null) {
      this.windowDataset = new java.util.ArrayList>();
    }
    this.windowDataset.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List> getWindowDataset() {
    return this.windowDataset;
  }

  public TFetchWindowBatchResp setWindowDataset(@org.apache.thrift.annotation.Nullable java.util.List> windowDataset) {
    this.windowDataset = windowDataset;
    return this;
  }

  public void unsetWindowDataset() {
    this.windowDataset = null;
  }

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

  public void setWindowDatasetIsSet(boolean value) {
    if (!value) {
      this.windowDataset = null;
    }
  }

  public boolean isHasMoreData() {
    return this.hasMoreData;
  }

  public TFetchWindowBatchResp setHasMoreData(boolean hasMoreData) {
    this.hasMoreData = hasMoreData;
    setHasMoreDataIsSet(true);
    return this;
  }

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

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

  public void setHasMoreDataIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASMOREDATA_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 QUERY_ID:
      if (value == null) {
        unsetQueryId();
      } else {
        setQueryId((java.lang.Long)value);
      }
      break;

    case COLUMN_NAME_LIST:
      if (value == null) {
        unsetColumnNameList();
      } else {
        setColumnNameList((java.util.List)value);
      }
      break;

    case COLUMN_TYPE_LIST:
      if (value == null) {
        unsetColumnTypeList();
      } else {
        setColumnTypeList((java.util.List)value);
      }
      break;

    case COLUMN_NAME_INDEX_MAP:
      if (value == null) {
        unsetColumnNameIndexMap();
      } else {
        setColumnNameIndexMap((java.util.Map)value);
      }
      break;

    case WINDOW_DATASET:
      if (value == null) {
        unsetWindowDataset();
      } else {
        setWindowDataset((java.util.List>)value);
      }
      break;

    case HAS_MORE_DATA:
      if (value == null) {
        unsetHasMoreData();
      } else {
        setHasMoreData((java.lang.Boolean)value);
      }
      break;

    }
  }

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

    case QUERY_ID:
      return getQueryId();

    case COLUMN_NAME_LIST:
      return getColumnNameList();

    case COLUMN_TYPE_LIST:
      return getColumnTypeList();

    case COLUMN_NAME_INDEX_MAP:
      return getColumnNameIndexMap();

    case WINDOW_DATASET:
      return getWindowDataset();

    case HAS_MORE_DATA:
      return isHasMoreData();

    }
    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 QUERY_ID:
      return isSetQueryId();
    case COLUMN_NAME_LIST:
      return isSetColumnNameList();
    case COLUMN_TYPE_LIST:
      return isSetColumnTypeList();
    case COLUMN_NAME_INDEX_MAP:
      return isSetColumnNameIndexMap();
    case WINDOW_DATASET:
      return isSetWindowDataset();
    case HAS_MORE_DATA:
      return isSetHasMoreData();
    }
    throw new java.lang.IllegalStateException();
  }

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

  public boolean equals(TFetchWindowBatchResp 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_queryId = true;
    boolean that_present_queryId = true;
    if (this_present_queryId || that_present_queryId) {
      if (!(this_present_queryId && that_present_queryId))
        return false;
      if (this.queryId != that.queryId)
        return false;
    }

    boolean this_present_columnNameList = true && this.isSetColumnNameList();
    boolean that_present_columnNameList = true && that.isSetColumnNameList();
    if (this_present_columnNameList || that_present_columnNameList) {
      if (!(this_present_columnNameList && that_present_columnNameList))
        return false;
      if (!this.columnNameList.equals(that.columnNameList))
        return false;
    }

    boolean this_present_columnTypeList = true && this.isSetColumnTypeList();
    boolean that_present_columnTypeList = true && that.isSetColumnTypeList();
    if (this_present_columnTypeList || that_present_columnTypeList) {
      if (!(this_present_columnTypeList && that_present_columnTypeList))
        return false;
      if (!this.columnTypeList.equals(that.columnTypeList))
        return false;
    }

    boolean this_present_columnNameIndexMap = true && this.isSetColumnNameIndexMap();
    boolean that_present_columnNameIndexMap = true && that.isSetColumnNameIndexMap();
    if (this_present_columnNameIndexMap || that_present_columnNameIndexMap) {
      if (!(this_present_columnNameIndexMap && that_present_columnNameIndexMap))
        return false;
      if (!this.columnNameIndexMap.equals(that.columnNameIndexMap))
        return false;
    }

    boolean this_present_windowDataset = true && this.isSetWindowDataset();
    boolean that_present_windowDataset = true && that.isSetWindowDataset();
    if (this_present_windowDataset || that_present_windowDataset) {
      if (!(this_present_windowDataset && that_present_windowDataset))
        return false;
      if (!this.windowDataset.equals(that.windowDataset))
        return false;
    }

    boolean this_present_hasMoreData = true;
    boolean that_present_hasMoreData = true;
    if (this_present_hasMoreData || that_present_hasMoreData) {
      if (!(this_present_hasMoreData && that_present_hasMoreData))
        return false;
      if (this.hasMoreData != that.hasMoreData)
        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 + org.apache.thrift.TBaseHelper.hashCode(queryId);

    hashCode = hashCode * 8191 + ((isSetColumnNameList()) ? 131071 : 524287);
    if (isSetColumnNameList())
      hashCode = hashCode * 8191 + columnNameList.hashCode();

    hashCode = hashCode * 8191 + ((isSetColumnTypeList()) ? 131071 : 524287);
    if (isSetColumnTypeList())
      hashCode = hashCode * 8191 + columnTypeList.hashCode();

    hashCode = hashCode * 8191 + ((isSetColumnNameIndexMap()) ? 131071 : 524287);
    if (isSetColumnNameIndexMap())
      hashCode = hashCode * 8191 + columnNameIndexMap.hashCode();

    hashCode = hashCode * 8191 + ((isSetWindowDataset()) ? 131071 : 524287);
    if (isSetWindowDataset())
      hashCode = hashCode * 8191 + windowDataset.hashCode();

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

    return hashCode;
  }

  @Override
  public int compareTo(TFetchWindowBatchResp 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(isSetQueryId(), other.isSetQueryId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryId, other.queryId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumnNameList(), other.isSetColumnNameList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnNameList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnNameList, other.columnNameList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumnTypeList(), other.isSetColumnTypeList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnTypeList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnTypeList, other.columnTypeList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumnNameIndexMap(), other.isSetColumnNameIndexMap());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnNameIndexMap()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnNameIndexMap, other.columnNameIndexMap);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetWindowDataset(), other.isSetWindowDataset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWindowDataset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.windowDataset, other.windowDataset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetHasMoreData(), other.isSetHasMoreData());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHasMoreData()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMoreData, other.hasMoreData);
      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("TFetchWindowBatchResp(");
    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("queryId:");
    sb.append(this.queryId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("columnNameList:");
    if (this.columnNameList == null) {
      sb.append("null");
    } else {
      sb.append(this.columnNameList);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("columnTypeList:");
    if (this.columnTypeList == null) {
      sb.append("null");
    } else {
      sb.append(this.columnTypeList);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("columnNameIndexMap:");
    if (this.columnNameIndexMap == null) {
      sb.append("null");
    } else {
      sb.append(this.columnNameIndexMap);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("windowDataset:");
    if (this.windowDataset == null) {
      sb.append("null");
    } else {
      sb.append(this.windowDataset);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("hasMoreData:");
    sb.append(this.hasMoreData);
    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 'queryId' because it's a primitive and you chose the non-beans generator.
    if (columnNameList == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnNameList' was not present! Struct: " + toString());
    }
    if (columnTypeList == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnTypeList' was not present! Struct: " + toString());
    }
    if (columnNameIndexMap == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnNameIndexMap' was not present! Struct: " + toString());
    }
    if (windowDataset == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'windowDataset' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'hasMoreData' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
    if (status != null) {
      status.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 TFetchWindowBatchRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TFetchWindowBatchRespStandardScheme getScheme() {
      return new TFetchWindowBatchRespStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchWindowBatchResp 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: // QUERY_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.queryId = iprot.readI64();
              struct.setQueryIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // COLUMN_NAME_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list568 = iprot.readListBegin();
                struct.columnNameList = new java.util.ArrayList(_list568.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem569;
                for (int _i570 = 0; _i570 < _list568.size; ++_i570)
                {
                  _elem569 = iprot.readString();
                  struct.columnNameList.add(_elem569);
                }
                iprot.readListEnd();
              }
              struct.setColumnNameListIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // COLUMN_TYPE_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list571 = iprot.readListBegin();
                struct.columnTypeList = new java.util.ArrayList(_list571.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem572;
                for (int _i573 = 0; _i573 < _list571.size; ++_i573)
                {
                  _elem572 = iprot.readString();
                  struct.columnTypeList.add(_elem572);
                }
                iprot.readListEnd();
              }
              struct.setColumnTypeListIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // COLUMN_NAME_INDEX_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map574 = iprot.readMapBegin();
                struct.columnNameIndexMap = new java.util.HashMap(2*_map574.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key575;
                int _val576;
                for (int _i577 = 0; _i577 < _map574.size; ++_i577)
                {
                  _key575 = iprot.readString();
                  _val576 = iprot.readI32();
                  struct.columnNameIndexMap.put(_key575, _val576);
                }
                iprot.readMapEnd();
              }
              struct.setColumnNameIndexMapIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // WINDOW_DATASET
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list578 = iprot.readListBegin();
                struct.windowDataset = new java.util.ArrayList>(_list578.size);
                @org.apache.thrift.annotation.Nullable java.util.List _elem579;
                for (int _i580 = 0; _i580 < _list578.size; ++_i580)
                {
                  {
                    org.apache.thrift.protocol.TList _list581 = iprot.readListBegin();
                    _elem579 = new java.util.ArrayList(_list581.size);
                    @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem582;
                    for (int _i583 = 0; _i583 < _list581.size; ++_i583)
                    {
                      _elem582 = iprot.readBinary();
                      _elem579.add(_elem582);
                    }
                    iprot.readListEnd();
                  }
                  struct.windowDataset.add(_elem579);
                }
                iprot.readListEnd();
              }
              struct.setWindowDatasetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // HAS_MORE_DATA
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.hasMoreData = iprot.readBool();
              struct.setHasMoreDataIsSet(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.isSetQueryId()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'queryId' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetHasMoreData()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasMoreData' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchWindowBatchResp 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(QUERY_ID_FIELD_DESC);
      oprot.writeI64(struct.queryId);
      oprot.writeFieldEnd();
      if (struct.columnNameList != null) {
        oprot.writeFieldBegin(COLUMN_NAME_LIST_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columnNameList.size()));
          for (java.lang.String _iter584 : struct.columnNameList)
          {
            oprot.writeString(_iter584);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.columnTypeList != null) {
        oprot.writeFieldBegin(COLUMN_TYPE_LIST_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columnTypeList.size()));
          for (java.lang.String _iter585 : struct.columnTypeList)
          {
            oprot.writeString(_iter585);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.columnNameIndexMap != null) {
        oprot.writeFieldBegin(COLUMN_NAME_INDEX_MAP_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.columnNameIndexMap.size()));
          for (java.util.Map.Entry _iter586 : struct.columnNameIndexMap.entrySet())
          {
            oprot.writeString(_iter586.getKey());
            oprot.writeI32(_iter586.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.windowDataset != null) {
        oprot.writeFieldBegin(WINDOW_DATASET_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.windowDataset.size()));
          for (java.util.List _iter587 : struct.windowDataset)
          {
            {
              oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter587.size()));
              for (java.nio.ByteBuffer _iter588 : _iter587)
              {
                oprot.writeBinary(_iter588);
              }
              oprot.writeListEnd();
            }
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(HAS_MORE_DATA_FIELD_DESC);
      oprot.writeBool(struct.hasMoreData);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TFetchWindowBatchResp struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.status.write(oprot);
      oprot.writeI64(struct.queryId);
      {
        oprot.writeI32(struct.columnNameList.size());
        for (java.lang.String _iter589 : struct.columnNameList)
        {
          oprot.writeString(_iter589);
        }
      }
      {
        oprot.writeI32(struct.columnTypeList.size());
        for (java.lang.String _iter590 : struct.columnTypeList)
        {
          oprot.writeString(_iter590);
        }
      }
      {
        oprot.writeI32(struct.columnNameIndexMap.size());
        for (java.util.Map.Entry _iter591 : struct.columnNameIndexMap.entrySet())
        {
          oprot.writeString(_iter591.getKey());
          oprot.writeI32(_iter591.getValue());
        }
      }
      {
        oprot.writeI32(struct.windowDataset.size());
        for (java.util.List _iter592 : struct.windowDataset)
        {
          {
            oprot.writeI32(_iter592.size());
            for (java.nio.ByteBuffer _iter593 : _iter592)
            {
              oprot.writeBinary(_iter593);
            }
          }
        }
      }
      oprot.writeBool(struct.hasMoreData);
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TFetchWindowBatchResp 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.queryId = iprot.readI64();
      struct.setQueryIdIsSet(true);
      {
        org.apache.thrift.protocol.TList _list594 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
        struct.columnNameList = new java.util.ArrayList(_list594.size);
        @org.apache.thrift.annotation.Nullable java.lang.String _elem595;
        for (int _i596 = 0; _i596 < _list594.size; ++_i596)
        {
          _elem595 = iprot.readString();
          struct.columnNameList.add(_elem595);
        }
      }
      struct.setColumnNameListIsSet(true);
      {
        org.apache.thrift.protocol.TList _list597 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
        struct.columnTypeList = new java.util.ArrayList(_list597.size);
        @org.apache.thrift.annotation.Nullable java.lang.String _elem598;
        for (int _i599 = 0; _i599 < _list597.size; ++_i599)
        {
          _elem598 = iprot.readString();
          struct.columnTypeList.add(_elem598);
        }
      }
      struct.setColumnTypeListIsSet(true);
      {
        org.apache.thrift.protocol.TMap _map600 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32); 
        struct.columnNameIndexMap = new java.util.HashMap(2*_map600.size);
        @org.apache.thrift.annotation.Nullable java.lang.String _key601;
        int _val602;
        for (int _i603 = 0; _i603 < _map600.size; ++_i603)
        {
          _key601 = iprot.readString();
          _val602 = iprot.readI32();
          struct.columnNameIndexMap.put(_key601, _val602);
        }
      }
      struct.setColumnNameIndexMapIsSet(true);
      {
        org.apache.thrift.protocol.TList _list604 = iprot.readListBegin(org.apache.thrift.protocol.TType.LIST);
        struct.windowDataset = new java.util.ArrayList>(_list604.size);
        @org.apache.thrift.annotation.Nullable java.util.List _elem605;
        for (int _i606 = 0; _i606 < _list604.size; ++_i606)
        {
          {
            org.apache.thrift.protocol.TList _list607 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            _elem605 = new java.util.ArrayList(_list607.size);
            @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem608;
            for (int _i609 = 0; _i609 < _list607.size; ++_i609)
            {
              _elem608 = iprot.readBinary();
              _elem605.add(_elem608);
            }
          }
          struct.windowDataset.add(_elem605);
        }
      }
      struct.setWindowDatasetIsSet(true);
      struct.hasMoreData = iprot.readBool();
      struct.setHasMoreDataIsSet(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