hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Wissmann <julian.wissm...@sdace.de>
Subject Re: confused by two add method of Put class
Date Wed, 05 Sep 2012 22:03:40 GMT
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);


    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.



2012/9/2 Lin Ma <linlma@gmail.com>

> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message