Class VeniceChunkedResponse

java.lang.Object
com.linkedin.venice.router.streaming.VeniceChunkedResponse

public class VeniceChunkedResponse extends Object
This is the class to talk to VeniceChunkedWriteHandler to send back partial response. Here is the high-level idea about how Streaming works in Venice: 1. When VenicePathParser recognizes the incoming request support streaming by looking at the streaming header: HttpConstants.VENICE_STREAMING, it will create a VeniceChunkedResponse associated with VenicePath; 2. After scattering, VeniceDispatcher will send the response received from Venice SN to write(ByteBuf) to Venice Client; 3. In the meantime, VeniceDispatcher will also return an empty response to the following processing logic; 4. When VeniceResponseAggregator gathers all the response, it will send a SuccessfulStreamingResponse to the following Netty handler, which is VeniceChunkedWriteHandler, which will delegate VeniceChunkedResponse to decide how to process every response; 5. For SuccessfulStreamingResponse, VeniceChunkedResponse will just skip this response, but send back LastHttpContent to indicate the end of the response, and for other error response, VeniceChunkedResponse will send back a LastHttpContent containing a StreamingFooterRecordV1 to include all the details about the error;