Class GrpcRequestContext
- java.lang.Object
-
- com.linkedin.venice.listener.grpc.GrpcRequestContext
-
public class GrpcRequestContext extends java.lang.Object
We need to keep track of each request as it goes through the pipeline so that we can record the necessary metrics and separate different parts of the logic for the response. If a specific handler raises an error, we set the hasError flag to true and stop executing the rest of the pipeline excluding the stats collection.
-
-
Constructor Summary
Constructors Constructor Description GrpcRequestContext(VeniceClientRequest veniceClientRequest, VeniceServerResponse.Builder veniceServerResponseBuilder, io.grpc.stub.StreamObserver<VeniceServerResponse> responseObserver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerStatsContext
getGrpcStatsContext()
ReadResponse
getReadResponse()
io.grpc.stub.StreamObserver<VeniceServerResponse>
getResponseObserver()
RouterRequest
getRouterRequest()
VeniceClientRequest
getVeniceClientRequest()
VeniceServerResponse.Builder
getVeniceServerResponseBuilder()
boolean
hasError()
boolean
isCompleted()
void
setCompleted()
void
setError()
void
setGrpcStatsContext(ServerStatsContext serverStatsContext)
void
setReadResponse(ReadResponse readResponse)
void
setResponseObserver(io.grpc.stub.StreamObserver<VeniceServerResponse> responseObserver)
void
setRouterRequest(RouterRequest routerRequest)
void
setVeniceClientRequest(VeniceClientRequest veniceClientRequest)
void
setVeniceServerResponseBuilder(VeniceServerResponse.Builder veniceServerResponseBuilder)
-
-
-
Constructor Detail
-
GrpcRequestContext
public GrpcRequestContext(VeniceClientRequest veniceClientRequest, VeniceServerResponse.Builder veniceServerResponseBuilder, io.grpc.stub.StreamObserver<VeniceServerResponse> responseObserver)
-
-
Method Detail
-
setGrpcStatsContext
public void setGrpcStatsContext(ServerStatsContext serverStatsContext)
-
getGrpcStatsContext
public ServerStatsContext getGrpcStatsContext()
-
getVeniceClientRequest
public VeniceClientRequest getVeniceClientRequest()
-
setVeniceClientRequest
public void setVeniceClientRequest(VeniceClientRequest veniceClientRequest)
-
getVeniceServerResponseBuilder
public VeniceServerResponse.Builder getVeniceServerResponseBuilder()
-
setVeniceServerResponseBuilder
public void setVeniceServerResponseBuilder(VeniceServerResponse.Builder veniceServerResponseBuilder)
-
getResponseObserver
public io.grpc.stub.StreamObserver<VeniceServerResponse> getResponseObserver()
-
setResponseObserver
public void setResponseObserver(io.grpc.stub.StreamObserver<VeniceServerResponse> responseObserver)
-
getRouterRequest
public RouterRequest getRouterRequest()
-
setRouterRequest
public void setRouterRequest(RouterRequest routerRequest)
-
getReadResponse
public ReadResponse getReadResponse()
-
setReadResponse
public void setReadResponse(ReadResponse readResponse)
-
setCompleted
public void setCompleted()
-
isCompleted
public boolean isCompleted()
-
hasError
public boolean hasError()
-
setError
public void setError()
-
-