示例#1
0
 @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);
   }
 }
示例#2
0
    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();
    }
示例#3
0
  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
  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;
  }