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 know how to make HBase  call my
coprocessor just for the first time?

@Override
    public void prePut(ObserverContext<RegionCoprocessorEnvironment>
context, Put put, WALEdit edit,
                       Durability durability) throws IOException {
        logger.info("==== Coprocessor shouldComplete :
"+context.shouldComplete()+"====");
        context.bypass();

        Put myPut = new Put(new RowKey(1).toBytes());

        //this call will caused an dead loop
        context.getEnvironment().getRegion().put(put);

    }

Thanks anyway

Reply via email to