Package com.linkedin.alpini.router.api
Interface PartitionDispatchHandler<H,P extends ResourcePath<K>,K,HTTP_REQUEST extends BasicRequest,HTTP_RESPONSE,HTTP_RESPONSE_STATUS>
- All Known Subinterfaces:
PartitionDispatchHandler4<H,
P, K>
- All Known Implementing Classes:
VeniceDispatcher
public interface PartitionDispatchHandler<H,P extends ResourcePath<K>,K,HTTP_REQUEST extends BasicRequest,HTTP_RESPONSE,HTTP_RESPONSE_STATUS>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispatch
(Scatter<H, P, K> scatter, ScatterGatherRequest<H, K> part, P path, HTTP_REQUEST request, AsyncPromise<H> hostSelected, AsyncPromise<List<HTTP_RESPONSE>> responseFuture, AsyncPromise<HTTP_RESPONSE_STATUS> retryFuture, AsyncFuture<Void> timeoutFuture, Executor contextExecutor) Performs the work.
-
Method Details
-
dispatch
void dispatch(@Nonnull Scatter<H, P, throws RouterExceptionK> scatter, @Nonnull ScatterGatherRequest<H, K> part, @Nonnull P path, @Nonnull HTTP_REQUEST request, @Nonnull AsyncPromise<H> hostSelected, @Nonnull AsyncPromise<List<HTTP_RESPONSE>> responseFuture, @Nonnull AsyncPromise<HTTP_RESPONSE_STATUS> retryFuture, @Nonnull AsyncFuture<Void> timeoutFuture, @Nonnull Executor contextExecutor) Performs the work.- Parameters:
scatter
- The scatter-gather request.part
- The part of the scatter-gather request to be executed.path
- The derived path of this part of the request.request
- The original HttpRequest object.hostSelected
- To be completed with the actual host selected.responseFuture
- To be completed with HttpResponse parts.retryFuture
- To be completed with the HttpResponseStatus.timeoutFuture
- Listen for timeout.contextExecutor
- For executing work on context executor. A single thread is available for each request. For efficiency, the AsyncPromises should be completed on the context executor thread.- Throws:
RouterException
-