You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Daniel Gómez Ferro <da...@yahoo-inc.com> on 2011/11/30 12:37:58 UTC

Return value from RegionObserver.preIncrement()

Hi,

RegionObserver.preIncrement() receives a Result object which it can modify if it wants to return directly to the client. However the only way of modifying it that I could find is through Result.readFields(). That would require the user to create the Result object he wants, serializing it and then deserializing. 

I think it would be better to either change preIncrement() to return a Result object or add a setter to Result. We could also change preIncrement() to receive a List<KeyValue> like preGet() does.

Thanks.

Daniel

Re: Return value from RegionObserver.preIncrement()

Posted by Lars George <la...@gmail.com>.
Hi Daniel,

If you like, the best way would be to provide a patch :)

Lars


On Nov 30, 2011, at 3:47 PM, Daniel Gómez Ferro wrote:

> Hi Lars,
> 
> Done: https://issues.apache.org/jira/browse/HBASE-4903
> 
> What's the best option to solve this?
> 
> Thanks,
> Daniel
> 
> On Nov 30, 2011, at 15:10 , Lars George wrote:
> 
>> Hi Daniel,
>> 
>> This indeed looks like an oversight. Could you create a JIRA for it please?
>> 
>> Thanks,
>> Lars
>> 
>> On Nov 30, 2011, at 12:37 PM, Daniel Gómez Ferro wrote:
>> 
>>> Hi,
>>> 
>>> RegionObserver.preIncrement() receives a Result object which it can modify if it wants to return directly to the client. However the only way of modifying it that I could find is through Result.readFields(). That would require the user to create the Result object he wants, serializing it and then deserializing. 
>>> 
>>> I think it would be better to either change preIncrement() to return a Result object or add a setter to Result. We could also change preIncrement() to receive a List<KeyValue> like preGet() does.
>>> 
>>> Thanks.
>>> 
>>> Daniel
>> 
> 


Re: Return value from RegionObserver.preIncrement()

Posted by Daniel Gómez Ferro <da...@yahoo-inc.com>.
Hi Lars,

Done: https://issues.apache.org/jira/browse/HBASE-4903

What's the best option to solve this?

Thanks,
Daniel

On Nov 30, 2011, at 15:10 , Lars George wrote:

> Hi Daniel,
> 
> This indeed looks like an oversight. Could you create a JIRA for it please?
> 
> Thanks,
> Lars
> 
> On Nov 30, 2011, at 12:37 PM, Daniel Gómez Ferro wrote:
> 
>> Hi,
>> 
>> RegionObserver.preIncrement() receives a Result object which it can modify if it wants to return directly to the client. However the only way of modifying it that I could find is through Result.readFields(). That would require the user to create the Result object he wants, serializing it and then deserializing. 
>> 
>> I think it would be better to either change preIncrement() to return a Result object or add a setter to Result. We could also change preIncrement() to receive a List<KeyValue> like preGet() does.
>> 
>> Thanks.
>> 
>> Daniel
> 


Re: Return value from RegionObserver.preIncrement()

Posted by Lars George <la...@gmail.com>.
Hi Daniel,

This indeed looks like an oversight. Could you create a JIRA for it please?

Thanks,
Lars

On Nov 30, 2011, at 12:37 PM, Daniel Gómez Ferro wrote:

> Hi,
> 
> RegionObserver.preIncrement() receives a Result object which it can modify if it wants to return directly to the client. However the only way of modifying it that I could find is through Result.readFields(). That would require the user to create the Result object he wants, serializing it and then deserializing. 
> 
> I think it would be better to either change preIncrement() to return a Result object or add a setter to Result. We could also change preIncrement() to receive a List<KeyValue> like preGet() does.
> 
> Thanks.
> 
> Daniel