Description
I have been doing some profiling of the garbage being created. The idea was to follow up on HBASE-14490 and experiment with offheap IPC byte buffers and byte buffer re-use. However, without changing the IPC byte buffers for now, there are a couple of (easy) improvements that I've identified from profiling:
1. RPCServer.Connection.processRequest() should work with ByteBuffer instead of byte[] and not-recreate CodedInputStream a few times.
2. RSRpcServices.getRegion() allocates two byte arrays for region, while only 1 is needed.
3. AnnotationReadingPriorityFunction is very expensive in allocations. Mainly it allocates the regionName byte[] to get the table name. We already set the priority for most of the operations (multi, get, increment, etc) but we are only reading the priority in case of multi. We should use the priority from the client side.
Lets do the simple improvements in this patch, we can get to IPC buffer re-use in HBASE-14490.