hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sulabh choudhury <sula...@gmail.com>
Subject Re: java.lang.IllegalArgumentException in incrementColumnValue and Increment
Date Tue, 29 Mar 2011 16:38:52 GMT
Thanks Jesse. Changing the 10 to 10L made it work.

On Tue, Mar 29, 2011 at 8:59 AM, Jesse Hutton <jesse.hutton@gmail.com>wrote:

> Hi,
>
> It looks like the problem is that the initial value you're inserting in the
> column is an int, while HTable#incrementColumnValue() expects a long.
> Instead of:
>
>
>> I enter data by :-
>> theput.add(Bytes.toBytes("uid"),Bytes.toBytes("1"), 1301087829999L + t,
>> Bytes.toBytes(10))
>>
>
> try:
> theput.add(Bytes.toBytes("uid"),Bytes.toBytes("1"), 1301087829999L + t,
> Bytes.toBytes(10L));
>
> Jesse
>
>
>>
>> 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()
>>
>
>

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