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

Anoop Sam John commented on PHOENIX-2742:
-----------------------------------------

Index cells RK will be different.. Ya.. I did not consider that.. I was asking 
whether we can include cell in the original Mutation.. Looks like even if we 
have cell for index RK within the Mutation, no issues (within HRegion code).. 
We have only RK check whether cells to belong to this region or not.
And for adding the index cells we have to do that by directly adding cells to 
familyCellMap..  If we use add(Cell) API in Put, that is having a RK check.
{quote}
More findings:
 - In {{doMiniBatchMutation()}}, we call getFamilyCellMap() before 
{{preBatchMutate()}}. However, {{prePut()}}, {{preDelete()}} happens before 
even {{doMiniBatchMutation}} is called.
{code}
        Map<byte[], List<Cell>> familyMap = mutation.getFamilyCellMap();
{code}
Thus, Indexer should inject at the prePut() level, not {{preBatchMutate()}} 
level for local indexes if we are following this path.
{quote}
Seems usage of any hook is ok.. Even if familyMap  is obtained before calling 
the preBatchMutate hook, we will refer to the same Map object within the hook 
impl and so any change to its state will get reflected in both places :-)  
But ya.. it is not looking so good..  So am not in favor of adding index cells 
to the same Mutation which is having another RK.  Let us do it proper way. :-)

> Add new batchmutate APIs in HRegion without mvcc and region level locks
> -----------------------------------------------------------------------
>
>                 Key: PHOENIX-2742
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2742
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Enis Soztutar
>             Fix For: 4.8.0
>
>
> Currently we cannot write mutations to same table in (pre/post)BatchMutate 
> hooks because of mvcc. It would be better to add new API to Region which 
> allows to write to table without locks and also with out memstore size check. 
> Need to see how sequence id's going to effect when the API used in 
> coprocessor hooks. 
> Just raising here to track it.



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

Reply via email to