guohao-rosicky opened a new pull request #3195:
URL: https://github.com/apache/ozone/pull/3195


   ## What changes were proposed in this pull request?
   
   Optimized the putBlock method of BlockDataStreamOutput
   
   
   
   1. PutBlock does not use RaftRpc, but through the stream close() method
   ```
   // putBlock metadata
   
   ByteBuffer buf =
       ContainerCommandRequestMessage.toMessage(putBlockRequestProto, null)
           .getContent().asReadOnlyByteBuffer();
   
   out.writeAsync(buf, StandardWriteOption.CLOSE); 
   
   ```
   
   
   2.Mark the stream data boundary by sending an empty stream packet
   ```
   // Mark the stream data boundary
   
   out.writeAsync(ByteBuffer.allocateDirect(0).asReadOnlyBuffer()); 
   ```
   
   3. Flush is also in the form of async RPC, because putBlock needs to fetch 
bcsId (Raft log index)
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6137
   
   ## How was this patch tested?
   
   Use the existing UT
   


-- 
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