amaliujia commented on pull request #298:
URL: https://github.com/apache/incubator-ratis/pull/298#issuecomment-735040004


   @szetszwo sorry for a bit delay on this PR.
   
   Sending a `StreamRequestHeaderProto` which includes path and data length 
make senses to me. This is also what I am trying to achieve in this PR.
   
   The question so far is, how to allow user send StreamRequestHeaderProto (or 
any other proto) to state machine?
   
   I think there are two models:
   1. Add it as a part of the stream header request. This will require to 
update DataStreamApi to expose a method (e.g. `DataStreamOutput 
stream(ByteBuffer headerContent)`). In this model, the header request will 
include information to initialize a data stream in state machine. 
   2. Keep stream header as what it is now, and for `StreamRequestHeaderProto`, 
user can use `DataStreamOutput.writeAsync` to send it (so 
`DataStreamOutput.writeAsync` is one of the stream DATA packet). In this case, 
state machine will need to understand that not all DATA is data, one could be a 
special proto.
   
   To me the model 1 is easy to use. What do you think?


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

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


Reply via email to