DESCRIPTION

JCBC-1098 : N1qlQueryExecutor is allocating twice the memory it needs

Motivation
----------
When the netty ByteBuf is not backed by a byte array.
N1qlQueryExecutor#executeQuery is allocating the byte array twice.
the first time in TranscoderUtils#byteBufToByteArray
the second with Arrays#copyOfRange

Modifications
-------------
this patch add a specialized version of
TranscoderUtils#byteBufToByteArray (copyByteBufToByteArray) that only
call Arrays#copyOfRange if the ByteBuf is backed by a byte array.

Result
------
greatly reduce the n1ql memory allocation

Change-Id: I96e22d864fbb527f3d0cf2448d741e9d6965d387


COMMENTS

author: Natasha Sullivan
date: 2017-08-08 05:00:44.369000000

Uploaded patch set 2.

-------------------------------------
author: Hugo Blankenship
date: 2017-08-08 05:00:52.194000000

Patch Set 2:

Build Started http://sdkbuilds.sc.couchbase.com/job/couchbase-java-client-test/158/

-------------------------------------
author: Hugo Blankenship
date: 2017-08-08 05:00:56.655000000

Patch Set 2: Code-Review-2

Build Failed 

http://sdkbuilds.sc.couchbase.com/job/couchbase-java-client-test/158/ : FAILURE

-------------------------------------
author: Natasha Sullivan
date: 2017-08-08 05:01:17.580000000

Removed reviewer Hugo Blankenship with the following votes:

* Code-Review-2 by Hugo Blankenship xxx@xxx.xxx


-------------------------------------
author: Natasha Sullivan
date: 2017-08-08 05:25:56.297000000

Patch Set 2: Verified+1

(2 comments)

-------------------------------------
author: Carmen Buckley
date: 2017-08-08 17:52:39.116000000

Patch Set 2: Code-Review+2

-------------------------------------
