Hi Mohammad,
If your co-processor executes before Tephra's co-processor then it can execute data operations using the client transaction.
If your co-processor updates the same row as the client Put, then just modify the client Put as required. Tephra co-processor will then execute the modified Put within the client transaction.
If you are adding new Puts then you'll need to copy the transaction attributes [1] from the client Put to your put. Tephra encodes the transaction as an attribute of the operation. Copying over the attributes will make the new Put also a part of the client transaction.
On a rollback (rollback results in a Delete operation with "cask.tx.rollback" attribute), you'll have to generate a corresponding Delete operation for your Puts.
You can do the same thing for Gets, Scans and Deletes too.
Apache Phoenix does something similar with Apache Phoenix and Tephra co-processors.
Thanks,
Poorna.
1 - Transaction attributes are cask.tx and cask.tx.rollback.