Try 
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HTable.html#increment(org.apache.hadoop.hbase.client.Increment)
instead.  It looks like its whats taking over from ICV (and we should
be decrementing ICV).
St.Ack

On Tue, Mar 29, 2011 at 8:22 AM, sulabh choudhury <sula...@gmail.com> wrote:
> Hi,
>
> Unable to use the Increment function, can anybody suggest what am I doing
> wrong...
>
> I enter data by :-
> theput.add(Bytes.toBytes("uid"),Bytes.toBytes("1"), 1301087829999L + t,
> Bytes.toBytes(10))
>
> Now when I try to increment the value I have tried...
> mytable.incrementColumnValue(Bytes.toBytes("row5"),
> Bytes.toBytes("uid"),Bytes.toBytes("1"),Bytes.toBytes(1))
> mytable.incrementColumnValue(Bytes.toBytes("row5"),
> Bytes.toBytes("uid"),Bytes.toBytes("1"),1)
>
> also
> val inc = new Increment(Bytes.toBytes("row" + 5))
> inc.addColumn(Bytes.toBytes("uid"),Bytes.toBytes("1"),1)
> mytable.increment(inc)
>
> In both of the cases, I get an error like
> org.apache.hadoop.hbase.client.RetriesExhaustedException:
> Exceptions:
> java.io.IOException: java.io.IOException:
> java.lang.IllegalArgumentException: offset (28) + length (8) exceed the
> capacity of the array: 32
> at
> org.apache.hadoop.hbase.util.Bytes.explainWrongLengthOrOffset(Bytes.java:502)
>  at org.apache.hadoop.hbase.util.Bytes.toLong(Bytes.java:480)
> at
> org.apache.hadoop.hbase.regionserver.HRegion.incrementColumnValue(HRegion.java:3134)
>  at
> org.apache.hadoop.hbase.regionserver.HRegionServer.incrementColumnValue(HRegionServer.java:2486)
> at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
>  at sun.reflec...
>
>
> I guess I have tried all possible combinations of datatypes....I could not
> even find a decent example of incrementColumnValue()
>

Reply via email to