ss77892 opened a new pull request, #11233:
URL: https://github.com/apache/ozone/pull/11233

   ## What changes were proposed in this pull request?
    Proto2Codec.fromCodecBuffer parsed the value through 
buffer.getInputStream(). Protobuf allocates a 4 KB decoding buffer for every 
parse that goes through an InputStream. Most values stored in RocksDB tables 
are only a few hundred bytes, so the allocation is much larger than the value 
itself and it happens on every table get and every iterator step.
   
     This change parses the message directly from 
buffer.asReadOnlyByteBuffer(), the same way Proto3Codec already does. The 
InputStream and the IOUtils.closeQuietly call are removed. Parse failures are 
still reported as CodecException with the InvalidProtocolBufferException as the 
cause.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16392
   
   ## How was this patch tested?
   new UTs has been added. 
   CodecTestUtil.runTest now also round trips each value through a direct 
CodecBuffer, which is the buffer type used by table get and iterators. This 
covers all codecs that use runTest.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to