szetszwo commented on pull request #2495: URL: https://github.com/apache/ozone/pull/2495#issuecomment-894085044
Since we are going to use Streaming in BlockDataStreamOutput, the write logic is different from BlockOutputStream. - In BlockOutputStream, we copy the data to a ChunkBuffer in write(byte[] b, int off, int len). We won't push the data out to the network until the ChunkBuffer is full. When the ChunkBuffer is full, we push it out to the network in writeChunkToContainer(ChunkBuffer). We also convert the header to proto and the data to ByteString. Then, we use commitWatcher to wait for the commit. - For Streaming (i.e. BlockDataStreamOutput), we should write the header (using proto) when creating the stream or right before the first write. In write(ByteBuffer), we will pass the ByteBuffer (without converting it to ByteString) to the underlying stream immediately since we don't need to wait for any buffer becoming full. We also don't need commitWatcher anymore. -- 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]
