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

Anoop Sam John commented on HBASE-13387:
----------------------------------------

Write path (I take the flush path) will get used in flush as well as in 
Compaction. In compaction, we might get Buffer backed Cells?  So we have to 
rely on hasArray check.   Also Cells added to Memstore and getting returned in 
Scan time. If we take Cells into Memstore, while scan, we have to type change 
it?
No ServerCell impls need not cache the lengths. That is not an interface 
contract but an impl detail. So no need for KeyValue to do this caching.  If we 
need caching in read path, we can extend KV to get a new Cell impl.

So what you say is keep the type of cell passing in read path as Cell itself 
(in Read related classes) and places where we deal with getXXXArray APIs, do 
the instance of check and type cast and call hasArray on ServerCell and do 
actions?    I can see that but I fear we will have to do this many many places. 
  instance of check might not be too costly still there is a cost no?   In one 
place, as you noted, am doing the instance of check.  That is in codec encode 
related area.  The same Codec encoder is used in client and server end and that 
is why the type is not changed and we have the instance of check. Also you can 
note that an oswrite() method is available in ServerCell.  Writing as a whole 
key rather than get lengths and write one after the other will be efficient and 
that is why oswrite () I prefer.

> Add ServerCell an extension to Cell
> -----------------------------------
>
>                 Key: HBASE-13387
>                 URL: https://issues.apache.org/jira/browse/HBASE-13387
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver, Scanners
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>         Attachments: WIP_ServerCell.patch
>
>
> This came in btw the discussion abt the parent Jira and recently Stack added 
> as a comment on the E2E patch on the parent Jira.
> The idea is to add a new Interface 'ServerCell'  in which we can add new 
> buffer based getter APIs, hasArray API etc.  We will keep this interface 
> @InterfaceAudience.Private
> Also we have to change the timestamp and seqId on Cells in server side. We 
> have added new interfaces SettableSequenceId, SettableTimestamp for this. Now 
> if we can add a ServerCell we can add the setter APIs there.



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

Reply via email to