[ 
https://issues.apache.org/jira/browse/HBASE-15600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15231558#comment-15231558
 ] 

ramkrishna.s.vasudevan commented on HBASE-15600:
------------------------------------------------

{code}
if (coprocessorHost.preBatchMutate(miniBatchOp)) {
3121              return 0L;    3122              return 0L;
3123            } else if (miniBatchOp.operationsFromCoprocessors!=null) {
3124                    WALEdit walEditForCpOperations= 
miniBatchOp.getWalEdit(0);
{code}
You are adding this as an else if condition . Better to add this as an 'if' 
condition only ?
So if there are some WALEdits added as part of prePut and preDelete, you will 
once again add new Cells in preBatchMutate and in the 0th index of the already 
added WALEdits, is it fine in doing like that?
bq.WALEdit walEditForCpOperations= miniBatchOp.getWalEdit(0);
Even here you are getting the first WALEdit only.
bq.public void addOperations(T[] newOperations) {
May need proper documentation here and how does it work. Better to rename it to 
addOperationsfromCP.
The default status of this operations is going to be NOT_RUN only correct?
Some where I feel that the index that we use to iterate and this new operations 
should some how be in sync. May be it is difficult to just add these new  
miniBatchOps to the acutal Operations already available and adjust the first 
and last index based on that?

> Add provision for adding mutations to memstore or able to write to same 
> region in batchMutate coprocessor hooks
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-15600
>                 URL: https://issues.apache.org/jira/browse/HBASE-15600
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>             Fix For: 2.0.0, 0.98.19, 1.1.5, 1.2.2, 1.0.5
>
>         Attachments: HBASE-15600.patch, HBASE-15600_v1.patch, 
> HBASE-15600_v2.patch
>
>
> As part of PHOENIX-1734 we need to write the index updates to same region 
> from coprocessors but writing from batchMutate API is not allowed because of 
> mvcc. 
> Raised PHOENIX-2742 to discuss any alternative way to write to the same 
> region directly or not but not having any proper solution there.
> Currently we have provision to write wal edits from coprocessors. We can set 
> wal edits in MiniBatchOperationInProgress.
> {noformat}
>   /**
>    * Sets the walEdit for the operation(Mutation) at the specified position.
>    * @param index
>    * @param walEdit
>    */
>   public void setWalEdit(int index, WALEdit walEdit) {
>     this.walEditsFromCoprocessors[getAbsoluteIndex(index)] = walEdit;
>   }
> {noformat}
> Similarly we can allow to write mutations from coprocessors to memstore as 
> well. Or else we should provide the batch mutation API allow write in batch 
> mutate coprocessors.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to