hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramkrishna.s.vasudevan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-16880) Correct the javadoc/behaviour of the APIs in ByteBufferUtils
Date Tue, 25 Oct 2016 05:23:58 GMT

     [ https://issues.apache.org/jira/browse/HBASE-16880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

ramkrishna.s.vasudevan updated HBASE-16880:
-------------------------------------------
      Resolution: Fixed
    Hadoop Flags: Reviewed
          Status: Resolved  (was: Patch Available)

Thanks for the review [~anoop.hbase].

> Correct the javadoc/behaviour of the APIs in ByteBufferUtils
> ------------------------------------------------------------
>
>                 Key: HBASE-16880
>                 URL: https://issues.apache.org/jira/browse/HBASE-16880
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 2.0.0
>
>         Attachments: HBASE-16880.patch
>
>
> There are some issues either with the javadoc or the actual behaviour of some APIs in
BBUtils.
> For eg,
> BBUtil#copyFromBufferToBuffer() says
> {code}
>   /**
>    * Copy one buffer's whole data to another. Write starts at the current position of
'out' buffer.
>    * Note : This will advance the position marker of {@code out} but not change the position
maker
>    * for {@code in}. The position and limit of the {@code in} buffer to be set properly
by caller.
>    * @param in source buffer
>    * @param out destination buffer
> {code}
> But this is true in case of UNSAFE.
> {code}
>     if (UNSAFE_AVAIL) {
>       int length = in.remaining();
>       UnsafeAccess.copy(in, in.position(), out, out.position(), length);
>       out.position(out.position() + length);
>     } else {
>       out.put(in);
>     }
> {code}
> But in other case where we move the else - the 'in' is also advanced. So we need to either
correct the behaviour or change the doc and see all the used places. This JIRA can be used
to correct all the APIs in this util class.



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

Mime
View raw message