hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiroshi Ikeda (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-14873) Problems around BoundedByteBufferPool providing direct buffers
Date Tue, 24 Nov 2015 08:45:11 GMT
Hiroshi Ikeda created HBASE-14873:

             Summary: Problems around BoundedByteBufferPool providing direct buffers
                 Key: HBASE-14873
                 URL: https://issues.apache.org/jira/browse/HBASE-14873
             Project: HBase
          Issue Type: Bug
            Reporter: Hiroshi Ikeda

HBASE-13819 made BoundedByteBufferPool provide direct buffers.

See RpcServer.java:
class Call implements RpcCallContext {
  protected synchronized void setResponse(...) {
    this.cellBlock = ipcUtil.buildCellBlock(..., reservoir);
    bc = new BufferChain(..., this.cellBlock);
    if (connection.useWrap) {
      bc = wrapWithSasl(bc);
  private BufferChain wrapWithSasl(BufferChain bc) throws IOException {
    byte[] responseBytes = bc.getBytes();

{{cellBlock}} is expected to be a direct buffer retrieved from {{reservoir}} (but not always),
and {{bc}} may be composed of both direct and non-direct buffers.

And then, see BufferChain.java:
byte [] getBytes() {
    for (ByteBuffer bb: this.buffers) {
      System.arraycopy(bb.array(), ...);

A direct buffer doesn't give its array, and will throw UnsupportedOperationException.

Another problem; {{cellBlock}} is allowed to be a non-direct buffer, and after use it will
be put to {{reservoir}}, mixing direct and non-direct buffers in the pool.

This message was sent by Atlassian JIRA

View raw message