They do the exact same thing. In fact the non-KV add looks like this:
public Put add(byte [] family, byte [] qualifier, long ts, byte [] value) {
List<KeyValue> list = getKeyValueList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value);
list.add(kv);
familyMap.put(kv.getFamily(), list);
return this;
}
So there is a KeyValue created within the method.
There are use cases, where either one is easier to use to achieve things.
Cheers
Julian
2012/9/2 Lin Ma <[email protected]>
> Hello HBase masters,
>
> For the two add methods of Put class,
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Put.html#add%28org.apache.hadoop.hbase.KeyValue%29
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Put.html#add%28byte[],%20byte[],%20long,%20byte[]%29
>
> I think they are both write to a cell in HBase by row-key, column family
> name, column name and time stamp. I have not found any special functions
> provided by the KeyValue based method compared to the other one. Any
> comments about special function which KeyValue based method could achieve?
>
> regards,
> Lin
>