Re: Coprocessor prePut

2018-01-29 Thread Anoop John
What fix u tried now will help you. You can not avoid the loop by using the complete or bypass way.. Because that is on the present context. Another put on region will create a new context and so that continues. One more thing/suggestion would be to see the hook preBatchMutate. You will receiv

Coprocessor prePut

2018-01-26 Thread Yang Zhang
Hi I overrode coprocessor prePut() function to prevent normal put, and try to put the same data with different rowkey into the same table. The code is "context.getEnvironment().getRegion().put(newPut);" . This will caused an exception when the context's region splite

Re: Coprocessor prePut

2018-01-22 Thread Ted Yu
bq. can call context.complete() to skip other coprocessors. FYI in hbase-2, complete() has been folded into bypass(). See javadoc of bypass() for details. On Mon, Jan 22, 2018 at 9:34 PM, Yang Zhang wrote: > In fact, I prevent normal writes, and put the same data with a different > row key(Exce

Re: Coprocessor prePut

2018-01-22 Thread Yang Zhang
In fact, I prevent normal writes, and put the same data with a different row key(Except row key, they have the same columns and same data). I have already solved the infinite call by add and check some flag attribute to Put. If the flag exist then skip my code. This will prevent the infinite call

Re: Coprocessor prePut

2018-01-22 Thread Ted Yu
Your prePut would write to a different column in the table, right ? Otherwise do you prevent normal writes from getting into the same column(s) ? If your prePut writes to dedicated column(s), you can check the presence of such column(s) so that the call is not infinite. Cheers On Mon, Jan 22, 20

Re: Coprocessor prePut

2018-01-22 Thread Yang Zhang
Yes, It is the same table. 2018-01-23 1:46 GMT+08:00 Ted Yu : > Can you clarify your use case ? > > bq. put a data into table > > Does your coprocessor write to the same table which receives user data ? > > Cheers > > On Mon, Jan 22, 2018 at 4:24 AM, Yang Zhang > wrote: > > > Hello Everyone > >

Re: Coprocessor prePut

2018-01-22 Thread Ted Yu
Can you clarify your use case ? bq. put a data into table Does your coprocessor write to the same table which receives user data ? Cheers On Mon, Jan 22, 2018 at 4:24 AM, Yang Zhang wrote: > Hello Everyone > > I am using the coprocessor and want to put another data when > someone put

Coprocessor prePut

2018-01-22 Thread Yang Zhang
Hello Everyone I am using the coprocessor and want to put another data when someone put a data into table. So I try prePut(), but when you call HRegion.put(), this will call my coprocessor's prePut function again, and it will cause an dead loop. My code looks like below, If anyone