R - type of incoming requestsP - type of outgoing responsespublic abstract class AbstractSqlGatewayRestHandler<R extends org.apache.flink.runtime.rest.messages.RequestBody,P extends org.apache.flink.runtime.rest.messages.ResponseBody,M extends org.apache.flink.runtime.rest.messages.MessageParameters>
extends org.apache.flink.runtime.rest.handler.AbstractHandler<org.apache.flink.runtime.webmonitor.NonLeaderRetrievalRestfulGateway,R,M>
RequestBodys and ResponseBodys.| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.table.gateway.api.SqlGatewayService |
service |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSqlGatewayRestHandler(org.apache.flink.table.gateway.api.SqlGatewayService service,
Map<String,String> responseHeaders,
org.apache.flink.runtime.rest.messages.MessageHeaders<R,P,M> messageHeaders) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract CompletableFuture<P> |
handleRequest(SqlGatewayRestAPIVersion version,
org.apache.flink.runtime.rest.handler.HandlerRequest<R> request)
This method is called for every incoming request and returns a
CompletableFuture
containing a the response. |
protected CompletableFuture<Void> |
respondToRequest(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx,
org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest httpRequest,
org.apache.flink.runtime.rest.handler.HandlerRequest<R> handlerRequest,
org.apache.flink.runtime.webmonitor.NonLeaderRetrievalRestfulGateway gateway) |
closeAsync, closeHandlerAsync, respondAsLeaderchannelRead0acceptInboundMessage, channelReadchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableprotected CompletableFuture<Void> respondToRequest(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest httpRequest, org.apache.flink.runtime.rest.handler.HandlerRequest<R> handlerRequest, org.apache.flink.runtime.webmonitor.NonLeaderRetrievalRestfulGateway gateway)
protected abstract CompletableFuture<P> handleRequest(@Nullable SqlGatewayRestAPIVersion version, @Nonnull org.apache.flink.runtime.rest.handler.HandlerRequest<R> request) throws org.apache.flink.runtime.rest.handler.RestHandlerException
CompletableFuture
containing a the response.
Implementations may decide whether to throw RestHandlerExceptions or fail the
returned CompletableFuture with a RestHandlerException.
Failing the future with another exception type or throwing unchecked exceptions is
regarded as an implementation error as it does not allow us to provide a meaningful HTTP
status code. In this case a HttpResponseStatus.INTERNAL_SERVER_ERROR will be
returned.
version - request versionrequest - request that should be handledorg.apache.flink.runtime.rest.handler.RestHandlerException - if the handling failedCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.