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

Erik Holstad commented on HBASE-1231:
-------------------------------------

  public static BatchUpdate toBatchUpdate(RowResult rr){
    BatchUpdate bu = new BatchUpdate(rr.getRow());
    for(Map.Entry<byte[], Cell> entry : rr.entrySet()){
      bu.put(entry.getKey(), entry.getValue().getValue());
    }
    return bu;
  }

is the code that I propose as a util method, not really sure if it is
the best way of doing it and where to put it, that is why I didn't  patch
it.

Erik

> Today, going from a RowResult to a BatchUpdate reqiures some data processing 
> even though they are pretty much the same thing.
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-1231
>                 URL: https://issues.apache.org/jira/browse/HBASE-1231
>             Project: Hadoop HBase
>          Issue Type: Improvement
>            Reporter: Erik Holstad
>            Assignee: Erik Holstad
>            Priority: Trivial
>
> When updating some values in a row you need to fetch the row, get the data, 
> change the data, get the key, get the row, create a new BatchUpdate 
> and put all the keys and new values into it. 
> The overall structure change that might be needed to solve this problem in 
> the right way, should probably go into HBASE-880. This issue just
> includes a util method that does the conversion for you.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to