Ejemplo n.º 1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, TIncrement 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) {
        oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
          for (TColumnIncrement _iter77 : struct.columns) {
            _iter77.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.attributes != null) {
        if (struct.isSetAttributes()) {
          oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
          {
            oprot.writeMapBegin(
                new org.apache.thrift.protocol.TMap(
                    org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.STRING,
                    struct.attributes.size()));
            for (Map.Entry<ByteBuffer, ByteBuffer> _iter78 : struct.attributes.entrySet()) {
              oprot.writeBinary(_iter78.getKey());
              oprot.writeBinary(_iter78.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.durability != null) {
        if (struct.isSetDurability()) {
          oprot.writeFieldBegin(DURABILITY_FIELD_DESC);
          oprot.writeI32(struct.durability.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.cellVisibility != null) {
        if (struct.isSetCellVisibility()) {
          oprot.writeFieldBegin(CELL_VISIBILITY_FIELD_DESC);
          struct.cellVisibility.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Ejemplo n.º 2
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TIncrement struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeBinary(struct.row);
   {
     oprot.writeI32(struct.columns.size());
     for (TColumnIncrement _iter79 : struct.columns) {
       _iter79.write(oprot);
     }
   }
   BitSet optionals = new BitSet();
   if (struct.isSetAttributes()) {
     optionals.set(0);
   }
   if (struct.isSetDurability()) {
     optionals.set(1);
   }
   if (struct.isSetCellVisibility()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetAttributes()) {
     {
       oprot.writeI32(struct.attributes.size());
       for (Map.Entry<ByteBuffer, ByteBuffer> _iter80 : struct.attributes.entrySet()) {
         oprot.writeBinary(_iter80.getKey());
         oprot.writeBinary(_iter80.getValue());
       }
     }
   }
   if (struct.isSetDurability()) {
     oprot.writeI32(struct.durability.getValue());
   }
   if (struct.isSetCellVisibility()) {
     struct.cellVisibility.write(oprot);
   }
 }
Ejemplo n.º 3
0
  public boolean equals(TIncrement 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_attributes = true && this.isSetAttributes();
    boolean that_present_attributes = true && that.isSetAttributes();
    if (this_present_attributes || that_present_attributes) {
      if (!(this_present_attributes && that_present_attributes)) return false;
      if (!this.attributes.equals(that.attributes)) return false;
    }

    boolean this_present_durability = true && this.isSetDurability();
    boolean that_present_durability = true && that.isSetDurability();
    if (this_present_durability || that_present_durability) {
      if (!(this_present_durability && that_present_durability)) return false;
      if (!this.durability.equals(that.durability)) return false;
    }

    boolean this_present_cellVisibility = true && this.isSetCellVisibility();
    boolean that_present_cellVisibility = true && that.isSetCellVisibility();
    if (this_present_cellVisibility || that_present_cellVisibility) {
      if (!(this_present_cellVisibility && that_present_cellVisibility)) return false;
      if (!this.cellVisibility.equals(that.cellVisibility)) return false;
    }

    return true;
  }
Ejemplo n.º 4
0
  /** Performs a deep copy on <i>other</i>. */
  public TIncrement(TIncrement other) {
    if (other.isSetRow()) {
      this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
      ;
    }
    if (other.isSetColumns()) {
      List<TColumnIncrement> __this__columns = new ArrayList<TColumnIncrement>();
      for (TColumnIncrement other_element : other.columns) {
        __this__columns.add(new TColumnIncrement(other_element));
      }
      this.columns = __this__columns;
    }
    if (other.isSetAttributes()) {
      Map<ByteBuffer, ByteBuffer> __this__attributes = new HashMap<ByteBuffer, ByteBuffer>();
      for (Map.Entry<ByteBuffer, ByteBuffer> other_element : other.attributes.entrySet()) {

        ByteBuffer other_element_key = other_element.getKey();
        ByteBuffer other_element_value = other_element.getValue();

        ByteBuffer __this__attributes_copy_key =
            org.apache.thrift.TBaseHelper.copyBinary(other_element_key);
        ;

        ByteBuffer __this__attributes_copy_value =
            org.apache.thrift.TBaseHelper.copyBinary(other_element_value);
        ;

        __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value);
      }
      this.attributes = __this__attributes;
    }
    if (other.isSetDurability()) {
      this.durability = other.durability;
    }
    if (other.isSetCellVisibility()) {
      this.cellVisibility = new TCellVisibility(other.cellVisibility);
    }
  }
Ejemplo n.º 5
0
  public int compareTo(TIncrement other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TIncrement typedOther = (TIncrement) 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(isSetAttributes()).compareTo(typedOther.isSetAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAttributes()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.attributes, typedOther.attributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDurability()).compareTo(typedOther.isSetDurability());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDurability()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.durability, typedOther.durability);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetCellVisibility()).compareTo(typedOther.isSetCellVisibility());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCellVisibility()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.cellVisibility, typedOther.cellVisibility);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }