[ 
https://issues.apache.org/jira/browse/HBASE-15600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Enis Soztutar updated HBASE-15600:
----------------------------------
    Attachment: hbase-15600_v3.patch

[~rajesh23] is taking some time off, but let me try to carry the flag. 

I was reviewing and thinking about this patch, and came up with v3 which is 
slightly different than the v2 patch. In the process, some of the review 
comments are automatically addressed. 

Going back to the original idea, the problem with current coprocessor hooks is 
that you can either add to the WALEdits in prePut() / preBatchMutate(), or you 
can change the Mutations, but you cannot add more mutations. 

bq. Why is mvcc in your way?
Rajesh is mentioning mvcc getting in the way, because I think he was testing 
doing a direct put() operation from preBatchMutate(). But in any case, we do 
not want that, because we want atomic commit and atomic visibility for local 
index updates. So this coprocessor hook should work so that corresponding to 
each Mutation in the batch, the coprocessor can add more mutations so that they 
are committed together and made visible via mvcc atomically. 

bq. 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?
I did this change, even before reading this. addOperationsFromCP() now takes an 
index corresponding to the original mutation in the batch. 

In the new approach, we are not piggybacking on the walEditsFromCoprocessors. 
We simply add the cells from the returned Mutations to the original familyMaps. 

> 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, 1.1.5, 1.2.2, 0.98.20, 1.0.5
>
>         Attachments: HBASE-15600.patch, HBASE-15600_v1.patch, 
> HBASE-15600_v2.patch, hbase-15600_v3.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