Ejemplo n.º 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TKey struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetRow()) {
     optionals.set(0);
   }
   if (struct.isSetColFamily()) {
     optionals.set(1);
   }
   if (struct.isSetColQualifier()) {
     optionals.set(2);
   }
   if (struct.isSetColVisibility()) {
     optionals.set(3);
   }
   if (struct.isSetTimestamp()) {
     optionals.set(4);
   }
   oprot.writeBitSet(optionals, 5);
   if (struct.isSetRow()) {
     oprot.writeBinary(struct.row);
   }
   if (struct.isSetColFamily()) {
     oprot.writeBinary(struct.colFamily);
   }
   if (struct.isSetColQualifier()) {
     oprot.writeBinary(struct.colQualifier);
   }
   if (struct.isSetColVisibility()) {
     oprot.writeBinary(struct.colVisibility);
   }
   if (struct.isSetTimestamp()) {
     oprot.writeI64(struct.timestamp);
   }
 }
Ejemplo n.º 2
0
 /** Performs a deep copy on <i>other</i>. */
 public TKey(TKey other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetRow()) {
     this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
     ;
   }
   if (other.isSetColFamily()) {
     this.colFamily = org.apache.thrift.TBaseHelper.copyBinary(other.colFamily);
     ;
   }
   if (other.isSetColQualifier()) {
     this.colQualifier = org.apache.thrift.TBaseHelper.copyBinary(other.colQualifier);
     ;
   }
   if (other.isSetColVisibility()) {
     this.colVisibility = org.apache.thrift.TBaseHelper.copyBinary(other.colVisibility);
     ;
   }
   this.timestamp = other.timestamp;
 }
Ejemplo n.º 3
0
  public boolean equals(TKey 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_colFamily = true && this.isSetColFamily();
    boolean that_present_colFamily = true && that.isSetColFamily();
    if (this_present_colFamily || that_present_colFamily) {
      if (!(this_present_colFamily && that_present_colFamily)) return false;
      if (!this.colFamily.equals(that.colFamily)) return false;
    }

    boolean this_present_colQualifier = true && this.isSetColQualifier();
    boolean that_present_colQualifier = true && that.isSetColQualifier();
    if (this_present_colQualifier || that_present_colQualifier) {
      if (!(this_present_colQualifier && that_present_colQualifier)) return false;
      if (!this.colQualifier.equals(that.colQualifier)) return false;
    }

    boolean this_present_colVisibility = true && this.isSetColVisibility();
    boolean that_present_colVisibility = true && that.isSetColVisibility();
    if (this_present_colVisibility || that_present_colVisibility) {
      if (!(this_present_colVisibility && that_present_colVisibility)) return false;
      if (!this.colVisibility.equals(that.colVisibility)) return false;
    }

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

    return true;
  }
Ejemplo n.º 4
0
  @Override
  public int compareTo(TKey other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRow()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColFamily()).compareTo(other.isSetColFamily());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColFamily()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colFamily, other.colFamily);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColQualifier()).compareTo(other.isSetColQualifier());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColQualifier()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.colQualifier, other.colQualifier);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColVisibility()).compareTo(other.isSetColVisibility());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColVisibility()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.colVisibility, other.colVisibility);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }