コード例 #1
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
    public void write(org.apache.thrift.protocol.TProtocol oprot, TGet struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.row != null) {
        oprot.writeFieldBegin(ROW_FIELD_DESC);
        oprot.writeBinary(struct.row);
        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 _iter11 : struct.columns) {
              _iter11.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetTimestamp()) {
        oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
        oprot.writeI64(struct.timestamp);
        oprot.writeFieldEnd();
      }
      if (struct.timeRange != null) {
        if (struct.isSetTimeRange()) {
          oprot.writeFieldBegin(TIME_RANGE_FIELD_DESC);
          struct.timeRange.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetMaxVersions()) {
        oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
        oprot.writeI32(struct.maxVersions);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
コード例 #2
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
 /** Performs a deep copy on <i>other</i>. */
 public TGet(TGet other) {
   __isset_bit_vector.clear();
   __isset_bit_vector.or(other.__isset_bit_vector);
   if (other.isSetRow()) {
     this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
     ;
   }
   if (other.isSetColumns()) {
     List<TColumn> __this__columns = new ArrayList<TColumn>();
     for (TColumn other_element : other.columns) {
       __this__columns.add(new TColumn(other_element));
     }
     this.columns = __this__columns;
   }
   this.timestamp = other.timestamp;
   if (other.isSetTimeRange()) {
     this.timeRange = new TTimeRange(other.timeRange);
   }
   this.maxVersions = other.maxVersions;
 }
コード例 #3
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
  public boolean equals(TGet that) {
    if (that == null) return false;

    boolean this_present_row = true && this.isSetRow();
    boolean that_present_row = true && that.isSetRow();
    if (this_present_row || that_present_row) {
      if (!(this_present_row && that_present_row)) return false;
      if (!this.row.equals(that.row)) return false;
    }

    boolean this_present_columns = true && this.isSetColumns();
    boolean that_present_columns = true && that.isSetColumns();
    if (this_present_columns || that_present_columns) {
      if (!(this_present_columns && that_present_columns)) return false;
      if (!this.columns.equals(that.columns)) return false;
    }

    boolean this_present_timestamp = true && this.isSetTimestamp();
    boolean that_present_timestamp = true && that.isSetTimestamp();
    if (this_present_timestamp || that_present_timestamp) {
      if (!(this_present_timestamp && that_present_timestamp)) return false;
      if (this.timestamp != that.timestamp) return false;
    }

    boolean this_present_timeRange = true && this.isSetTimeRange();
    boolean that_present_timeRange = true && that.isSetTimeRange();
    if (this_present_timeRange || that_present_timeRange) {
      if (!(this_present_timeRange && that_present_timeRange)) return false;
      if (!this.timeRange.equals(that.timeRange)) return false;
    }

    boolean this_present_maxVersions = true && this.isSetMaxVersions();
    boolean that_present_maxVersions = true && that.isSetMaxVersions();
    if (this_present_maxVersions || that_present_maxVersions) {
      if (!(this_present_maxVersions && that_present_maxVersions)) return false;
      if (this.maxVersions != that.maxVersions) return false;
    }

    return true;
  }
コード例 #4
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TGet struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.row = iprot.readBinary();
   struct.setRowIsSet(true);
   BitSet incoming = iprot.readBitSet(4);
   if (incoming.get(0)) {
     {
       org.apache.thrift.protocol.TList _list13 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.columns = new ArrayList<TColumn>(_list13.size);
       for (int _i14 = 0; _i14 < _list13.size; ++_i14) {
         TColumn _elem15; // optional
         _elem15 = new TColumn();
         _elem15.read(iprot);
         struct.columns.add(_elem15);
       }
     }
     struct.setColumnsIsSet(true);
   }
   if (incoming.get(1)) {
     struct.timestamp = iprot.readI64();
     struct.setTimestampIsSet(true);
   }
   if (incoming.get(2)) {
     struct.timeRange = new TTimeRange();
     struct.timeRange.read(iprot);
     struct.setTimeRangeIsSet(true);
   }
   if (incoming.get(3)) {
     struct.maxVersions = iprot.readI32();
     struct.setMaxVersionsIsSet(true);
   }
 }
コード例 #5
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TGet struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeBinary(struct.row);
   BitSet optionals = new BitSet();
   if (struct.isSetColumns()) {
     optionals.set(0);
   }
   if (struct.isSetTimestamp()) {
     optionals.set(1);
   }
   if (struct.isSetTimeRange()) {
     optionals.set(2);
   }
   if (struct.isSetMaxVersions()) {
     optionals.set(3);
   }
   oprot.writeBitSet(optionals, 4);
   if (struct.isSetColumns()) {
     {
       oprot.writeI32(struct.columns.size());
       for (TColumn _iter12 : struct.columns) {
         _iter12.write(oprot);
       }
     }
   }
   if (struct.isSetTimestamp()) {
     oprot.writeI64(struct.timestamp);
   }
   if (struct.isSetTimeRange()) {
     struct.timeRange.write(oprot);
   }
   if (struct.isSetMaxVersions()) {
     oprot.writeI32(struct.maxVersions);
   }
 }
コード例 #6
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
    public void read(org.apache.thrift.protocol.TProtocol iprot, TGet struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // ROW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.row = iprot.readBinary();
              struct.setRowIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
                struct.columns = new ArrayList<TColumn>(_list8.size);
                for (int _i9 = 0; _i9 < _list8.size; ++_i9) {
                  TColumn _elem10; // optional
                  _elem10 = new TColumn();
                  _elem10.read(iprot);
                  struct.columns.add(_elem10);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timestamp = iprot.readI64();
              struct.setTimestampIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // TIME_RANGE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.timeRange = new TTimeRange();
              struct.timeRange.read(iprot);
              struct.setTimeRangeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // MAX_VERSIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.maxVersions = iprot.readI32();
              struct.setMaxVersionsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }
コード例 #7
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
  public int compareTo(TGet other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TGet typedOther = (TGet) other;

    lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRow()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumns()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimestamp()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(typedOther.isSetTimeRange());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimeRange()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.timeRange, typedOther.timeRange);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxVersions()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }