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

Chia-Ping Tsai commented on HBASE-19607:
----------------------------------------

bq. Maybe HBaseIOE?
The HBaseIOE is just another IOE. If we want to add more meaning to the 
exception, we should add an new exception. Maybe UnsupportedCellException?

Think it over. Passing the incorrect cell is not a common case. The cells from 
RPC layer are always of ExtendedCell. The cells from mutation#add are also 
wrapped to ExtendedCell. The way which can smuggle the cell into MSLAB should 
be viewed as a system bug like NPE. I feel a unchecked runtime exception is 
more suitable.

> throw the exception if memstore is incompetent to do the deep clone for cell
> ----------------------------------------------------------------------------
>
>                 Key: HBASE-19607
>                 URL: https://issues.apache.org/jira/browse/HBASE-19607
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Chia-Ping Tsai
>            Assignee: Yung-An He
>            Priority: Trivial
>
> We must to clone the cell since the cell is backed by the reusable byte 
> array. Also, we assume all cells passed to AbstractMemStore is of 
> ExtendedCell. Not only is the type check unnecessary, but it also confuses 
> the readers. 
> {code:title=AbstractMemStore.java}
>   private static Cell deepCopyIfNeeded(Cell cell) {
>     if (cell instanceof ExtendedCell) {
>       return ((ExtendedCell) cell).deepClone();
>     }
>     return cell;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to