Esempio n. 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeI64(struct.startRowOffset);
   {
     oprot.writeI32(struct.rows.size());
     for (TRow _iter126 : struct.rows) {
       _iter126.write(oprot);
     }
   }
   BitSet optionals = new BitSet();
   if (struct.isSetColumns()) {
     optionals.set(0);
   }
   oprot.writeBitSet(optionals, 1);
   if (struct.isSetColumns()) {
     {
       oprot.writeI32(struct.columns.size());
       for (TColumn _iter127 : struct.columns) {
         _iter127.write(oprot);
       }
     }
   }
 }
Esempio n. 2
0
  public boolean equals(TRowSet that) {
    if (that == null) return false;

    boolean this_present_startRowOffset = true;
    boolean that_present_startRowOffset = true;
    if (this_present_startRowOffset || that_present_startRowOffset) {
      if (!(this_present_startRowOffset && that_present_startRowOffset)) return false;
      if (this.startRowOffset != that.startRowOffset) return false;
    }

    boolean this_present_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;
    }

    return true;
  }
Esempio n. 3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC);
      oprot.writeI64(struct.startRowOffset);
      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 _iter124 : struct.rows) {
            _iter124.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.columns != null) {
        if (struct.isSetColumns()) {
          oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
            for (TColumn _iter125 : struct.columns) {
              _iter125.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.binaryColumns != null) {
        if (struct.isSetBinaryColumns()) {
          oprot.writeFieldBegin(BINARY_COLUMNS_FIELD_DESC);
          oprot.writeBinary(struct.binaryColumns);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetColumnCount()) {
        oprot.writeFieldBegin(COLUMN_COUNT_FIELD_DESC);
        oprot.writeI32(struct.columnCount);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Esempio n. 4
0
 /** Performs a deep copy on <i>other</i>. */
 public TRowSet(TRowSet other) {
   __isset_bitfield = other.__isset_bitfield;
   this.startRowOffset = other.startRowOffset;
   if (other.isSetRows()) {
     List<TRow> __this__rows = new 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()) {
     List<TColumn> __this__columns = new ArrayList<TColumn>(other.columns.size());
     for (TColumn other_element : other.columns) {
       __this__columns.add(new TColumn(other_element));
     }
     this.columns = __this__columns;
   }
 }
Esempio n. 5
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.startRowOffset = iprot.readI64();
   struct.setStartRowOffsetIsSet(true);
   {
     org.apache.thrift.protocol.TList _list128 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.rows = new ArrayList<TRow>(_list128.size);
     TRow _elem129;
     for (int _i130 = 0; _i130 < _list128.size; ++_i130) {
       _elem129 = new TRow();
       _elem129.read(iprot);
       struct.rows.add(_elem129);
     }
   }
   struct.setRowsIsSet(true);
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     {
       org.apache.thrift.protocol.TList _list131 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.columns = new ArrayList<TColumn>(_list131.size);
       TColumn _elem132;
       for (int _i133 = 0; _i133 < _list131.size; ++_i133) {
         _elem132 = new TColumn();
         _elem132.read(iprot);
         struct.columns.add(_elem132);
       }
     }
     struct.setColumnsIsSet(true);
   }
   if (incoming.get(1)) {
     struct.binaryColumns = iprot.readBinary();
     struct.setBinaryColumnsIsSet(true);
   }
   if (incoming.get(2)) {
     struct.columnCount = iprot.readI32();
     struct.setColumnCountIsSet(true);
   }
 }
Esempio n. 6
0
  @Override
  public int compareTo(TRowSet other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartRowOffset()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, other.startRowOffset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRows()).compareTo(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 = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumns()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Esempio n. 7
0
 /** Performs a deep copy on <i>other</i>. */
 public TRowSet(TRowSet other) {
   __isset_bitfield = other.__isset_bitfield;
   this.startRowOffset = other.startRowOffset;
   if (other.isSetRows()) {
     List<TRow> __this__rows = new 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()) {
     List<TColumn> __this__columns = new ArrayList<TColumn>(other.columns.size());
     for (TColumn other_element : other.columns) {
       __this__columns.add(new TColumn(other_element));
     }
     this.columns = __this__columns;
   }
   if (other.isSetBinaryColumns()) {
     this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(other.binaryColumns);
   }
   this.columnCount = other.columnCount;
 }
Esempio n. 8
0
 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: // START_ROW_OFFSET
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.startRowOffset = iprot.readI64();
           struct.setStartRowOffsetIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // ROWS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list118 = iprot.readListBegin();
             struct.rows = new ArrayList<TRow>(_list118.size);
             TRow _elem119;
             for (int _i120 = 0; _i120 < _list118.size; ++_i120) {
               _elem119 = new TRow();
               _elem119.read(iprot);
               struct.rows.add(_elem119);
             }
             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 _list121 = iprot.readListBegin();
             struct.columns = new ArrayList<TColumn>(_list121.size);
             TColumn _elem122;
             for (int _i123 = 0; _i123 < _list121.size; ++_i123) {
               _elem122 = new TColumn();
               _elem122.read(iprot);
               struct.columns.add(_elem122);
             }
             iprot.readListEnd();
           }
           struct.setColumnsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // BINARY_COLUMNS
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.binaryColumns = iprot.readBinary();
           struct.setBinaryColumnsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // COLUMN_COUNT
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.columnCount = iprot.readI32();
           struct.setColumnCountIsSet(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();
   struct.validate();
 }