Пример #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();
    }
Пример #2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TIncrement struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.row = iprot.readBinary();
   struct.setRowIsSet(true);
   {
     org.apache.thrift.protocol.TList _list81 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.columns = new ArrayList<TColumnIncrement>(_list81.size);
     for (int _i82 = 0; _i82 < _list81.size; ++_i82) {
       TColumnIncrement _elem83; // required
       _elem83 = new TColumnIncrement();
       _elem83.read(iprot);
       struct.columns.add(_elem83);
     }
   }
   struct.setColumnsIsSet(true);
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     {
       org.apache.thrift.protocol.TMap _map84 =
           new org.apache.thrift.protocol.TMap(
               org.apache.thrift.protocol.TType.STRING,
               org.apache.thrift.protocol.TType.STRING,
               iprot.readI32());
       struct.attributes = new HashMap<ByteBuffer, ByteBuffer>(2 * _map84.size);
       for (int _i85 = 0; _i85 < _map84.size; ++_i85) {
         ByteBuffer _key86; // required
         ByteBuffer _val87; // required
         _key86 = iprot.readBinary();
         _val87 = iprot.readBinary();
         struct.attributes.put(_key86, _val87);
       }
     }
     struct.setAttributesIsSet(true);
   }
   if (incoming.get(1)) {
     struct.durability = TDurability.findByValue(iprot.readI32());
     struct.setDurabilityIsSet(true);
   }
   if (incoming.get(2)) {
     struct.cellVisibility = new TCellVisibility();
     struct.cellVisibility.read(iprot);
     struct.setCellVisibilityIsSet(true);
   }
 }
Пример #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;
  }
Пример #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);
    }
  }
Пример #5
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);
   }
 }
Пример #6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TIncrement 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 _list70 = iprot.readListBegin();
                struct.columns = new ArrayList<TColumnIncrement>(_list70.size);
                for (int _i71 = 0; _i71 < _list70.size; ++_i71) {
                  TColumnIncrement _elem72; // required
                  _elem72 = new TColumnIncrement();
                  _elem72.read(iprot);
                  struct.columns.add(_elem72);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin();
                struct.attributes = new HashMap<ByteBuffer, ByteBuffer>(2 * _map73.size);
                for (int _i74 = 0; _i74 < _map73.size; ++_i74) {
                  ByteBuffer _key75; // required
                  ByteBuffer _val76; // required
                  _key75 = iprot.readBinary();
                  _val76 = iprot.readBinary();
                  struct.attributes.put(_key75, _val76);
                }
                iprot.readMapEnd();
              }
              struct.setAttributesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // DURABILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.durability = TDurability.findByValue(iprot.readI32());
              struct.setDurabilityIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CELL_VISIBILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.cellVisibility = new TCellVisibility();
              struct.cellVisibility.read(iprot);
              struct.setCellVisibilityIsSet(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
  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;
  }