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

Matt Corgan commented on HBASE-10861:
-------------------------------------

This is just a style/naming thing, but I'm wondering if ByteRange should be the 
read-only interface, and we extend it with MutableByteRange to give access to 
the methods that modify the underlying bytes.  I think the read-only interface 
would be more commonly used (so the short name is nice), and a piece of code 
that's granted access to the MutableByteRange has the longer name as a constant 
reminder that is has greater responsibility to not mess up.

Also wonder if the class hierarchy could be constructed so you don't need 
these:{code}
+  @Override
+  public PositionedByteRange put(int index, byte[] val) {
+    throw new ReadOnlyByteRangeException();
+  }
{code}

> Supporting API in ByteRange
> ---------------------------
>
>                 Key: HBASE-10861
>                 URL: https://issues.apache.org/jira/browse/HBASE-10861
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>         Attachments: HBASE-10861.patch, HBASE-10861_2.patch
>
>
> We would need APIs that would 
> setLimit(int limit)
> getLimt()
> asReadOnly()
> These APIs would help in implementations that have Buffers offheap (for now 
> BRs backed by DBB).
> If anything more is needed could be added when needed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to